/* ── Fonts (subset from app/src/main/res/font) ──────────────────────── */
@font-face { font-family: Fraunces; src: url(../fonts/fraunces.woff2) format("woff2"); font-weight: 300 600; font-display: swap; }
@font-face { font-family: Fraunces; src: url(../fonts/fraunces-italic.woff2) format("woff2"); font-weight: 300 600; font-style: italic; font-display: swap; }
@font-face { font-family: Geist; src: url(../fonts/geist-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Geist; src: url(../fonts/geist-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Geist; src: url(../fonts/geist-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: Literata; src: url(../fonts/literata.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Literata; src: url(../fonts/literata-italic.woff2) format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url(../fonts/source-serif.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(../fonts/garamond.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Atkinson; src: url(../fonts/atkinson.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Shantell Sans"; src: url(../fonts/shantell.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/inter.woff2) format("woff2"); font-display: swap; }

/* ── Tokens: ui/theme/Color.kt, DesignTokens.kt, AccentColor.kt ──────── */
:root {
  --bg: #020617;          /* Slate950: background */
  --surface: #0F172A;     /* Slate900: cards */
  --raised: #1E293B;      /* Slate800: sheets, selected */
  --high: #334155;        /* Slate700 */
  --line: #1E293B;        /* borderSubtle */
  --text: #F8FAFC;        /* Slate50 */
  --text-2: #CBD5E1;      /* Slate300 */
  --muted: #64748B;       /* Slate500 */
  --muted-2: #94A3B8;
  --flame: #FF6B35;

  --accent: #10B981;
  --accent-light: #34D399;
  --accent-dark: #059669;
  --accent-rgb: 16 185 129;
  --on-accent: #020617;

  /* AfsanaEdge.Surface: hairline lit from the top-left. */
  --edge: linear-gradient(135deg, #4B5565 0%, #1E293B 34%, #1E293B 66%, #353F50 100%);

  --display: Fraunces, Georgia, serif;
  --ui: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
:root[data-accent="azure"] { --accent: #1591DC; --accent-light: #55B9EE; --accent-dark: #0872B3; --accent-rgb: 21 145 220; }
:root[data-accent="neutral"] { --accent: #D5DBE3; --accent-light: #E8ECF1; --accent-dark: #AEB7C2; --accent-rgb: 213 219 227; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
::selection { background: rgb(var(--accent-rgb) / .35); }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }
[hidden] { display: none !important; }

h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(44px, 6.4vw, 84px); line-height: 1; }
h2 { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.05; text-align: center; }
em { font-style: italic; color: var(--accent-light); }
.muted { color: var(--muted-2); }
.hint { text-align: center; color: var(--muted-2); margin: 12px 0 0; font-size: 15px; }

/* ── App components ──────────────────────────────────────────────────── */
/* Surface with the AfsanaEdge hairline. */
.card, .sheet, .group, .chat-panel, .focus-dialog {
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--edge) border-box;
  border: 1px solid transparent; border-radius: 20px;
}
.card { padding: 16px 18px; }
.card-row, .row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* The app's outlined accent button with a solid lip (Sign in, Start, Read, Import). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; text-decoration: none; font-weight: 600;
  color: var(--accent-light); background: #0B1120;
  border: 2px solid var(--accent-light); box-shadow: 0 4px 0 var(--accent);
  transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--accent); }
.btn-play { min-height: 60px; padding: 0 26px 0 20px; gap: 14px; color: var(--text); }
.play-logo { width: 24px; height: 26px; flex: none; }
.play-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; font-size: 19px; font-weight: 600; }
.play-text small { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.text-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 6px; font-weight: 500; color: var(--text); }
.text-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.plain { border: 0; background: none; }
.square-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--high); background: transparent; }
.square-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Filter chips (Discover): selected is a filled accent pill. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); }
.chip:first-child { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pill { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--accent-light); background: rgb(var(--accent-rgb) / .14); }

/* Segmented control (Dictionary | AI, Classic | Color | Artwork). */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted-2); font-weight: 500; font-size: 15px; }
.seg button[aria-selected="true"], .seg button.on { background: var(--high); color: var(--text); }
.seg-plain { background: transparent; border: 0; padding: 0; gap: 8px; }
.seg-plain button { border: 1px solid var(--high); }
.seg-plain button.on { background: var(--surface); border-color: var(--muted); }
.seg-sm button { min-height: 32px; font-size: 13px; padding: 0 12px; }

