/* Ammi and Dad — Paul's claymation house style (~/Dev/clay-templates "Clay Kit").
   Porcelain light / kiln dark grounds, matte grain, puffy clay surfaces with a lit
   top rim and a pressed-in lip, chunky pill buttons that squish when pressed.
   One action colour (moss). Mom is terracotta, Dad is sky. */
:root {
  --bg: #E2E1E7; --surface: #F4F3F6; --surface2: #FBFAFC;
  --line: rgba(33, 30, 39, .13); --line-lit: rgba(33, 30, 39, .26);
  --text: #211E27; --muted: #57526A;
  --accent: #5E7C42; --accent2: #526D39; --ink: #ffffff; --accent-lip: rgba(50, 70, 32, .6);
  --danger: #B3402A; --warn: #94600a; --info: #4A7392;
  --mom: #9A4524; --dad: #3A5C7B;
  --me: #E4ECDB; --me-line: rgba(94, 124, 66, .28);
  --lip: rgba(33, 30, 39, .22);
  --hi: rgba(255, 255, 255, .75);      /* lit top rim of a clay piece */
  --lo: rgba(33, 30, 39, .07);         /* the pressed bottom edge */
  --shadow: 0 2px 4px rgba(33, 30, 39, .06), 0 18px 34px -24px rgba(33, 30, 39, .5);
  --shadow-lift: 0 2px 4px rgba(33, 30, 39, .07), 0 34px 60px -40px rgba(33, 30, 39, .65);
  --grain-blend: multiply; --grain: .12;
  --radius: 20px; --radius-sm: 14px; --r-l: 30px;
  --press: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Nunito", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", ui-rounded, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141218; --surface: #1D1A22; --surface2: #26222D;
    --line: rgba(239, 235, 243, .13); --line-lit: rgba(239, 235, 243, .26);
    --text: #EFEBF3; --muted: #B2AABD;
    --accent: #8CAE68; --accent2: #9BBC77; --ink: #141218; --accent-lip: rgba(40, 58, 24, .9);
    --danger: #F08A6E; --warn: #fbbf24; --info: #6C9AC0;
    --mom: #E8875C; --dad: #7FA9CD;
    --me: #26301E; --me-line: rgba(140, 174, 104, .3);
    --lip: rgba(0, 0, 0, .55);
    --hi: rgba(255, 255, 255, .07);
    --lo: rgba(0, 0, 0, .3);
    --shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 18px 34px -22px rgba(0, 0, 0, .85);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 34px 60px -36px rgba(0, 0, 0, .95);
    --grain-blend: overlay; --grain: .09;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141218; --surface: #1D1A22; --surface2: #26222D;
  --line: rgba(239, 235, 243, .13); --line-lit: rgba(239, 235, 243, .26);
  --text: #EFEBF3; --muted: #B2AABD;
  --accent: #8CAE68; --accent2: #9BBC77; --ink: #141218; --accent-lip: rgba(40, 58, 24, .9);
  --danger: #F08A6E; --warn: #fbbf24; --info: #6C9AC0;
  --mom: #E8875C; --dad: #7FA9CD;
  --me: #26301E; --me-line: rgba(140, 174, 104, .3);
  --lip: rgba(0, 0, 0, .55);
  --hi: rgba(255, 255, 255, .07);
  --lo: rgba(0, 0, 0, .3);
  --shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 18px 34px -22px rgba(0, 0, 0, .85);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 34px 60px -36px rgba(0, 0, 0, .95);
  --grain-blend: overlay; --grain: .09;
  color-scheme: dark;
}

