:root {
  --paper: #f8f4eb; --card: #fffdf8; --ink: #213c33; --soft: #66756b;
  --line: #dddcd1; --light: #eef0e6; --gold: #b09062; --warn: #8a3b2a; --warn-bg: #fbeee9;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 Arial, Helvetica, sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font: 400 36px/1.15 Georgia, serif; letter-spacing: -.5px; }
h2 { font: 400 26px/1.2 Georgia, serif; }
h3 { font: 600 13px/1.4 Arial, sans-serif; letter-spacing: .4px; }

header { max-width: 620px; margin: 0 auto; padding: 24px 20px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font: italic 22px/1.3 Georgia, serif; background: none; border: 0; padding: 0; }
.brand span { color: var(--gold); }
nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
main { max-width: 620px; margin: 0 auto; padding: 8px 20px 120px; }

.quiet { color: var(--soft); font-size: 14px; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.primary { border: 1px solid var(--ink); background: var(--ink); color: var(--card); border-radius: 12px; padding: 12px 20px; min-height: 48px; }
.primary:hover:not(:disabled) { background: #355447; }
.secondary { border: 1px solid #b7c2ad; background: var(--card); border-radius: 12px; padding: 12px 18px; min-height: 48px; }
.secondary:hover:not(:disabled) { background: var(--light); }
.link { background: none; border: 0; padding: 8px 6px; color: var(--soft); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; }
.link:hover { color: var(--ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
input[type=email], input[type=password], textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 12px 14px; }
textarea { resize: vertical; min-height: 84px; display: block; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }

.signin { padding-top: 40px; }
.signin p { max-width: 380px; }

.list { list-style: none; padding: 0; margin: 0; }
.list li + li { margin-top: 10px; }
.saved-label { margin: 36px 0 12px; font: 600 13px/1.3 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.item { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
button.item:hover { background: var(--light); }
.item strong { display: block; font: 400 18px/1.35 Georgia, serif; overflow-wrap: anywhere; }
.item small { color: var(--soft); font-size: 13px; }

.thought { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.thought:first-child { border-top: 0; }
.thought input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--ink); flex: none; }
.thought p { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.thought .link { padding: 0 4px; min-height: 28px; }

.consent { border: 1px solid var(--gold); background: #fbf6ea; border-radius: 14px; padding: 16px 18px; }
.consent p { font-size: 15px; }
.consent details { margin-top: 8px; font-size: 14px; color: var(--soft); }
.consent summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.consent details p { font-size: 14px; margin-top: 8px; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.notice.error { background: var(--warn-bg); color: var(--warn); border: 1px solid #e6c4b9; }
.notice.info { background: var(--light); border: 1px solid var(--line); }

.response { border-left: 3px solid var(--gold); }
.response .tag { font-size: 12px; color: var(--soft); letter-spacing: .3px; margin-bottom: 4px; }
.response .tag b { color: var(--ink); }
.response blockquote { margin: 0 0 10px; font-size: 13px; color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.response textarea { min-height: 150px; }

.thinking { display: inline-flex; gap: 8px; align-items: center; color: var(--soft); font-size: 15px; }
.thinking::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .thinking::before { animation: none; } }

.savebar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); }
.savebar > div { max-width: 620px; margin: 0 auto; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.savebar .status { font-size: 14px; color: var(--soft); }
.savebar .status.dirty { color: var(--ink); font-weight: 600; }
.savebar .status.error { color: var(--warn); }

.demo-banner { background: var(--ink); color: var(--card); text-align: center; font-size: 13px; padding: 6px 12px; }
@media (max-width: 420px) { h1 { font-size: 30px; } .card { padding: 18px; } }

/* ----- landing ----- */
.info-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: none; font: italic 17px Georgia, serif; margin-left: auto; }
header:has(#brand[hidden]) { justify-content: flex-end; }
.landing { text-align: center; max-width: 460px; margin: 0 auto; }
.landing > * + * { margin-top: 14px; }
.landing h1 { font-size: 40px; }
/* Keep the way forward on screen: the picture gives up height before the button does. */
.landing-art { display: block; width: 100%; height: auto; max-height: 42vh; object-fit: cover; object-position: 50% 18%; border: 1px solid #cdb18d; border-radius: 20px; }
.quotes { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 4px; border: 1px solid #cdb18d; border-radius: 16px; padding: 12px 4px; }
.quotes button { background: none; border: 0; color: #83765f; font: 26px/1 Georgia, serif; min-height: 44px; border-radius: 8px; }
.quotes button:hover { color: var(--ink); }
/* Every quote sits in the same cell, so the box is as tall as the longest and never jumps. */
.quote-stack { display: grid; align-items: center; }
.quote-stack p { grid-area: 1 / 1; font: italic 18px/1.4 Georgia, serif; transition: opacity .4s; }
.quote-stack p[aria-hidden=true] { opacity: 0; pointer-events: none; }
.dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--ink); }
.wide { width: 100%; }

/* ----- onboarding, cards, home ----- */
.eyebrow { color: var(--soft); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 12px; min-height: 70px; font-size: 16px; }
.tile:hover { background: var(--light); }
.center-row { justify-content: center; }
.practice h2 { margin-bottom: 16px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { border: 1px solid #cdd4c5; border-radius: 14px; background: var(--light); padding: 14px; text-align: left; }
.choice.most { background: #f6efe0; border-color: #dcc9a6; }
.choice small { display: block; color: var(--soft); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.choice p { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.as-button { display: block; width: 100%; text-align: left; }
.as-button:hover { border-color: var(--gold); }
.when { margin-top: 12px; color: var(--soft); font-size: 13px; }
h2.section { margin-top: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #b7c2ad; background: var(--card); border-radius: 999px; padding: 10px 16px; min-height: 44px; }
.chip[aria-pressed=true] { background: var(--ink); color: var(--card); border-color: var(--ink); }
input[type=text], input[type=time] { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 12px 14px; }
input[type=time] { max-width: 180px; }
dialog { max-width: min(440px, calc(100vw - 40px)); color: var(--ink); }
dialog::backdrop { background: #213c3366; }
.augustine { margin: 0; padding-left: 14px; border-left: 3px solid var(--gold); font: italic 17px/1.5 Georgia, serif; }
.augustine cite { display: block; margin-top: 6px; font: 13px Arial, sans-serif; color: var(--soft); }
@media (max-width: 360px) { .pair { grid-template-columns: 1fr; } }

/* The landing portrait carries into the first question, small, at the top right. */
.love-heading { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 18px; align-items: center; }
.portrait { display: block; width: 120px; height: 113px; object-fit: cover; object-position: 50% 20%; border: 1px solid #cdb18d; border-radius: 14px; }
@media (max-width: 420px) { .love-heading { grid-template-columns: minmax(0, 1fr) 92px; gap: 14px; } .portrait { width: 92px; height: 87px; } }

/* ----- timeline ----- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: #cfcdbd; border-radius: 2px; }
.tl-row { position: relative; }
.tl-row + .tl-row { margin-top: 18px; }
.tl-node { position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--paper); }
.tl-when { font-size: 13px; letter-spacing: .4px; color: var(--soft); margin-bottom: 6px; font-weight: 600; }
.tl-card { position: relative; cursor: pointer; padding-right: 48px; }
.tl-card:hover { border-color: var(--gold); }
.tl-card h2 { font-size: 22px; margin-bottom: 14px; }
.grab { position: absolute; right: 6px; top: 8px; width: 40px; height: 44px; border: 0; background: none; color: var(--soft); font-size: 20px; cursor: grab; touch-action: none; border-radius: 8px; }
.grab:hover { background: var(--light); color: var(--ink); }
body.dragging { cursor: grabbing; user-select: none; }
body.dragging .tl-row, body.dragging main > div > :not(.timeline) { opacity: .3; }
body.dragging .timeline::before { opacity: 0; }
.ruler { position: fixed; top: 72px; bottom: 28px; width: 4px; background: var(--ink); border-radius: 4px; z-index: 50; }
.ruler span { position: absolute; left: 14px; transform: translateY(-50%); font-size: 12px; color: var(--soft); white-space: nowrap; }
.ruler-mark { position: absolute; left: -6px; transform: translateY(-50%); background: var(--gold); color: #fff; font-weight: 600; font-size: 14px; padding: 4px 12px 4px 22px; border-radius: 999px; white-space: nowrap; }
.ruler-mark::before { content: ""; position: absolute; left: 4px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff; }
.drag-chip { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; background: var(--ink); color: var(--card); padding: 6px 14px; border-radius: 999px; font-size: 13px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 18px #0003; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chips.days .chip { padding: 10px 12px; min-width: 52px; }
input[type=date] { width: 100%; max-width: 220px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 12px 14px; }

/* ----- grass ----- */
.grass { text-align: center; }
.grass img { display: block; width: 100%; height: auto; border-radius: 20px; border: 1px solid var(--line); }
.savebar .row { flex-wrap: nowrap; }
@media (max-width: 480px) { .savebar > div { flex-wrap: wrap; } .savebar .status { width: 100%; } .savebar .row { width: 100%; } .savebar .row button { flex: 1; padding-left: 10px; padding-right: 10px; } }

/* ----- getting unstuck: two panes ----- */
main.wide { max-width: 1080px; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--light); border: 1px solid var(--line); border-radius: 14px; padding: 5px; position: sticky; top: 8px; z-index: 5; }
.tabs button { background: transparent; border: 0; border-radius: 10px; padding: 11px 8px; min-height: 44px; font: 600 15px/1.2 Arial, Helvetica, sans-serif; color: var(--soft); }
.tabs button[aria-selected=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (max-width: 879px) { .work-grid[data-tab=thoughts] > #pane-voices, .work-grid[data-tab=voices] > #pane-thoughts { display: none; } }
@media (min-width: 880px) { .tabs, .to-voices { display: none; } }
@media (min-width: 880px) { .work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; } }
.small { font-size: 13px; }
.lenses { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lens { text-align: left; background: var(--card); border: 1px solid #b7c2ad; border-radius: 12px; padding: 12px 14px; min-height: 68px; }
.lens:hover:not(:disabled) { background: var(--light); border-color: var(--ink); }
.lens strong { display: block; font: 400 17px/1.3 Georgia, serif; }
.lens small { display: block; color: var(--soft); font-size: 12px; line-height: 1.35; margin-top: 3px; }
.lens[aria-busy=true] { border-color: var(--gold); background: #fbf6ea; opacity: 1; }
.answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.55; }
.summary { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.55 Arial, Helvetica, sans-serif; background: var(--light); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-height: 320px; overflow: auto; }
@media (max-width: 420px) { .lenses { grid-template-columns: 1fr; } }

/* ----- admin ----- */
.admin-list .item { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.off { color: var(--warn); font-size: 13px; }
textarea.tall { min-height: 200px; }
input[type=number] { width: 110px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 12px 14px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.link.danger { color: var(--warn); }

/* ----- public front page ----- */
.front { max-width: 420px; margin: 0 auto; padding: 6vh 0 24px; min-height: 78vh; display: flex; flex-direction: column; }
.mark { font: italic 400 76px/1 Georgia, serif; letter-spacing: -3px; color: var(--ink); }
.mark span { color: var(--gold); letter-spacing: 2px; }
.mark-name { font: italic 16px/1.3 Georgia, serif; color: var(--soft); margin: 10px 0 0; }
.front-line { font: 400 25px/1.35 Georgia, serif; margin: 48px 0 0; text-wrap: balance; }
.front-sub { margin: 14px 0 0; }
.front-form { margin-top: 40px; }
.front-quote { margin: auto 0 0; padding-top: 48px; font: italic 13px/1.6 Georgia, serif; color: var(--soft); }
.front-quote span { display: block; font-style: normal; }
.horizon { display: block; width: 100%; height: auto; margin: 28px 0 0; overflow: visible; }
.horizon-line { stroke: var(--line); stroke-width: 1; }
.horizon .step { fill: var(--gold); }
.horizon .glint { fill: var(--gold); }
.horizon .glint-halo { fill: var(--gold); opacity: .14; transform-origin: 338px 40px; animation: glint 5s ease-in-out infinite; }
@keyframes glint { 0%, 100% { opacity: .08; transform: scale(.8); } 50% { opacity: .22; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .horizon .glint-halo { animation: none; } }
.front-form { margin-top: 28px; }

/* ----- sharing ----- */
.shared-item blockquote { margin: 0; padding-left: 12px; border-left: 2px solid var(--line); color: var(--soft); font-size: 14px; }
.shared-be { font: 400 20px/1.35 Georgia, serif; margin: 0; }
.shared-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shared-pair > div { background: var(--light); border-radius: 12px; padding: 12px 14px; }
.shared-pair > div.most { background: #f6ecd9; }
.shared-pair small { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.shared-pair p { margin: 4px 0 0; }
@media (max-width: 420px) { .shared-pair { grid-template-columns: 1fr; } }
.mark.small { font-size: 40px; letter-spacing: -1.5px; }
.shared-page { padding-top: 3vh; }
.shared-intro { margin: 28px 0 12px; }
.shared-page .front-line { margin-top: 40px; }
.small-answer { font-size: 15px; max-height: 220px; overflow: auto; }

/* ----- pass it on ----- */
.pass { margin-top: 56px; padding-bottom: 8px; }
.pass-row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.dots { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.dot { width: 36px; height: 36px; padding: 0; border: 0; background: none; border-radius: 50%; position: relative; }
.dot::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--gold); border: 2px solid var(--gold); transition: transform .15s ease; }
.dot:hover:not(:disabled)::after { transform: scale(1.25); }
.dot.sent::after { background: transparent; }
.dot.used::after { background: transparent; border-color: var(--line); }
.dot:disabled { cursor: default; opacity: 1; }
.pass-line { font: italic 16px/1.3 Georgia, serif; color: var(--soft); }
.friend-line { font: italic 17px/1.4 Georgia, serif; color: var(--gold); margin: 0; }

/* ----- files as thoughts ----- */
.file-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.drop-zone.over { outline: 2px dashed var(--gold); outline-offset: 4px; background: #fbf6ea; }
.file-thought { flex: 1; min-width: 0; }
.file-thought details { margin-top: 6px; }
.file-thought summary { cursor: pointer; color: var(--soft); font-size: 13px; }
.file-thought pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 Arial, Helvetica, sans-serif; background: var(--light); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 220px; overflow: auto; }

/* ----- prepare and practice ----- */
.coach-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coach-mode { text-align: left; background: var(--card); border: 1px solid #b7c2ad; border-radius: 12px; padding: 12px 14px; min-height: 64px; }
.coach-mode strong { display: block; font: 400 19px/1.3 Georgia, serif; }
.coach-mode small { display: block; color: var(--soft); font-size: 12px; margin-top: 2px; }
.coach-mode.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.coach-mode.on small { color: #cfd8cc; }
.coach-mode:hover:not(:disabled):not(.on) { background: var(--light); border-color: var(--ink); }
.keepable { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.keepable p { margin: 0; flex: 1; }
.keepable button { flex: none; }
.carry { font: italic 18px/1.4 Georgia, serif; }
@media (max-width: 480px) { .keepable { flex-direction: column; align-items: flex-start; } }
.card-plan { margin: 12px 0 0; font-size: 14px; }
.card-plan b { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); margin-right: 6px; }
.card-remember { margin: 6px 0 0; font: italic 15px/1.4 Georgia, serif; color: var(--soft); }
.next-up { border-color: var(--gold); }
.next-be { font: 400 20px/1.35 Georgia, serif; margin: 0; }

/* ----- usage ----- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile strong { display: block; font: 400 30px/1.1 Georgia, serif; }
.tile small { color: var(--soft); font-size: 13px; }
.tile.warn { border-color: #e6c4b9; background: var(--warn-bg); }
.tile.warn strong { color: var(--warn); }
.bar-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 40px; gap: 12px; align-items: center; font-size: 15px; }
.bar { background: var(--light); border-radius: 6px; height: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.bar-row b { text-align: right; font-weight: 600; }
.person-usage small { display: block; }