.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--high); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #CBD5E1; transition: transform .2s var(--ease), background .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: #fff; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) var(--p), var(--high) var(--p)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) var(--p), var(--high) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--accent); border: 5px solid #E2F8EF; box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 5px solid #E2F8EF; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter); background: rgb(2 6 23 / .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 22px; }
.brand img { height: 26px; width: auto; }
.tabs { display: flex; gap: 4px; }
.tabs a { text-decoration: none; color: var(--muted-2); padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); background: var(--surface); }

/* ── Phone frame: the screen keeps the device's 1080 × 2414 ratio ────── */
.phone {
  --w: 300px; width: var(--w); max-width: 100%; flex: none;
  padding: 9px; border-radius: 44px; background: #0B0F17;
  box-shadow: inset 0 0 0 1px #262E3B, 0 0 0 1px #05070B, 0 30px 70px -30px rgb(0 0 0 / .9);
}
.screen {
  position: relative; aspect-ratio: 1080 / 2414; overflow: hidden; border-radius: 36px; background: var(--bg);
  container-type: inline-size; isolation: isolate;
}
.screen::after { /* punch-hole camera */
  content: ""; position: absolute; z-index: 30; top: 1.6%; left: 50%; width: 3.4%; aspect-ratio: 1; translate: -50% 0;
  border-radius: 50%; background: #000; box-shadow: 0 0 0 1px #1b1f27; pointer-events: none;
}
.screen img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

