/* STILL web — app-specific tokens (shared palette via design-system.css) */
:root {
  --bone: #E7CFC5;
  --ink-night: #EEDAD2;
  --line: #DFC4B8; /* ponytail: opaque override — design-system uses rgba for dark pages, app needs opaque on cream */
  --danger: #8B2020;
  --lilac: #D9D7EA;
  --sage: #DCE0D2;
  --teal-deep: #4D6A6E;
  --plum: #5B5770;
  --maroon-deep: #65393A;
  --rose: #C89393;
  --enter: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 600ms ease;
}
body.dark { background: var(--night); color: var(--ink-night); }

@keyframes orbIn { from { opacity: 0; transform: scale(0.55); } to { opacity: 1; transform: scale(1); } }
@keyframes centreFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---- header (app overrides — layout via .still-header in design-system) ---- */
.still-header { position: relative; z-index: 60; }
.still-header > button.wordmark { border: none; cursor: pointer; }
body.dark .still-header--bordered { border-color: var(--line-light); }

.hdr-nav-narrow { display: none; }
@media (max-width: 720px) {
  .hdr-nav-wide { display: none; }
  .hdr-nav-narrow { display: block; position: relative; }
  .hdr-nav-narrow > summary {
    list-style: none; cursor: pointer; font-size: 22px; line-height: 1; padding: var(--space-1); opacity: 0.7;
  }
  .hdr-nav-narrow > summary::-webkit-details-marker { display: none; }
  .hdr-nav-panel {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 70;
    background: var(--card); border: 1px solid var(--line); border-radius: 0;
    padding: var(--space-1) 0; display: flex; flex-direction: column; gap: 0;
    min-width: 190px; box-shadow: 0 12px 32px -16px rgba(0,0,0,0.25);
    font-size: var(--nav-link-size); font-weight: 600;
    letter-spacing: var(--nav-tracking); text-transform: uppercase;
  }
  .hdr-nav-panel button,
  .hdr-nav-panel .jar-menu > summary {
    padding: var(--space-2) var(--space-4); text-align: left; border-radius: 0;
    background: none; border: none; color: inherit; cursor: pointer;
    font: inherit; letter-spacing: inherit; text-transform: inherit;
  }
  .hdr-nav-panel button:hover { background: rgba(70,26,27,0.04); }
  body.dark .hdr-nav-panel { background: var(--night); border-color: var(--line-light); }
  body.dark .hdr-nav-panel button:hover { background: rgba(238,218,210,0.06); }
}

.jar-menu { position: relative; }
.jar-menu > summary { list-style: none; cursor: pointer; }
.jar-menu > summary::-webkit-details-marker, .jar-menu > summary::marker { display: none; }
.jar-badge {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--clay); margin-left: 6px; vertical-align: middle;
}
.jar-menu-panel {
  display: none; position: absolute; top: calc(100% + 10px); right: 0; z-index: 70;
  background: var(--card); border: 1px solid var(--line); border-radius: 0;
  padding: var(--space-1) 0; flex-direction: column; gap: 0; min-width: 170px;
  box-shadow: 0 12px 32px -16px rgba(0,0,0,0.25);
}
.jar-menu-panel button { padding: var(--space-2) var(--space-4); text-align: left; border-radius: 0; opacity: 0.8; white-space: nowrap; }
.jar-menu-panel button:hover { background: rgba(70,26,27,0.04); }
.jar-menu:hover .jar-menu-panel, .jar-menu[open] .jar-menu-panel { display: flex; }
body.dark .jar-menu-panel { background: var(--night); border-color: rgba(238,218,210,0.2); }
body.dark .jar-menu-panel button:hover { background: rgba(238,218,210,0.06); }

