:root {
  --navy: #191f28;
  --navy-soft: #4e5968;
  --copper: #3182f6;
  --copper-soft: #2272eb;
  --copper-hi: #4593fc;
  --cream: #fafafa;
  --cream-2: #f4f5f7;
  --card: #ffffff;
  --ink: #191f28;
  --ink-soft: #4e5968;
  --muted: #6b7684;
  --border: #e5e8eb;
  --hair: rgba(25, 31, 40, .12);
  --hair-2: rgba(25, 31, 40, .07);
  --copper-bg: rgba(49, 130, 246, .08);
  --copper-line: rgba(49, 130, 246, .35);
  --navy-bg: rgba(25, 31, 40, .05);
  --good: #067647;
  --good-bg: rgba(3, 178, 108, .07);
  --good-line: rgba(3, 178, 108, .3);
  --bad: #d22030;
  --bad-bg: rgba(240, 68, 82, .06);
  --bad-line: rgba(240, 68, 82, .3);
  --serif: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Noto Sans KR", sans-serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Noto Sans KR", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-title: clamp(1.875rem, 4vw, 3rem);
  --fs-h3: 1.25rem;
  --fs-body: 1.0625rem;
  --fs-sm: .875rem;
  --fs-meta: .75rem;
  --fs-eyebrow: .625rem;
  --lh-snug: 1.2;
  --lh-body: 1.65;
  --ls-tight: -.02em;
  --ls-eyebrow: .06em;
  --ls-meta: .1em;
  --space-xs: .5rem;
  --space-sm: .75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 40px rgba(25, 31, 40, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .3s;
  --nav-height: 68px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--copper-line);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.brand-bg {
  background-color: var(--cream);
  background-size: 26px 26px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--navy);
  color: var(--cream);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ── 헤더 ─────────────────────────────────────── */

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: var(--space-sm);
  padding: calc(var(--space-sm) + env(safe-area-inset-top)) var(--space-md) var(--space-sm);
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: var(--space-sm);
}

.brand-mark {
  position: relative;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border: 1px solid var(--navy);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  background: var(--copper);
  border-radius: 50%;
}

.brand-mark::before {
  width: 7px;
  height: 7px;
  top: 5px;
  right: 4px;
}

.brand-mark::after {
  width: 4px;
  height: 4px;
  bottom: 6px;
  left: 6px;
}

.brand-kicker,
.brand-name,
.screen-heading p,
.panel-heading p {
  margin: 0;
}

.brand-kicker {
  color: var(--copper);
  font-family: var(--mono);
  font-size: .55rem;
  letter-spacing: .16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-name {
  overflow: hidden;
  color: var(--navy);
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 본문 공통 ────────────────────────────────── */

.app-main {
  width: min(100%, 820px);
  min-height: calc(100vh - 132px);
  min-height: calc(100dvh - 132px);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) calc(var(--nav-height) + var(--space-2xl) + env(safe-area-inset-bottom));
}

.screen {
  animation: screen-in .25s var(--ease) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-heading {
  margin-bottom: var(--space-xl);
}

.compact-heading {
  margin-bottom: var(--space-lg);
}

.mp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--copper);
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

.mp-eyebrow::before {
  width: 2rem;
  height: 1px;
  background: var(--copper);
  content: "";
}

.mp-title {
  margin: var(--space-sm) 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-snug);
}

.screen-intro,
.supporting-copy {
  max-width: 46rem;
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.6;
}

.field > span {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--navy);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.field b {
  color: var(--copper);
}

textarea,
input:not([type="file"]),
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
}

textarea,
input:not([type="file"]) {
  padding: .7rem .8rem;
}

select {
  padding: .55rem .7rem;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--copper-line);
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: .7rem var(--space-md);
}

.primary-button {
  border: 1px solid var(--copper);
  background: var(--copper);
  color: #ffffff;
}

.primary-button:hover {
  border-color: var(--copper-soft);
  background: var(--copper-soft);
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--navy);
}