/* Simple line icons, drawn with CSS masks so they take the text colour. */
:root {
  --i-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 6l-6 6 6 6'/%3E%3C/svg%3E");
  --i-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3H20v15H6.5A2.5 2.5 0 0 0 4 20.5z'/%3E%3Cpath d='M4 20.5A2.5 2.5 0 0 0 6.5 23H20v-5'/%3E%3Cpath d='M9 8h7M9 11.5h5'/%3E%3C/svg%3E");
  --i-speaker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E");
  --i-mute: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z'/%3E%3Cpath d='M17 9.5l5 5M22 9.5l-5 5'/%3E%3C/svg%3E");
  --i-sliders: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'%3E%3Cpath d='M4 7h10M18 7h2M4 17h4M12 17h8'/%3E%3Ccircle cx='16' cy='7' r='2'/%3E%3Ccircle cx='10' cy='17' r='2'/%3E%3C/svg%3E");
  --i-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E");
  --i-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4M10 16l-4-4 4-4M6 12h10'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; color: var(--text); }
html { background: var(--bg); }
body { font: 500 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: radial-gradient(120% 70% at 50% -10%, var(--surface2) 0%, var(--bg) 60%) fixed, var(--bg); }
/* the grain that keeps every surface matte, like real clay */
body::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: var(--grain); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.ko, .t-ko { word-break: keep-all; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* 80% of the screen on desktop, 90% on phones, centered */
.page { width: 80vw; margin: 0 auto; padding: 1.6rem 0 0; min-height: 100dvh;
  display: flex; flex-direction: column; }
@media (max-width: 760px) { .page { width: 90vw; padding-top: 1rem; } }
/* Chat fills exactly one screen: header on top, messages scroll, typing box pinned at the bottom */
.page:has(> #v-chat:not([hidden])) { height: 100dvh; min-height: 0; }
.view { display: flex; flex-direction: column; flex: 1; min-height: 0; }

h1, h2, h3 { font-family: var(--font); font-weight: 800; letter-spacing: -.015em; }
h1 { font-size: 1.5rem; margin: 0; line-height: 1.25; }
.ko { font-weight: 600; color: var(--muted); margin-left: .4rem; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }
.err { color: var(--danger); margin: 0; font-weight: 600; }

/* ---------- clay buttons: a pill with thickness, a lit rim, and a squish when pressed ---------- */
.btn { --l: var(--lip); border: 1px solid var(--line); background: var(--surface2); border-radius: 999px;
  padding: .55rem 1.15rem; cursor: pointer; font-weight: 700; color: var(--text); font-size: 1rem;
  min-height: 46px; display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  white-space: nowrap; margin-bottom: 4px;
  box-shadow: inset 0 2px 0 var(--hi), 0 4px 0 var(--l);
  transition: transform .16s var(--press), box-shadow .16s ease, background-color .16s; }
.btn:hover { transform: translateY(2px); box-shadow: inset 0 2px 0 var(--hi), 0 2px 0 var(--l); }
.btn:active { transform: translateY(4px) scale(1.03, .96); box-shadow: inset 0 2px 0 var(--hi), 0 0 0 var(--l); }
.btn:focus-visible, .seg button:focus-visible, textarea:focus-visible, input:focus-visible,
.person:focus-visible, .chip:focus-visible, .empty .tries button:focus-visible, .facts-card:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px; }
.btn.primary { --l: var(--accent-lip); background: var(--accent); border-color: transparent; color: var(--ink);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .22), 0 4px 0 var(--l); }
.btn.primary:hover { background: var(--accent2); }
.btn.ghost { background: var(--surface); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* icon slots (CSS masks) */
#back::before, #facts-back::before, #signout::before, #voice-toggle::before,
#tune-toggle::before, #chat-facts::before {
  content: ""; width: 19px; height: 19px; flex: none; background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
#back, #facts-back { --ic: var(--i-back); padding-left: .75rem; }
#signout { --ic: var(--i-out); }
#voice-toggle { --ic: var(--i-speaker); }
#voice-toggle[aria-pressed="true"] { color: var(--accent); }
#voice-toggle[aria-pressed="false"] { --ic: var(--i-mute); color: var(--muted); }
#tune-toggle { --ic: var(--i-sliders); }
#tune-toggle[aria-expanded="true"] { background: var(--me); border-color: var(--me-line); color: var(--accent);
  transform: translateY(3px); box-shadow: inset 0 2px 4px var(--lo), 0 1px 0 var(--l); }
#chat-facts { --ic: var(--i-book); }

/* ---------- a clay portrait: cut-out on a soft pool of light ---------- */
.portrait, .person::before, #chat-title::before, .msg.twin .who::before {
  background: var(--photo) center 30% / cover no-repeat, radial-gradient(circle at 50% 38%, var(--surface2), color-mix(in srgb, var(--c) 30%, var(--surface)) 80%); }

/* ---------- sign in ---------- */
#v-login { justify-content: center; padding-bottom: 6vh; }
.login { max-width: 460px; width: 100%; margin: 4vh auto 0; display: flex; flex-direction: column; gap: .6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.6rem 2rem 2rem;
  box-shadow: inset 0 2px 0 var(--hi), inset 0 -4px 0 var(--lo), var(--shadow-lift); text-align: center;
  animation: rise .45s ease-out both; }
.login .duo { display: flex; justify-content: center; margin: -.2rem auto .1rem; height: 150px; }
.login .duo img { width: 150px; height: 150px; object-fit: contain; margin: 0 -14px;
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .18)); animation: bob 5s ease-in-out infinite; }
.login .duo img + img { animation-delay: -2.5s; }
.login h1 { font-size: 1.85rem; }
.login h1 .ko { display: block; margin: .1rem 0 0; font-size: 1.2rem; color: var(--mom); }
.login > p { margin: 0 0 .3rem; font-size: 1.02rem; }
.login form { display: flex; flex-direction: column; gap: 1rem; margin-top: .5rem; text-align: left; }
.login label { display: flex; flex-direction: column; gap: .4rem; font-weight: 700; font-size: 1rem; }
.login input { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .8rem 1rem; font-size: 1.1rem; min-height: 52px; box-shadow: inset 0 3px 6px var(--lo); }
.login input:focus { border-color: var(--accent); outline: none; }
.login .btn.primary { min-height: 56px; font-size: 1.12rem; margin-top: .4rem; }
@media (max-width: 520px) {
  .login { padding: 1.2rem 1.2rem 1.6rem; margin-top: 1vh; }
  .login .duo { height: 120px; } .login .duo img { width: 120px; height: 120px; }
}

/* ---------- header bar ---------- */
.bar { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; padding-bottom: .9rem;
  border-bottom: 2px solid var(--line); }
.bar h1 { flex: 1; min-width: 10rem; }
.bar-actions { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }

/* the language switch is a clay tray with a raised clay knob for the chosen one */
.seg { display: inline-flex; border-radius: 999px; padding: 4px; gap: 3px; background: var(--bg);
  box-shadow: inset 0 3px 6px var(--lo), inset 0 -1px 0 var(--hi); margin-bottom: 4px; }