/* Status bar rendered in HTML (device px 0–120). */
.sbar {
  position: absolute; z-index: 20; inset: 0 0 auto; height: calc(120 * 100cqw / 1080);
  display: flex; align-items: center; justify-content: space-between; padding: 0 calc(66 * 100cqw / 1080);
  font: 500 calc(40 * 100cqw / 1080) var(--ui); color: #E2E8F0; background: var(--bg);
}
.sbar svg { height: calc(36 * 100cqw / 1080); width: auto; fill: #E2E8F0; }
.sbar .icons { display: flex; gap: calc(18 * 100cqw / 1080); align-items: center; }

/* App screens: header, scrolling body, fixed bottom nav (device px). */
.view { position: absolute; inset: 0; transition: opacity .18s ease; }
.view.leaving { opacity: 0; pointer-events: none; z-index: 1; }
.app-view { display: flex; flex-direction: column; }
.app-head { position: relative; z-index: 2; flex: none; margin-top: calc(120 * 100cqw / 1080); }
.app-head img + img { position: absolute; inset: 0; opacity: 0; transition: opacity .2s; }
.app-head.scrolled img + img { opacity: 1; }
.app-body { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.app-body::-webkit-scrollbar { display: none; }
.app-body .pad { height: calc(var(--nav, 0) * 100cqw / 1080); }
.app-nav { position: absolute; inset: auto 0 0; z-index: 5; }
@media (pointer: fine) { .app-body { overscroll-behavior: contain; } }

.hot { position: absolute; z-index: 6; border: 0; padding: 0; background: transparent; border-radius: calc(30 * 100cqw / 1080); -webkit-tap-highlight-color: transparent; }
.ripple { position: absolute; z-index: 25; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgb(255 255 255 / .35); pointer-events: none; animation: ripple .45s ease-out forwards; }
@keyframes ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  max-width: 1160px; margin: 0 auto; padding: clamp(40px, 7vw, 90px) var(--gutter) 40px;
  display: grid; grid-template-columns: 1fr auto; gap: clamp(32px, 6vw, 90px); align-items: center;
}
.lede { color: var(--text-2); font-size: clamp(18px, 2vw, 22px); margin: 20px 0 32px; }
.cta { margin-bottom: 28px; }
.hero-device { display: grid; justify-items: center; gap: 14px; animation: rise .8s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.hero .phone { --w: min(340px, 82vw); }

/* Hero phone as an object: perspective, a visible side edge, buttons and glass. */
.hero-device { perspective: 1800px; }
.phone-3d {
  position: relative; transform-style: preserve-3d;
  transform: rotateY(var(--ry, -16deg)) rotateX(var(--rx, 4deg)) rotateZ(1deg);
  transition: transform .5s var(--ease);
  background: #11161F;
  box-shadow:
    inset 0 0 0 1px #2B3443,
    inset 0 0 0 3px #0B0F17,
    /* the right-hand side of the body, seen at an angle */
    1px 0 0 #1C2330, 2px 0 0 #1A202C, 3px 0 0 #181E29, 4px 0 0 #161B25, 5px 0 0 #141922, 6px 1px 0 #12161E, 7px 1px 0 #10141B,
    /* contact and ambient shadows */
    40px 50px 60px -30px rgb(0 0 0 / .85), 70px 90px 120px -40px rgb(0 0 0 / .6);
}
.phone-3d::before, .phone-3d::after { /* power and volume keys on the right edge */
  content: ""; position: absolute; right: -9px; width: 4px; border-radius: 0 3px 3px 0; background: #1F2632;
  box-shadow: inset -1px 0 0 #2E3747;
}
.phone-3d::before { top: 22%; height: 12%; }
.phone-3d::after { top: 37%; height: 6%; }
.glare {
  position: absolute; inset: 9px; border-radius: 36px; pointer-events: none; z-index: 31;
  background: linear-gradient(115deg, rgb(255 255 255 / .07) 0%, rgb(255 255 255 / .02) 28%, transparent 42%);
}
.proto-bar { display: flex; align-items: center; gap: 10px; }
.proto-note { color: var(--muted-2); font-size: 14px; }

/* ── Sections ────────────────────────────────────────────────────────── */
.sec { max-width: 1160px; margin: 0 auto; padding: clamp(80px, 11vw, 140px) var(--gutter) 0; }
.sec > h2 + * { margin-top: 44px; }
.sec > h2 + .hint { margin-top: 12px; }
.sec > .hint + * { margin-top: 32px; }
.split { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.split h2 { text-align: left; }

/* Page playground */
.pair { display: flex; gap: clamp(28px, 5vw, 64px); justify-content: center; align-items: center; }
.phone-reader { --w: min(330px, 84vw); }
.reader {
  --page-bg: #111418; --page-ink: #E4E7EB; --rf: Literata; --rs: 20; --rlh: 1.5; --ralign: left; --margin: 28;
  background: var(--page-bg); color: var(--page-ink); transition: background .35s, color .35s;
}
.reader-art { position: absolute; inset: 0; background: url(../img/app/art-bg.webp) top / cover; opacity: 0; transition: opacity .35s; }
.reader-art::after { content: ""; position: absolute; inset: 0; background: var(--art-wash, transparent); }
.reader.art .reader-art { opacity: 1; }
.reader-head { position: relative; padding-top: 16%; text-align: center; font-family: var(--rf), Georgia, serif; font-size: calc(var(--rs) * 4.2 * 100cqw / 1080); }
.reader-viewport {
  position: absolute; top: 24%; bottom: 7%;
  left: calc(var(--margin) * 2.2 * 100cqw / 1080); right: calc(var(--margin) * 2.2 * 100cqw / 1080);
  overflow: hidden;
}
.reader-viewport.scroll { overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.reader-viewport.scroll::-webkit-scrollbar { display: none; }
.reader-text {
  font-family: var(--rf), Georgia, serif; font-size: calc(var(--rs) * 2.7 * 100cqw / 1080); line-height: var(--rlh);
  text-align: var(--ralign); hyphens: auto; -webkit-hyphens: auto; transition: transform .4s var(--ease);
}
.reader-viewport.paged .reader-text { height: 100%; column-gap: 40px; column-fill: auto; }
.reader-text p { margin: 0; text-indent: 1.4em; }
.reader-text p:first-child { text-indent: 0; }
.turn { position: absolute; top: 50%; z-index: 3; width: 13%; aspect-ratio: 1; translate: 0 -50%; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 1px solid color-mix(in srgb, var(--page-ink) 22%, transparent); background: color-mix(in srgb, var(--page-bg) 70%, transparent); }
.turn svg { width: 45%; fill: none; stroke: var(--page-ink); stroke-width: 2; stroke-linecap: round; }
.turn.prev { left: 2%; } .turn.next { right: 2%; }
.reader.scrolling .turn { display: none; }
.reader-foot { position: absolute; left: 5.5%; right: 5.5%; bottom: 3.2%; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--page-ink) 18%, transparent); overflow: hidden; }
.reader-foot i { display: block; height: 100%; width: 10%; background: var(--accent); transition: width .3s; }

.sheet { width: min(420px, 100%); padding: 20px; display: grid; gap: 16px; border-radius: 28px; }
.sheet-head b, .dlg-title { font-family: var(--display); font-weight: 400; font-size: 24px; }
.divider { height: 1px; background: var(--line); margin: 2px 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tone {
  position: relative; min-height: 62px; padding: 10px 12px; border-radius: 14px; text-align: left; font-size: 14px; font-weight: 500;
  background: var(--tb); color: var(--ti); border: 2px solid rgb(255 255 255 / .08);
}
.tone i { position: absolute; left: 12px; right: 34%; bottom: 13px; height: 2px; background: currentColor; opacity: .3; box-shadow: 0 -6px 0 currentColor; }
.tone.on { border-color: var(--text-2); }
.tone.on::after { content: ""; position: absolute; right: 14px; top: 50%; width: 12px; height: 6px; border: solid currentColor; border-width: 0 0 2px 2px; transform: translateY(-70%) rotate(-45deg); }
.font { min-height: 46px; border-radius: 12px; border: 1px solid var(--high); background: transparent; font-size: 15px; color: var(--text-2); padding: 0 4px; }
.font.on { background: var(--raised); border-color: var(--muted); color: var(--text); }
.slider-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 15px; color: var(--text-2); }
.slider-row input { grid-column: 1 / -1; }
.slider-row output { color: var(--text); font-variant-numeric: tabular-nums; }
.row-between > span { font-size: 15px; color: var(--text-2); }

/* Words */
.word-stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; max-width: 940px; margin-inline: auto; }
.page-card {
  position: relative; padding: clamp(24px, 4vw, 44px); border-radius: 20px; overflow: hidden; min-height: 480px;
  background: #F4F1E8; color: #302E29; font-family: Literata, Georgia, serif; font-size: clamp(17px, 1.7vw, 19px); line-height: 1.65;
}
#sel-text p { margin: 0; text-indent: 1.4em; cursor: text; }
#sel-text p:first-child { text-indent: 0; }
#sel-text p.cut::after { content: " …"; opacity: .5; }
#sel-text ::selection { background: rgb(var(--accent-rgb) / .35); }
mark.hl { background: rgb(251 191 36 / .5); color: inherit; border-radius: 2px; }
.sel-menu {
  position: absolute; z-index: 5; display: flex; padding: 6px; border-radius: 20px; translate: -50% calc(-100% - 14px);
  background: rgb(255 255 255 / .96); box-shadow: 0 10px 30px -8px rgb(0 0 0 / .35); font-family: var(--ui);
}
.sel-menu button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 66px; padding: 8px 6px; border: 0; background: none; border-radius: 14px; font-size: 12px; color: #1F2937; }
.sel-menu button:hover { background: #EEF0F2; }
.sel-menu svg { width: 22px; height: 22px; fill: none; stroke: #1F2937; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.def-sheet {
  position: absolute; inset: auto 0 0; z-index: 6; max-height: 82%; display: flex; flex-direction: column; gap: 14px;
  padding: 20px 22px 18px; border-radius: 24px 24px 0 0; background: #111827; color: var(--text); font-family: var(--ui); font-size: 15.5px; line-height: 1.5;
  box-shadow: 0 -10px 40px rgb(0 0 0 / .35); animation: sheet .28s var(--ease);
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.def-head { display: flex; align-items: center; justify-content: space-between; }
.def-head b { font-size: 20px; font-weight: 600; }
.def-body { overflow-y: auto; min-height: 90px; color: var(--text-2); }
.def-body p { margin: 0 0 4px; }
.def-body .pos { margin-top: 12px; color: var(--text); }
.def-body ul { margin: 2px 0 0; padding-left: 18px; }
.def-body .note { color: var(--muted-2); font-size: 13px; margin-top: 12px; }
.def-foot { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.skeleton { display: grid; gap: 8px; padding-top: 4px; }
.skeleton i { height: 12px; border-radius: 6px; background: var(--raised); animation: pulse 1.1s ease-in-out infinite alternate; }
.skeleton i:nth-child(2) { width: 82%; } .skeleton i:nth-child(3) { width: 56%; }
@keyframes pulse { to { opacity: .45; } }
.vocab { min-width: 0; }
.vocab ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.vocab li { min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.vocab li b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.vocab li span { display: block; color: var(--muted-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vocab li.empty { color: var(--muted-2); font-size: 14px; background: none; border: 1px dashed var(--high); }

/* Ask */
.ask-wrap { max-width: 640px; margin-inline: auto; display: grid; gap: 14px; }
.read-slider .card-row { font-size: 14px; color: var(--muted-2); }
.read-slider b { color: var(--text); font-variant-numeric: tabular-nums; }
.parts { display: flex; justify-content: space-between; font-family: var(--display); font-style: italic; font-size: 13px; color: var(--muted-2); padding: 0 2px; }
.chat-panel { display: flex; flex-direction: column; background: linear-gradient(#0B1120, #0B1120) padding-box, var(--edge) border-box; border-radius: 28px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat-head b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.2; }
.chat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); flex: none; }
.chat-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--on-accent); stroke-width: 1.8; stroke-linejoin: round; }
.chat-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.chat-log { min-height: 300px; max-height: 440px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg-me { align-self: flex-end; max-width: 80%; padding: 10px 14px; border-radius: 14px; background: rgb(var(--accent-rgb) / .14); border: 1px solid rgb(var(--accent-rgb) / .5); font-size: 15px; }
.msg-bot { color: var(--text-2); font-size: 15.5px; line-height: 1.6; }
.msg-from { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.msg-from span { padding: 2px 8px; border-radius: 6px; background: var(--raised); color: var(--text-2); }
.suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: auto; }
.suggest button { border: 1px solid var(--high); background: transparent; padding: 8px 14px; border-radius: 12px; font-size: 14px; color: var(--text-2); }
.suggest button:hover { border-color: var(--accent); color: var(--text); }
.chat-input { display: flex; gap: 8px; margin: 0 14px 14px; padding: 6px 6px 6px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.chat-input input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; }
.chat-input button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--high); background: transparent; display: grid; place-items: center; flex: none; }
.chat-input svg { width: 18px; height: 18px; fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); animation: pulse .6s ease-in-out infinite alternate; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }

/* Focus dialog (zen/ZenUi.kt) */
.focus-dialog { width: min(400px, 100%); margin-inline: auto; padding: 24px; display: grid; gap: 6px; background: linear-gradient(#111827, #111827) padding-box, var(--edge) border-box; border-radius: 28px; }
.dial { width: 72%; margin: 10px auto 4px; touch-action: none; cursor: grab; display: block; }
.dial line { stroke: #475569; stroke-width: 2.5; stroke-linecap: round; }
.dial line.major { stroke-width: 4; }
.dial line.lit { stroke: var(--accent-light); }
#dial-knob { fill: var(--accent); }
.dial-num { font-family: var(--display); font-size: 64px; fill: var(--text); text-anchor: middle; dominant-baseline: middle; }
.dial-unit { font-size: 15px; fill: var(--muted-2); text-anchor: middle; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 28px; margin-bottom: 10px; font-size: 14px; }
.switch-row { padding: 10px 0; font-size: 16px; }
.dlg-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 8px; }

/* Shelf */
.shelf { display: flex; gap: 28px; justify-content: center; }
.shelf figure { margin: 0; display: grid; gap: 14px; justify-items: center; }
.shelf .phone { --w: 290px; }
.shelf figcaption { color: var(--muted-2); font-size: 15px; }

/* Accent */
.accent-card { display: flex; justify-content: space-around; padding: 22px; margin-top: 32px; max-width: 360px; }
.accent-card button { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; transition: box-shadow .2s; }
.accent-card [data-accent="emerald"] { background: #10B981; }
.accent-card [data-accent="azure"] { background: #1591DC; }
.accent-card [data-accent="neutral"] { background: #D5DBE3; }
.accent-card [aria-checked="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text-2); }
#yours .phone { --w: 300px; }
.accent-screens img { position: absolute; top: calc(120 * 100cqw / 1080); left: 0; opacity: 0; transition: opacity .35s; }
.accent-screens img.on { opacity: 1; }

/* Private: settings-style grouped list */
.group { max-width: 640px; margin-inline: auto; overflow: hidden; }
.group-row { display: flex; gap: 16px; align-items: center; padding: 18px 20px; }
.group-row + .group-row { border-top: 1px solid var(--line); }
.group-row b { display: block; font-weight: 500; font-size: 17px; }
.group-row span:not(.row-icon) { color: var(--muted-2); font-size: 14px; }
.row-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgb(var(--accent-rgb) / .12); border: 1px solid rgb(var(--accent-rgb) / .35); }
.row-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-light); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.final { display: grid; justify-items: center; gap: 28px; padding: clamp(100px, 13vw, 160px) var(--gutter); text-align: center; }
.final img { height: 64px; width: auto; }
.footer { max-width: 1160px; margin: 0 auto; padding: 28px var(--gutter) 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; font-size: 14px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer nav a { color: var(--muted-2); text-decoration: none; }
.footer nav a:hover { color: var(--text); }
.footer .brand { font-size: 18px; } .footer .brand img { height: 22px; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .tabs { display: none; }
  .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero .chips, .cta { justify-content: center; display: flex; }
  .pair { flex-direction: column; }
  .word-stage { grid-template-columns: 1fr; }
  .shelf { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--gutter) 8px; margin-inline: calc(-1 * var(--gutter)); scrollbar-width: none; }
  .shelf figure { scroll-snap-align: center; }
  .shelf .phone { --w: 260px; }
  .split { grid-template-columns: 1fr; justify-items: center; }
  .split h2 { text-align: center; }
  .accent-card { margin-inline: auto; }
}
@media (max-width: 520px) {
  .topbar .btn-sm { display: none; }
  .sel-menu button { min-width: 54px; font-size: 11px; padding: 6px 2px; }
  .page-card { min-height: 540px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
