/* Sapere — styles (Part 1 search + Part 2 memory)
   Serious and calm, never dull. Blue = the app; gold = what has become yours. */

:root {
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", "Noto Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* light (cool paper, matches the icon) */
  --bg: #f4f6fb;
  --bg-2: #e9edf5;
  --surface: #ffffff;
  --line: rgba(15, 20, 32, .10);
  --line-2: rgba(15, 20, 32, .18);
  --text: #0f1420;
  --muted: #55607a;
  --faint: #8590a8;
  --accent: #1d5fe0;
  --accent-2: #3b7cf5;
  --accent-soft: rgba(59, 124, 245, .14);
  --blue: #2f6fe0;
  --blue-soft: rgba(47, 111, 224, .12);
  --gold: #a8781e;
  --gold-soft: rgba(201, 150, 47, .16);
  --danger: #c2412c;
  --on-accent: #ffffff;
  --settled: #1f7a4d;
  --debated: #c25a2c;
  --unknown: #6b4fc2;
  --shadow: 0 1px 2px rgba(20, 24, 30, .05), 0 10px 30px -12px rgba(20, 24, 30, .18);
  --glow: 0 0 0 4px rgba(59, 124, 245, .20);
  --radius: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .4, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --dark: 1; }
}
:root[data-theme="dark"] { --dark: 1; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060a14; --bg-2: #0b1020; --surface: #0f1628;
    --line: rgba(205, 220, 255, .10); --line-2: rgba(205, 220, 255, .18);
    --text: #e8edf8; --muted: #93a0bd; --faint: #66728f;
    --accent: #4ea1ff; --accent-2: #8cc4ff; --accent-soft: rgba(78, 161, 255, .16);
    --blue: #4ea1ff; --blue-soft: rgba(78, 161, 255, .14);
    --gold: #e2b65c; --gold-soft: rgba(226, 182, 92, .16); --danger: #ff7a66; --on-accent: #04101f;
    --settled: #5fd39a; --debated: #ff8f70; --unknown: #b79cff;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 14px 40px -14px rgba(0,0,0,.7);
    --glow: 0 0 0 4px rgba(78, 161, 255, .18);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060a14; --bg-2: #0b1020; --surface: #0f1628;
  --line: rgba(205, 220, 255, .10); --line-2: rgba(205, 220, 255, .18);
  --text: #e8edf8; --muted: #93a0bd; --faint: #66728f;
  --accent: #4ea1ff; --accent-2: #8cc4ff; --accent-soft: rgba(78, 161, 255, .16);
  --blue: #4ea1ff; --blue-soft: rgba(78, 161, 255, .14);
  --gold: #e2b65c; --gold-soft: rgba(226, 182, 92, .16); --danger: #ff7a66; --on-accent: #04101f;
  --settled: #5fd39a; --debated: #ff8f70; --unknown: #b79cff;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 14px 40px -14px rgba(0,0,0,.7);
  --glow: 0 0 0 4px rgba(78, 161, 255, .18);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--blue-soft), transparent 60%),
    var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
button { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--accent-soft); }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.mark { width: 30px; height: 30px; border-radius: 9px; display: block; box-shadow: 0 0 0 1px var(--line), 0 0 18px -4px var(--blue); }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: .005em; font-variation-settings: "opsz" 48; }
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; cursor: pointer; display: grid; place-items: center;
  color: var(--muted); transition: background .2s, color .2s, border-color .2s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
.icon-btn:active { transform: scale(.96); }
.ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-sun { display: none; }
  :root:not([data-theme="light"]) .ic-moon { display: block; }
}

.setup-banner {
  margin: 0 16px 8px; padding: 10px 14px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--text); font-size: 14px;
}
.setup-banner code { font-family: var(--mono); font-size: 13px; background: var(--surface); padding: 1px 6px; border-radius: 6px; }

/* ---------- main ---------- */
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px 40px; }
main.has-answer { max-width: 760px; }
@media (min-width: 900px) { main.has-answer { max-width: 1040px; } }

/* hero */
.hero { text-align: center; padding: clamp(28px, 10vh, 96px) 0 18px; }
.hero-title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 9vw, 64px);
  line-height: 1.02; margin: 0 0 12px; letter-spacing: -.015em; font-variation-settings: "opsz" 144;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub { margin: 0; color: var(--muted); font-size: 16px; }
