/* sårda — a blank page with one question on it.
   The system is documented in docs/DESIGN-SYSTEM.md. Change tokens there and here together. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,300..700,0..100,0..1;1,9..144,300..700,0..100,0..1&family=Inter:wght@400;500;600&display=swap');

:root {
  --paper: #ffffff;
  --ink: #17171a;
  --graphite: #62626b;
  --placeholder: #76767f;
  --line: #e8e7e2;
  --line-strong: #c9c8c2;
  --wash: #f6f5f1;
  --marigold: #ffd44a;
  --marigold-pale: #ffedb3;
  --marigold-deep: #f5a800;
  --tomato: #d23b1f;
  /* Fraunces is always set soft: SOFT 100, WONK 1. See the rule under Base. */
  --serif: 'Fraunces', Georgia, serif;
  --soft: 'SOFT' 100, 'WONK' 1;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 28px;
  --tabbar: 64px;
  --measure: 760px;
}

/* Base */
* { box-sizing: border-box; }
/* The font shorthand resets variation settings, so the soft cut is applied to
   every element rather than inherited. Inter has neither axis and ignores it. */
*, ::before, ::after, ::placeholder { font-variation-settings: var(--soft) !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
a { color: inherit; text-underline-offset: 4px; }
input:focus, textarea:focus { outline: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
h1 { font-size: 52px; line-height: 1; letter-spacing: -.025em; }
h2 { font-size: 22px; font-style: italic; font-weight: 400; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.25; }
p { margin: 0; }
button svg, [data-icon] svg { width: 16px; height: 16px; display: block; flex-shrink: 0; }
[data-icon] { display: inline-flex; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* Whimsy, rationed: one highlighter stroke, crayon punctuation, one loud word. */
.hl { background: linear-gradient(transparent 62%, var(--marigold) 62%, var(--marigold) 92%, transparent 92%); padding: 0 .06em; margin: 0 -.06em; }
.crayon { color: var(--tomato); }
.loud { font: 600 clamp(96px, 30vw, 132px)/.9 var(--serif); letter-spacing: -.04em; }

/* Labels and quiet text */
.eyebrow, .field-label { display: block; font: 600 13px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); margin: 0; }
.field-label { margin: 20px 0 4px; }
.field-help { font-size: 14px; color: var(--graphite); margin: 8px 0 0; }
.muted { font-size: 14px; color: var(--graphite); white-space: nowrap; }

/* Buttons */
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 16px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.primary-button { background: var(--ink); color: var(--paper); }
.primary-button:hover:not(:disabled) { background: #000; }
.secondary-button { background: var(--paper); color: var(--ink); min-height: 48px; padding: 0 22px; }
.secondary-button:hover:not(:disabled) { background: var(--wash); }
.text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 500; text-align: left; text-decoration: underline; text-underline-offset: 4px; }
.text-button svg.diagonal { transform: rotate(-45deg); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 24px; line-height: 1; }
.icon-button:hover { background: var(--wash); }

/* Shell and navigation: bottom tabs on phones, top bar on wider screens. */
.app-shell { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter) calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
.brand { display: none; align-items: center; font: 600 22px/1 var(--serif); letter-spacing: -.01em; text-decoration: none; min-height: 44px; }
.brand-mark { display: none; }
.brand-dot { color: var(--tomato); }
.tab-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-between; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 1px solid var(--line); }
.nav-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px; border: 0; background: none; font-size: 15px; font-weight: 500; color: var(--graphite); }
.nav-tab.active { color: var(--ink); font-weight: 600; }
.nav-tab.active > span:first-child { background: linear-gradient(transparent 62%, var(--marigold) 62%); padding: 0 3px; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tomato); }
main { max-width: var(--measure); margin: 0 auto; padding-top: max(40px, env(safe-area-inset-top, 0px)); min-height: 70vh; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 14px 16px; margin-bottom: 20px; background: var(--wash); border-radius: 12px; font-size: 15px; }
.notice a { font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 12px); transform: translateX(-50%); z-index: 30; width: max-content; max-width: min(90vw, 480px); padding: 12px 18px; background: var(--ink); color: var(--paper); border-radius: 12px; font-size: 15px; }
.journal-footer, .login-footer, .legal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; max-width: var(--measure); margin: 64px auto 0; padding: 12px 0 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--graphite); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Today */
.intro-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 14px; font-weight: 500; color: var(--graphite); }
.streak-link { min-height: 44px; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 500; color: var(--graphite); }
.streak-link:hover { color: var(--ink); }
.today-kept { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); }
/* Story or thought: a small ink pill under the date. The chosen word takes the tomato full stop. */
.kind-switch { display: inline-flex; margin-top: 12px; padding: 3px; border: 1.5px solid var(--ink); border-radius: 999px; }
.kind-tab { height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: none; font: 500 17px/1 var(--serif); font-variation-settings: 'opsz' 24, var(--soft) !important; color: var(--ink); }
.kind-tab > span { position: relative; display: inline-block; transform: translateY(-1px); }
.kind-dot { position: absolute; left: 100%; color: transparent; }
.kind-tab[aria-selected='true'] { background: var(--ink); color: var(--paper); }
.kind-tab[aria-selected='true'] .kind-dot { color: var(--tomato); }
.kind-tab:focus-visible { outline-offset: 5px; }
.thought-note { margin-top: 14px; font-size: 13px; color: var(--graphite); }
.prompt { margin-top: 24px; font-size: clamp(52px, 15.5vw, 64px); line-height: .98; }
.journal-paper { display: flex; flex-direction: column; margin-top: 32px; }
.journal-paper textarea { display: block; width: 100%; min-height: 34vh; min-height: 34dvh; padding: 0; border: 0; resize: none; background: transparent; font-size: 20px; line-height: 1.5; field-sizing: content; }
/* Where the field grows with its words, it starts as one underlined line. */
@supports (field-sizing: content) { .journal-paper textarea { min-height: 60px; } }
.journal-paper textarea:placeholder-shown { text-indent: 10px; }
.story-writing { padding-bottom: 10px; border-bottom: 1.5px solid var(--ink); }
/* The keyboard focus ring stands in for the underline, so the field never carries both. */
.story-writing:has(textarea:focus-visible) { border-bottom-color: transparent; }
.field-caret { display: none; position: absolute; left: 0; top: 2px; width: 2px; height: 26px; border-radius: 1px; background: var(--tomato); animation: caret-blink 1.1s steps(1) infinite; }
.story-writing.is-empty:not(:focus-within) .field-caret { display: block; }
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.story-writing { position: relative; }
#story-highlights { position: absolute; top: 0; left: 0; box-sizing: border-box; overflow: hidden; pointer-events: none; color: transparent; white-space: pre-wrap; overflow-wrap: break-word; }
#story-text { position: relative; z-index: 1; }
.known-mention { color: transparent; background: linear-gradient(transparent 50%, var(--marigold-pale) 50%, var(--marigold-pale) 92%, transparent 92%); padding: 0; }
.paper-bottom { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; background: var(--paper); }
/* An empty page offers the outline; the first word fills it with ink. */
.keep-button.is-empty:not(:disabled) { background: var(--paper); color: var(--ink); }
.paper-bottom > span { font-size: 14px; color: var(--graphite); }
.under-paper { min-height: 20px; font-size: 13px; color: var(--graphite); }
.compose-connection { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--graphite); }
.compose-connection strong { font-weight: 600; color: var(--ink); }
/* Once something is kept, its word takes the prompt's place. A story earns the loud one; a thought is kept quietly. */
.writing-column:has(.saved-paper:not(.hidden)) :is(.prompt, .kind-switch) { display: none; }
.quiet-kept { font: italic 400 64px/.95 var(--serif); letter-spacing: -.03em; margin: 12px 0 14px; }
.saved-line { font-size: 20px; line-height: 1.4; }
.mentioned { display: flex; flex-direction: column; gap: 12px; margin-top: 40px; }
.mentioned-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mentioned-row .connection-labels { margin-top: 0; }
.mentioned-row .muted { white-space: normal; }
.wash-row.plain-row::before { content: none; }
/* Later the same day: what is already kept sits under the page. */
.kept-today { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.kept-today-list { display: flex; flex-direction: column; margin-top: 4px; }
.kept-row { display: flex; align-items: baseline; gap: 14px; width: 100%; min-height: 44px; padding: 8px 0; border: 0; background: none; text-align: left; }
.kept-time { flex-shrink: 0; min-width: 62px; font-size: 14px; color: var(--graphite); white-space: nowrap; }
.kept-row:hover .card-text { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.writing-column:has(.saved-paper:not(.hidden)) ~ .kept-today { display: none; }
.saved-paper { padding-top: 28px; }
.saved-paper .loud { margin: 0 0 12px; font-style: normal; }
#saved-description { font-size: 20px; line-height: 1.4; }
.saved-connections { margin-top: 32px; }
.saved-connections:empty { display: none; }
.wash-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; margin-top: 20px; padding: 8px 16px; border: 0; border-radius: 12px; background: var(--wash); font-size: 15px; text-align: left; }
.wash-row::before { content: ''; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--tomato); }
.wash-row::after { content: '›'; margin-left: auto; font-size: 22px; line-height: 1; }
.saved-actions { display: flex; align-items: center; gap: 20px; margin-top: 32px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Story rows */
.story-grid { display: flex; flex-direction: column; }
.story-card { display: flex; gap: 16px; width: 100%; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.story-card:last-child { border-bottom: 0; }
.card-date { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; width: 48px; }
.card-date strong { font: 500 30px/1 var(--serif); }
.card-date small { font-size: 13px; color: var(--graphite); }
.card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.card-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.story-card:hover .card-text { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.card-bottom { font-size: 13px; color: var(--graphite); overflow-wrap: anywhere; }
/* A thought in the timeline: greyer, smaller, in the italic serif. */
.thought-card { padding: 14px 0; color: var(--graphite); }
.thought-card .card-text { font: italic 400 15px/1.45 var(--serif); }
.thought-card .card-date strong { font: 400 22px/1.2 var(--serif); }
.month-group + .month-group { margin-top: 20px; }
.month-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 16px; }
.month-heading span { font: 400 14px/1.4 var(--sans); color: var(--graphite); }
.month-group .story-card:last-child { border-bottom: 0; }
.library-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; min-height: 44px; margin-top: 12px; }
.filter-chips { display: flex; gap: 6px; }
.filter-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; font-size: 14px; font-weight: 500; color: var(--ink); }
.filter-chip.active { border-color: var(--ink); background: var(--ink); color: var(--paper); font-weight: 600; }
.filter-chip, #jot-thought { position: relative; }
.filter-chip::after { content: ''; position: absolute; inset: -4px 0; }
#jot-thought { font-size: 14px; white-space: nowrap; }
.empty-collection { padding: 28px 0; }
.empty-icon { display: none; }
.empty-collection h3 { font: italic 400 22px/1.25 var(--serif); margin-bottom: 6px; }
.empty-collection p { font-size: 15px; color: var(--graphite); }