.secondary-button:hover {
  border-color: var(--copper-line);
  color: var(--copper);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--copper);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.panel {
  position: relative;
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.panel-heading h2 {
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
}

.panel-kicker,
.detail-label {
  color: var(--copper);
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
}

.status-chip,
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 40vw;
  overflow: hidden;
  margin: 0;
  padding: .2rem .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .05em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-chip.is-active-session {
  border-color: var(--copper-line);
  background: var(--copper-bg);
  color: #1b64da;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.field-full {
  grid-column: 1 / -1;
}

.result-stack {
  display: grid;
  gap: var(--space-md);
}

/* ── 안내 박스 ────────────────────────────────── */

.guide-box {
  margin-bottom: var(--space-xl);
  border: 1px solid var(--copper-line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.guide-summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: var(--space-sm);
  padding: .4rem var(--space-md);
  cursor: pointer;
  list-style: none;
}

.guide-summary::-webkit-details-marker {
  display: none;
}

.guide-kicker {
  color: var(--copper);
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  white-space: nowrap;
}

.guide-title {
  flex: 1;
  overflow: hidden;
  color: var(--navy);
  font-family: var(--serif);
  font-size: .98rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-more {
  color: var(--navy-soft);
  font-size: var(--fs-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.guide-box[open] .guide-more {
  color: var(--copper);
}

.guide-steps {
  margin: 0;
  padding: 0 var(--space-md) var(--space-md) var(--space-md);
  list-style: none;
}

.guide-steps li {
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--hair-2);
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.55;
}

.guide-steps strong {
  color: var(--navy);
}

/* ── 세션 목록 ────────────────────────────────── */

.session-list-section {
  margin-top: var(--space-xl);
}

.collection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.collection-heading h2 {
  margin: .15rem 0 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
}

.session-card,
.empty-state {
  position: relative;
  overflow: hidden;
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.session-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--border);
  content: "";
}

.session-card.is-current::before {
  background: var(--copper);
}

.session-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}

.session-model {
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}

.session-meta {
  margin: var(--space-xs) 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .03em;
}

.session-memo {
  margin: var(--space-xs) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.session-actions > button {
  flex: 1 1 130px;
}

.danger-button {
  border-color: var(--bad-line);
  color: var(--bad);
}

.danger-button:hover {
  border-color: var(--bad);
  color: var(--bad);
}

.empty-state {
  color: var(--ink-soft);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--navy);
  font-family: var(--serif);
  font-size: var(--fs-h3);
}

.transfer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.file-button {
  position: relative;
  text-align: center;
}

.notice-box {
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--copper-line);
  border-radius: var(--radius-md);
  background: var(--copper-bg);
  color: #1b64da;
}

.notice-box p {
  margin: 0 0 var(--space-sm);
}

/* ── 진행률 ───────────────────────────────────── */

.progress-wrap {
  margin-bottom: var(--space-lg);
}

.progress-labels {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.progress-text {
  color: var(--navy);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.progress-percent {
  color: var(--copper);
  font-family: var(--mono);
  font-size: var(--fs-meta);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--cream-2);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-soft) 70%, var(--copper) 100%);
  transition: width var(--dur) var(--ease);
}

/* ── 필터 ─────────────────────────────────────── */

.filter-row {
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tab-button {
  min-height: 36px;
  padding: .25rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.tab-button:hover {
  border-color: var(--copper-line);
  color: var(--copper);
}

.tab-button[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--cream);
}

.quick-toggle {
  min-height: 36px;
  padding: .25rem .7rem;
  border: 1px dashed var(--copper-line);
  border-radius: 999px;
  background: var(--card);
  color: var(--copper);
  font-size: var(--fs-sm);
  font-weight: 600;
  justify-self: start;
}

.quick-toggle[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--copper);
  background: var(--copper);
  color: var(--cream);
}

/* ── 테스트 카드 ──────────────────────────────── */

.test-stack {
  display: grid;
  gap: var(--space-lg);
}

.test-card {
  position: relative;
  overflow: hidden;
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.test-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--copper);
  content: "";
}

.test-card.is-scored::before {
  background: var(--good);
}

.test-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: .12rem .5rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--navy-bg);
  color: var(--navy);
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .05em;
  white-space: nowrap;
}

.custom-badge {
  border-color: var(--copper-line);
  background: var(--copper-bg);
  color: #1b64da;
}

.quick-badge {
  border-color: var(--good-line);
  background: var(--good-bg);
  color: var(--good);
}

.test-title {
  width: 100%;
  margin: var(--space-xs) 0 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: var(--fs-h3);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.test-why {
  margin: var(--space-sm) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.test-why .detail-label {
  display: block;
  margin-bottom: .2rem;
}

.prompt-block {
  margin-top: var(--space-md);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--navy);
}

.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: .35rem .5rem .35rem var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  color: var(--copper-hi);
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
}

.copy-button {
  min-height: 34px;
  padding: .15rem .7rem;
  border: 1px solid var(--copper-soft);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--cream);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.copy-button:hover {
  border-color: var(--copper);
  background: var(--copper);
}

.prompt-pre {
  overflow-x: auto;
  max-height: 340px;
  margin: 0;
  padding: var(--space-md);
  color: var(--cream);
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-overflow-scrolling: touch;
}