.seg button { border: 0; background: transparent; padding: .4rem 1rem; cursor: pointer; min-height: 44px;
  font-weight: 700; color: var(--muted); border-radius: 999px; transition: background-color .15s, color .15s, transform .16s var(--press); }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--ink);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .22), 0 3px 0 var(--accent-lip); }
.seg button:active { transform: scale(1.04, .95); }

/* ---------- pick a parent ---------- */
#v-pick .bar { border-bottom: 0; padding-bottom: 0; }
#v-pick .bar h1 { font-size: 1.9rem; }
#v-pick .bar h1 .ko { display: block; margin: .15rem 0 0; font-size: 1.15rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem; margin: 1.5rem 0 1.3rem; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; gap: 1rem; margin-top: 1.1rem; } }
.person { --photo: none; position: relative; text-align: center; cursor: pointer; color: var(--text);
  border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line)); border-radius: var(--r-l);
  background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--c) 20%, var(--surface)) 0%, var(--surface) 70%);
  box-shadow: inset 0 2px 0 var(--hi), inset 0 -5px 0 color-mix(in srgb, var(--c) 18%, transparent), var(--shadow);
  padding: 1.4rem 1.4rem 1.6rem; display: flex; flex-direction: column; align-items: center; gap: .4rem;
  animation: rise .5s ease-out both; transition: transform .28s var(--press), box-shadow .28s ease; }
.person:nth-child(2) { animation-delay: .08s; }
.person::before { /* the clay portrait */
  content: ""; width: 200px; height: 200px; border-radius: 50%; margin-bottom: .4rem;
  background-size: 112%; background-position: center 18%;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .08), 0 10px 0 -4px color-mix(in srgb, var(--c) 30%, transparent);
  transition: transform .35s var(--press); }
.person:hover { transform: translateY(-5px); box-shadow: inset 0 2px 0 var(--hi), inset 0 -5px 0 color-mix(in srgb, var(--c) 18%, transparent), var(--shadow-lift); }
.person:hover::before { transform: rotate(-3deg) scale(1.03); }
.person:active { transform: translateY(0) scale(1.02, .97); }
.person .name { font-size: 2.2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.person .name .ko { display: block; margin: .25rem 0 0; color: var(--c); font-size: 1.35rem; font-weight: 800; }
.person .meta { color: var(--muted); font-size: 1.02rem; }
@media (max-width: 900px) {
  .person::before { width: 150px; height: 150px; }
  .person .name { font-size: 1.9rem; }
}
@media (max-width: 640px) { /* phones: portrait beside the name to save height */
  .person { display: grid; grid-template-columns: auto minmax(0, 1fr); text-align: left; column-gap: 1rem; row-gap: .3rem;
    align-items: center; padding: 1rem 1.1rem 1.2rem; }
  .person::before { grid-row: 1 / span 3; width: 104px; height: 104px; margin: 0; }
  .person .name { font-size: 1.7rem; }
  .person .name .ko { font-size: 1.15rem; }
  .person .meta { font-size: .98rem; }
}
.badge { max-width: 100%; display: inline-flex; align-items: center; gap: .35rem; font-size: .92rem; font-weight: 700;
  padding: .25rem .8rem; border-radius: 999px; background: var(--bg); color: var(--muted); width: fit-content;
  box-shadow: inset 0 2px 4px var(--lo); }
.badge.ok { color: color-mix(in srgb, var(--accent) 70%, var(--text)); background: var(--me); }
.badge.ok::before { content: ""; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: var(--i-speaker) center / contain no-repeat; mask: var(--i-speaker) center / contain no-repeat; }

/* ---------- chat ---------- */
#v-chat .bar { padding-bottom: .7rem; }
#chat-title { display: flex; align-items: center; gap: .65rem; font-size: 1.55rem; min-width: 0; }
#chat-title::before { content: ""; width: 52px; height: 52px; border-radius: 50%; flex: none;
  background-size: 120%; background-position: center 15%;
  box-shadow: 0 0 0 3px var(--surface), 0 4px 0 2px color-mix(in srgb, var(--c) 35%, transparent); }
#chat-title .ko { color: var(--c); margin-left: 0; }

@media (max-width: 900px) {
  #v-chat .bar-actions { width: 100%; flex-wrap: nowrap; }
  #v-chat .bar-actions .btn { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 900px) {
  #v-chat .bar { gap: .5rem; }
  #v-chat .bar h1 { flex: 1; font-size: 1.35rem; }
  #chat-title::before { width: 44px; height: 44px; }
  /* one row on phones: language switch + three icon buttons (labels stay for screen readers) */
  #v-chat .bar-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 46px); gap: .35rem; align-items: start; max-width: 40rem; }
  #v-chat .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #v-chat .seg button { padding: .3rem .15rem; font-size: .95rem; }
  #v-chat .bar-actions .btn { width: 46px; padding: 0; font-size: 0; gap: 0; }
  #v-chat .bar-actions .btn::before { width: 22px; height: 22px; }
  #tune { max-height: 32dvh; }
}
/* When the on-screen keyboard leaves little room, hide the extra controls while typing */
@media (max-width: 760px) and (max-height: 520px) {
  #v-chat .bar-actions, #tune { display: none !important; }
}

