/* Layout: one narrow column, like a private notebook held in one hand. */
:root {
  --bg: #1c1218;
  --surface: #26181f;
  --surface-2: #31202a;
  --line: #452f3b;
  --ink: #f4e8ec;
  --muted: #b89ca8;
  --rose: #ee8aa0;
  --amber: #e9b872;
  --yes: #ee8aa0;
  --maybe: #e9b872;
  --no: #6f5a65;
  --danger: #ff8f8f;
  --chart-shared: #da5a7e;
  --chart-talk: #b38429;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbf4f6;
    --surface: #ffffff;
    --surface-2: #f6e9ee;
    --line: #ead6de;
    --ink: #2b1720;
    --muted: #7d5f6c;
    --rose: #c94a68;
    --amber: #b5772a;
    --yes: #c94a68;
    --maybe: #b5772a;
    --no: #b9a3ad;
    --danger: #c0392b;
    --chart-shared: #b93a5c;
    --chart-talk: #c9952f;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.05rem; font-family: var(--body); font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 28px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* The mark: two overlapping circles. */
.mark { position: relative; width: 36px; height: 36px; flex: none; }
.mark span { position: absolute; width: 24px; height: 24px; border-radius: 50%; mix-blend-mode: screen; }
.mark span:first-child { left: 0; bottom: 0; background: var(--rose); }
.mark span:last-child { right: 0; top: 0; background: var(--amber); opacity: .9; }
@media (prefers-color-scheme: light) { .mark span { mix-blend-mode: multiply; } }
.boot { min-height: 60vh; display: grid; place-items: center; }

/* Forms */
label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
input {
  font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%;
}
input:focus { outline: 2px solid var(--rose); outline-offset: 1px; border-color: transparent; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; display: grid; gap: 12px; }
legend { padding: 0 6px; font-family: var(--display); font-size: 1.1rem; color: var(--ink); }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px;
  padding: 12px 20px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:focus-visible, .btn:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.primary { background: var(--rose); border-color: var(--rose); color: #22101a; }
.ghost { background: transparent; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--danger); }
.block { width: 100%; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.4em; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.2rem; }
.top-actions { display: flex; gap: 8px; }
.icon-btn { padding: 8px 14px; font-size: .875rem; }

/* Home */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.person .name { font-family: var(--display); font-size: 1.2rem; }
.meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--rose); border-radius: inherit; transition: width .3s; }
.person.partner .meter i { background: var(--amber); }
.count { font-variant-numeric: tabular-nums; font-size: .875rem; color: var(--muted); }
.cta { display: grid; gap: 10px; }