main.has-answer .hero { display: none; }

/* ask box */
.ask { margin: 10px 0 0; position: sticky; top: 0; z-index: 5; padding: 8px 0 6px; background: linear-gradient(var(--bg) 80%, transparent); }
main:not(.has-answer) .ask { position: static; background: none; }
.ask-box {
  position: relative; display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 26px;
  padding: 8px 8px 8px 18px; box-shadow: var(--shadow);
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
main:not(.has-answer) .ask-box { animation: breathe 4.5s ease-in-out infinite; }
.ask-box:focus-within { border-color: var(--accent); box-shadow: var(--shadow), var(--glow); animation: none; }
.ask-box textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 17px; line-height: 1.45; padding: 8px 0; max-height: 160px;
}
.ask-box textarea::placeholder { color: var(--faint); }
.ask-btn {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
  transition: transform .2s var(--spring), background .2s, opacity .2s;
}
.ask-btn svg { width: 20px; height: 20px; }
.ask-btn:hover { transform: scale(1.06); background: var(--accent-2); }
.ask-btn:active { transform: scale(.94); }
.ask-btn[disabled] { opacity: .5; cursor: default; transform: none; }
.ask-hint { display: flex; justify-content: space-between; color: var(--faint); font-size: 12.5px; padding: 8px 16px 0; }
.ask-hint .count:empty { display: none; }
main.has-answer .ask-hint { display: none; }

/* suggestions */
.suggest { margin-top: 22px; }
main.has-answer .suggest { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer;
  transition: all .2s var(--ease); animation: rise .5s var(--ease) both;
}
.chip:nth-child(2) { animation-delay: .06s } .chip:nth-child(3) { animation-delay: .12s } .chip:nth-child(4) { animation-delay: .18s }
.chip:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); transform: translateY(-1px); }
.recent { margin-top: 28px; }
.recent-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; text-align: center; }
.recent-list { display: flex; flex-direction: column; gap: 4px; }
.recent-item {
  text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px;
  color: var(--muted); cursor: pointer; font-family: var(--serif); font-size: 17px; display: flex; justify-content: space-between; gap: 10px;
}
.recent-item:hover { color: var(--text); }
.recent-item span:last-child { color: var(--faint); font-family: var(--sans); font-size: 13px; flex: none; }

/* ---------- answer ---------- */
.answer { margin-top: 18px; }
.asked {
  font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 5.6vw, 34px); line-height: 1.18;
  margin: 10px 0 18px; letter-spacing: -.01em; animation: rise .5s var(--ease) both; font-variation-settings: "opsz" 72;
}

.thinking { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 16px; }
.thinking[hidden] { display: none; }
.thread { height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; position: relative; }
.thread i {
  position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: thread 1.4s var(--ease) infinite;
}
.thinking-text { color: var(--muted); font-size: 14px; }

/* depth toggle */
.depths { animation: rise .5s var(--ease) both; }
.seg {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 14px;
}
.seg-btn {
  position: relative; z-index: 1; border: 0; background: transparent; cursor: pointer; padding: 7px 18px;
  border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 14px; transition: color .2s;
}
.seg-btn.is-on { color: var(--text); }
.seg-pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); transition: transform .35s var(--spring);
}
.seg[data-depth="technical"] .seg-pill { transform: translateX(100%); }
@media (min-width: 900px) { .seg { display: none; } }

.depth-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.depth { display: none; animation: fade .3s var(--ease) both; }
.depth.is-on { display: block; }
@media (min-width: 900px) {
  .depth-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .depth { display: block; }
  .depth::before {
    content: attr(data-label); display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); margin-bottom: 8px;
  }
  .depth-technical { border-left: 1px solid var(--line); padding-left: 28px; }
}