.log { flex: 1; min-height: 0; overflow-y: auto; padding: 1.2rem .75rem 1.2rem .2rem; scrollbar-gutter: stable;
  display: flex; flex-direction: column; gap: 1.2rem; overscroll-behavior: contain; }
.empty { margin: auto; text-align: center; max-width: 36rem; color: var(--muted); padding: 1rem 0; animation: rise .45s ease-out both; }
.empty::before { content: ""; display: block; width: 170px; height: 170px; margin: 0 auto .4rem; border-radius: 50%;
  background: var(--photo) center 20% / 115% no-repeat, radial-gradient(circle at 50% 40%, var(--surface2), color-mix(in srgb, var(--c) 25%, var(--surface)) 80%);
  box-shadow: 0 10px 0 -4px color-mix(in srgb, var(--c) 30%, transparent); animation: bob 5s ease-in-out infinite; }
.empty p { font-size: 1.15rem; margin: .4rem 0 0; color: var(--text); }
.empty .tries { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.2rem; }
.empty .tries button { border: 1px solid color-mix(in srgb, var(--c) 25%, var(--line)); background: var(--surface2);
  border-radius: 999px; padding: .55rem 1.2rem; cursor: pointer; min-height: 46px; color: var(--text); margin-bottom: 4px;
  font-size: 1.02rem; font-weight: 600; text-align: center;
  box-shadow: inset 0 2px 0 var(--hi), 0 4px 0 color-mix(in srgb, var(--c) 35%, var(--lip));
  transition: transform .16s var(--press), box-shadow .16s; }
.empty .tries button:hover { transform: translateY(2px); box-shadow: inset 0 2px 0 var(--hi), 0 2px 0 color-mix(in srgb, var(--c) 35%, var(--lip)); }
.empty .tries button:active { transform: translateY(4px) scale(1.03, .96); box-shadow: inset 0 2px 0 var(--hi), 0 0 0 transparent; }

.msg { max-width: min(46rem, 88%); display: flex; flex-direction: column; gap: .45rem; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.twin { align-self: flex-start; }
.who { font-size: 1rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: .45rem;
  padding: 0 .3rem; }
.msg.twin .who { color: var(--c); }
.msg.twin .who::before { content: ""; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background-size: 125%; background-position: center 15%; box-shadow: 0 0 0 2px var(--surface); }
/* clay bubbles: puffy, lit on top, pressed at the bottom */
.bubble { border-radius: 22px; padding: .85rem 1.15rem; font-size: 1.12rem; line-height: 1.6; white-space: pre-wrap;
  word-break: keep-all; overflow-wrap: break-word; }
.msg.me .bubble { background: var(--me); border: 1px solid var(--me-line); border-bottom-right-radius: 8px;
  box-shadow: inset 0 2px 0 var(--hi), inset 0 -3px 0 color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow); }
.msg.twin .bubble { background: color-mix(in srgb, var(--c) 9%, var(--surface2));
  border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line)); border-bottom-left-radius: 8px;
  box-shadow: inset 0 2px 0 var(--hi), inset 0 -3px 0 color-mix(in srgb, var(--c) 14%, transparent), var(--shadow); }
@media (max-width: 520px) { .msg { max-width: 94%; } .bubble { font-size: 1.07rem; padding: .75rem 1rem; } }

/* calm "thinking" and "still writing" states: three little clay beads */
.thinking { color: var(--muted); display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; }
.thinking::after { content: ""; width: 40px; height: 10px; flex: none;
  background:
    radial-gradient(circle 5px, var(--c) 95%, transparent) 0 50% / 10px 10px no-repeat,
    radial-gradient(circle 5px, var(--c) 95%, transparent) 15px 50% / 10px 10px no-repeat,
    radial-gradient(circle 5px, var(--c) 95%, transparent) 30px 50% / 10px 10px no-repeat;
  animation: breathe 1.4s ease-in-out infinite; }
.msg.streaming .bubble::after { content: ""; display: inline-block; width: .55em; height: .55em; margin-left: .25em;
  border-radius: 50%; background: var(--c); animation: breathe 1s ease-in-out infinite; vertical-align: .05em; }

.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.chip { --l: color-mix(in srgb, var(--c, var(--accent)) 35%, var(--lip)); border: 1px solid var(--line); background: var(--surface2);
  border-radius: 999px; padding: .4rem 1.05rem .4rem .85rem; margin-bottom: 4px;
  cursor: pointer; font-size: .98rem; font-weight: 700; min-height: 46px; color: var(--text);
  display: inline-flex; align-items: center; gap: .5rem;
  box-shadow: inset 0 2px 0 var(--hi), 0 4px 0 var(--l);
  transition: transform .16s var(--press), box-shadow .16s ease; }
.chip:hover { transform: translateY(2px); box-shadow: inset 0 2px 0 var(--hi), 0 2px 0 var(--l); }
.chip:active { transform: translateY(4px) scale(1.03, .96); box-shadow: inset 0 2px 0 var(--hi), 0 0 0 var(--l); }
.chip svg { width: 22px; height: 22px; padding: 5px; border-radius: 50%; fill: var(--surface2); background: var(--c, var(--accent)); flex: none; }