/* Questionnaire */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-inline: -4px; padding-inline: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; font-size: .85rem; font-weight: 500; border-radius: 999px; background: transparent; }
.chip[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .done { margin-left: 4px; color: var(--rose); }
.chip[aria-current="true"] .done { color: var(--rose); }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.q-text { font-size: 1.02rem; }
.side { display: grid; gap: 8px; }
.side + .side { border-top: 1px dashed var(--line); padding-top: 12px; }
.side-label { font-size: .8rem; letter-spacing: .04em; color: var(--muted); }
.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ans { padding: 10px 6px; font-size: .9rem; font-weight: 600; border-radius: 10px; background: transparent; }
.ans[aria-pressed="true"][data-v="yes"] { background: var(--yes); border-color: var(--yes); color: #22101a; }
.ans[aria-pressed="true"][data-v="maybe"] { background: var(--maybe); border-color: var(--maybe); color: #22101a; }
.ans[aria-pressed="true"][data-v="no"] { background: var(--no); border-color: var(--no); color: var(--ink); }
.cat-head { display: grid; gap: 4px; }
.nav-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* Matches */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.both { background: var(--rose); }
.dot.one { background: linear-gradient(90deg, var(--rose) 50%, var(--amber) 50%); }
.dot.curious { background: var(--amber); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.match-group { display: grid; gap: 8px; }
.match { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.match .dot { margin-top: 7px; flex: none; }
.match-body { display: grid; gap: 2px; min-width: 0; }
.who { font-size: .8rem; color: var(--muted); }
.empty { text-align: center; padding: 32px 16px; border: 1px dashed var(--line); border-radius: var(--radius); display: grid; gap: 8px; }

/* Confirm panel */
.confirm { border: 1px solid var(--danger); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.3); max-width: calc(100% - 32px);
}

@media (max-width: 380px) {
  .pair { grid-template-columns: 1fr; }
  h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Tonight ---------- */
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--rose); color: #22101a; font-size: .75rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tonight-cta { justify-content: flex-start; gap: 10px; }
.tonight-cta .presence { margin-left: auto; }
.presence { font-size: .85rem; color: var(--muted); font-weight: 500; }
.presence.on::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #7fd0a4; margin-right: 6px; vertical-align: middle; }
.chat-status { min-height: 1.4em; }
.suggest { margin-left: auto; flex: none; padding: 6px 12px; font-size: .8rem; }

body.chat-mode main { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
.messages { display: grid; gap: 10px; }
.msg { display: grid; gap: 3px; max-width: 82%; position: relative; }
.msg.mine { justify-self: end; justify-items: end; }
.msg.theirs { justify-self: start; justify-items: start; }
.bubble {
  padding: 10px 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line);
  overflow-wrap: anywhere; white-space: pre-wrap; min-width: 0;
}
.bubble.mine { background: var(--rose); color: #22101a; border-color: var(--rose); border-bottom-right-radius: 6px; cursor: pointer; }
.bubble.theirs { border-bottom-left-radius: 6px; }
.bubble.t-photo { padding: 4px; background: var(--surface); border-color: var(--line); }
.bubble.t-photo img { display: block; border-radius: 14px; max-height: 360px; max-width: 100%; width: auto; }
.photo-wrap { position: relative; overflow: hidden; border-radius: 14px; min-width: 160px; min-height: 120px; background: var(--surface-2); }
.photo-wrap img { filter: blur(32px) saturate(.6) brightness(.7); transform: scale(1.25); -webkit-user-drag: none; }
.photo-wrap.shown img { filter: none; transform: none; cursor: zoom-in; }
.photo-wrap.sized { min-width: 0; min-height: 0; }
.bubble.t-photo .photo-wrap.sized img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.chat-top { text-align: center; min-height: 1px; }
.photo-reveal {
  position: absolute; inset: 0; margin: auto; width: max-content; height: max-content;
  padding: 9px 16px; border-radius: 999px; font-size: .85rem;
  background: rgba(20, 10, 15, .72); color: #f4e8ec; border: 1px solid rgba(255, 255, 255, .25);
}
.photo-hide {
  position: absolute; top: 8px; right: 8px; padding: 5px 10px; font-size: .75rem; border-radius: 999px;
  background: rgba(20, 10, 15, .66); color: #f4e8ec; border: 1px solid rgba(255, 255, 255, .2);
}
.bubble.t-nudge, .bubble.t-prompt { background: var(--surface); color: var(--ink); border: 1px solid var(--amber); }
.bubble.mine.t-nudge, .bubble.mine.t-prompt { border-color: var(--rose); }
.card-msg { display: grid; gap: 8px; white-space: normal; }
.card-text { font-family: var(--display); font-size: 1.12rem; line-height: 1.3; }
.card-text.big { font-size: 1.35rem; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { padding: 7px 12px; font-size: .85rem; }
.quote {
  display: block; width: 100%; text-align: left; font: inherit; font-size: .8rem; color: inherit; opacity: .78;
  background: none; border: 0; border-left: 2px solid currentColor; border-radius: 0; padding: 0 0 0 8px; margin-bottom: 4px; white-space: normal; cursor: pointer;
}
.quote-who { display: block; font-weight: 600; }
.on-list { justify-self: start; display: block; width: max-content; margin-top: 6px; padding: 4px 10px; font-size: .75rem; border-radius: 999px; background: transparent; color: inherit; border: 1px solid currentColor; }

/* hold to react, swipe to reply */
.bubble { touch-action: pan-y; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; transition: transform .18s ease; }
.msg.swiping .bubble { transition: none; }
.bubble.held { outline: 2px solid var(--amber); outline-offset: 2px; }
.bubble.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { outline: 2px solid var(--amber); outline-offset: 3px; } 100% { outline: 2px solid transparent; outline-offset: 3px; } }
.bubble { position: relative; z-index: 1; }
.reply-hint { position: absolute; left: 10px; top: 12px; z-index: 0; opacity: 0; color: var(--muted); font-size: 1.1rem; transition: opacity .15s, color .15s; pointer-events: none; }
.msg.swiping .reply-hint { opacity: .5; }
.msg.will-reply .reply-hint { opacity: 1; color: var(--rose); }
.reactions {
  display: inline-flex; gap: 2px; margin-top: -12px; padding: 2px 7px; border-radius: 999px; font-size: .9rem; line-height: 1.3;
  background: var(--surface); border: 1px solid var(--line); position: relative; z-index: 1;
}
.msg.mine .reactions { margin-right: 8px; }
.msg.theirs .reactions { margin-left: 8px; }
.react-layer { position: fixed; inset: 0; z-index: 30; background: rgba(10, 5, 8, .35); }
.react-panel {
  position: fixed; display: grid; gap: 8px; padding: 8px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  max-width: calc(100vw - 24px);
}
.react-row { display: flex; gap: 2px; }
.react { font-size: 1.45rem; line-height: 1; padding: 7px; border-radius: 999px; background: transparent; border: 0; min-width: 42px; min-height: 42px; }
.react.on { background: var(--surface-2); outline: 2px solid var(--rose); }
.react-actions { display: flex; gap: 6px; }
.react-actions button { flex: 1; padding: 8px 12px; font-size: .85rem; }
.reply-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 6px 6px 12px; border-left: 3px solid var(--rose); background: var(--surface); border-radius: 10px; }
.reply-to { display: grid; min-width: 0; flex: 1; }
.reply-snip { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.seen { justify-self: end; font-size: .75rem; color: var(--muted); }
.msg-menu { display: flex; gap: 6px; }
.msg-menu button { padding: 6px 12px; font-size: .8rem; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--bg); border-top: 1px solid var(--line);
  padding-block: 10px calc(10px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.dock > * { max-width: 560px; margin-inline: auto; }
.dock-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  flex: 1; min-width: 0; resize: none; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px; max-height: 140px;
}
.composer textarea:focus { outline: 2px solid var(--rose); outline-offset: 1px; border-color: transparent; }
.composer .icon-btn { flex: none; padding: 10px 14px; }
.composer .icon-btn.square { padding: 9px; display: grid; place-items: center; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* in-app camera */
.camera {
  position: fixed; inset: 0; z-index: 40; background: #000; color: #f4e8ec;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.cam-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.camera button.ghost, .cam-top .icon-btn { color: #f4e8ec; background: transparent; border-color: rgba(255, 255, 255, .45); }
.camera .muted { color: rgba(244, 232, 236, .75); }
.cam-stage { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.cam-stage video, .cam-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cam-stage video.mirror { transform: scaleX(-1); }
.cam-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 18px 24px 22px; }
.cam-controls > :first-child { justify-self: start; }
.cam-controls > :last-child { justify-self: end; }
.cam-controls .primary, .cam-controls .ghost:not(.cam-flip) { min-width: 110px; }
.cam-controls:has(> :nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
.cam-flip { color: #f4e8ec; padding: 12px; }
.shutter { width: 72px; height: 72px; border-radius: 50%; padding: 0; background: #f4e8ec; border: 5px solid rgba(255, 255, 255, .35); background-clip: padding-box; }
.shutter:active { transform: scale(.94); }
.card-panel {
  background: var(--surface); border: 1px solid var(--amber); border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px; display: grid; gap: 14px;
}
.heat { display: flex; gap: 6px; }

.photo-view {
  position: fixed; inset: 0; z-index: 20; background: rgba(10, 5, 8, .94);
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.photo-view img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.photo-view .close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }

@media (max-width: 420px) {
  .brand-name { display: none; }
  .msg { max-width: 90%; }
}

/* ---------- question descriptions ---------- */
.q-head { display: grid; gap: 4px; }
.q-desc { font-size: .86rem; color: var(--muted); line-height: 1.45; }

/* ---------- update bar ---------- */
#update-bar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px;
  background: var(--surface); border: 1px solid var(--rose); border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0,0,0,.3); font-size: .9rem; max-width: calc(100% - 32px);
}

/* ---------- chapters ---------- */
.nav-rows { display: grid; gap: 8px; }
.chapters .chapter-chip { font-family: var(--display); font-size: .95rem; border-color: transparent; }
.chapters .chapter-chip[aria-current="true"] { background: var(--rose); border-color: var(--rose); color: #22101a; }
.chapters .chapter-chip[aria-current="true"] .done { color: #22101a; }

/* ---------- tried ---------- */
.tried { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 8px; }
.tried .link { justify-self: start; font-size: .85rem; }
.tried-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { padding: 6px 12px; font-size: .82rem; font-weight: 600; border-radius: 999px; background: transparent; }
.tchip.static { cursor: default; border: 1px solid var(--line); display: inline-block; }
.tchip[aria-pressed="true"].t-loved, .tchip.static.t-loved { background: var(--rose); border-color: var(--rose); color: #22101a; }
.tchip[aria-pressed="true"].t-ok, .tchip.static.t-ok { background: var(--amber); border-color: var(--amber); color: #22101a; }
.tchip[aria-pressed="true"].t-nope, .tchip.static.t-nope { background: var(--no); border-color: var(--no); color: var(--ink); }
.tchip.static.t-none { color: var(--muted); }
.tried-item { display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stack-sm { display: grid; gap: 6px; }

/* ---------- section guide ---------- */
.guide { background: var(--surface); border: 1px solid var(--amber); border-radius: var(--radius); padding: 14px 16px; }
.guide summary { cursor: pointer; font-family: var(--display); font-size: 1.1rem; }
.guide ol { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: .92rem; line-height: 1.5; }

/* ---------- surprise us ---------- */
.surprise-btn { border-color: var(--rose); color: var(--ink); }
.select-label { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.select-label select {
  font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; min-width: 0; flex: 1;
}
.kind-tag { justify-self: start; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kind-tag.k-do { color: var(--rose); }
.kind-tag.k-talk { color: var(--amber); }
.kind-tag.k-again { color: #7fd0a4; }
.card-panel { max-height: 60vh; overflow-y: auto; }

/* ---------- passkeys ---------- */
.or { text-align: center; font-size: .85rem; color: var(--muted); }
.passkey-row { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

/* ---------- in the mood ---------- */
.mood-btn { border-color: var(--rose); color: var(--rose); background: transparent; }
.mood-pick { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--rose); border-radius: var(--radius); }
.mood-banner {
  display: grid; gap: 4px; justify-items: start; justify-content: stretch; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--rose);
  background: var(--surface); color: var(--ink); font-weight: 400;
}
.mood-banner strong { font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.mood-banner .small { color: var(--rose); font-weight: 600; }

/* ---------- reminders in chat ---------- */
.msg.system { justify-self: center; justify-items: center; max-width: 92%; }
.bubble.system-note { background: transparent; border: 1px dashed var(--amber); text-align: center; display: grid; gap: 6px; justify-items: center; white-space: normal; }

/* ---------- our list ---------- */
.match-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.match-actions .suggest { margin-left: 0; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 12px; padding: 4px 14px 14px; }
.plan:has(.plan-head[aria-expanded="false"]) { padding-bottom: 4px; }
.plan.done .plan-text { text-decoration: line-through; color: var(--muted); }
.plan-head {
  all: unset; cursor: pointer; display: grid; gap: 2px; padding: 10px 0; min-width: 0;
}
.plan-head:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; border-radius: 6px; }
.plan-text { font-size: 1rem; overflow-wrap: anywhere; }
.plan input[type="date"] {
  font: inherit; font-size: .85rem; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; width: auto;
}
.plan-add input { flex: 1; min-width: 0; border-radius: 999px; }
.done-list summary { cursor: pointer; color: var(--muted); }
.done-list > .stack-sm { margin-top: 10px; }
.chip:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- new questions & editing ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.tag { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.tag-new { color: #22101a; background: var(--rose); border-color: var(--rose); }
.new-dot {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: var(--rose); color: #22101a; font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.chip[aria-current="true"] .new-dot { background: var(--bg); color: var(--ink); }
.new-btn {
  justify-content: flex-start; gap: 10px; width: 100%; border-color: var(--rose); background: transparent; font-weight: 600;
}
.new-btn .new-dot { margin-left: 0; }
.q-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.q-foot .tried { border-top: 0; padding-top: 0; flex: 1; min-width: 0; }
.q-foot > .link { flex: none; }
.q-form textarea {
  font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; resize: vertical;
}
.q-form textarea:focus { outline: 2px solid var(--rose); outline-offset: 1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: .9rem; }
.check input { width: 20px; height: 20px; accent-color: var(--rose); flex: none; }
.add-q > .ghost { border-style: dashed; color: var(--muted); }

/* ---------- us at a glance ---------- */
.compat { display: grid; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.compat-head { display: grid; gap: 4px; }
.compat-headline { font-family: var(--display); font-size: 1.25rem; line-height: 1.25; text-wrap: balance; }
.compat-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.swatch.shared, .seg.shared { background: var(--chart-shared); }
.swatch.talk, .seg.talk { background: var(--chart-talk); }
.compat-rows { display: grid; gap: 4px; }
.compat-row {
  all: unset; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px;
  padding: 8px 10px; margin: 0 -10px; border-radius: 10px;
}
.compat-row:hover { background: var(--surface-2); }
.compat-row[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--rose); }
.compat-row:focus-visible { outline: 2px solid var(--rose); outline-offset: 1px; }
.compat-name { font-size: .92rem; }
.compat-nums { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.compat-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.seg { display: block; height: 100%; min-width: 3px; }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg:only-child { border-radius: 4px; }
.chapter-filter { padding: 8px 12px; border: 1px solid var(--rose); border-radius: 999px; font-size: .9rem; }

/* ---------- tried history ---------- */
.last-done { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tried .row.small { gap: 12px; }
.when-row { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.date-pick { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink); }
.date-pick input {
  font: inherit; font-size: .85rem; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; width: auto;
}
.hist summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.hist > .stack-sm { margin-top: 8px; }
.hist-row { font-size: .88rem; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---------- pattern unlock ---------- */
.pattern-pad {
  width: min(78vw, 280px); height: auto; aspect-ratio: 1; max-width: 100%; justify-self: center; display: block; margin-inline: auto;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
}
.p-dot { fill: var(--muted); transition: r .12s, fill .12s; }
.p-dot.on { fill: var(--rose); r: 13; }
.p-line { fill: none; stroke: var(--rose); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.pattern-pad.error .p-dot.on, .pattern-pad.error { --rose: var(--danger); }
.pattern-pad.error { border-color: var(--danger); animation: p-shake .3s; }
.pattern-pad.ok { border-color: var(--rose); }
@keyframes p-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .pattern-pad.error, .bubble.flash { animation: none; } }
.pattern-hint { text-align: center; font-family: var(--display); font-size: 1.15rem; }
.pattern-login { gap: 12px; }

/* ---------- alerts nudge ---------- */
.nudge { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px dashed var(--amber); border-radius: var(--radius); background: transparent; color: var(--ink); font-weight: 500; text-align: left; }
.nudge .small { color: var(--amber); font-weight: 600; }
p.nudge { color: var(--muted); }

/* ----- v19: view-once and timed photos, new-messages line, jump button, typing, camera extras, crop ----- */
.photo-gone, .photo-once { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--muted); font-size: .9rem; }
.photo-once { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; text-align: left; color: var(--ink); background: transparent; border: 1px dashed var(--rose); border-radius: 14px; font: inherit; }
.photo-once .ico { grid-row: span 2; }
.photo-once .small { color: var(--muted); font-size: .8rem; }
.bubble.t-photo:has(.photo-gone), .bubble.t-photo:has(.photo-once) { padding: 4px; }
.photo-timer {
  position: absolute; left: 8px; bottom: 8px; padding: 4px 9px; border-radius: 999px; font-size: .72rem;
  background: rgba(20, 10, 15, .72); color: #f4e8ec; pointer-events: none;
}
.photo-view.once .once-note {
  position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center;
  color: rgba(244, 232, 236, .85); font-size: .85rem;
}
.quote.with-thumb { display: flex; gap: 8px; align-items: center; }
.quote-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; filter: blur(3px); flex: none; }
.bubble img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

.new-line { display: flex; align-items: center; gap: 10px; color: var(--rose); font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.new-line::before, .new-line::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }

.dock { overflow: visible; }
.dock > .jump {
  position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: -56px; margin: 0; max-width: none;
  min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

.typing { display: inline-flex; align-items: center; gap: 8px; justify-self: start; color: var(--muted); font-size: .85rem; }
.dots { display: inline-flex; gap: 3px; padding: 9px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .7; } }

.camera { -webkit-user-select: none; user-select: none; }
.cam-opts { display: grid; gap: 6px; justify-items: start; }
.cam-opt { padding: 7px 11px; font-size: .78rem; }
.cam-stage { position: relative; }
.cam-stage video { transform-origin: center; }
.cam-zoom {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #f4e8ec; border: 1px solid rgba(255, 255, 255, .35); font-size: .82rem;
}
.cam-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 6rem; font-weight: 700; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); pointer-events: none; }
.cam-focus { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid #e9b872; border-radius: 10px; pointer-events: none; animation: focus .9s ease-out forwards; }
@keyframes focus { from { transform: scale(1.4); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.cam-glow { position: fixed; inset: 0; z-index: 60; background: #fff; }
.composer-view { z-index: 45; grid-template-rows: auto 1fr auto auto; }
.lasts-box { padding: 0 16px 4px; }
.lasts { justify-content: center; }
.lasts .chip { color: #f4e8ec; border-color: rgba(255, 255, 255, .35); background: transparent; }
.lasts .chip[aria-current="true"] { background: #f4e8ec; color: #22101a; border-color: #f4e8ec; }
.lasts-note { text-align: center; min-height: 1.3em; }
.crop-area { position: absolute; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; }
.crop-h { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; }
.crop-h.nw { left: -4px; top: -4px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.crop-h.ne { right: -4px; top: -4px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.crop-h.sw { left: -4px; bottom: -4px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.crop-h.se { right: -4px; bottom: -4px; border-left: 0; border-top: 0; cursor: nwse-resize; }
.crop-h::after { content: ""; position: absolute; inset: -12px; } /* bigger touch target */

/* ----- v20: boundaries, notes, sorting, date night, search, video, saved, check-in, export ----- */
.bounds { background: var(--surface); border: 1px solid var(--amber); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.bounds-word strong { font-family: var(--display); font-size: 1.25rem; margin-left: 4px; }
.bounds-limits { white-space: pre-wrap; }
.bounds-slot:empty { display: none; }
.bounds-slot .bounds { padding: 10px 14px; }
.bounds-compact summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 4px; }
.bounds-compact summary::-webkit-details-marker { display: none; }
.bounds-compact[open] { display: grid; gap: 8px; }
.bounds label, .checkin-form label { display: grid; gap: 4px; }
.bounds input, .bounds textarea, .note input, .checkin-form textarea, #q-search {
  font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%;
}
.note { margin-top: 2px; }
.note-text { font-size: .88rem; font-style: italic; }
.note-form { gap: 6px; flex-wrap: nowrap; }
.note-form input { min-width: 0; flex: 1; padding: 7px 10px; }
.sort-label { align-self: center; margin-right: 2px; }
.date-night { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.date-night.closed { padding: 0; border: 0; background: none; }
.date-picks { display: grid; gap: 8px; padding-left: 1.2em; margin: 0; }
.date-picks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.date-picks .icon-btn { padding: 5px 10px; font-size: .78rem; flex: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.search-open { display: flex; align-items: center; gap: 8px; justify-content: flex-start; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; }
.search-open .ico { width: 18px; height: 18px; }
.bubble.t-video video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 14px; background: #000; }
.photo-view video { max-width: 100%; max-height: 100%; border-radius: 10px; }
.cam-mid { display: grid; justify-items: center; gap: 8px; padding-top: 10px; }
.camera:not(.composer-view) { grid-template-rows: auto 1fr auto auto; }
.cam-modes { display: flex; gap: 4px; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 3px; }
.cam-mode { background: transparent; color: rgba(244, 232, 236, .75); border: 0; padding: 6px 16px; border-radius: 999px; font-size: .85rem; }
.cam-mode[aria-checked="true"] { background: #f4e8ec; color: #22101a; font-weight: 600; }
.cam-rec { color: #ff6b6b; font-variant-numeric: tabular-nums; font-weight: 600; }
.shutter.rec { background: #e5484d; }
.shutter.recording { border-radius: 18px; transform: scale(.82); transition: border-radius .2s, transform .2s; }
.saved-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.saved-tile { position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; }
.saved-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) saturate(.6) brightness(.7); transform: scale(1.3); }
.saved-meta { position: absolute; left: 6px; bottom: 6px; font-size: .7rem; padding: 2px 7px; border-radius: 999px; background: rgba(20, 10, 15, .7); color: #f4e8ec; }
.saved-actions { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.checkin-banner { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--amber); background: var(--surface); color: var(--ink); }
.checkin-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkin-col { display: grid; gap: 8px; align-content: start; }
.checkin-col p { white-space: pre-wrap; }
@media (max-width: 420px) { .checkin-pair { grid-template-columns: 1fr; } }
.warn { color: var(--amber); }
.export-doc { background: #fff; color: #222; border-radius: 10px; padding: 20px; display: grid; gap: 14px; }
.export-doc h1 { font-size: 1.4rem; } .export-doc h2 { font-size: 1.1rem; margin-top: 8px; }
.export-doc table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.export-doc th, .export-doc td { border: 1px solid #ccc; padding: 5px 7px; text-align: left; vertical-align: top; }
.export-doc th { background: #f3f3f3; }
.export-doc .muted { color: #666; }
@media print {
  header.top, .no-print, .dock, #toast, #update-bar { display: none !important; }
  body, main { background: #fff !important; color: #222 !important; padding: 0 !important; }
  .export-doc { padding: 0; }
}

/* ----- beta: legal pages, setup tick, feedback ----- */
main.legal { max-width: 680px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top, 0px)) 16px 48px; }
.legal h2 { font-family: var(--display); font-size: 1.25rem; }
.legal ul { padding-left: 1.2em; display: grid; gap: 6px; }
.legal table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.legal a, .beta-check a { color: var(--rose); }
.beta-check { align-items: flex-start; }
.beta-check input { margin-top: 3px; flex: none; }
.beta-feedback textarea { font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
.beta-link { justify-self: center; }
.check a { color: var(--rose); }
