/* Eʋegbe Lexicon review desk — warm paper, ink, one accent per direction. */

:root {
  --paper: #f4efe5;
  --paper-2: #ece3d3;
  --paper-3: #e3d7c2;
  --ink: #1d1a15;
  --ink-soft: #3b342a;
  --muted: #746855;
  --line: #d7c9b3;
  --line-strong: #bfae93;
  --accent: #b45309;
  --accent-dark: #92400e;
  --green: #3f6212;
  --blue: #1e3a5f;
  --red: #9f1239;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 1px 0 rgba(29, 26, 21, 0.04), 0 12px 30px -24px rgba(29, 26, 21, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 85% -10%, #fbf7ef 0%, transparent 60%),
    radial-gradient(900px 600px at 0% 100%, #efe6d5 0%, transparent 55%),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

code, .mono { font-family: var(--mono); font-size: 0.9em; }

/* ---------- shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(244, 239, 229, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
}
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-family: var(--serif); font-size: 1.05rem; letter-spacing: 0.01em; }
.brand-text small { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav a {
  color: var(--ink-soft);
  font-size: 0.82rem;
  padding: 7px 9px;
  border-radius: 8px;
  letter-spacing: 0.01em;
}
.nav a:hover { background: var(--paper-2); text-decoration: none; }
.nav-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 44px) 80px;
}

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 44px) 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- messages ---------- */

.messages { max-width: 1180px; margin: 18px auto 0; padding: 0 clamp(18px, 4vw, 44px); }
.message {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #fbf7ef;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.message.error { border-left-color: var(--red); }
.message.success { border-left-color: var(--green); }

/* ---------- typography helpers ---------- */

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.lede { max-width: 58ch; color: var(--ink-soft); font-size: 1.05rem; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 0.88rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 18px 0 0; }

/* ---------- hero ---------- */

.hero { padding-top: 10px; margin-bottom: 34px; }
.hero h1 { max-width: 17ch; }
.hero h1 em { color: var(--accent-dark); font-style: italic; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-note { color: var(--muted); font-size: 0.82rem; margin: 10px 0 0; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin: 28px 0 34px;
}
.stat-strip > div { background: #fbf7ef; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat-strip strong { font-family: var(--mono); font-size: 1.25rem; }
.stat-strip span { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- cards ---------- */

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  --tone: var(--accent);
  position: relative;
  background: #fbf7ef;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.card header h2 { margin: 4px 0 6px; }
.card header p { margin: 0; color: var(--muted); font-size: 0.9rem; min-height: 2.6em; }
.card-kicker { color: var(--tone); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; }

.progress { height: 6px; background: var(--paper-3); border-radius: 999px; overflow: hidden; margin: 18px 0 8px; }
.progress span { display: block; height: 100%; background: var(--tone); border-radius: inherit; }
.progress-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.78rem; }
.progress-line strong { color: var(--ink); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 18px; }
.mini-stats div { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.mini-stats dt { color: var(--muted); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; }
.mini-stats dd { margin: 0; font-family: var(--mono); font-size: 1rem; }
.card footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card footer .link { margin-left: auto; font-size: 0.8rem; }

.tone-ochre { --tone: #b45309; }
.tone-clay { --tone: #9a3412; }
.tone-moss { --tone: #4d7c0f; }
.tone-slate { --tone: #334155; }
.tone-plum { --tone: #6b21a8; }
.tone-indigo { --tone: #3730a3; }
.tone-dual { --tone: #7c2d12; }

/* ---------- buttons / chips ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: #fbf7ef;
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}
.button:hover { text-decoration: none; border-color: var(--ink-soft); }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.button.primary:hover { background: #000; }
.button.ghost { background: transparent; }
.button.small { padding: 7px 10px; font-size: 0.8rem; }
.button.tiny { padding: 4px 8px; font-size: 0.74rem; border-radius: 7px; }

.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip-label { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; margin-right: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf7ef;
  color: var(--ink-soft);
  font-size: 0.78rem;
}
.chip:hover { text-decoration: none; border-color: var(--line-strong); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- review ---------- */

.review-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.review-head h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.position { display: flex; align-items: baseline; gap: 8px; }
.position strong { font-family: var(--mono); font-size: 1.3rem; }
.position span { color: var(--muted); font-size: 0.8rem; }

.filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.search { display: flex; gap: 8px; margin-top: 4px; }
.search input {
  flex: 1;
  max-width: 360px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbf7ef;
  font: inherit;
}

.review-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 22px; align-items: start; }

.word-panel {
  --tone: var(--accent);
  position: sticky;
  top: 92px;
  background: #fbf7ef;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.word-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.source-word {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 4px 0 6px;
  overflow-wrap: anywhere;
}
.key { color: var(--muted); font-size: 0.8rem; margin: 0; }

.example { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 16px; }
.example-head { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; }
.example-source { font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; margin: 10px 0 8px; }
.example-target { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.example-target.example-en { color: var(--muted); }
.example-lang {
  display: inline-block;
  min-width: 2.2em;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge.tier-A { color: var(--green); border-color: #b7c99a; background: #f3f8ea; }
.badge.tier-B { color: var(--accent-dark); border-color: #e0c6a4; background: #fbf1e3; }
.badge.tier-C { color: var(--muted); }
.badge.tier-F { color: var(--blue); border-color: #b9c8db; background: #eef3f9; }
.badge.warn { color: var(--red); border-color: #e5b8c6; background: #fdf0f4; }
.badge.status-accepted { color: var(--green); border-color: #b7c99a; background: #f3f8ea; }
.badge.status-skipped { color: var(--muted); }
.badge.status-needs_more { color: var(--accent-dark); border-color: #e0c6a4; background: #fbf1e3; }
.badge.sev-error { color: var(--red); border-color: #e5b8c6; background: #fdf0f4; }
.badge.sev-warning { color: var(--accent-dark); border-color: #e0c6a4; background: #fbf1e3; }

.decision-panel { background: #fbf7ef; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }

.candidates-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.candidate-title { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.candidate-hint { color: var(--muted); font-size: 0.7rem; }

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

.page.has-dock { padding-bottom: 128px; }

.action-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(244, 239, 229, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -18px 40px -32px rgba(29, 26, 21, 0.55);
}
.dock-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px clamp(18px, 4vw, 44px);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.dock-summary { display: flex; flex-direction: column; min-width: 0; }
.dock-label { color: var(--muted); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; }
.dock-choice {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}
.dock-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.candidates { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; max-height: 40vh; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.candidates::-webkit-scrollbar { width: 8px; }
.candidates::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.candidates::-webkit-scrollbar-track { background: transparent; }
.candidate {
  --score: 0;
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr auto 22px;
  grid-template-areas: "rank text score add" "rank sub sub add" "bar bar bar bar";
  gap: 2px 10px;
  align-items: center;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdfaf4;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.candidate:hover { border-color: var(--line-strong); background: #fffdf8; }
.candidate input { position: absolute; opacity: 0; pointer-events: none; }
.candidate .cand-rank {
  grid-area: rank;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}
.candidate .cand-text { grid-area: text; font-size: 1.05rem; font-family: var(--serif); overflow-wrap: anywhere; }
.candidate .cand-score { grid-area: score; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.candidate .cand-sub { grid-area: sub; color: var(--muted); font-size: 0.7rem; }
.candidate .cand-add {
  grid-area: add;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
}
.candidate.is-chosen .cand-add {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.candidate .cand-bar {
  grid-area: bar;
  display: block;
  height: 3px;
  margin-top: 6px;
  background: var(--paper-3);
  border-radius: 999px;
  overflow: hidden;
}
.candidate .cand-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: calc(var(--score) * 100%);
  background: var(--accent);
  border-radius: inherit;
}
.candidate.is-stop { border-style: dashed; }
.candidate.is-stop .cand-bar::after { background: var(--blue); }
.candidate.is-chosen {
  border-color: var(--accent);
  background: #fff7ea;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.candidate.is-chosen .cand-rank { background: var(--accent); color: #fff; }

.selected-panel { border-top: 1px dashed var(--line); padding-top: 12px; margin: 4px 0 14px; }
.selected-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.selected-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.selected-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7ea;
}
.sel-rank {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.7rem;
}
.sel-text { font-family: var(--serif); font-size: 1rem; overflow-wrap: anywhere; }
.sel-auto {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.6rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.selected-item.auto { border-style: dashed; }
.sel-actions { display: flex; gap: 2px; }
.sel-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  padding: 0;
}
.sel-btn:hover { border-color: var(--line-strong); }
.sel-btn.sel-remove { color: var(--red); }
.selected-empty { color: var(--muted); font-size: 0.78rem; margin: 8px 0 0; }

.custom-add { display: flex; gap: 8px; margin-bottom: 12px; }
.custom-add input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdf8;
  font: inherit;
}
.custom-add input:focus { outline: 2px solid rgba(180, 83, 9, 0.25); border-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(180, 83, 9, 0.25);
  border-color: var(--accent);
}
.field-row { display: flex; gap: 12px; }
.field.grow { flex: 1; }
.field-row .field { min-width: 140px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.keys { margin: 12px 0 0; color: var(--muted); font-size: 0.74rem; }
kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.7rem;
}

/* ---------- tables / panels ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fbf7ef; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.source-cell span { font-family: var(--serif); font-size: 1.05rem; }
.source-cell small { display: block; color: var(--muted); font-size: 0.68rem; }
.cand-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.pill {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  font-size: 0.76rem;
}
.pill em { color: var(--muted); font-style: normal; font-family: var(--mono); font-size: 0.68rem; }
.pill.is-stop { border-style: dashed; color: var(--muted); }
.chosen { color: var(--ink); font-family: var(--serif); margin-top: 3px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 0.8rem; }

.panel { background: #fbf7ef; border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.panel.wide { margin-top: 22px; }
.panel h2 { margin-bottom: 8px; }
.panel p { margin-top: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form input { flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; font: inherit; }
.table-input { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fffdf8; font: inherit; font-size: 0.85rem; }

.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--line-strong); border-radius: 14px; }
.empty h2 { margin-bottom: 8px; }
.empty-note { color: var(--muted); padding: 18px; text-align: center; }

.dual-banner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
  margin: 6px 0 22px;
  padding: 22px 24px;
  color: var(--ink);
  background: linear-gradient(120deg, #fbf7ef 0%, #f6ead9 100%);
  border: 1px solid var(--line);
  border-left: 4px solid var(--tone, #7c2d12);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.dual-banner:hover { text-decoration: none; border-color: var(--line-strong); }
.dual-banner h2 { margin: 2px 0 6px; font-size: 1.6rem; }
.dual-banner p { margin: 0; color: var(--muted); max-width: 55ch; }
.dual-banner-stats { display: flex; flex-direction: column; gap: 4px; }
.dual-banner-stats strong { font-family: var(--mono); font-size: 1.8rem; line-height: 1; }
.dual-banner-stats span { color: var(--muted); font-size: 0.78rem; }
.dual-banner-stats small { color: var(--muted); font-size: 0.72rem; }
.dual-banner .progress { margin: 8px 0 2px; }

.dual-word { position: static; }
.dual-word-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; align-items: start; }
.dual-word .source-word { font-size: clamp(2.2rem, 4vw, 3.2rem); margin: 0; }
.dual-word .example { margin-top: 0; border-top: 0; padding-top: 0; }
.dual-word .example.compact .example-source { font-size: 0.98rem; }

.dual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.lang-panel { min-width: 0; }
.lang-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.lang-head h2 { font-size: 1.25rem; }
.lang-note { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.lang-help { color: var(--muted); font-size: 0.75rem; margin: -4px 0 10px; }
.lang-panel .candidates { max-height: 34vh; }
.lang-panel .selected-panel {
  border-top: 0;
  border-bottom: 1px dashed var(--line);
  padding-top: 0;
  padding-bottom: 10px;
  margin-top: 0;
  margin-bottom: 12px;
}
.shared-fields { margin: 16px 0 8px; }
.form-error { color: var(--red); background: #fdf0f4; border: 1px solid #e5b8c6; padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; }

.clusters { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.cluster-card { border: 1px solid var(--line); border-radius: 12px; background: #fbf7ef; overflow: hidden; }
.cluster-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.cluster-card > header strong { font-family: var(--serif); font-size: 1.05rem; }
.cluster-card > header small { display: block; color: var(--muted); font-size: 0.7rem; }
.occurrence-list { max-height: 40vh; overflow-y: auto; }
.occurrence {
  display: grid;
  grid-template-columns: 22px 78px 1fr;
  grid-template-areas:
    "check ref ewe"
    "check ref full"
    "check ref fr"
    "check ref en"
    "check ref badge";
  gap: 3px 10px;
  align-items: start;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.88rem;
}
.occurrence:last-child { border-bottom: 0; }
.occurrence:hover { background: #fffdf8; }
.occurrence.is-assigned { background: #f5f9ee; }
.occurrence input { grid-area: check; margin-top: 4px; }
.occ-ref { grid-area: ref; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }
.occ-text { grid-area: ewe; font-family: var(--serif); font-size: 1rem; }
.occ-fr { grid-area: fr; color: var(--ink-soft); font-size: 0.82rem; }
.occ-en { grid-area: en; color: var(--muted); font-size: 0.78rem; }
.occ-full { grid-area: full; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.occ-full summary { cursor: pointer; color: var(--accent-dark); }
.hit { background: #fde68a; color: var(--ink); padding: 0 2px; border-radius: 3px; box-shadow: inset 0 -1px 0 #d97706; }
.occurrence .badge { grid-area: badge; justify-self: start; }

.sense-list { margin-top: 30px; }
.sense-list > h2 { margin-bottom: 12px; }
.sense-card { border: 1px solid var(--line); border-radius: 12px; background: #fbf7ef; padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.sense-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sense-card h3 { font-family: var(--mono); font-size: 1rem; }
.sense-gloss { margin: 2px 0 8px; font-family: var(--serif); font-size: 1.1rem; }
.sense-edit { margin-top: 8px; }
.sense-edit summary { cursor: pointer; color: var(--accent-dark); font-size: 0.82rem; }
.sense-edit form { margin-top: 10px; }
.sense-actions { display: flex; gap: 8px; margin-top: 10px; }
.assign-row { margin-top: 4px; }

.how { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 24px; }
.how h2 { margin-bottom: 14px; }
.how ol { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.how li { margin-bottom: 8px; }
.how .note { margin-top: 14px; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .review-grid { grid-template-columns: 1fr; }
  .dual-grid { grid-template-columns: 1fr; }
  .dual-banner { grid-template-columns: 1fr; }
  .dual-word-body { grid-template-columns: 1fr; }
  .word-panel { position: static; }
  .cards { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .dock-inner { padding: 10px 14px; gap: 10px; }
  .dock-summary { display: none; }
  .dock-buttons { width: 100%; }
  .dock-buttons .button { flex: 1; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav-sep { display: none; }
  .field-row { flex-direction: column; }
  .review-head { flex-direction: column; align-items: flex-start; }
  .stat-strip { grid-template-columns: 1fr; }
  .source-word { font-size: 2.6rem; }
}


/* ---------- authentication ---------- */

.user-box { display: flex; align-items: center; gap: 8px; }
.user-chip { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }
.logout-button { border: 0; background: transparent; color: var(--accent-dark); font: inherit; font-size: 0.78rem; cursor: pointer; padding: 6px 7px; border-radius: 7px; }
.logout-button:hover { background: var(--paper-2); }
.auth-shell { display: grid; place-items: center; min-height: 52vh; }
.auth-card { width: min(460px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: #fbf7ef; box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 10px; }
.auth-card .answer-input { margin: 0 0 14px; }
.auth-card .answer-label { margin-top: 14px; }
.auth-actions { margin-top: 8px; }
.form-error { color: var(--red); font-size: 0.88rem; }