/* ---- wheel ---- */
.wheel-main {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--header-min-h)); overflow: hidden;
  padding: var(--space-6) 0 var(--space-6);
}
.wheel-above {
  text-align: center; padding: 0 var(--space-4); animation: centreFade 460ms ease both;
  margin-bottom: var(--space-5); position: relative; z-index: 10;
}
.wheel-below {
  text-align: center; animation: centreFade 460ms 200ms ease both;
  margin-top: var(--space-5); position: relative; z-index: 10;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.wheel-stage { position: relative; width: 630px; height: 630px; }
.wheel-scale { transform-origin: center center; }
/* pointer-events none so overlapping orb boxes never swallow a neighbour's
   hit circle — the .orb-hit gets explicit inline pointer-events from JS */
.orb { position: absolute; width: 900px; height: 900px; pointer-events: none; }
.orb-enter { position: absolute; inset: 0; pointer-events: none; animation: orbIn 0.7s var(--enter) both; }
.orb-dim { position: absolute; inset: 0; transform-origin: center; transition: opacity 320ms ease, transform 3.6s var(--enter); }
.orb-layer { position: absolute; inset: 0; border-radius: 50%; }
.orb-base { filter: blur(50px); }
.orb-core {
  -webkit-mask-image: radial-gradient(circle at center, #000 0%, rgba(0,0,0,0.8) 20%, transparent 60%);
  mask-image: radial-gradient(circle at center, #000 0%, rgba(0,0,0,0.8) 20%, transparent 60%);
}
.orb-hit {
  position: absolute; left: 50%; top: 50%; width: 176px; height: 176px;
  transform: translate(-50%, -50%); border-radius: 50%; cursor: pointer; z-index: 6;
  pointer-events: auto; /* parent .orb is pointer-events:none; this opts the hit circle back in */
}
.wheel-labels { position: absolute; inset: 0; pointer-events: none; z-index: 60; transition: opacity 320ms ease; }
.wheel-labels text {
  font-family: var(--serif); font-size: 28px; letter-spacing: 0.12em;
  fill: rgba(70, 26, 27, 0.80);
}
.flood { position: absolute; inset: -60px; pointer-events: none; z-index: 5; opacity: 0; transition: opacity 700ms ease; }
.wheel-centre {
  position: absolute; inset: 0; display: grid; place-items: center;
  z-index: 70; pointer-events: none; text-align: center;
}
.wheel-centre > div { pointer-events: auto; animation: centreFade 460ms ease both; max-width: 400px; }
.rest-title { font-family: var(--serif); font-style: italic; font-size: 44px; color: var(--ink); }
.hover-name { font-family: var(--serif); font-style: italic; font-size: 42px; }
.hover-caption { font-family: var(--serif); font-size: 17px; margin-top: var(--space-1); }
.select-name { font-family: var(--serif); font-style: italic; font-size: 48px; }
.select-caption { font-family: var(--serif); font-size: 17px; color: rgba(70,26,27,0.72); margin-top: var(--space-2); }
.rest-sub { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: rgba(70,26,27,0.72); margin: var(--space-2) auto 0; max-width: 300px; text-wrap: pretty; }
body.dark .rest-sub { color: rgba(238,218,210,0.6); }
.just-write {
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; background: none; border: none; border-bottom: 1px solid currentColor;
  color: rgba(70,26,27,0.7); cursor: pointer; padding: 4px 2px;
}

/* ---- flow screens ---- */
.flow-main { position: relative; min-height: calc(100vh - var(--header-min-h)); display: grid; place-items: center; padding: var(--space-4) 0 var(--space-8); }
.flow-glow { position: fixed; inset: -20%; pointer-events: none; z-index: 0; }
.flow-col { position: relative; z-index: 10; width: min(600px, 92vw); animation: centreFade 500ms ease both; }
.back-btn {
  position: absolute; top: 6px; left: 40px; z-index: 30;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  background: none; border: none; color: inherit; opacity: 0.7; cursor: pointer;
}
@media (max-width: 560px) { .back-btn { left: 20px; } }
.discard-btn {
  position: absolute; top: 2px; right: 40px; z-index: 30;
  font-size: 17px; line-height: 1; background: none; border: none; color: inherit;
  opacity: 0.28; cursor: pointer; padding: 6px;
}
.discard-btn:hover { opacity: 0.75; }
@media (max-width: 560px) { .discard-btn { right: 20px; } }

.kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; }
.flow-title { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 31px; line-height: 1.15; margin-top: var(--space-2); text-wrap: pretty; }
.body-serif { font-family: var(--serif); font-size: 22px; line-height: 1.6; text-wrap: pretty; }
.body-muted { font-family: var(--serif); font-size: 18px; line-height: 1.6; opacity: 0.65; margin-top: var(--space-2); white-space: pre-wrap; }
.loading-line { font-family: var(--serif); font-style: italic; font-size: 18px; opacity: 0.6; margin-top: var(--space-4); }
.kicker + .body-serif, .kicker + .body-serif.markable { margin-top: var(--space-4); }
.flow-title + .card-sub { margin-top: var(--space-2); }

.flow-ta {
  width: 100%; min-height: 220px; margin-top: var(--space-4);
  font-family: var(--serif); font-size: 21px; line-height: 1.6;
  background: transparent; border: none; outline: none; resize: vertical;
  color: inherit; caret-color: var(--clay);
}
.flow-ta::placeholder { color: rgba(146,116,110,0.7); }
body.dark .flow-ta::placeholder { color: rgba(238,218,210,0.35); }

.editable-card {
  width: 100%; min-height: 140px; margin-top: var(--space-2);
  font-family: var(--serif); font-size: 20px; line-height: 1.6;
  background: var(--card); border: 1px solid transparent; border-radius: 0;
  padding: var(--space-3) var(--space-4); color: var(--ink); resize: vertical;
}
body.dark .editable-card { background: rgba(238,218,210,0.045); border-color: transparent; color: var(--ink-night); }

/* ---- cards ---- */
.cards { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-5); }
.choice-card {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid transparent; border-radius: 0;
  padding: var(--space-3) var(--space-4); color: inherit; font-family: var(--sans);
  transition: transform 160ms ease, border-color 220ms ease, background 220ms ease;
}
.choice-card:hover { transform: translateY(-2px); border-color: #CBA79B; }
body.dark .choice-card { background: rgba(238,218,210,0.045); border-color: transparent; }
body.dark .choice-card:hover { border-color: rgba(238,218,210,0.45); }
.card-label { font-size: 17px; font-weight: 600; }
.card-sub { font-size: 13.5px; opacity: 0.7; margin-top: 2px; }
.choice-card.selected { border-color: var(--clay); }
.choice-card .tick { float: right; font-size: 15px; color: var(--clay); }
.choice-card.static { cursor: default; }
.choice-card.static:hover { transform: none; border-color: transparent; }
body.dark .choice-card.static:hover { border-color: transparent; }
/* Love Jar shares that arrived since the recipient's last visit — a slightly
   warmer card, only until the next time the page is opened. */
.choice-card.jar-fresh, .choice-card.static.jar-fresh:hover { background: #FFF3EB; border-color: #CBA79B; }
body.dark .choice-card.jar-fresh, body.dark .choice-card.static.jar-fresh:hover { background: rgba(238,218,210,0.09); border-color: rgba(238,218,210,0.4); }
.jar-group-kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; }

.suggestion-row.resolved { opacity: 0.55; }
.suggestion-btn {
  width: 38px; height: 38px; border-radius: 50%; font-size: 15px; line-height: 1;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; color: inherit;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease;
}
.suggestion-btn:hover { transform: translateY(-1px); }
.suggestion-btn.accept { color: #4B7A52; border-color: #A9C1AC; }
.suggestion-btn.accept:hover { background: #A9C1AC; color: #fff; }
.suggestion-btn.dismiss { color: var(--faint); }
.suggestion-btn.dismiss:hover { background: var(--line); }
body.dark .suggestion-btn { background: rgba(238,218,210,0.045); border-color: rgba(238,218,210,0.2); }

/* ---- buttons ---- */
.row { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-5); flex-wrap: wrap; }
.btn {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; cursor: pointer; border-radius: 0;
  padding: 14px 26px; min-height: 44px; border: 1px solid transparent;
  transition: opacity 160ms ease, background 160ms ease, transform 160ms ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--clay-hover); color: #fff; }
.btn-primary:hover { background: #884530; }
.btn-secondary { background: transparent; border-color: currentColor; color: inherit; }
.btn-ghost { background: none; border: none; color: inherit; opacity: 0.7; }
.btn-ghost:hover { opacity: 1; }
.btn-mood { color: #fff; }
/* "Continue with Google" — full width, quiet, sits under its own divider. */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: var(--cream); border-color: var(--line); color: var(--ink);
}
.btn-google:hover { border-color: currentColor; }
.oauth-divider {
  display: flex; align-items: center; gap: 14px; margin: 22px 0 16px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.5;
}
.oauth-divider::before, .oauth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* mic */
.mic-row { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.mic-btn {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  background: none; border: 1px solid currentColor; border-radius: 0; color: inherit;
  opacity: 0.7; cursor: pointer; padding: var(--space-1) var(--space-3);
}
.mic-btn.listening { opacity: 1; color: var(--clay); border-color: var(--clay); }
.mic-hint { font-size: 12px; opacity: 0.5; }

/* ---- auth ---- */
.auth-col { width: min(480px, 92vw); margin: 4vh auto var(--space-7); position: relative; z-index: 10; animation: centreFade 500ms ease both; }
.auth-title { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1.25; text-wrap: pretty; }
.auth-card { background: var(--card); border: 1px solid transparent; border-radius: 0; padding: var(--space-5); margin-top: var(--space-5); }
label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; margin: var(--space-3) 0 var(--space-1); }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; padding: 14px 0; font-family: var(--serif); font-size: 17px;
  background: transparent; border: none; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink);
  transition: border-color var(--transition-fast);
}
input:focus { outline: none; border-bottom-color: var(--clay); }
input:focus-visible { outline: 3px solid var(--clay); outline-offset: 5px; }
body.dark input[type="text"], body.dark input[type="email"], body.dark input[type="password"] {
  color: var(--ink-night); border-bottom-color: rgba(238,218,210,0.2);
}
body.dark input:focus { border-bottom-color: var(--clay); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 68px; padding-left: 0; }
.pw-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 6px 8px;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--clay);
}
.pw-toggle:hover { color: var(--ink); }
.checkbox-row { display: flex; gap: var(--space-2); align-items: flex-start; margin: var(--space-2) 0; }
.checkbox-row input { width: 20px; height: 20px; margin-top: 4px; flex-shrink: 0; accent-color: var(--clay); }
.checkbox-row label { font-size: 14.5px; font-weight: 400; letter-spacing: normal; text-transform: none; opacity: 1; margin: 0; }
.error { color: var(--danger); font-size: 14px; margin-top: var(--space-2); min-height: 20px; }
.fine { font-size: 13px; opacity: 0.72; margin-top: var(--space-4); line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
hr.rule { border: none; border-top: 1px solid var(--line); margin: var(--space-4) 0; }
.section-break { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.safety-box { border-left: 3px solid var(--danger); padding: 4px 0 4px 20px; margin-top: var(--space-4); }
.safety-box p { margin-top: var(--space-2); font-size: 15.5px; }
.safety-box table { border-collapse: collapse; margin-top: var(--space-2); font-size: 15.5px; }
.safety-box td { padding: var(--space-1) var(--space-3) var(--space-1) 0; vertical-align: top; }

/* ---- threads ---- */
/* List-screen grid — shared container for Table, Vault, Jar, History.
   .threads-col kept as alias until screens migrate in Phase 2.3. */
.list-col, .threads-col {
  width: min(600px, 92vw); margin: var(--space-6) auto var(--space-8);
  position: relative; z-index: 10; animation: centreFade 500ms var(--ease) both;
}

/* Row override inside cards — tighter than the default --space-5 */
.choice-card .row, .synth-card .row { margin-top: var(--space-2); }

/* Back button inline (inside flow column, not absolute-positioned) */
.back-btn.inline { position: static; margin-bottom: var(--space-3); }

/* CTA card — the primary action card (e.g. "Bring something to the table") */
.choice-card.cta { margin-top: var(--space-3); border-color: var(--clay); background: rgba(181,102,76,0.06); }

/* Archived card — dimmed */
.choice-card.archived { opacity: 0.7; }

/* Crosslink — bottom-of-section link with hairline above */
.crosslink { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }

/* Inline text-link button (reset inside prose) */
.text-btn { background: none; border: none; padding: 0; color: var(--clay); font: inherit; cursor: pointer; text-decoration: underline; }

/* Prompt lines (weekly lines on Table) */
.prompt-lines { margin-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }

/* Danger card + button */
.synth-card.danger { border-color: var(--rose); }
.synth-card.danger .kicker { color: var(--danger); opacity: 1; }
.btn.danger { color: var(--danger); opacity: 1; }
.thread-meta { font-size: 13px; opacity: 0.55; margin-top: 3px; }
.pill {
  display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 0; background: rgba(181,102,76,0.12); color: var(--clay); margin-left: 10px;
}
.synth-card { background: var(--card); border: 1px solid transparent; border-radius: 0; padding: var(--space-4); margin-top: var(--space-4); }
body.dark .synth-card { background: rgba(238,218,210,0.05); border-color: transparent; }

/* jar mirror card inside the rant flow */
.jar-mirror { border-color: rgba(200,147,147,0.55); }

/* jar status */
.jar-status-btn { padding: 8px 16px; min-height: 0; font-size: 11px; }
.jar-status-btn.active { opacity: 1; color: var(--clay); border: 1px solid var(--clay); }
.mistake-link {
  display: block; margin-top: 10px; background: none; border: none; color: inherit;
  font-family: var(--sans); font-size: 12px; opacity: 0.7; cursor: pointer; text-decoration: underline;
}
.mistake-link:hover { opacity: 0.85; }

/* selects (user area) */
select {
  width: 100%; padding: 14px 0; font-family: var(--serif); font-size: 17px;
  background: transparent; border: none; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink);
  transition: border-color var(--transition-fast);
}
select:focus { outline: none; border-bottom-color: var(--clay); }
select:focus-visible { outline: 3px solid var(--clay); outline-offset: 5px; }

/* collapsed context ("what you said before") + session history */
.context-details { margin-top: var(--space-3); }
.context-details summary, .history-item summary {
  cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; opacity: 0.7;
}
.history-item { border-top: 1px solid var(--line); padding: var(--space-3) 0; }
.history-item summary { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 15px; opacity: 0.85; }
.entry-block { border-top: 1px solid var(--line); padding: var(--space-3) 0; }
.entry-body { font-family: var(--serif); font-size: 17px; line-height: 1.65; white-space: pre-wrap; }
.invite-code {
  font-family: var(--serif); font-size: 30px; letter-spacing: 0.35em; text-align: center;
  padding: var(--space-4); background: rgba(181,102,76,0.08); border-radius: 0; margin: var(--space-3) 0; user-select: all;
}

/* ---- mark bar (highlight-to-keep: Vault / Love Jar) ---- */
.mark-bar {
  position: fixed; z-index: 120; display: flex; align-items: center; gap: 2px;
  background: var(--ink); border-radius: 0; padding: var(--space-1);
  box-shadow: 0 6px 24px rgba(44, 23, 24, 0.28);
  animation: centreFade 160ms ease both;
}
.mark-bar button {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; background: none; border: none; color: var(--cream);
  cursor: pointer; padding: 4px var(--space-2); white-space: nowrap;
}
.mark-bar button:hover { color: #fff; }
.mark-sep { width: 1px; align-self: stretch; background: rgba(238,218,210,0.3); }
.markable::selection, .markable *::selection { background: rgba(181,102,76,0.3); }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%);
  font-family: var(--serif); font-style: italic; font-size: 15px;
  background: var(--ink); color: var(--cream);
  padding: var(--space-2) var(--space-4); border-radius: 0; z-index: 100;
  animation: centreFade 300ms ease both;
}
body.dark .toast { background: var(--ink-night); color: var(--night); }

@media (max-width: 700px) {
  .rest-title { font-size: 32px; }
  .wheel-above { margin-bottom: var(--space-4); }
  .wheel-below { margin-top: var(--space-4); }
  .flow-title { font-size: 26px; }
  .body-serif { font-size: 19px; }
}