.refs { display: flex; flex-direction: column; gap: .6rem; margin-top: .3rem; }
.refs-title { font-size: .95rem; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; gap: .5rem; padding: 0 .3rem; }
.refs-title::before { content: ""; width: 30px; height: 30px; flex: none; background: url(clay/handset.webp) center / contain no-repeat; }
.ref { position: relative; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem 1rem .85rem 1.2rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem;
  align-items: center; box-shadow: inset 0 2px 0 var(--hi), inset 4px 0 0 color-mix(in srgb, var(--c) 55%, transparent), var(--shadow); }
.ref .t-ko, .ref .t-en, .ref .date { grid-column: 1; }
.ref .t-ko { font-size: 1.07rem; line-height: 1.5; font-weight: 600; }
.ref .t-ko::before { content: "\201C"; color: var(--c); font-weight: 800; margin-right: .1em; }
.ref .t-ko::after { content: "\201D"; color: var(--c); font-weight: 800; margin-left: .05em; }
.ref .t-en { font-size: 1rem; color: var(--muted); line-height: 1.5; }
.ref .date { font-size: 1rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; margin-top: .15rem; font-weight: 600; }
.ref .date::before { content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--i-cal) center / contain no-repeat; mask: var(--i-cal) center / contain no-repeat; }
.ref .chip { grid-row: 1 / span 3; grid-column: 2; }
@media (max-width: 560px) {
  .ref { grid-template-columns: minmax(0, 1fr); }
  .ref .chip { grid-row: auto; grid-column: 1; justify-self: start; margin-top: .4rem; }
}

/* typing box, pinned at the bottom: a clay tray with a pressed-in well */
.composer { display: flex; gap: .55rem; align-items: flex-end; padding: .75rem 0 calc(.9rem + env(safe-area-inset-bottom));
  border-top: 2px solid var(--line); flex: none; }
.composer textarea { flex: 1; min-width: 0; resize: none; background: var(--surface2); border: 1px solid var(--line);
  border-radius: 24px; padding: .75rem 1.15rem; font-size: 1.08rem; line-height: 1.45; min-height: 50px; max-height: 9rem;
  box-shadow: inset 0 3px 7px var(--lo); transition: border-color .15s; margin-bottom: 4px; }
.composer textarea:focus { border-color: var(--accent); outline: none; }
.composer textarea::placeholder { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer .btn { min-height: 50px; }
.btn.mic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; }
.btn.mic.rec { --l: rgba(120, 30, 20, .6); background: var(--danger); border-color: transparent; color: #fff; animation: pulse 1.6s ease-in-out infinite; }
#send svg { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 520px) {
  #mic-label, #send .lbl { display: none; }
  .composer textarea { font-size: 1.02rem; padding: .75rem 1rem; }
  .composer .btn { width: 50px; padding: 0; }
  .composer .btn.mic.rec { width: auto; padding: 0 .9rem; }
  .composer .btn.mic.rec #mic-label { display: inline; }
}

.boot { margin: 26vh auto; display: flex; flex-direction: column; align-items: center; gap: .4rem; font-weight: 700; }
.boot::before { content: ""; width: 120px; height: 120px; background: url(clay/kettle-steaming.webp) center / contain no-repeat;
  animation: bob 2.4s ease-in-out infinite; }

/* voice tuning panel: a clay tray of sliders */
.tune { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .7rem 1.6rem;
  padding: 1rem 1.2rem; margin-top: .8rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: inset 0 3px 7px var(--lo);
  animation: rise .25s ease-out both; max-height: 45dvh; overflow-y: auto; flex: none; }
.tune label { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 .6rem;
  color: var(--muted); font-size: 1rem; font-weight: 700; }
.tune output { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.tune input[type=range] { grid-column: 1 / -1; width: 100%; min-height: 44px; margin: 0; accent-color: var(--accent); }
.tune #tune-reset { justify-self: start; align-self: end; }
@media (max-width: 520px) { .tune { gap: .4rem; padding: .8rem .95rem; } }

/* ---------- family fact sheet ---------- */
.facts-card { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 1.2rem 1.6rem 1.3rem 7.6rem; cursor: pointer; display: flex; flex-direction: column;
  gap: .25rem; color: var(--text); margin-bottom: 1rem; width: 100%; min-height: 7rem;
  box-shadow: inset 0 2px 0 var(--hi), inset 0 -5px 0 color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow);
  animation: rise .5s .14s ease-out both; transition: transform .28s var(--press), box-shadow .28s ease; }
.facts-card::before { content: ""; position: absolute; left: 1.2rem; top: 50%; width: 92px; height: 92px; transform: translateY(-50%);
  background: url(clay/open-book.webp) center / contain no-repeat; }
.facts-card:hover { transform: translateY(-4px); box-shadow: inset 0 2px 0 var(--hi), inset 0 -5px 0 color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow-lift); }
.facts-card:active { transform: scale(1.01, .98); }
.facts-card .name { font-size: 1.4rem; font-weight: 800; }
.facts-card .name .ko { color: var(--accent); }
.facts-card .meta { color: var(--muted); font-size: 1.02rem; }
@media (max-width: 520px) {
  .facts-card { padding: 1.1rem 1.1rem 1.2rem 5.6rem; }
  .facts-card::before { left: .8rem; width: 70px; height: 70px; }
  .facts-card .name .ko { display: block; margin: .05rem 0 0; }
}
#pick-note { margin: .3rem 0 2rem; font-size: .98rem; }