/* Stories and People */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
[data-mode='stories'] .people-head, [data-mode='stories'] .collection-nav, [data-mode='people'] .stories-head { display: none; }
.collection-tab[data-collection='stories'] { display: none; }
.segmented, .collection-nav { display: inline-flex; gap: 4px; max-width: 100%; padding: 4px; background: var(--wash); border-radius: 999px; overflow-x: auto; }
.collection-nav { margin-bottom: 12px; }
.segment, .collection-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-size: 14px; font-weight: 500; color: var(--graphite); white-space: nowrap; }
.segment.active, .collection-tab.active { background: var(--paper); color: var(--ink); font-weight: 600; }
.quiet-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--tomato); color: var(--paper); font-size: 12px; font-weight: 600; }
.library-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 8px; }
.search-field { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; min-height: 48px; border-bottom: 1px solid var(--ink); }
.search-field svg { width: 18px; height: 18px; }
.search-field input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; font-size: 17px; }
.collection-intro { font-size: 15px; color: var(--graphite); margin: 12px 0 4px; }
.collection-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin: 12px 0 4px; }
.collection-meta .collection-intro { flex: 1 1 240px; margin: 0; }
.connection-sort-control { display: flex; align-items: center; gap: 8px; max-width: 100%; font-size: 14px; color: var(--graphite); }
.connection-sort-control select { min-height: 44px; min-width: 0; max-width: 100%; padding: 0 4px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: none; font-size: 16px; color: var(--ink); }
.connections-grid { display: flex; flex-direction: column; }
.entity-card { display: flex; width: 100%; padding: 18px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.entity-card:last-child { border-bottom: 0; }
.entity-card-mark, .entity-card > svg { display: none; }
.entity-card-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 16px; flex: 1; min-width: 0; }
.entity-card-body > strong { grid-column: 1; grid-row: 1; font: 500 32px/1.1 var(--serif); letter-spacing: -.015em; overflow-wrap: anywhere; }
.entity-card-body > small { grid-column: 2; grid-row: 1; font-size: 14px; color: var(--graphite); white-space: nowrap; }
.entity-card-context { grid-column: 1 / -1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; font-size: 14px; color: var(--graphite); overflow-wrap: anywhere; }
.entity-card:hover strong { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 4px; text-underline-offset: 6px; }

