@charset "UTF-8";
/* Idiolect — warm ivory, slate ink, clay for elegance, olive for whimsy. */

:root {
  --bg: #faf9f5;
  --bg-2: #f1efe7;
  --card: #ffffff;
  --line: #e8e6dc;
  --line-2: #d6d3c7;
  --ink: #141413;
  --ink-2: #3d3d3a;
  --muted: #6b6a64;
  --faint: #a19f96;
  --clay: #d97757;
  --clay-ink: #b5512f;
  --clay-wash: #d977571f;
  --olive: #788c5d;
  --olive-ink: #56683f;
  --olive-wash: #788c5d24;
  --shadow-1: 0 1px 2px #1414130a, 0 1px 1px #14141305;
  --shadow-2: 0 12px 28px -14px #1414132e, 0 2px 6px #1414130d;
  --shadow-3: 0 30px 80px -24px #14141345, 0 8px 20px -8px #1414131f;
  --backdrop: #14141352;

  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;
  --out: cubic-bezier(.16, 1, .3, 1);

  --r-xl: 24px;
  --r-lg: 16px;
  --r-md: 12px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #1a1918;
  --bg-2: #232220;
  --card: #262523;
  --line: #34332f;
  --line-2: #47453f;
  --ink: #f4f2ea;
  --ink-2: #d9d6cc;
  --muted: #a29f95;
  --faint: #73716a;
  --clay: #e08a6d;
  --clay-ink: #ee9f83;
  --clay-wash: #e08a6d26;
  --olive: #9db27f;
  --olive-ink: #b1c494;
  --olive-wash: #9db27f22;
  --shadow-1: 0 1px 2px #0000004d;
  --shadow-2: 0 14px 30px -14px #000000a6, 0 2px 6px #00000040;
  --shadow-3: 0 30px 80px -20px #000000b8;
  --backdrop: #00000094;
  color-scheme: dark;
}

[data-flavor='elegant'] { --accent: var(--clay); --accent-ink: var(--clay-ink); --wash: var(--clay-wash); }
[data-flavor='whimsical'] { --accent: var(--olive); --accent-ink: var(--olive-ink); --wash: var(--olive-wash); }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 10px; }
::selection { background: var(--clay-wash); }
[hidden] { display: none !important; }
svg { flex: none; }

.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent, var(--faint)); }
.dot.blend { background: linear-gradient(90deg, var(--clay) 50%, var(--olive) 50%); }

.link {
  color: var(--ink);
  font: italic 400 1.08em/1 var(--serif);
  text-decoration: underline;
  text-decoration-color: var(--accent, var(--clay));
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s;
}
.link:hover { color: var(--accent-ink, var(--clay-ink)); }

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 3px 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  font: 500 11px/1 var(--mono);
  text-align: center;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 17px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform .3s var(--out), background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.saved { color: var(--accent-ink, var(--clay-ink)); border-color: var(--accent, var(--clay)); background: var(--wash, var(--clay-wash)); }
.btn.saved svg { fill: currentColor; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--muted);
  transition: background-color .2s, color .2s, transform .3s var(--out);
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.sm { width: 30px; height: 30px; }