#v-facts { --soft: color-mix(in srgb, var(--accent) 16%, transparent); }
#v-facts .bar h1 .ko { display: block; margin: .1rem 0 0; font-size: 1.05rem; }
#v-facts.playing { padding-bottom: 240px; }
.fs { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 2rem; padding: 1.4rem 0 2.5rem; font-size: 17px; line-height: 1.65; }
.fs-msg { grid-column: 1 / -1; }
.fs header.top { grid-column: 1 / -1; }
.fs header.top h1 { display: none; }
.fs .intro { color: var(--muted); }
.fs .intro ul { margin: .5rem 0 0; }
.fs nav.toc { position: sticky; top: 1rem; align-self: start; max-height: calc(100dvh - 2rem); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem .9rem;
  font-size: 15px; line-height: 1.45; box-shadow: inset 0 2px 0 var(--hi), var(--shadow); }
.fs .toc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; gap: .5rem; }
.fs .toc-title { font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; }
.fs .btns { display: flex; gap: 6px; }
.fs .btns button { font-size: 13.5px; border: 1px solid var(--line); background: var(--surface2); color: var(--text);
  border-radius: 999px; padding: 4px 12px; cursor: pointer; min-height: 40px; font-weight: 700;
  box-shadow: inset 0 2px 0 var(--hi), 0 3px 0 var(--lip); margin-bottom: 3px; transition: transform .16s var(--press), box-shadow .16s; }
.fs .btns button:active { transform: translateY(3px); box-shadow: inset 0 2px 0 var(--hi), 0 0 0 var(--lip); }
.fs .toc-list, .fs .toc-list ol { list-style: none; margin: 0; padding: 0; }
.fs .toc-list > li { margin: 2px 0; }
.fs .toc-list a { display: block; color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 12px; font-weight: 600; }
.fs .toc-list a:hover { background: var(--soft); }
.fs .toc-list a.active { background: var(--soft); color: var(--accent); font-weight: 800; }
.fs .toc-list .n { display: inline-block; width: 1.6em; color: var(--muted); }
.fs .toc-list ol.sub { margin: 0 0 4px 1.6em; display: none; }
.fs .toc-list li.open > ol.sub { display: block; }
.fs .toc-list ol.sub a { font-size: 14px; color: var(--muted); padding: 3px 10px; }
.fs main { min-width: 0; }
.fs details.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1.1rem;
  box-shadow: inset 0 2px 0 var(--hi), var(--shadow); }
.fs details.sec > summary { list-style: none; cursor: pointer; padding: 1rem 1.4rem; display: flex; align-items: center; gap: .8rem; min-height: 58px; }
.fs details.sec > summary::-webkit-details-marker { display: none; }
.fs details.sec > summary::before { content: ""; width: 10px; height: 10px; border-right: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent); border-radius: 2px; transform: rotate(-45deg); transition: transform .2s var(--press); flex: none; }
.fs details.sec[open] > summary::before { transform: rotate(45deg); }
.fs details.sec > summary h2 { margin: 0; font-size: 1.35rem; }
.fs .sec-body { padding: 0 1.6rem 1.2rem; border-top: 2px solid var(--line); }
.fs h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; color: var(--accent); scroll-margin-top: 1rem; }
.fs details.sec { scroll-margin-top: 1rem; }
.fs ul, .fs ol { padding-left: 1.3rem; margin: .4rem 0; }
.fs li { margin: .3rem 0; }
.fs strong { font-weight: 800; }
.fs p { margin: .7rem 0; }
.fs footer { grid-column: 1 / -1; color: var(--muted); font-size: 14px; text-align: center; }
.fs .d { color: var(--muted); font-size: .85em; white-space: nowrap; }
.fs .d .clip { font: inherit; font-size: 1em; font-weight: 700; color: var(--accent); background: var(--soft); border: 1px solid transparent;
  border-radius: 999px; padding: .05em .65em .05em .55em; margin: 2px 1px; cursor: pointer; white-space: nowrap; line-height: 1.7;
  display: inline-flex; align-items: center; gap: .3em; vertical-align: baseline; }
.fs .d .clip::before { content: ""; width: 0; height: 0; border-left: .55em solid currentColor;
  border-top: .33em solid transparent; border-bottom: .33em solid transparent; }
.fs .d .clip:hover, .fs .d .clip:focus-visible { border-color: var(--accent); outline: none; }
.fs .d .clip.whole { background: transparent; border: 1px dashed var(--line-lit); color: var(--muted); }
.fs .d .clip.whole:hover { border-color: var(--accent); color: var(--accent); }
.fs .d .clip.now { background: var(--accent); color: var(--ink); }
.fs .toc-toggle { display: none; }
@media (max-width: 900px) {
  .fs { display: block; padding-top: 1rem; }
  .fs nav.toc { top: 0; z-index: 5; max-height: none; border-radius: 0 0 var(--radius) var(--radius); margin: 0 0 1rem; padding: .6rem .9rem; }
  .fs nav.toc .toc-list { display: none; max-height: 60vh; overflow: auto; margin-top: .5rem; }
  .fs nav.toc.show .toc-list { display: block; }
  .fs .toc-toggle { display: inline-block !important; }
  .fs .sec-body { padding: 0 1rem 1rem; }
  .fs details.sec > summary { padding: .9rem 1rem; }
  .fs details.sec > summary h2 { font-size: 1.2rem; }
  .fs .d { white-space: normal; }
}

