/* Layout: one narrow phone column. Today's prompt on top, the framed photo as the hero, actions under it. */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --ink: #2a1570;
  --muted: #4d586b;
  --line: #d9dee6;
  --accent: #2a1570;
  --on-accent: #ffffff;
  --logo-dot: #cc7a00; /* Cristi's Day logo: deeper gold on light grounds */
  --logo-lens: #ffffff;
  --display: "Fredoka", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Figtree", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* Dark = Cristi's Night logo: purple ground, white type, gold accents. Follows the phone unless the
   header switch (theme.js) has set data-theme. The two dark blocks must stay identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1b1145; --surface: #2a1570; --ink: #ffffff; --muted: #cfc7f2; --line: #4a3a9a; --accent: #ffb547; --on-accent: #2a1570; --logo-dot: #ffb547; --logo-lens: transparent; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #1b1145; --surface: #2a1570; --ink: #ffffff; --muted: #cfc7f2; --line: #4a3a9a; --accent: #ffb547; --on-accent: #2a1570; --logo-dot: #ffb547; --logo-lens: transparent; color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 440px; margin: 0 auto; padding-inline: 16px; padding-block: calc(20px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 18px; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topright { display: flex; align-items: center; gap: 10px; }
/* Cristi's wordmark: the name, then a dotted trail ending in the magnifier (same paths as the frame's). */
.logo { display: inline-flex; flex-direction: column; align-items: flex-start; color: var(--ink); }
.logo-word { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1; letter-spacing: -0.01em; }
.logo-trail { width: 148px; height: 32px; margin-top: -1px; }
.logo-dot { fill: var(--logo-dot); }
.logo-lens { fill: var(--logo-lens); stroke: currentColor; }
.logo-handle { stroke: currentColor; }
.logo-x { stroke: var(--logo-dot); }
.logolink { text-decoration: none; }
.themebtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.themebtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.themebtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Show the icon for the mode you'd switch to. */
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-sun { display: block; } :root:not([data-theme="light"]) .icon-moon { display: none; } }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }

.prompt { display: grid; gap: 6px; }
.dayrow { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.dayrow button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 44px; height: 44px; border-radius: 50%; font-size: 20px; cursor: pointer; line-height: 1; }
.dayrow button:disabled { opacity: 0.35; cursor: default; }
.dayrow .when { flex: 1; }
.dayrow .nextdrop { font-size: 13px; white-space: nowrap; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 8vw, 36px); line-height: 1.05; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.hint { margin: 0; color: var(--muted); max-width: 38ch; }

.stage { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 12px; }
#out, #saved { width: 100%; max-width: 100%; height: auto; display: block; border-radius: 4px; background: var(--line); }
.formats { display: inline-flex; justify-self: start; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.fmt { font: 600 13px var(--body); color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 5px 14px; cursor: pointer; }
.fmt[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.who { display: grid; gap: 6px; }
.who label { font-weight: 600; font-size: 14px; }
.who label span { font-weight: 400; color: var(--muted); font-size: 14px; }
.who input { font: 400 16px var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }

.actions { display: grid; gap: 10px; }
.btn.primary.before, #share { font-size: 17px; padding-block: 15px; }
.alt { margin: 0; text-align: center; font-size: 15px; }
.alt .linkish { color: var(--ink); }
/* One step at a time: before a photo only "Take a photo" shows; after, the name field and Share. */
.stage:not(.has-photo) .after, .stage.has-photo .before { display: none; }
/* "Who were you with?" only on connection days. */
.stage.no-who .who { display: none; }
.btn { font: 600 15px var(--body); border-radius: 10px; padding: 13px 12px; cursor: pointer; text-align: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.wide { grid-column: 1 / -1; }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#status { min-height: 1.5em; margin: 0; font-size: 14px; color: var(--muted); text-align: center; }

.tally { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tally > div { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tally b { font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.tally span { color: var(--muted); font-size: 14px; }

.note { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 6px; }
.note strong { color: var(--ink); font-weight: 600; }
.note p { margin: 0; }
.note details { display: grid; gap: 6px; }
.note details[open] > p { margin-top: 6px; }
.note summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; padding-block: 4px; }
.note summary::-webkit-details-marker { display: none; }
.note summary::after { content: "›"; font-size: 15px; line-height: 1; transition: transform 0.15s; }
.note details[open] summary::after { transform: rotate(90deg); }
.note summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.note a, .linkish { color: var(--muted); }
.linkish { font: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

.btn:focus-visible, .fmt:focus-visible, .dayrow button:focus-visible, .linkish:focus-visible, .who input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn:has(+ input:focus-visible) { outline: 3px solid var(--accent); }

.page { max-width: 600px; }
.page h1 { font-size: 30px; }
.page p, .page li { max-width: 62ch; }
/* Grid columns must be allowed to shrink below the canvas's 1080px intrinsic width. */
.wrap, .stage { grid-template-columns: minmax(0, 1fr); }
.wrap > *, .stage > * { min-width: 0; }

.daycolor { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.daycolor b { color: var(--ink); font-weight: 600; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--line); }
.heard { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.heard p { margin: 0; font-weight: 600; }
.heardopts { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 14px var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.heard .linkish { justify-self: start; font-size: 14px; color: var(--muted); }
.remind { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.remind p { margin: 0; }
.remind .remindopts { display: flex; flex-wrap: wrap; gap: 8px; }
.remind .chip { text-decoration: none; }