/* To clarify */
.clarification-list { display: flex; flex-direction: column; }
.clarification-card { padding: 24px 0 20px; border-bottom: 1px solid var(--line); }
.clarification-card:last-child { border-bottom: 0; }
.clarification-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clarification-card h3 { margin: 4px 0 16px; font-size: clamp(44px, 13vw, 64px); line-height: .98; letter-spacing: -.03em; overflow-wrap: anywhere; }
.clarification-excerpt { margin-bottom: 8px; font: 400 19px/1.4 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.clarification-candidates, .connection-matches { display: flex; flex-direction: column; }
.candidate-button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; width: 100%; min-height: 68px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.candidate-button strong { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.candidate-button span { font-size: 14px; color: var(--graphite); overflow-wrap: anywhere; }
.candidate-button:hover strong { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.clarification-actions { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 8px; }
.clarification-deferred { opacity: .6; }

/* Calendar: a deeper marigold means more stories that day. */
.calendar-nav { display: flex; align-items: center; justify-content: space-between; }
.calendar-nav h2 { font-size: 28px; }
.calendar-arrows { display: flex; margin-right: -10px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-items: center; }
.calendar-weekdays { margin: 12px 0 8px; font-size: 13px; font-weight: 500; color: var(--graphite); }
.calendar-grid { row-gap: 4px; }
.calendar-day { width: min(44px, 100%); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 16px; color: var(--graphite); }
.calendar-day.has-story { color: var(--ink); font-weight: 600; }
.count-1 { background: var(--marigold-pale); }
.count-2 { background: var(--marigold); }
.count-3 { background: var(--marigold-deep); }
.calendar-day.is-today { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
.calendar-day.selected { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.calendar-day:disabled { opacity: .35; }
.calendar-key { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--graphite); }
.calendar-key > span { display: inline-flex; align-items: center; gap: 6px; }
.key-dot { width: 14px; height: 14px; border-radius: 50%; }
.calendar-side { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.calendar-side > h2 { font: 600 13px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }

/* Pages and sheets: full height on phones, a centred panel on wider screens. */
dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: max(16px, env(safe-area-inset-top, 0px)) var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 0; background: var(--paper); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgba(23, 23, 26, .45); }
dialog.connection-dialog { height: auto; max-height: 90vh; max-height: 90dvh; margin: auto 0 0; padding-top: 16px; border-radius: 24px 24px 0 0; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.dialog-top .icon-button { margin-right: -10px; font-size: 30px; }
.detail-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.detail-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-intro { font-size: 14px; color: var(--graphite); margin: 0 0 12px; }
.section-spark { display: none; }
.provenance { font-size: 13px; color: var(--graphite); text-align: right; }

/* One story: your words first. */
.detail-date { margin: 12px 0 16px; font-size: 14px; font-weight: 500; color: var(--graphite); }
.original-section { display: flex; flex-direction: column-reverse; gap: 12px; }
.original-section .detail-section-heading { min-height: 0; }
.original-section h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.original-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--graphite); }
.original-label svg { width: 12px; height: 12px; }
.detail-text { font: 400 22px/1.4 var(--serif); letter-spacing: -.005em; white-space: pre-wrap; overflow-wrap: anywhere; }
/* One thought: the same page in the italic, with no summary or notes, and a way to make it a story. */
[data-kind='thought'] .detail-text { font-style: italic; line-height: 1.42; }
[data-kind='thought'] :is(.summary-section, .annotations-section) { display: none; }
.promote-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 72px; margin-top: 24px; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.promote-row > span { display: flex; flex-direction: column; gap: 3px; }
.promote-row strong { font-size: 16px; font-weight: 600; }
.promote-row small { font-size: 14px; color: var(--graphite); }
[data-kind='thought'] .mementos-section { margin-top: 0; }
.promote-dialog h2 { margin: 12px 0 0; }
.promote-intro { margin-top: 12px; font-size: 16px; line-height: 1.5; }
.promote-days { min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
.promote-days legend { padding: 0; margin-bottom: 8px; }
.radio-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--line); cursor: pointer; }
.radio-row > span { display: flex; flex-direction: column; gap: 2px; }
.radio-row strong { font-size: 16px; font-weight: 500; }
.radio-row small { font-size: 14px; color: var(--graphite); }
.radio-row input { flex-shrink: 0; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--paper); appearance: none; -webkit-appearance: none; cursor: pointer; }
.radio-row input:checked { background: radial-gradient(var(--ink) 0 6px, transparent 6.5px); }
#promote-other { padding-bottom: 8px; }
.promote-dialog .saved-actions { margin-top: 20px; }
.detail-section textarea, .entity-form textarea { display: block; width: 100%; min-height: 96px; max-height: 420px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-size: 16px; line-height: 1.5; resize: vertical; }
.detail-section textarea:focus, .entity-form textarea:focus { border-color: var(--ink); }
.editor-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 10px; }
.character-count { font-size: 13px; color: var(--graphite); font-variant-numeric: tabular-nums; }
.character-count.over-limit { color: var(--tomato); }
.editor-error { margin-top: 12px; padding: 12px 14px; background: var(--wash); border-radius: 12px; font-size: 14px; color: var(--tomato); white-space: pre-wrap; overflow-wrap: anywhere; }
.editor-error details { margin-top: 8px; color: var(--ink); white-space: normal; }
.editor-error details summary { cursor: pointer; font-weight: 600; }
.editor-error details p { white-space: pre-wrap; }
.note-kind-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; color: var(--graphite); }
.note-kind-row select { min-height: 44px; max-width: 100%; padding: 0 4px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: none; font-size: 16px; }
.story-annotation { padding: 14px 0; border-bottom: 1px solid var(--line); }
.annotation-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--graphite); }
.annotation-kind { font-weight: 600; color: var(--ink); }
.annotation-meta time { margin-left: auto; }
.story-annotation p { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.annotation-form { margin-top: 16px; }
.story-annotations:empty + .annotation-form { margin-top: 0; }
.detail-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.detail-images:empty, .detail-documents:empty { display: none; }
.detail-images img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.detail-documents { display: grid; margin-top: 8px; }
.document-memento { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.document-memento > span:nth-child(2) { flex: 1; min-width: 0; }
.document-symbol { font-size: 22px; line-height: 1; }
.document-memento strong { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.document-memento small { font-size: 13px; color: var(--graphite); }
.document-download { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.document-download svg { width: 14px; height: 14px; transform: rotate(90deg); }
.memento-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 12px; }

/* People are round, places are square. */
.connection-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.connection-labels:empty { margin-top: 0; }
.connection-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px; padding: 4px 16px; border: 1px solid var(--ink); border-radius: 999px; background: none; font-size: 15px; font-weight: 500; text-align: left; overflow-wrap: anywhere; }
.connection-chip:hover { background: var(--wash); }
.connection-chip > span[aria-hidden] { display: none; }
.connection-chip small { font-size: 13px; font-weight: 400; color: var(--graphite); }
.connection-chip.place-chip { border-radius: 8px; }
.inline-clarify { min-height: 0; font-size: 14px; }
.connection-rows { margin: 8px 0; }
.connection-edit-row { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--line); }
.connection-edit-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.connection-edit-row > span > span[aria-hidden] { display: none; }
.connection-edit-row small { display: block; font-size: 13px; color: var(--graphite); }
.connection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 12px; }
.quiet-details { margin-top: 12px; font-size: 15px; }
.quiet-details > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; color: var(--graphite); cursor: pointer; list-style: none; }
.quiet-details > summary::-webkit-details-marker { display: none; }
.quiet-details > summary::before { content: '+'; width: 12px; font-size: 18px; }
.quiet-details[open] > summary::before { content: '−'; }
.version-list { display: grid; }
.version-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.version-item > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.version-item strong { font-size: 15px; font-weight: 600; }
.version-item time { font-size: 13px; color: var(--graphite); }
.version-item p { margin-top: 6px; font-size: 14px; color: var(--graphite); white-space: pre-wrap; overflow-wrap: anywhere; }
.version-item details { margin-top: 6px; font-size: 14px; }
.version-item details summary { cursor: pointer; min-height: 32px; }