#fs-player { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: 80vw; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: inset 0 2px 0 var(--hi), var(--shadow-lift); padding: .85rem 1.1rem; font-size: 15.5px; line-height: 1.45;
  animation: slideup .3s var(--press) both; }
#fs-player .ph { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
#fs-player .pdate { font-weight: 800; color: var(--accent); font-size: 16.5px; }
#fs-player .tag { font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 1px 9px; background: var(--bg); color: var(--muted); box-shadow: inset 0 2px 3px var(--lo); }
#fs-player .ptime { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
#fs-player .pclose { border: 1px solid var(--line); background: var(--surface2); color: var(--muted); border-radius: 999px;
  padding: 3px 14px; cursor: pointer; font-size: 14px; min-height: 40px; font-weight: 700; box-shadow: inset 0 2px 0 var(--hi), 0 3px 0 var(--lip); }
#fs-player .pclose:hover { color: var(--text); }
#fs-player .plines { margin: .5rem 0; max-height: 96px; overflow: auto; }
#fs-player .pl { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 2px 10px; margin: 0 0 4px; }
#fs-player .spk { font-weight: 800; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
#fs-player .ko { margin-left: 0; color: var(--text); font-weight: 600; }
#fs-player .en { grid-column: 2; color: var(--muted); }
#fs-player .pnote { color: var(--muted); margin: .5rem 0; }
#fs-player .pc { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
#fs-player .pc button { font-size: 14.5px; border: 1px solid var(--line); background: var(--surface2); color: var(--text);
  border-radius: 999px; padding: 6px 15px; cursor: pointer; min-height: 44px; font-weight: 700; margin-bottom: 4px;
  box-shadow: inset 0 2px 0 var(--hi), 0 4px 0 var(--lip); transition: transform .16s var(--press), box-shadow .16s; }
#fs-player .pc button:hover { transform: translateY(2px); box-shadow: inset 0 2px 0 var(--hi), 0 2px 0 var(--lip); }
#fs-player .pc button:active { transform: translateY(4px) scale(1.03, .96); box-shadow: inset 0 2px 0 var(--hi), 0 0 0 var(--lip); }
#fs-player .pc button.main { background: var(--accent); color: var(--ink); border-color: transparent; min-width: 5.5em;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .22), 0 4px 0 var(--accent-lip); }
#fs-player input[type=range] { flex: 1 1 160px; accent-color: var(--accent); min-width: 120px; min-height: 32px; }
@media (max-width: 900px) {
  #fs-player { width: 90vw; bottom: calc(8px + env(safe-area-inset-bottom)); padding: .6rem .75rem; }
  #v-facts.playing { padding-bottom: 290px; }
  #fs-player .plines { max-height: 80px; }
  #fs-player .ph { flex-wrap: nowrap; gap: 6px; }
  #fs-player .pdate { font-size: 14px; white-space: nowrap; }
  #fs-player .tag { white-space: nowrap; font-size: 11.5px; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  #fs-player .ptime { font-size: 12.5px; white-space: nowrap; }
  #fs-player input[type=range] { order: -1; flex-basis: 100%; }
  #fs-player .pc { gap: 6px; }
  #fs-player .pc button { padding: 5px 10px; flex: 1 1 auto; }
}

/* ---------- gentle clay motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98, 1.02); } to { opacity: 1; transform: none; } }
@keyframes slideup { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-1.5deg); } }
@keyframes breathe { 0%, 100% { opacity: .35; transform: scale(.92); } 50% { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 4px 0 var(--l), 0 0 0 0 color-mix(in srgb, var(--danger) 45%, transparent); }
  50% { box-shadow: 0 4px 0 var(--l), 0 0 0 9px color-mix(in srgb, var(--danger) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 640px) {
  #v-pick .bar h1 { font-size: 1.55rem; }
  .person .badge { font-size: .95rem; padding: .2rem .7rem; }
}

.login input { border-color: color-mix(in srgb, var(--text) 28%, transparent); }

/* ---------- Paul only: the review page and the full version of the fact sheet ---------- */
#v-review .bar h1 { font-size: 1.6rem; }
.rv-intro { margin: .9rem 0 .6rem; max-width: 60rem; }
.rv-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin: .3rem 0 1.2rem; }
.rv-badge { display: inline-flex; align-items: center; font-size: .9rem; font-weight: 800; border-radius: 999px;
  padding: .2rem .8rem; background: var(--bg); color: var(--muted); box-shadow: inset 0 2px 3px var(--lo); }
.rv-badge.hide { color: var(--danger); }
.rv-badge.rewrite { color: var(--warn); }
.rv-badge.keep { color: var(--accent); }
.rv-badge.serious { color: #fff; background: var(--danger); box-shadow: none; font-size: .8rem; }
.rv-list { display: flex; flex-direction: column; gap: 1.1rem; padding-bottom: 3rem; }
.rv-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 2px 0 var(--hi), var(--shadow); }
.rv-group > summary { list-style: none; cursor: pointer; padding: 1rem 1.4rem; display: flex; align-items: baseline;
  flex-wrap: wrap; gap: .3rem 1rem; min-height: 56px; }