/* prose */
.prose { font-family: var(--serif); font-size: 19px; line-height: 1.55; font-variation-settings: "opsz" 18; }
.depth-technical .prose { font-family: var(--sans); font-size: 16px; line-height: 1.6; }
.prose p { margin: 0 0 .9em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 .9em; padding-left: 1.3em; }
.prose li { margin: .25em 0; }
.prose h4 { margin: 1em 0 .4em; font-size: 1em; font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.prose pre {
  background: #0a1020; color: #e3e9f6; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  overflow: auto; font-size: 13.5px; line-height: 1.5; margin: .8em 0;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose .cite + .cite { margin-left: 4px; }
.prose .cite { color: var(--accent); font-family: var(--sans); font-size: .72em; vertical-align: super; margin-left: 1px; text-decoration: none; }
.prose .cursor { display: inline-block; width: .55em; height: 1em; background: var(--accent); vertical-align: -0.15em; margin-left: 2px; animation: blink 1s steps(2) infinite; border-radius: 2px; }

/* honesty mark */
.honesty { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px; animation: rise .5s var(--ease) both; }
.honesty-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.honesty-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px var(--accent-soft); }
.honesty[data-mark="settled"] .honesty-dot { background: var(--settled); box-shadow: 0 0 0 3px color-mix(in srgb, var(--settled) 22%, transparent); }
.honesty[data-mark="debated"] .honesty-dot { background: var(--debated); box-shadow: 0 0 0 3px color-mix(in srgb, var(--debated) 22%, transparent); }
.honesty[data-mark="unknown"] .honesty-dot { background: var(--unknown); box-shadow: 0 0 0 3px color-mix(in srgb, var(--unknown) 22%, transparent); }
.honesty-why { color: var(--muted); font-size: 14px; }

/* question behind the question */
.next {
  display: grid; gap: 4px; width: 100%; text-align: left; margin: 18px 0 0; padding: 16px 18px 16px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  position: relative; overflow: hidden; box-shadow: var(--shadow); animation: rise .5s var(--ease) both;
  transition: transform .25s var(--ease), border-color .25s;
}
.next::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(#dfe7f5, var(--accent)); }
.next:hover { transform: translateY(-2px); border-color: var(--accent); }
.next-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.next-q { font-family: var(--serif); font-size: 20px; line-height: 1.3; }
.next-go { color: var(--accent); font-size: 14px; font-weight: 500; margin-top: 2px; }

/* sources */
.sources { margin-top: 22px; animation: rise .5s var(--ease) both; }
.sources-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.sources-list { display: grid; gap: 6px; }
@media (min-width: 640px) { .sources-list { grid-template-columns: 1fr 1fr; } }
.src {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  text-decoration: none; color: var(--text); min-width: 0; transition: border-color .2s, transform .2s var(--ease);
}
.src:hover { border-color: var(--accent); transform: translateY(-1px); }
.src.is-used { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.src-ico { width: 22px; height: 22px; border-radius: 6px; background: var(--bg-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--muted); overflow: hidden; }
.src-ico img { width: 16px; height: 16px; }
.src-main { min-width: 0; display: grid; gap: 1px; }
.src-host { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-n { font-size: 12px; color: var(--accent); font-weight: 600; }
.src-age { font-size: 11.5px; color: var(--faint); }
.sources-none { color: var(--muted); font-size: 14px; }

/* actions */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; animation: rise .5s var(--ease) both; }
.actions > button { white-space: nowrap; }
.keep {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font-weight: 600;
  transition: background .2s, color .2s, transform .2s var(--spring);
}
.keep svg { width: 18px; height: 18px; }
.keep:hover { background: var(--accent); color: var(--on-accent); }
.keep:active { transform: scale(.96); }
.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--muted); padding: 10px 16px; border-radius: 999px; cursor: pointer; transition: all .2s; }
.ghost:hover { color: var(--text); border-color: var(--text); }

.err { margin-top: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--debated); color: var(--text); background: color-mix(in srgb, var(--debated) 10%, var(--surface)); font-size: 15px; }