/* One person or place */
.entity-title-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 16px; }
.entity-title-row h2 { flex: 1; min-width: 0; margin-top: 8px; font: 500 clamp(40px, 12vw, 72px)/.98 var(--serif); letter-spacing: -.03em; overflow-wrap: anywhere; }
.entity-description { margin-top: 14px; font-size: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.entity-aliases { margin-top: 6px; font-size: 14px; color: var(--graphite); }
.contact-details dl { margin: 0; }
.contact-details dl > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.contact-details dt { font-size: 13px; color: var(--graphite); }
.contact-details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.contact-details a { display: inline-flex; align-items: center; min-height: 44px; }
.entity-related-section, .entity-stories-section { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.entity-dialog .detail-section-heading h3 { font: italic 400 22px/1.2 var(--serif); }
.related-connection { display: inline-flex; align-items: center; max-width: 100%; }
.remove-related { width: 44px; height: 44px; margin-left: -4px; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 20px; color: var(--graphite); }
.remove-related:hover { background: var(--wash); color: var(--ink); }
.entity-story-list { display: flex; flex-direction: column; }
.entity-form .editor-bottom { margin-top: 24px; }
.entity-contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
.entity-duplicate-matches { margin: 12px 0 20px; }
.entity-duplicate-matches .candidate-button { width: 100%; }
.entity-duplicate-matches svg { width: 14px; height: 14px; vertical-align: middle; }
/* On the map: a place's location, found quietly or chosen with search-as-you-type. */
.entity-location-field { margin-top: 4px; }
.location-search { position: relative; }
.entity-form .location-search input { padding-right: 4px; }
.location-results { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); max-height: 320px; overflow-y: auto; }
.location-option { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 60px; padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.location-option strong { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.location-option span { font-size: 14px; color: var(--graphite); overflow-wrap: anywhere; }
.location-option.active, .location-option:hover { background: var(--wash); }
.location-option.active strong { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.location-chosen { padding: 8px 0 4px; border-bottom: 1px solid var(--line); }
.location-link { display: inline-flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; color: var(--ink); text-decoration: none; }
.location-link strong { font-size: 17px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.location-link strong::after { content: ' ↗'; font-weight: 400; color: var(--graphite); }
.location-link span:not(.sr-only) { font-size: 14px; color: var(--graphite); overflow-wrap: anywhere; }
.location-source { display: block; font-size: 14px; color: var(--graphite); }
.location-source .text-button { min-height: 44px; font-size: 14px; }
.location-actions { display: flex; flex-wrap: wrap; gap: 0 20px; }
.entity-location { margin-top: 16px; }
.entity-location .eyebrow, .entity-birthday .eyebrow { margin-bottom: 2px; }
.location-status { margin: 0; font-size: 15px; color: var(--graphite); }
.location-status .text-button { min-height: 44px; }
.map-attribution { font-size: 13px; }
/* Date of birth: month and day, with the year left optional. */
.birthday-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.birthday-field legend { padding: 0; }
.birthday-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 0 16px; }
.birthday-part { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.birthday-part > span { font-size: 14px; color: var(--graphite); }
.birthday-part select { display: block; width: 100%; min-height: 48px; padding: 0; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; background: none; font-size: 17px; color: var(--ink); }
.entity-birthday { margin-top: 14px; font-size: 17px; }
.entity-birthday .eyebrow { display: inline; margin-right: 6px; }
.entity-merge-dialog > h2 { margin: 12px 0; font: 500 clamp(36px, 9vw, 52px)/1.05 var(--serif); letter-spacing: -.025em; }
.entity-merge-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.entity-merge-preview section { min-width: 0; border-top: 1px solid var(--line); padding-top: 12px; overflow-wrap: anywhere; }
.entity-merge-preview h3 { margin-bottom: 8px; color: var(--graphite); font-size: 13px; font-weight: 500; }
.entity-merge-preview strong { font: 500 26px/1.15 var(--serif); }
.entity-merge-preview p { margin-top: 8px; font-size: 14px; white-space: pre-wrap; }
.merge-contact-intro { margin: 20px 0 12px; font-size: 15px; }
#entity-merge-conflicts fieldset { min-width: 0; margin: 16px 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); }
#entity-merge-conflicts legend { padding-right: 12px; font-size: 14px; font-weight: 600; }
.merge-contact-choice { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; cursor: pointer; }
.merge-contact-choice input { flex: 0 0 20px; width: 20px; height: 20px; accent-color: var(--ink); }
.merge-contact-choice span { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.merge-contact-choice small { display: block; color: var(--graphite); font-size: 13px; }
#entity-merge-form .editor-bottom { margin-top: 24px; }

/* Fields: an underline, never smaller than 16px. */
.entity-form input, .connection-dialog input:not([type='radio']), .settings-dialog input:not([type='checkbox']), #email-signin-form input, .auth-page .auth-card input { display: block; width: 100%; min-height: 48px; padding: 0; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; background: none; font-size: 17px; }
.settings-dialog input[readonly] { border-bottom-color: var(--line); color: var(--graphite); cursor: default; }
.connection-dialog h2 { margin: 4px 0 8px; font: 500 36px/1 var(--serif); letter-spacing: -.025em; }
.connection-dialog #connection-name { min-height: 56px; font: 500 28px/1.2 var(--serif); }
.connection-matches { max-height: 36vh; max-height: 36dvh; margin: 8px 0; overflow-y: auto; overscroll-behavior: contain; }
.connection-matches:empty { margin: 0; }
#connection-relationship { margin-bottom: 8px; }
#connection-create { margin-top: 16px; }

/* You */
.settings-dialog > h2 { margin: 4px 0 20px; font: 500 52px/1 var(--serif); letter-spacing: -.025em; }
.ritual-card { padding-bottom: 20px; }
.streak-line { display: flex; align-items: flex-end; gap: 16px; }
.streak-big { font: 600 112px/.8 var(--serif); letter-spacing: -.04em; }
.streak-line strong { font-size: 18px; font-weight: 600; }
.streak-line p { margin-top: 6px; font-size: 14px; color: var(--graphite); }
.stats-card { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 20px; font-size: 14px; color: var(--graphite); }
.stats-card > div { display: flex; align-items: baseline; gap: 6px; }
.stats-card strong { font: 500 22px/1 var(--serif); color: var(--ink); }
.week-strip { display: flex; justify-content: space-between; max-width: 360px; margin-top: 20px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--graphite); }
.week-dot { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1.5px solid var(--line); border-radius: 50%; font-size: 14px; color: var(--ink); }
.week-dot.done { background: var(--marigold); border-color: var(--marigold); }
.week-dot.current { border-color: var(--ink); }
.today-status { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--graphite); }
.status-circle { flex-shrink: 0; width: 12px; height: 12px; border: 1.5px solid var(--ink); border-radius: 50%; }
.status-circle.done { background: var(--marigold); }
.account-box { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-avatar { display: none; }
.account-box > div { flex: 1; min-width: 0; }
.account-box strong { font-weight: 600; overflow-wrap: anywhere; }
.account-box small { display: block; font-size: 13px; color: var(--graphite); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toggle-row label { font-weight: 500; }
.toggle-row p { margin-top: 3px; font-size: 14px; color: var(--graphite); }
input[role='switch'] { position: relative; flex-shrink: 0; width: 56px; height: 34px; margin: 0; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); cursor: pointer; appearance: none; -webkit-appearance: none; }
input[role='switch']::before { content: ''; position: absolute; top: 3px; left: 3px; width: 25px; height: 25px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
input[role='switch']:checked { background: var(--marigold); }
input[role='switch']:checked::before { transform: translateX(22px); }
input[role='switch']:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.settings-save { width: 100%; margin-top: 24px; }
.connections { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 15px; }
.service-badge { font-size: 13px; color: var(--graphite); }
.service-badge.ready { font-weight: 600; color: var(--ink); }
.mcp-box { display: flex; gap: 12px; margin-top: 20px; padding: 16px; background: var(--wash); border-radius: 12px; }
.mcp-box > span svg { width: 20px; height: 20px; }
.mcp-box p { margin: 4px 0 8px; font-size: 14px; color: var(--graphite); }
.mcp-box code { font-size: 13px; overflow-wrap: anywhere; }
.setup-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-size: 15px; }

/* Sign in */
.login-page .brand, .legal-page .brand { display: inline-flex; }
.login-header, .legal-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; max-width: 1100px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top, 0px)) var(--gutter) 0; }
.login-main { display: grid; gap: 48px; max-width: 1040px; min-height: 0; margin: 0 auto; padding: 40px var(--gutter) 0; }
.auth-card > .eyebrow, .auth-card-star, .login-drawing { display: none; }
/* The wordmark: sårda in Fraunces 600, soft, ending on the tomato full stop. On sign in it
   plays once: the dot above the a pops, the ring appears and cools to ink, and the dot hops
   over r and d and rolls down the last a to rest as the full stop. Everywhere else it is still. */
.wordmark, .wordmark * { font-variation-settings: 'opsz' 144, var(--soft) !important; }
.wordmark { margin: 0; padding-top: 28px; font: 600 clamp(72px, 26vw, 108px)/1 var(--serif); letter-spacing: -.04em; white-space: nowrap; }
.wm-a { position: relative; display: inline-block; }
.wm-ring { position: absolute; left: .1135em; top: 0; letter-spacing: 0; opacity: 0; color: var(--tomato); transform-origin: .1168em .2988em; animation: wm-ring 4.2s .4s both; }
.wm-x { position: absolute; left: .118em; top: -.4925em; letter-spacing: 0; animation: wm-x 4.2s .4s both; }
.wm-y { display: block; animation: wm-y 4.2s .4s both; }
.wm-s { display: block; color: var(--tomato); transform-origin: .1123em .872em; animation: wm-s 4.2s .4s both; }
.wm-stop { margin-left: .04em; opacity: 0; }
@keyframes wm-x { 0%, 15.4% { transform: translateX(0); } 20% { transform: translateX(-.006em); animation-timing-function: linear; } 33.8% { transform: translateX(.4448em); } 36.9% { transform: translateX(.46em); animation-timing-function: linear; } 58.5% { transform: translateX(1.2698em); animation-timing-function: ease-in-out; } 70.8% { transform: translateX(1.4513em); animation-timing-function: cubic-bezier(0, 0, .4, 1); } 83.1%, 100% { transform: translateX(1.611em); } }
@keyframes wm-y { 0%, 20% { transform: translateY(0); animation-timing-function: cubic-bezier(.33, .67, .67, 1); } 26.9% { transform: translateY(-.1873em); animation-timing-function: cubic-bezier(.33, 0, .67, .33); } 33.8%, 36.9% { transform: translateY(.0338em); animation-timing-function: cubic-bezier(.33, .67, .67, 1); } 47.7% { transform: translateY(-.3873em); animation-timing-function: cubic-bezier(.33, 0, .67, .33); } 58.5% { transform: translateY(.0338em); animation-timing-function: ease-in-out; } 70.8% { transform: translateY(.0953em); animation-timing-function: cubic-bezier(.5, 0, 1, 1); } 83.1% { transform: translateY(.4925em); animation-timing-function: cubic-bezier(.33, .67, .67, 1); } 89.2% { transform: translateY(.4325em); animation-timing-function: cubic-bezier(.33, 0, .67, .33); } 95.4%, 100% { transform: translateY(.4925em); } }
@keyframes wm-s { 0%, 15.4% { transform: scale(1, 1); } 20% { transform: scale(1.12, .84); } 23.1% { transform: scale(.9, 1.14); } 27.7% { transform: scale(1, 1); } 33.8% { transform: scale(1.1, .88); } 36.9% { transform: scale(1, 1); } 58.5% { transform: scale(1.1, .88); } 61.5% { transform: scale(1, 1); } 83.1% { transform: scale(1.14, .84); } 86.2% { transform: scale(.94, 1.08); } 89.2% { transform: scale(1, 1); } 95.4% { transform: scale(1.08, .9); } 100% { transform: scale(1, 1); } }
@keyframes wm-ring { 0%, 20% { transform: scale(.4); opacity: 0; color: var(--tomato); } 26.2% { transform: scale(1.12); opacity: 1; color: var(--tomato); } 32.3% { transform: scale(.96); opacity: 1; color: var(--tomato); } 38.5% { transform: scale(1); opacity: 1; color: var(--tomato); } 55.4%, 100% { transform: scale(1); opacity: 1; color: var(--ink); } }
@media (prefers-reduced-motion: reduce) {
  .wm-x { animation: none; transform: translateX(1.611em); }
  .wm-y { animation: none; transform: translateY(.4925em); }
  .wm-s { animation: none; }
  .wm-ring { animation: none; opacity: 1; color: var(--ink); }
  .field-caret { animation: none; }
}
.login-tagline { max-width: 12ch; margin-top: 24px; font: 500 36px/1.05 var(--serif); letter-spacing: -.025em; text-wrap: balance; }
.login-description { max-width: 38ch; margin-top: 18px; font-size: 18px; line-height: 1.5; }
.login-page .auth-card { width: 100%; min-width: 0; max-width: 380px; padding-top: 32px; border-top: 1px solid var(--line); }
.login-page .auth-card h2 { font-size: 32px; line-height: 1.15; }
.login-page .auth-intro { font-size: 15px; line-height: 1.6; margin-top: 8px; margin-bottom: 28px; }
/* Keep Clerk's own headings on every step, including verification and recovery. */
.auth-card:has(#clerk-signin .cl-headerTitle) > .auth-heading { display: none; }
#clerk-signin { min-width: 0; }
#clerk-signin .cl-footer { background: transparent; }
.auth-card h2, .auth-page .auth-card h1 { margin-bottom: 6px; font: 500 40px/1 var(--serif); letter-spacing: -.025em; }
.auth-intro { margin-bottom: 20px; color: var(--graphite); }
.signin-status { margin-bottom: 16px; font-size: 15px; color: var(--graphite); }
.login-notice { margin-bottom: 16px; padding: 12px 14px; background: var(--wash); border-radius: 12px; font-size: 15px; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; border: 1.5px solid var(--ink); border-radius: 999px; font-weight: 600; text-decoration: none; }
.google-button:hover { background: var(--wash); }
.auth-disabled { opacity: .55; }
.auth-option-note { margin-top: 8px; font-size: 14px; color: var(--graphite); }
.existing-signin .primary-button, #email-signin-form .primary-button, .auth-page .auth-card .primary-button { width: 100%; }
#email-signin-form .primary-button, .auth-page .auth-card .primary-button { margin-top: 16px; }
.existing-signin p, .password-note, .browser-signin-help, .auth-page .auth-card p { margin-top: 12px; font-size: 14px; color: var(--graphite); }
#google-option.after-chatgpt { margin-top: 12px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 8px; font-size: 14px; color: var(--graphite); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
#email-signin-form .field-label { margin-top: 12px; }
.email-sent > span { display: none; }
.email-sent h3 { margin: 16px 0 8px; font: italic 400 22px/1.25 var(--serif); }
.email-sent p { font-size: 15px; color: var(--graphite); }
.auth-privacy { display: flex; align-items: flex-start; gap: 8px; margin-top: 28px; font-size: 13px; line-height: 1.6; color: var(--graphite); }
.auth-privacy svg { flex-shrink: 0; margin-top: 3px; }
.login-footer { max-width: 984px; margin: 56px var(--gutter) 0; padding: 20px 0 28px; font-size: 13px; }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--gutter); }
.auth-page .auth-card { width: 100%; max-width: 440px; }

/* Terms and privacy */
.legal-shell { max-width: 720px; margin: 0 auto; padding-bottom: 32px; }
.legal-header { padding-left: var(--gutter); padding-right: var(--gutter); }
.legal-back { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
.legal-content { max-width: none; min-height: 0; padding: 40px var(--gutter) 0; }
.legal-content .eyebrow { margin: 0 0 8px; font-size: 13px; line-height: 1.4; }
.legal-content h1 { margin-bottom: 12px; }
.legal-content h2 { margin: 32px 0 8px; }
.legal-content p, .legal-content li { margin: 0 0 12px; font-size: 17px; line-height: 1.6; }
.legal-content ul { padding-left: 20px; }
.legal-date { color: var(--graphite); margin-top: 12px; }
.legal-intro { font-size: 20px; }
.legal-footer { margin-left: var(--gutter); margin-right: var(--gutter); }

/* Wider screens */
@media (min-width: 761px) {
  .app-shell { padding-bottom: 0; }
  .site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0; }
  .brand { display: inline-flex; }
  .tab-bar { position: static; gap: 28px; padding: 0; border: 0; background: none; }
  main { padding-top: 48px; }
  .prompt { font-size: clamp(64px, 10vw, 112px); line-height: .95; letter-spacing: -.03em; }
  .journal-paper textarea { min-height: 220px; font-size: 22px; }
  .paper-bottom { bottom: 0; }
  .toast { bottom: 24px; }
  .detail-text { font-size: 25px; line-height: 1.38; }
  .entity-contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog, dialog.connection-dialog { width: min(680px, calc(100vw - 48px)); max-width: none; height: auto; max-height: 88vh; max-height: 88dvh; margin: auto; padding: 24px 40px 36px; border: 1px solid var(--line); border-radius: 20px; }
  dialog.connection-dialog { width: min(480px, calc(100vw - 48px)); }
}

@media (min-width: 960px) {
  .login-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 80px; padding-top: 80px; }
  .wordmark { font-size: 132px; padding-top: 0; }
  .login-tagline { font-size: 44px; }
  .login-page .auth-card { padding-top: 8px; border-top: 0; }
  .login-footer { margin: 72px max(var(--gutter), calc((100vw - 984px) / 2)) 0; }
}