.pill {
  height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font: 400 16.5px/1 var(--serif);
  transition: transform .35s var(--out), border-color .2s, color .2s, box-shadow .3s;
}
.pill:hover { transform: translateY(-2px); border-color: var(--clay); color: var(--ink); box-shadow: var(--shadow-2); }
.pill:active { transform: scale(.96); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
body.scrolled .topbar { border-color: var(--line); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 500 22px/1 var(--serif);
  letter-spacing: -.015em;
  text-decoration: none;
}
.brand .wordmark { display: block; width: auto; height: 28px; }
.brand .comma { transform-box: fill-box; transform-origin: 30% 90%; transition: transform .5s var(--out); }
.brand:hover .comma { transform: rotate(-12deg) translateY(-4%); }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.palace-btn { padding: 0 8px 0 14px; }
.badge {
  min-width: 24px;
  height: 21px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 11.5px/21px var(--sans);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ---------- hero + search ---------- */

.app { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 72px; }
.hero { padding-top: clamp(36px, 10vh, 112px); transition: padding .7s var(--out); }
body[data-view='results'] .hero { padding-top: 18px; }

.intro { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .7s var(--out), opacity .45s; }
.intro-inner { min-height: 0; overflow: hidden; }
body[data-view='results'] .intro { grid-template-rows: 0fr; opacity: 0; }

.eyebrow { margin: 0 0 16px; color: var(--clay-ink); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
h1 {
  max-width: 14ch;
  margin: 0;
  font: 400 clamp(40px, 6.6vw, 72px)/1.02 var(--serif);
  letter-spacing: -.03em;
  text-wrap: balance;
}
h1 em { color: var(--clay); font-style: italic; }
.lede { max-width: 54ch; margin: 20px 0 36px; color: var(--muted); font-size: 17.5px; text-wrap: pretty; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 66px;
  padding: 0 10px 0 22px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-1);
  transition: border-color .25s, box-shadow .4s var(--out);
}
.search:focus-within { border-color: var(--clay); box-shadow: 0 0 0 5px var(--clay-wash), var(--shadow-2); }
.search-icon { color: var(--faint); transition: color .25s, transform .4s var(--out); }
.search:focus-within .search-icon { color: var(--clay); transform: scale(1.06); }
.field { position: relative; flex: 1; align-self: stretch; min-width: 0; }
.field input, .field .ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 23px/64px var(--serif);
  letter-spacing: -.005em;
  white-space: pre;
}
.field input { outline: none; }
.field input::placeholder { color: var(--faint); font-style: italic; }
.field .ghost { overflow: hidden; pointer-events: none; }
.ghost .typed { color: transparent; }
.ghost .rest { color: var(--faint); }
.tab-hint { opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .3s var(--out); }
.search.has-ghost .tab-hint { opacity: 1; transform: none; }
.go {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--ink);
  color: var(--bg);
  transition: transform .35s var(--out), background-color .2s;
}
.go:hover { background: var(--ink-2); }
.go:hover svg { transform: translateX(2px); }
.go svg { transition: transform .35s var(--out); }
.go:active { transform: scale(.92); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; opacity: 0; transition: opacity .25s; }
.progress::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, var(--clay), transparent);
  transform: translateX(-100%);
}
.search.busy .progress { opacity: 1; }
.search.busy .progress::after { animation: sweep 1.05s var(--out) infinite; }
@keyframes sweep { to { transform: translateX(240%); } }

.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 16px; }

.seg { position: relative; display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.seg button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: color .3s;
}
.seg button:hover, .seg button[aria-checked='true'] { color: var(--ink); }
.seg button .dot { width: 6px; height: 6px; opacity: .5; transition: opacity .3s, transform .4s var(--out); }
.seg button[aria-checked='true'] .dot { opacity: 1; transform: scale(1.2); }
.seg-pill { position: absolute; top: 4px; left: 0; height: 34px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }

.dial { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.dial input { --p: 60%; width: clamp(140px, 22vw, 230px); height: 24px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.dial input::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--ink) var(--p), var(--line-2) var(--p)); }
.dial input::-moz-range-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--ink) var(--p), var(--line-2) var(--p)); }
.dial input::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-2);
  transition: transform .35s var(--out);
  -webkit-appearance: none;
}
.dial input::-moz-range-thumb { width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--card); box-shadow: var(--shadow-2); transition: transform .35s var(--out); }
.dial input:hover::-webkit-slider-thumb { transform: scale(1.12); }
.dial input:active::-webkit-slider-thumb { transform: scale(1.28); }
.dial input:active::-moz-range-thumb { transform: scale(1.28); }

.trail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 4px; margin-top: 16px; font-size: 13px; }
.crumb { padding: 3px 10px; border-radius: 999px; color: var(--muted); font-family: var(--serif); font-size: 15px; transition: background-color .2s, color .2s; }
.crumb:hover { background: var(--bg-2); color: var(--ink); }
.crumb[aria-current='true'] { background: var(--bg-2); color: var(--ink); }
.trail .sep { color: var(--faint); }

/* ---------- home ---------- */