/* footer */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; align-items: center; color: var(--faint); font-size: 12.5px; padding: 18px 16px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.link { background: none; border: 0; padding: 0; color: var(--faint); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
a.link { color: var(--faint); }
.signin-fine a.link { color: var(--muted); }
.sheet-links { display: flex; justify-content: center; gap: 8px; color: var(--faint); font-size: 13px; margin: 4px 0 14px; }

/* sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; animation: fade .25s both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto;
  background: var(--surface); color: var(--text); border-radius: 22px 22px 0 0; padding: 10px 22px 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.25);
  animation: up .35s var(--ease) both; max-height: 86dvh; overflow: auto;
}
.sheet-art { width: 100%; max-width: 300px; display: block; margin: 0 auto 12px; border-radius: 18px; box-shadow: 0 10px 40px -10px rgba(0,0,0,.6); }
.sheet-tag { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 14px; font-style: italic; }
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 4px auto 14px; }
.sheet-title { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 6px; }
.sheet-intro { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.promises { margin: 0 0 14px; padding-left: 1.2em; display: grid; gap: 10px; font-size: 15px; }
.promises b { font-weight: 600; }
.sheet-foot { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.sheet-close { width: 100%; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 30;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow); animation: up .3s var(--ease) both; max-width: calc(100% - 32px); text-align: center;
}

/* animations */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.sheet { animation-name: sheetup; }
@keyframes sheetup { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes thread { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes breathe { 0%, 100% { box-shadow: var(--shadow); } 50% { box-shadow: var(--shadow), 0 0 0 6px var(--accent-soft); } }
@keyframes blink { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
[hidden] { display: none !important; }

/* =====================================================================
   PART 2 — memory, sign-in, daily check, My Mind
   ===================================================================== */

/* header: My Mind */
.mind-btn {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px 0 10px;
  border-radius: 999px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text); cursor: pointer; font-size: 14px; font-weight: 500; margin-right: 4px;
  transition: border-color .2s, background .2s, transform .2s var(--spring);
}
.mind-btn svg { width: 19px; height: 19px; color: var(--accent); }
.mind-btn:hover { border-color: var(--accent); }
.mind-btn:active { transform: scale(.96); }
.mind-btn.is-on { background: var(--accent-soft); border-color: var(--accent); }
.mind-dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--bg); }
@media (max-width: 370px) { .mind-btn span { display: none; } .mind-btn { padding: 0 9px; } }

/* daily check card */
.daily {
  width: 100%; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; text-align: left;
  margin: 14px 0 0; padding: 14px 16px 14px 14px; border-radius: 20px; cursor: pointer; color: var(--text);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--gold) 80%, transparent), var(--accent)) border-box;
  border: 1.5px solid transparent; box-shadow: var(--shadow); animation: rise .5s var(--ease) both;
  transition: transform .25s var(--ease);
}
.daily:hover { transform: translateY(-2px); }
.daily:active { transform: scale(.985); }
.daily-ring { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.daily-ring svg { position: absolute; inset: 0; width: 48px; height: 48px; transform: rotate(-90deg); }
.daily-ring circle { fill: none; stroke-width: 3.5; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 119.4; transition: stroke-dashoffset 1.1s var(--ease); }
.daily-ring b { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.daily-text { display: grid; gap: 2px; min-width: 0; }
.daily-title { font-weight: 600; font-size: 15.5px; }
.daily-sub { color: var(--muted); font-size: 13.5px; }
.daily-go { color: var(--accent); font-size: 20px; }
.daily.is-done { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, var(--line-2), var(--line-2)) border-box; cursor: default; }
.daily.is-done .ring-fg { stroke: var(--gold); }
.daily.is-done .daily-go { display: none; }
main.has-answer .daily, main.mind-mode #daily { display: none; }

/* answer extras */
.subject-tag { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); animation: fade .4s both; }
.subject-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--subj, var(--accent)); }
.subject-tag + .asked { margin-top: 6px; }
.keep .keep-tick { display: none; }
.keep.is-kept { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.keep.is-kept .keep-tick { display: inline; }
.keep.is-kept path:first-child { fill: currentColor; fill-opacity: .18; }
.keep.is-busy { opacity: .6; pointer-events: none; }
.keep.pop { animation: pop .5s var(--spring); }
.ghost-quiet { border-color: transparent; }
.kept-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 12px; }
.kept-note { color: var(--muted); font-size: 14px; animation: fade .4s both; }
.kept-row .link { font-size: 14px; }
.kept-note b { color: var(--text); font-weight: 600; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* primary button */
.primary {
  border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer; font-weight: 600;
  background: var(--accent); color: var(--on-accent); transition: transform .2s var(--spring), background .2s, opacity .2s;
}
.primary:hover { background: var(--accent-2); }
.primary:active { transform: scale(.97); }
.primary[disabled] { opacity: .55; cursor: default; transform: none; }
.primary.danger { background: var(--danger); }
.link-danger { color: var(--danger) !important; }

/* sign-in sheet */
.signin { text-align: center; }
.signin-mark { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 0 30px -6px var(--accent); }
.signin-mark img { width: 64px; height: 64px; display: block; }
.signin .sheet-intro { max-width: 340px; margin-left: auto; margin-right: auto; }
.gbtn-wrap { display: flex; justify-content: center; min-height: 44px; margin: 6px 0 2px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.email-form, .code-form { display: grid; gap: 10px; }
.email-form input, .code-form input {
  width: 100%; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); border-radius: 14px;
  padding: 13px 14px; font: inherit; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.email-form input:focus, .code-form input:focus { border-color: var(--accent); box-shadow: var(--glow); }
.code-form input { text-align: center; font-size: 28px; letter-spacing: .4em; font-family: var(--serif); padding: 12px 0 12px .4em; }
.code-sent { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.code-sent b { color: var(--text); }
.code-links { display: flex; justify-content: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--faint); }
.signin-err { margin: 12px 0 0; color: var(--danger); font-size: 14px; }
.signin-fine { color: var(--faint); font-size: 12.5px; margin: 16px auto 12px; max-width: 340px; }

/* confirm sheet */
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- daily check overlay ---------- */
.checks {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: radial-gradient(900px 500px at 50% -10%, var(--blue-soft), transparent 60%), var(--bg);
  animation: fade .25s both;
}
.checks-top { display: flex; align-items: center; gap: 12px; max-width: 640px; width: 100%; margin: 0 auto; }
.checks-progress { flex: 1; display: flex; gap: 6px; }
.checks-progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.checks-progress i.done { background: var(--accent); }
.checks-progress i.had { background: var(--gold); }
.checks-progress i.now { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.checks-stage { flex: 1; display: grid; align-items: center; max-width: 640px; width: 100%; margin: 0 auto; overflow: auto; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px 20px 20px;
  box-shadow: var(--shadow); animation: cardin .45s var(--ease) both;
}
.card.out-left { animation: cardout-left .38s var(--ease) both; }
.card.out-right { animation: cardout-right .38s var(--ease) both; }
@keyframes cardin { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cardout-left { to { opacity: 0; transform: translateX(-40px) rotate(-3deg); } }
@keyframes cardout-right { to { opacity: 0; transform: translateX(40px) rotate(3deg); } }
.card-subject { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.card-subject i { width: 8px; height: 8px; border-radius: 50%; background: var(--subj, var(--accent)); }
.card-q { font-family: var(--serif); font-size: clamp(24px, 6.4vw, 32px); line-height: 1.2; margin: 10px 0 18px; letter-spacing: -.01em; }
.card-answer-area textarea {
  width: 100%; resize: none; border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  border-radius: 16px; padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.5; outline: none; min-height: 92px;
  transition: border-color .2s, box-shadow .2s;
}
.card-answer-area textarea:focus { border-color: var(--accent); box-shadow: var(--glow); }
.card-hint { color: var(--faint); font-size: 12.5px; margin-top: 8px; }
.card-reveal { animation: rise .4s var(--ease) both; }
.card-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 2px 0 6px; }
.card-yours { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-2); }
.card-yours-text { color: var(--muted); font-size: 15.5px; white-space: pre-wrap; }
.card-kept { font-size: 18px; }
.card-from { color: var(--faint); font-size: 13px; margin-top: 10px; }
.checks-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; max-width: 640px; width: 100%; margin: 0 auto; }
.checks-actions .ghost, .checks-actions .primary { padding: 14px 16px; font-size: 16px; }
.judge-yes { background: var(--accent); }
.checks-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; max-width: 520px; margin: 0 auto; animation: rise .5s var(--ease) both; }
.done-orbit { position: relative; width: 120px; height: 120px; margin-bottom: 18px; }
.done-orbit i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--accent); opacity: .5; animation: orbit 3.2s linear infinite; }
.done-orbit i:nth-child(2) { inset: 18px; border-color: var(--gold); animation-duration: 2.4s; animation-direction: reverse; }
.done-orbit i:nth-child(3) { inset: 44px; background: var(--accent); border: 0; opacity: 1; box-shadow: 0 0 30px var(--accent); animation: breathe-dot 2.6s ease-in-out infinite; }
@keyframes orbit { to { transform: rotate(360deg) scale(1.02); } }
@keyframes breathe-dot { 50% { transform: scale(.85); opacity: .8; } }
.done-orbit i:nth-child(1) { border-style: dashed; }
.done-title { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0; }
.done-lines { color: var(--muted); margin: 6px 0 22px; line-height: 1.7; }
.done-lines b { color: var(--text); font-weight: 600; }
.done-lines .gold { color: var(--gold); font-weight: 600; }