.rv-group > summary::-webkit-details-marker { display: none; }
.rv-group > summary h2 { margin: 0; font-size: 1.3rem; }
.rv-gcount { font-size: .95rem; font-weight: 600; }
.rv-gbtns { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0 1.4rem .8rem; }
.rv-gbtns .btn { min-height: 42px; font-size: .95rem; }
.rv-empty { padding: 0 1.4rem 1rem; margin: 0; }
.rv-item { border-top: 2px solid var(--line); padding: 1rem 1.4rem 1.1rem; border-left: 5px solid transparent; }
.rv-item.c-hide { border-left-color: color-mix(in srgb, var(--danger) 70%, transparent); }
.rv-item.c-rewrite { border-left-color: color-mix(in srgb, var(--warn) 80%, transparent); }
.rv-item.c-keep { border-left-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.rv-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.rv-head h3 { margin: 0; font-size: 1.12rem; }
.rv-id { font-weight: 800; font-size: .85rem; color: var(--muted); background: var(--bg); border-radius: 8px; padding: .05rem .45rem; }
.rv-meta { margin: .2rem 0 .5rem; color: var(--muted); font-size: .95rem; }
.rv-quote { margin: .4rem 0; padding: .55rem .9rem; background: var(--surface2); border-left: 4px solid var(--line-lit);
  border-radius: 10px; font-size: 1.02rem; line-height: 1.5; overflow-wrap: anywhere; }
.rv-cut { margin: .1rem 0 .5rem; font-size: .93rem; color: var(--muted); overflow-wrap: anywhere; }
.rv-why { margin: .35rem 0; font-size: .97rem; }
.rv-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .6rem; }
.rv-actions .seg button { padding: .35rem .95rem; }
.rv-saved { font-size: .92rem; font-weight: 700; color: var(--accent); }
.rv-saved.err { color: var(--danger); }
.rv-rewrite { margin-top: .7rem; display: flex; flex-direction: column; gap: .6rem; }
.rv-rewrite[hidden] { display: none; }
.rv-rw { display: flex; flex-direction: column; gap: .3rem; }
.rv-rw textarea { width: 100%; resize: vertical; background: var(--bg); border: 1px solid var(--line-lit);
  border-radius: var(--radius-sm); padding: .6rem .8rem; font-size: 1rem; line-height: 1.5; }
.rv-rw textarea:focus { border-color: var(--accent); outline: none; }
@media (max-width: 640px) {
  .rv-group > summary, .rv-item { padding-left: 1rem; padding-right: 1rem; }
  .rv-gbtns { padding: 0 1rem .8rem; }
}

#v-facts .admin-only { margin-left: auto; }
.switch { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; cursor: pointer; min-height: 46px; }
.switch input { width: 22px; height: 22px; accent-color: var(--danger); }
.full-note { margin: .6rem 0 0; padding: .7rem 1rem; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--line); font-size: .97rem; }
mark.rd { color: inherit; border-radius: 4px; padding: 0 .1em; }
mark.rd-hide { background: color-mix(in srgb, var(--danger) 22%, transparent); text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--danger) 70%, transparent); }
mark.rd-rewrite { background: color-mix(in srgb, var(--warn) 22%, transparent); text-decoration: line-through; }
mark.rd-keep { background: transparent; text-decoration: underline dotted var(--accent) 2px; }
ins.rd-new { text-decoration: none; background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 4px; padding: 0 .15em; }
.fs .rd-hidebtn { font: inherit; font-size: .78em; font-weight: 800; color: var(--danger); background: transparent;
  border: 1px dashed color-mix(in srgb, var(--danger) 45%, transparent); border-radius: 999px; padding: 0 .6em;
  margin-left: .35em; cursor: pointer; min-height: 28px; vertical-align: baseline; }
.fs .rd-hidebtn:hover, .fs .rd-hidebtn:focus-visible { background: color-mix(in srgb, var(--danger) 12%, transparent); outline: none; }
.fs .rd-pick { margin: .5rem 0 .7rem; padding: .7rem .9rem; background: var(--surface2); border: 1px solid var(--line-lit);
  border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: .45rem; }
.fs .rd-pick-h { margin: 0; font-weight: 800; font-size: .95rem; color: var(--muted); }
.fs .rd-row { display: flex; align-items: center; gap: .8rem; }
.fs .rd-q { flex: 1; min-width: 0; font-size: .95rem; overflow-wrap: anywhere; }
.fs .rd-go { min-height: 40px; font-size: .92rem; color: var(--danger); flex: none; }
.fs .rd-err { display: block; font-size: .9rem; }
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 70; background: var(--text); color: var(--bg); padding: .7rem 1.2rem; border-radius: 999px; font-weight: 700;
  max-width: 90vw; box-shadow: var(--shadow-lift); }
#toast[hidden] { display: none; }

/* ---------- top menu ---------- */
.topnav { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  padding: .35rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); position: sticky; top: .5rem; z-index: 20; }
.topnav[hidden] { display: none; }
.topnav button { border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700;
  padding: .5rem 1rem; border-radius: 999px; cursor: pointer; }
.topnav button .ko { margin-left: .3rem; }
.topnav button:hover { background: var(--surface2); }
.topnav button[aria-current="page"] { background: var(--accent); color: var(--ink); }
.topnav button[aria-current="page"] .ko { color: var(--ink); opacity: .85; }
.topnav button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.topnav-gap { flex: 1; }
.topnav-out { color: var(--muted) !important; }
@media (max-width: 760px) { .topnav button { padding: .45rem .7rem; } .topnav button .ko { display: none; } }