.home { margin-top: 28px; }
.mine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 16px 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--clay-wash), transparent 55%), var(--card);
}
.mine h2 { margin: 0 0 4px; font: 500 20px/1.2 var(--serif); }
.mine p { max-width: 62ch; margin: 0; color: var(--muted); font-size: 14px; }
.mine em { font-family: var(--serif); font-size: 1.08em; color: var(--ink-2); }
.mine-actions { display: flex; align-items: center; gap: 4px; }
.try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; }
.try > span { margin-right: 4px; color: var(--faint); font-size: 13px; }
.quote { max-width: 700px; margin: clamp(48px, 9vh, 104px) 0 0; }
.quote blockquote { position: relative; margin: 0; color: var(--ink-2); font: italic 400 clamp(21px, 2.6vw, 27px)/1.42 var(--serif); text-wrap: pretty; }
.quote blockquote::before { content: '\201C'; position: absolute; left: -.55em; top: -.08em; color: var(--clay); font-size: 1.6em; line-height: 1; opacity: .7; }
.quote figcaption { margin-top: 12px; color: var(--faint); font-size: 13px; letter-spacing: .02em; }

/* ---------- spotlight ---------- */

.results { margin-top: 26px; }
.spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-areas: 'head body' 'actions body';
  gap: 22px 44px;
  padding: clamp(22px, 3.6vw, 38px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: radial-gradient(110% 90% at 0% 0%, var(--wash, transparent), transparent 55%), var(--card);
  box-shadow: var(--shadow-1);
  transition: background .5s;
}
.spotlight::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.spot-head { grid-area: head; min-width: 0; }
.spot-label { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--muted); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.spot-label b { color: var(--accent-ink); font-weight: 600; }
.spot-word { margin: 0; font: 400 clamp(46px, 7.4vw, 82px)/1 var(--serif); letter-spacing: -.035em; overflow-wrap: anywhere; }
.spot-word .w { display: inline-block; white-space: nowrap; }
.spot-word .ch { display: inline-block; }
.spot-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.ipa { color: var(--ink-2); font: 400 14px/1 var(--mono); }
.ipa:empty { display: none; }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-size: 12px; }
.rarity { display: inline-flex; align-items: center; gap: 3px; }
.rarity i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.rarity i.on { background: var(--accent); }
.rarity i:nth-child(5) { margin-right: 6px; }

.spot-body { grid-area: body; align-self: center; min-width: 0; }
.defs { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: d; }
.defs li { position: relative; padding-left: 28px; color: var(--ink-2); font: 400 17.5px/1.5 var(--serif); }
.defs li::before {
  content: counter(d);
  counter-increment: d;
  position: absolute;
  left: 0;
  top: 4px;
  width: 19px;
  height: 19px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--faint);
  font: 500 10.5px/17px var(--mono);
  text-align: center;
}
.defs .def-loading, .defs .def-none { padding-left: 0; }
.defs .def-loading::before, .defs .def-none::before { content: none; }
.def-none { color: var(--faint) !important; font-style: italic !important; font-size: 15.5px !important; }
.def-loading span { display: block; height: 12px; margin: 8px 0; border-radius: 6px; background: linear-gradient(90deg, var(--bg-2) 25%, var(--line) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.def-loading span:last-child { width: 62%; }
.def-pos { margin-right: 7px; color: var(--faint); font-size: 14.5px; font-style: italic; }
.why { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding: 0; list-style: none; }
.why li { padding: 5px 11px; border-radius: 999px; background: var(--wash); color: var(--accent-ink); font-size: 12.5px; font-weight: 500; }
.kin { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }
.spot-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-self: end; gap: 8px; }

/* ---------- results grid ---------- */

.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 36px 0 14px; }
.count { margin: 0; color: var(--muted); font-size: 14px; }
.count b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.count em { color: var(--ink-2); font-family: var(--serif); font-size: 1.12em; }
.pos { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--out);
}
.pos-chip:hover { border-color: var(--line-2); color: var(--ink); }
.pos-chip:active { transform: scale(.95); }
.pos-chip span { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.pos-chip[aria-pressed='true'] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.pos-chip[aria-pressed='true'] span { color: inherit; opacity: .6; }

.grid { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.cell { position: relative; }
/* A tile fading out after the slider moved it off the list (see glide in motion.js). */
.cell.exiting { position: absolute; pointer-events: none; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 94px;
  padding: 16px 18px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  text-align: left;
  transition: border-color .25s, box-shadow .4s var(--out), transform .4s var(--out), background-color .4s;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card:active { transform: scale(.98); }
.card:focus-visible { outline-offset: 3px; border-radius: var(--r-lg); }
.cell.active .card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--wash); }
.card-word { padding-right: 30px; color: var(--ink); font: 400 22.5px/1.12 var(--serif); letter-spacing: -.012em; overflow-wrap: break-word; hyphens: auto; }
.card-meta { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 12px; }
.card-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.card-bar i { position: absolute; inset: 0; background: var(--accent); opacity: .75; transform: scaleX(0); transform-origin: left; transition: transform .7s var(--out); }
.card-tools { position: absolute; top: 9px; right: 9px; display: flex; flex-direction: column; gap: 2px; opacity: 0; transform: translateX(4px); transition: opacity .2s, transform .3s var(--out); }
.cell:hover .card-tools, .cell:focus-within .card-tools, .cell.saved .card-tools { opacity: 1; transform: none; }
.cell.saved:not(:hover):not(:focus-within) .tool:not(.star) { opacity: 0; }
.tool { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--faint); transition: background-color .2s, color .2s, transform .3s var(--out), opacity .2s; }
.tool:hover { background: var(--bg-2); color: var(--ink); }
.tool:active { transform: scale(.85); }
.cell.saved .star { color: var(--accent); }
.cell.saved .star svg { fill: currentColor; }
.cell.flash .card { animation: flash .7s var(--out); }
@keyframes flash { from { background: var(--wash); } }