/* Write link from a reminder email: one question, no navigation, no journal content. */
.write-shell { padding-bottom: env(safe-area-inset-bottom, 0px); }
.write-header { display: flex; align-items: center; min-height: 44px; max-width: var(--measure); margin: 0 auto; padding-top: max(16px, env(safe-area-inset-top, 0px)); }
.write-brand { font: 600 22px/1 var(--serif); letter-spacing: -.04em; }
.write-shell main { padding-top: 16px; }
.write-shell .paper-bottom { bottom: env(safe-area-inset-bottom, 0px); }
.write-shell .editor-error a { color: var(--ink); font-weight: 600; }
.write-note { font-size: 17px; color: var(--graphite); }
.write-shell:not([data-state="ready"]) #write-ready, .write-shell:not([data-state="kept"]) #write-kept,
.write-shell:not([data-state="expired"]) #write-expired, .write-shell:not([data-state="unavailable"]) #write-unavailable { display: none; }
.unsubscribe-shell:not([data-state="ready"]) #unsubscribe-ready, .unsubscribe-shell:not([data-state="done"]) #unsubscribe-done,
.unsubscribe-shell:not([data-state="expired"]) #unsubscribe-expired, .unsubscribe-shell:not([data-state="unavailable"]) #unsubscribe-unavailable { display: none; }

