:root {
  color-scheme: dark;
  --bg: #070807;
  --panel: #131413;
  --panel-soft: #101110;
  --panel-raised: #171817;
  --line: #2c2d2c;
  --line-strong: #394039;
  --text: #f5f6f4;
  --muted: #8f938e;
  --muted-strong: #bfc4bd;
  --green: #18d872;
  --green-deep: #0e9e52;
  --orange: #6f4428;
  --orange-line: #91613f;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  font-family:
    Pretendard,
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 76px;
  background:
    radial-gradient(circle at 82% 38%, rgba(24, 216, 114, 0.13), transparent 15rem),
    linear-gradient(180deg, #080908 0%, #050605 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 30px 24px 36px;
}

.app-header {
  text-align: center;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: 0;
  word-break: keep-all;
}

.material-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  min-height: 88px;
  margin-bottom: 32px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(22, 23, 22, 0.88);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 66px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.tab.is-active {
  color: #072111;
  background: linear-gradient(180deg, #1ee681, var(--green));
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 0 1px rgba(24, 216, 114, 0.24),
    0 18px 38px rgba(24, 216, 114, 0.13);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(20, 21, 20, 0.96);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 38px 32px;
}

.result-panel {
  padding: 34px 32px;
}

.panel-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 26px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 900;
}

.input-label {
  background: rgba(20, 84, 42, 0.46);
  color: #a8ffc7;
}

.input-label::before {
  content: "📝";
  margin-right: 4px;
}

.result-label {
  margin-bottom: 0;
  background: rgba(105, 61, 33, 0.55);
  color: #ffb57c;
}

.result-label::before {
  content: "📊";
  margin-right: 4px;
}

.field-stack {
  display: grid;
  gap: 22px;
}

.field-group {
  display: grid;
  gap: 10px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label,
.group-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

input,
select {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e0f0e;
  color: var(--text);
  padding: 0 18px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted-strong) 50%),
    linear-gradient(135deg, var(--muted-strong) 50%, transparent 50%);
  background-position:
    calc(100% - 24px) 23px,
    calc(100% - 16px) 23px;
  background-size:
    8px 8px,
    8px 8px;
  background-repeat: no-repeat;
  padding-right: 48px;
}

input:focus,
select:focus {
  border-color: rgba(24, 216, 114, 0.65);
  box-shadow: 0 0 0 3px rgba(24, 216, 114, 0.13);
}

input:disabled,
select:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 56px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e0f0e;
}

.segmented button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 800;
  cursor: pointer;
}

.segmented button.is-active {
  background: #20211f;
  color: var(--text);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  color: var(--text);
  font-weight: 800;
}

.checkbox-row input {
  width: 22px;
  min-height: 22px;
  height: 22px;
  accent-color: var(--green);
  padding: 0;
}

.custom-fields,
.dimension-fields {
  display: none;
}

.custom-fields.is-visible,
.dimension-fields.is-visible {
  display: grid;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.result-actions {
  display: inline-flex;
  gap: 10px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e0f0e;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: #181918;
}

.hero-result {
  min-height: 188px;
  margin-bottom: 20px;
  padding: 28px 28px 24px;
  border: 1px solid rgba(24, 216, 114, 0.32);
  border-radius: 14px;
  background:
    radial-gradient(circle at 88% 20%, rgba(24, 216, 114, 0.15), transparent 7rem),
    #0d0e0d;
}

.hero-result p {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 16px;
  font-weight: 900;
}

.hero-result strong {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 70px;
  font-size: clamp(54px, 8vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-result strong span:last-child {
  color: var(--green);
  font-size: 26px;
}

.hero-result small {
  color: var(--muted);
  font-size: 15px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 112px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  background: #0e0f0e;
}

.metric-name {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.metric-value {
  display: block;
  color: var(--text);
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: 0;
}

.site-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 84px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--orange-line);
  border-radius: 10px;
  background: rgba(92, 55, 35, 0.72);
  color: var(--muted-strong);
}

.site-note p {
  margin: 0;
  line-height: 1.7;
}

.feedback-strip {
  position: fixed;
  right: max(16px, calc((100vw - 1080px) / 2 + 24px));
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(254, 229, 0, 0.35);
  border-radius: 12px;
  background: rgba(16, 16, 14, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(12px);
}

.feedback-copy {
  padding: 0 4px 0 7px;
}

.feedback-kicker {
  margin: 0;
  color: #fee500;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.feedback-strip h2 {
  display: none;
}

.feedback-strip p:last-child {
  display: none;
}

.feedback-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(254, 229, 0, 0.12);
  border-radius: 8px;
  background: #fee500;
  color: #191600;
  font-weight: 900;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(254, 229, 0, 0.13);
}

.feedback-link:not(.is-disabled):hover {
  background: #fff04a;
}

.feedback-link.is-disabled {
  border-color: var(--line);
  background: #20211f;
  color: var(--muted);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.kakao-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #191600;
}

.kakao-mark svg {
  width: 21px;
  height: 21px;
  fill: #fee500;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 24px 16px 28px;
  }

  .material-tabs,
  .workspace,
  .field-row {
    grid-template-columns: 1fr;
  }

  .material-tabs {
    min-height: auto;
  }

  .tab {
    min-height: 58px;
  }

  .input-panel,
  .result-panel {
    padding: 26px 20px;
  }

  .feedback-strip {
    left: 16px;
    right: 16px;
    width: auto;
    padding: 8px;
  }

  .feedback-link {
    width: 100%;
  }

  .feedback-copy {
    display: none;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 26px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero-result {
    min-height: 160px;
    padding: 24px 20px;
  }

  .hero-result strong {
    font-size: 52px;
  }

}

@media print {
  body {
    background: #fff;
    color: #111;
    padding-bottom: 0;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .material-tabs,
  .input-panel,
  .result-actions,
  .feedback-strip {
    display: none;
  }

  .panel,
  .hero-result,
  .metric-card,
  .site-note {
    box-shadow: none;
    color: #111;
    background: #fff;
  }
}