.grid-sm { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }
.grid-sm .card { min-height: 78px; padding: 13px 15px 15px; }
.grid-sm .card-word { font-size: 19.5px; }
.skeleton { height: 78px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--bg-2) 25%, var(--line) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

.more { display: flex; margin: 18px auto 0; }
.afield { margin-top: 60px; }
.afield header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 14px; }
.afield h2 { margin: 0; font: 400 28px/1.1 var(--serif); letter-spacing: -.015em; }
.afield p { margin: 0; color: var(--muted); font-size: 13.5px; }

.picks { margin-top: 28px; }
.picks header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 14px; }
.picks h2 { margin: 0; font: 400 28px/1.1 var(--serif); letter-spacing: -.015em; }
.picks h2::before { content: '\2726'; margin-right: 9px; color: var(--clay); font-size: .62em; vertical-align: .3em; }
.picks header p { flex: 1; margin: 0; color: var(--muted); font-size: 13.5px; }
.picks header .btn { margin-left: auto; }
#picks-grid { grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); }
#picks-grid .skeleton { height: 112px; }
.card-why { color: var(--muted); font-size: 12.5px; line-height: 1.4; }

.message { padding: 64px 0; text-align: center; }
.message h2 { margin: 0 0 8px; font: 400 34px/1.2 var(--serif); letter-spacing: -.015em; }
.message p { margin: 0; color: var(--muted); }
.message .try { justify-content: center; }

/* ---------- footer ---------- */

.keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 18px 16px 28px; color: var(--faint); font-size: 12px; }
.keys kbd { margin-right: 2px; }

/* ---------- dialogs ---------- */

dialog { max-width: none; max-height: none; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
dialog::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog[open]::backdrop { animation: fade .35s var(--out); }
dialog.closing::backdrop { animation: fade .24s ease-in reverse forwards; }
@keyframes fade { from { opacity: 0; } }

.sheet { position: fixed; inset: 0 0 0 auto; width: min(480px, 100vw); height: 100dvh; margin: 0; }
.sheet-inner { display: flex; flex-direction: column; height: 100%; border-left: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow-3); }
.sheet[open] .sheet-inner { animation: slide-in .6s var(--out); }
.sheet.closing .sheet-inner { animation: slide-out .24s ease-in forwards; }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes slide-out { to { transform: translateX(100%); } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 22px 14px 26px; }
.sheet-head h2 { margin: 0; font: 400 30px/1.1 var(--serif); letter-spacing: -.02em; }
.sheet-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 26px 16px; border-bottom: 1px solid var(--line); }
.sheet-body { flex: 1; padding: 6px 26px 48px; overflow-y: auto; overscroll-behavior: contain; }