/* Reminder schedule and email in, inside You. */
.reminder-schedule { padding: 4px 0 8px; }
.reminder-schedule[hidden] { display: none; }
.schedule-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.schedule-row > label, .schedule-row > span { font-weight: 500; }
.settings-dialog .schedule-row input[type="time"] { width: auto; min-width: 128px; min-height: 44px; text-align: right; }
.schedule-days { display: block; }
.schedule-days-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-weight: 500; }
.day-summary { font-size: 15px; font-weight: 400; color: var(--graphite); }
.day-chips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.day-chips .filter-chip { min-height: 44px; padding: 0; justify-content: center; }
.toggle-row.nested { min-height: 64px; margin-top: 0; border-top: 0; }
.email-in { margin-top: 28px; }
.email-address-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 12px 14px; background: var(--wash); border-radius: 12px; }
.email-address-row code { font-size: 15px; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Voice: say it out loud. The mic is a round outline beside Keep it. Listening
   follows the Sårda app's speaking screen: the prompt shrinks with Cancel beside
   it, and a wash panel holds "listening…", the time, the waveform and Stop. */
.keep-actions { display: flex; align-items: center; gap: 10px; }
.mic-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 52px; height: 52px; padding: 0; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink); }
.mic-button:hover:not(:disabled) { background: var(--wash); }
.mic-button svg { width: 20px; height: 20px; }