.watch-block,
.rubric-block {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border-left: 2px solid var(--border);
  background: var(--cream);
}

.watch-block {
  border-left-color: var(--navy);
}

.rubric-block {
  border-left-color: var(--copper);
}

.watch-block .detail-label,
.rubric-block .detail-label {
  display: block;
  margin-bottom: var(--space-xs);
}

.watch-list,
.rubric-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.55;
}

.rubric-list {
  padding-left: 0;
  list-style: none;
}

.rubric-list li {
  margin-top: .35rem;
}

.rubric-list li:first-child {
  margin-top: 0;
}

.rubric-score {
  display: inline-block;
  min-width: 3.4em;
  color: var(--navy);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.score-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: .45rem .3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink-soft);
  font-weight: 600;
  gap: .1rem;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.score-button .score-num {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
}

.score-button .score-word {
  font-size: .78rem;
}

.score-button:hover {
  border-color: var(--copper-line);
  color: var(--copper);
}

.score-button[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--cream);
}

.score-button.score-0[aria-pressed="true"] {
  border-color: var(--bad);
  background: var(--bad);
}

.score-button.score-1[aria-pressed="true"] {
  border-color: var(--copper);
  background: var(--copper);
}

.score-button.score-2[aria-pressed="true"] {
  border-color: var(--good);
  background: var(--good);
}

.note-field {
  margin-top: var(--space-md);
}

.note-field textarea {
  min-height: 56px;
}

.save-hint {
  margin: .3rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .04em;
}

.custom-delete-row {
  margin-top: var(--space-md);
  text-align: right;
}

.custom-test-panel {
  margin-top: var(--space-2xl);
}

/* ── 결과 ─────────────────────────────────────── */

.results-session-field {
  max-width: 420px;
  margin-bottom: var(--space-lg);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.stat-card {
  min-width: 0;
  padding: var(--space-md) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.stat-value {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 6.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.stat-label {
  display: block;
  margin-top: var(--space-xs);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.radar-panel {
  margin-top: 0;
  text-align: center;
}

.radar-wrap {
  max-width: 460px;
  margin: 0 auto;
}

.radar-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  font-size: var(--fs-sm);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--ink-soft);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.data-table caption {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--cream-2);
  color: var(--navy);
  font-family: var(--mono);
  font-size: .67rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table .num-cell {
  font-family: var(--mono);
  white-space: nowrap;
}

.delta-up {
  color: var(--good);
  font-weight: 700;
}

.delta-down {
  color: var(--bad);
  font-weight: 700;
}

.delta-flat {
  color: var(--muted);
}

.unscored {
  color: var(--muted);
}

.compare-selects {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.compare-headline {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--copper);
  background: var(--copper-bg);
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.5;
}

/* ── 하단 내비게이션 ──────────────────────────── */

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 0 max(var(--space-xs), env(safe-area-inset-right)) env(safe-area-inset-bottom) max(var(--space-xs), env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 -8px 28px rgba(25, 31, 40, .06);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 56px;
  padding: .35rem .1rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  gap: 2px;
}

.nav-item::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 24px;
  height: 2px;
  background: var(--copper);
  content: "";
  opacity: 0;
  transform: translateX(-50%);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.nav-item.is-active {
  color: var(--navy);
  font-weight: 700;
}

.nav-item.is-active::before {
  opacity: 1;
}

/* ── 토스트 ───────────────────────────────────── */

.toast {
  position: fixed;
  z-index: 80;
  right: var(--space-md);
  bottom: calc(var(--nav-height) + var(--space-md) + env(safe-area-inset-bottom));
  left: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 560px;
  min-height: 44px;
  margin: 0 auto;
  padding: .75rem var(--space-md);
  border-left: 3px solid var(--copper);
  background: var(--navy);
  color: var(--cream);
  box-shadow: var(--shadow-soft);
  font-size: var(--fs-sm);
  gap: var(--space-sm);
}

/* ── 반응형 ───────────────────────────────────── */

@media (min-width: 640px) {
  .app-header {
    padding-right: var(--space-xl);
    padding-left: var(--space-xl);
  }

  .app-main {
    padding-right: var(--space-xl);
    padding-left: var(--space-xl);
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .transfer-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .compare-selects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    right: 50%;
    left: auto;
    width: min(560px, 100%);
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
    transform: translateX(50%);
  }
}

@media (max-width: 360px) {
  .brand-name {
    max-width: 148px;
  }

  .nav-item {
    font-size: .63rem;
  }

  .score-button .score-word {
    font-size: .7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