.modal { width: min(780px, calc(100vw - 24px)); margin: auto; }
.modal-inner { display: flex; flex-direction: column; max-height: min(88dvh, 840px); overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--bg); box-shadow: var(--shadow-3); }
.modal[open] .modal-inner { animation: pop-in .55s var(--out); }
.modal.closing .modal-inner { animation: pop-out .22s ease-in forwards; }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; justify-content: space-between; gap: 16px; padding: 28px 22px 4px 28px; }
.modal-head h2 { margin: 0; font: 400 32px/1.08 var(--serif); letter-spacing: -.022em; }
.modal-head p { max-width: 54ch; margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding: 16px 28px 24px; }
.fine { max-width: 46ch; margin: 0 auto 0 0; color: var(--faint); font-size: 12.5px; }
.spacer { flex: 1; }
.imp-step { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.drop { position: relative; margin: 18px 28px 0; border: 1.5px dashed var(--line-2); border-radius: 18px; background: var(--card); transition: border-color .2s, background-color .2s, transform .4s var(--out); }
.drop.over { border-color: var(--clay); background: var(--clay-wash); transform: scale(1.012); }
.drop textarea { display: block; width: 100%; min-height: 250px; max-height: 46dvh; padding: 18px 20px 8px; border: 0; background: transparent; color: var(--ink); font: 400 14.5px/1.65 var(--mono); outline: none; resize: vertical; }
.drop textarea::placeholder { color: var(--faint); }
.drop-hint { margin: 0; padding: 6px 20px 14px; color: var(--faint); font-size: 13px; }
.drop-hint .link { font-size: 1.1em; }

#imp-sections { padding: 14px 28px 0; }
.sec-label { margin: 0 0 8px; color: var(--faint); font-size: 12px; }
.sec-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sec { display: inline-flex; align-items: center; gap: 7px; height: 31px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; transition: opacity .25s, border-color .25s, transform .3s var(--out); }
.sec span { color: var(--faint); font-size: 11px; }
.sec:active { transform: scale(.95); }
.sec[aria-pressed='false'] { border-style: dashed; opacity: .45; text-decoration: line-through; }
.imp-groups { flex: 1; min-height: 0; padding: 0 28px 8px; overflow-y: auto; overscroll-behavior: contain; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--clay); }

/* shelves + chips (palace drawer and importer review) */
.shelf { margin-top: 22px; }
.shelf[data-shelf='elegant'] { --accent: var(--clay); --accent-ink: var(--clay-ink); --wash: var(--clay-wash); }
.shelf[data-shelf='whimsical'] { --accent: var(--olive); --accent-ink: var(--olive-ink); --wash: var(--olive-wash); }
.shelf[data-shelf='snippets'] { --accent: var(--ink-2); --wash: var(--bg-2); }
.shelf[data-shelf='quotes'] { --accent: var(--faint); --wash: var(--bg-2); }
.shelf h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.shelf h3 .n { color: var(--faint); font-weight: 500; letter-spacing: 0; }
.shelf h3 small { margin-left: auto; color: var(--faint); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip-wrap { display: inline-flex; align-items: center; border-radius: 999px; background: var(--wash); transition: background-color .25s; }
.chip-wrap:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.chip { padding: 6px 4px 6px 13px; border-radius: 999px; color: var(--ink); font: 400 16px/1.25 var(--serif); text-align: left; }
.chip-tool { display: grid; place-items: center; width: 22px; height: 22px; margin-right: 3px; border-radius: 50%; color: var(--muted); font-size: 11px; opacity: .45; transition: opacity .2s, background-color .2s, color .2s; }
.chip-wrap:hover .chip-tool, .chip-tool:focus-visible { opacity: 1; }
.chip-tool:hover { background: var(--card); color: var(--ink); }
.chip-tool svg { width: 12px; height: 12px; }
.chip-wrap:last-child .chip-tool:last-child, .chip-wrap .chip-tool:last-child { margin-right: 5px; }
.quotes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.quote-item { position: relative; display: block; padding: 12px 40px 12px 15px; border-radius: var(--r-md); background: var(--bg-2); }
.quote-item blockquote { margin: 0; color: var(--ink-2); font: italic 400 15.5px/1.45 var(--serif); white-space: pre-line; }
.quote-item cite { display: block; margin-top: 4px; color: var(--faint); font-size: 12px; font-style: normal; }
.quote-item .chip-tool { position: absolute; top: 9px; right: 6px; }
.starter-note { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(120deg, var(--clay-wash), transparent 70%), var(--card); }
.starter-note p { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.starter-note em { font-family: var(--serif); font-size: 1.08em; }
.empty-note { margin: 0; color: var(--faint); font-size: 13.5px; font-style: italic; }

/* extras panel */
.extras-body { padding-top: 0; }
.extra { margin-top: 24px; }
.extra h3 { margin: 0 0 10px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.setting + .setting { margin-top: 8px; }
.setting b { font-weight: 500; }
.setting p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.soon .setting { background: transparent; border-style: dashed; opacity: .75; }
.voice-row { display: flex; align-items: center; gap: 6px; flex: none; max-width: 58%; }
.voice-row select { min-width: 0; max-width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; }
.credits { margin: 28px 0 0; color: var(--faint); font-size: 12px; line-height: 1.6; }

.switch { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); transition: background-color .3s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .45s cubic-bezier(.34, 1.5, .5, 1), width .2s; }
.switch[aria-checked='true'] { background: var(--clay); }
.switch[aria-checked='true'] span { transform: translateX(18px); }
.switch:active span { width: 24px; }
.switch[aria-checked='true']:active span { transform: translateX(14px); }

.offline { position: relative; overflow: hidden; }
.offline-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.offline-done { color: var(--olive-ink); font-size: 13px; font-weight: 500; }
.offline[data-state='idle'] .offline-done, .offline[data-state='idle'] #offline-remove,
.offline[data-state='busy'] .offline-actions,
.offline[data-state='done'] #offline-get { display: none; }
.dl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; opacity: 0; }
.dl-bar::after { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--clay), transparent); animation: sweep 1.1s var(--out) infinite; }
.offline[data-state='busy'] .dl-bar { opacity: 1; }