.voice-panel { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.voice-panel .editor-error { margin-top: 0; }
/* Nothing to say while idle or listening; the status still speaks to screen readers. */
.voice-panel[data-state='idle'], .voice-panel[data-state='listening'] { margin-top: 0; }
.voice-panel:is([data-state='idle'], [data-state='listening']) .voice-note { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.voice-panel[data-state='idle']:not(:has(.editor-error:not(.hidden))) { gap: 0; }

/* Where a recording is: a quiet wash row, like the clarify row. */
.voice-note { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--wash); border-radius: 12px; }
.voice-note:focus { outline: none; }
.voice-status { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.voice-status::before { content: ''; flex-shrink: 0; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; border: 1.5px solid var(--ink); }
.voice-panel:is([data-state='ready'], [data-state='applied']) .voice-status::before { border-color: var(--tomato); background: var(--tomato); }
.voice-panel[data-state='busy'] .voice-status::before { background: var(--ink); animation: voice-pulse 1.2s ease-in-out infinite; }
.voice-date { padding-left: 18px; font-size: 14px; line-height: 1.45; color: var(--graphite); }
@keyframes voice-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.voice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.voice-actions:not(:has(> :not(.hidden))) { display: none; }
.voice-panel [hidden], .voice-panel .hidden { display: none; }

/* A recording waits for its words to go into the page; until then Keep it steps aside. */
.journal-paper.voice-pending .paper-bottom { position: static; }
.journal-paper.voice-pending .keep-button { display: none; }

/* Listening */
.voice-listening { display: flex; flex-direction: column; align-items: center; padding: 28px var(--gutter) 34px; background: var(--wash); }
.listening-head { align-self: stretch; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.listening-word { font: 500 44px/1 var(--serif); letter-spacing: -.02em; }
.voice-timer { font-size: 15px; font-weight: 500; color: var(--graphite); font-variant-numeric: tabular-nums; white-space: nowrap; }
.voice-wave { display: flex; align-items: center; gap: 5px; height: 48px; margin-top: 28px; }
.voice-wave span { width: 4px; height: calc(8px + 40px * var(--level, var(--rest))); border-radius: 2px; background: var(--ink); }
.voice-wave.is-live span { transition: height .09s linear; }
.voice-wave:not(.is-live) span { animation: voice-breathe 1.8s ease-in-out calc(var(--i) * -.23s) infinite alternate; }
@keyframes voice-breathe { from { transform: scaleY(.55); } to { transform: scaleY(1); } }
.voice-stop { display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; margin-top: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); }
.voice-stop:hover { background: #000; }
.voice-stop:focus-visible { outline-offset: 4px; }
.voice-stop span { width: 24px; height: 24px; border-radius: 5px; background: var(--paper); }
.listening-hint { margin-top: 14px; font-size: 14px; line-height: 1.45; color: var(--graphite); text-align: center; text-wrap: pretty; }
.voice-cancel { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 500; color: var(--graphite); }
.voice-cancel:hover { color: var(--ink); }

/* While listening, Today is only the question, the words so far, and the panel. */
body.is-listening :is(.intro-row, .kind-switch, .thought-note, .paper-bottom, .under-paper, .compose-connection, .kept-today, .journal-footer) { display: none !important; }
body.is-listening .writing-column { position: relative; }
body.is-listening .voice-cancel { position: absolute; top: 0; right: 0; }
body.is-listening .prompt { margin-top: 0; padding: 10px 88px 10px 0; font-size: 22px; line-height: 1.1; letter-spacing: -.01em; }
body.is-listening .prompt .hl { background: none; }
body.is-listening .prompt .crayon { color: inherit; }
body.is-listening .journal-paper { margin-top: 20px; }
body.is-listening .story-writing { padding-bottom: 0; border-bottom-color: transparent; }
body.is-listening .field-caret { display: none !important; }
body.is-listening #story-text::placeholder { color: transparent; }
body.is-listening .journal-paper textarea { min-height: 0; }

@media (max-width: 760px) {
  /* On phones the panel takes the bottom of the screen, where the tabs were. */
  .voice-listening { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; min-height: 380px; padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px)); }
  .voice-stop { margin-top: auto; }
  .voice-wave { margin-bottom: 28px; }
  body.is-listening .tab-bar { display: none; }
  body.is-listening main { min-height: 0; }
  body.is-listening .app-shell { padding-bottom: calc(400px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 761px) {
  .voice-listening { margin-top: 32px; padding: 32px 36px 36px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-wave span { animation: none !important; transition: none !important; }
  .voice-panel[data-state='busy'] .voice-status::before { animation: none; }
}

/* Voice on a record: a quiet mic beside a long field's Keep button, or on its
   label line. Listening is a compact wash row under the field. */
.field-mic { color: var(--graphite); }
.field-mic:hover:not(:disabled) { color: var(--ink); }
.field-mic svg { width: 20px; height: 20px; }
.editor-bottom .field-mic { margin-left: auto; }
.field-label-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.field-label-row .field-mic { margin: 0 -10px 0 0; }
.field-mic[hidden], .field-voice[hidden], .field-voice [hidden] { display: none !important; }
.field-voice { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.field-voice-bar { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 8px 8px 16px; background: var(--wash); border-radius: 12px; }
.field-voice-wave { display: flex; align-items: center; gap: 3px; height: 24px; }
.field-voice-wave span { width: 3px; height: calc(4px + 20px * var(--level, var(--rest))); border-radius: 2px; background: var(--ink); }
.field-voice-wave.is-live span { transition: height .09s linear; }
.field-voice-wave:not(.is-live) span { animation: voice-breathe 1.8s ease-in-out calc(var(--i) * -.23s) infinite alternate; }
.field-voice-word { font: 500 19px/1 var(--serif); letter-spacing: -.01em; }
.field-voice-time { font-size: 14px; font-weight: 500; color: var(--graphite); font-variant-numeric: tabular-nums; white-space: nowrap; }
.field-voice-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.field-voice[data-phase='working'] .field-voice-dot { animation: voice-pulse 1.2s ease-in-out infinite; }
.field-voice[data-phase='failed'] .field-voice-dot, .field-voice[data-phase='ready'] .field-voice-dot { background: var(--tomato); }
.field-voice-message { flex: 1; min-width: 0; padding: 6px 0; font-size: 15px; line-height: 1.4; }
.field-voice-bar .voice-cancel { margin-left: auto; padding: 0 6px; font-size: 14px; }
.field-voice-stop { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); }
.field-voice-stop:hover { background: #000; }
.field-voice-stop:focus-visible { outline-offset: 3px; }
.field-voice-stop span { width: 14px; height: 14px; border-radius: 3px; background: var(--paper); }
.field-voice-actions { display: flex; flex-wrap: wrap; gap: 0 20px; }
.field-voice-actions .text-button { font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  .field-voice-wave span { animation: none !important; transition: none !important; }
  .field-voice[data-phase='working'] .field-voice-dot { animation: none; }
}