/* ---------- My Mind ---------- */
.mind { padding-top: 10px; animation: rise .45s var(--ease) both; }
main.mind-mode .hero, main.mind-mode .ask, main.mind-mode .suggest, main.mind-mode .answer { display: none !important; }
.mind-head { margin: 18px 0 14px; }
.mind-title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 8vw, 46px); margin: 0; letter-spacing: -.015em; }
.mind-sub { color: var(--muted); margin: 4px 0 0; }
.mind-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 10px; }
.stat b { display: block; font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.gold b { color: var(--gold); }
.daily-inline { margin: 12px 0 4px; }
.mind-list { margin-top: 18px; display: grid; gap: 22px; }
.subj-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.subj-head i { width: 9px; height: 9px; border-radius: 50%; background: var(--subj, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--subj, var(--accent)) 22%, transparent); }
.subj-head span:last-child { margin-left: auto; color: var(--faint); letter-spacing: 0; text-transform: none; }
.mind-items { display: grid; gap: 6px; }
.mi {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; text-align: left; width: 100%;
  padding: 13px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .2s, transform .2s var(--ease);
}
.mi:hover { border-color: var(--accent); transform: translateY(-1px); }
.mi-q { font-family: var(--serif); font-size: 17.5px; line-height: 1.3; min-width: 0; }
.mi-meta { grid-column: 1 / 2; color: var(--faint); font-size: 12.5px; }
.mi-dots { grid-row: 1 / 3; grid-column: 2; display: flex; gap: 4px; }
.mi-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.mi-dots i.on { background: var(--accent); }
.mi.yours { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.mi.yours .mi-dots i { background: var(--gold); }
.mi.yours .mi-meta { color: var(--gold); }
.mind-empty { text-align: center; padding: 30px 8px 10px; color: var(--muted); }
.mind-empty-art { width: 120px; height: 120px; margin: 0 auto 10px; color: var(--accent); }
.mind-empty h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--text); margin: 0 0 8px; }
.mind-empty p { max-width: 420px; margin: 0 auto 18px; }
.mind-foot { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; justify-items: center; color: var(--faint); font-size: 13.5px; }
.mind-foot-actions { display: flex; gap: 8px; align-items: center; }
.mind-skeleton { height: 58px; border-radius: 16px; background: linear-gradient(90deg, var(--surface), var(--bg-2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.kept-note b.gold { color: var(--gold); }
.confirm-actions button { white-space: nowrap; }

/* touch screens: no sticky hover after a tap */
@media (hover: none) {
  .primary:hover { background: var(--accent); }
  .primary.danger:hover { background: var(--danger); }
  .ask-btn:hover { transform: none; background: var(--accent); }
  .keep:not(.is-kept):hover { background: transparent; color: var(--accent); }
  .ghost:hover { color: var(--muted); border-color: var(--line-2); }
  .chip:hover { border-color: var(--line-2); color: var(--muted); background: transparent; transform: none; }
  .mi:hover, .daily:hover, .next:hover, .src:hover { transform: none; }
  .mi:hover { border-color: var(--line); }
  .mi.yours:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
  .next:hover { border-color: var(--line); }
  .src:hover { border-color: var(--line); }
  .src.is-used:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
  .icon-btn:hover { background: transparent; border-color: transparent; color: var(--muted); }
  .mind-btn:hover { border-color: var(--line-2); }
  .mind-btn.is-on:hover { border-color: var(--accent); }
}