.offline-tag { color: var(--olive-ink); }

.ai-config { flex-direction: column; align-items: stretch; gap: 10px; }
.ai-row { display: flex; align-items: center; gap: 12px; }
.ai-row > span { flex: none; width: 64px; color: var(--muted); font-size: 13px; }
.ai-row select, .ai-row input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px; }
.ai-row input:focus, .ai-row select:focus { border-color: var(--clay); outline: none; box-shadow: 0 0 0 3px var(--clay-wash); }
.ai-config .ai-blurb { margin: 0; }
.ai-config .ai-note { margin: -4px 0 0 76px; font-size: 12.5px; }
.ai-note code { font: 12px var(--mono); }
.ai-signin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-ok { color: var(--olive-ink); font-size: 13px; font-weight: 500; }
.ai-foot { display: flex; align-items: center; gap: 12px; }
.ai-status { color: var(--muted); font-size: 13px; }
.ai-status[data-tone='ok'] { color: var(--olive-ink); }
.ai-status[data-tone='err'] { color: var(--clay-ink); }
.ai-config .fine { margin: 0; }

.ai-device { position: relative; display: grid; gap: 10px; }

.better { flex-direction: column; align-items: stretch; gap: 10px; }
.better-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.better-voices { display: flex; flex-wrap: wrap; gap: 6px; }
.better-voice { display: grid; gap: 1px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); text-align: left; transition: border-color .2s, box-shadow .3s var(--out), transform .3s var(--out); }
.better-voice:hover { border-color: var(--line-2); }
.better-voice:active { transform: scale(.97); }
.better-voice[aria-checked='true'] { border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-wash); }
.better-voice b { font-weight: 500; font-size: 13.5px; }
.better-voice span { color: var(--muted); font-size: 11.5px; }
.better[data-state='idle'] .better-voices, .better[data-state='idle'] #better-on,
.better[data-state='idle'] #better-try, .better[data-state='idle'] #better-remove,
.better[data-state='busy'] .better-voices, .better[data-state='busy'] #better-on,
.better[data-state='busy'] #better-try, .better[data-state='busy'] #better-remove,
.better[data-state='done'] #better-get { display: none; }
.better[data-state='done'][data-on='false'] .better-voices, .better[data-state='done'][data-on='false'] #better-try { display: none; }
.better:not([data-state='busy']) .dev-bar { display: none; }
.dev-check { margin: 0; color: var(--muted); font-size: 13px; }
.dev-tiers { display: grid; gap: 6px; }
.dev-tier { display: grid; gap: 2px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); text-align: left; transition: border-color .2s, box-shadow .3s var(--out), transform .3s var(--out); }
.dev-tier:hover { border-color: var(--line-2); }
.dev-tier:active { transform: scale(.985); }
.dev-tier[aria-checked='true'] { border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-wash); }
.dev-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dev-name b { font-weight: 500; }
.dev-size { color: var(--ink-2); font: 12px var(--mono); }
.dev-blurb { color: var(--muted); font-size: 12.5px; }
.dev-badge { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.dev-badge.rec { background: var(--clay-wash); color: var(--clay-ink); }
.dev-badge.ok { background: var(--olive-wash); color: var(--olive-ink); }
.dev-badge.warn { background: var(--bg-2); color: var(--muted); }
.dev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dev-bar { display: block; height: 3px; overflow: hidden; border-radius: 3px; background: var(--line); }
.dev-bar i { display: block; height: 100%; background: var(--clay); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--out); }

.rw-body { padding: 18px 28px 0; overflow-y: auto; }
.rw-body textarea { width: 100%; min-height: 84px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--card); color: var(--ink); font: 400 19px/1.45 var(--serif); resize: vertical; }
.rw-body textarea:focus { border-color: var(--clay); outline: none; box-shadow: 0 0 0 3px var(--clay-wash); }
.rw-out { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.rw-out:empty { display: none; }
.rw-item { position: relative; padding: 14px 52px 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.rw-item.skeleton { height: 76px; border: 0; }
.rw-text { margin: 0; font: 400 19px/1.45 var(--serif); }
.rw-why { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.rw-tools { position: absolute; top: 9px; right: 9px; display: flex; flex-direction: column; gap: 2px; }
.rw-tools .saved { color: var(--clay); }
.rw-tools .saved svg { fill: currentColor; }
.rw-note { padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted); font-size: 13.5px; }
.rw-note.err { color: var(--clay-ink); }
[data-act='speak'].recorded { color: var(--accent-ink, var(--clay-ink)); }
[data-act='speak'].speaking svg { animation: pulse .8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); opacity: .6; } }

/* ---------- toast + effects ---------- */

.toast {
  position: fixed;
  inset: auto auto 24px 50%;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 17px 10px 13px;
  overflow: visible;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-3);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px) scale(.95);
  transition: transform .5s var(--out), opacity .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { color: var(--clay); }

.fx-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.fx-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; }
.fx-ring { position: absolute; width: 46px; height: 46px; border: 2px solid; border-radius: 50%; }
.fx-chip { position: absolute; left: 0; top: 0; padding: 6px 13px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); font: 400 16px/1.2 var(--serif); white-space: nowrap; will-change: transform; }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

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

@media (max-width: 760px) {
  .spotlight { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'body' 'actions'; }
  .controls { flex-direction: column; align-items: stretch; }
  .seg { align-self: flex-start; }
  .dial input { flex: 1; width: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .grid-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .card-word { font-size: 19.5px; }
  .palace-btn .label { display: none; }
  .mine { flex-direction: column; align-items: flex-start; }
  .search { height: 58px; padding-left: 16px; border-radius: 18px; }
  .field input, .field .ghost { font-size: 20px; line-height: 56px; }
  .go { width: 40px; height: 40px; border-radius: 13px; }
  .tab-hint { display: none; }
  .modal-head, .modal-foot { padding-left: 20px; padding-right: 16px; }
  .drop { margin: 14px 18px 0; }
  .imp-groups, #imp-sections { padding-left: 20px; padding-right: 20px; }
  .sheet-head, .sheet-actions, .sheet-body { padding-left: 20px; padding-right: 20px; }
  .rw-body { padding-left: 20px; padding-right: 20px; }
  .ai-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .ai-row > span { width: auto; }
  .ai-config .ai-note { margin-left: 0; }
  .quote blockquote::before { display: none; }
}

@media (max-width: 720px), (hover: none) {
  .keys { display: none; }
}

@media (hover: none) {
  .card-tools { opacity: 1; transform: none; }
  .chip-tool { opacity: .7; }
}

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