/* Long Story Short: styles copied from prototype v1.0 (locked), plus a few additions marked "ADDED". */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url(/fonts/dm-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url(/fonts/dm-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url(/fonts/dm-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-weight: 700; font-style: italic; font-display: swap; src: url(/fonts/dm-sans-latin-700-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* latin-ext (addendum v1.3): Polish, Romanian, German and Tagalog letters such as ą ł ș ț ß. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url(/fonts/dm-sans-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url(/fonts/dm-sans-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url(/fonts/dm-sans-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-weight: 700; font-style: italic; font-display: swap; src: url(/fonts/dm-sans-latin-ext-700-italic.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #fff7ee;
  --surface: #ffffff;
  --ink: #232042;
  --muted: #6b6785;
  --line: #eadfd2;
  --accent: #e8458b; /* prototype had coral #ff5a4e here as a fallback; set to Her pink so no red can show */
  --accent-ink: #ffffff;
  --sun: #ffc94d;
  --sun-ink: #3b2d00;
  --good: #1f8f5f;
  --her: #e8458b; --her-ink: #ffffff; --her-tint: #ffd0e4;
  --him: #2f6fe4; --him-ink: #ffffff; --him-tint: #cddfff;
  --tint: var(--her-tint); --tint-ink: #241a30;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17152b; --surface: #211e3b; --ink: #f6efe6; --muted: #a9a4c4; --line: #36315a;
    --accent: #ff6fae; --accent-ink: #2a0618; --sun: #ffcf5c; --sun-ink: #3b2d00; --good: #4cd08f;
    --her: #ff6fae; --her-ink: #2a0618; --her-tint: #ffc2dc;
    --him: #6ea2ff; --him-ink: #06142e; --him-tint: #bcd3ff;
    --tint-ink: #1d1730;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17152b; --surface: #211e3b; --ink: #f6efe6; --muted: #a9a4c4; --line: #36315a;
  --accent: #ff6fae; --accent-ink: #2a0618; --sun: #ffcf5c; --sun-ink: #3b2d00; --good: #4cd08f;
  --her: #ff6fae; --her-ink: #2a0618; --her-tint: #ffc2dc;
  --him: #6ea2ff; --him-ink: #06142e; --him-tint: #bcd3ff;
  --tint-ink: #1d1730;
  color-scheme: dark;
}
/* Speaker's colour drives the tab and button; the result card takes the listener's colour. */
body[data-mode="short"] { --accent: var(--her); --accent-ink: var(--her-ink); --tint: var(--him-tint); }
body[data-mode="decode"] { --accent: var(--him); --accent-ink: var(--him-ink); --tint: var(--her-tint); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; /* ADDED: prototype ran inside a frame; a normal page needs this to avoid sideways scroll */
  overflow-x: hidden;
  background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  padding-block: 28px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
main { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
header { display: flex; flex-direction: column; gap: 6px; }
h1 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 9vw, 3.6rem);
  line-height: 0.95; letter-spacing: -0.03em; margin: 0; text-wrap: balance;
}
/* Steve, 18 Oct 2026: "short." in the brand pink (the Her tab pink) on both tabs. Light #e8458b, dark #ff6fae. Never red. */
h1 .brand-short, h1 .gap { color: var(--her); }
.sub { margin: 0; color: var(--muted); max-width: 46ch; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--line); padding: 6px; border-radius: 16px; }
.mode {
  font: inherit; font-weight: 700; color: var(--muted); background: transparent; border: 0; border-radius: 12px;
  padding: 12px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  min-width: 0;
}
.mode small { font-weight: 500; font-size: 0.8rem; }
.mode { border: 2px solid transparent; }
#mode-short { border-color: var(--her); }
#mode-decode { border-color: var(--him); }
#mode-short[aria-pressed="true"] { background: var(--her); color: var(--her-ink); }
#mode-decode[aria-pressed="true"] { background: var(--him); color: var(--him-ink); }
.mode[aria-pressed="true"] small { opacity: .9; }
.mode .who { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.mode:focus-visible, button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
label.field { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
textarea {
  width: 100%; min-height: 150px; resize: vertical; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; line-height: 1.5;
}
/* ADDED: input takes the speaker's colour (handover: Her input pink, His input blue). */
#input { border: 2px solid var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  font: inherit; font-size: 0.9rem; font-weight: 500; color: var(--ink); background: transparent;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 13px; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; text-align: left;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.ghost { border-style: dashed; color: var(--muted); }
.chip.ghost.ex-her[aria-pressed="true"] { background: #E01484; border-color: #E01484; border-style: solid; color: #fff; }
.chip.ghost.ex-him[aria-pressed="true"] { background: #0098C7; border-color: #0098C7; border-style: solid; color: #fff; }
.go {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 14px; padding: 15px 20px; cursor: pointer; width: 100%;
}
.go:disabled { opacity: 0.6; cursor: progress; }
.hint { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ADDED: microphone button (stub), character count, paste note, free tries (stub). */
.inputwrap { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.inputwrap textarea { flex: 1; min-width: 0; }
.mic {
  flex: none; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface);
  color: var(--accent); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: -6px; }
.charcount, .pastenote, .micnote, .tries { margin: 0; font-size: 0.8rem; color: var(--muted); }
.charcount.over { color: var(--ink); font-weight: 700; }
.pastenote button { font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.tries:empty { display: none; }

.ticket { background: var(--tint); color: var(--tint-ink); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.ticket .tag { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ticket .tag .ex { background: var(--tint-ink); color: var(--tint); border-radius: 999px; padding: 1px 9px; }
.short { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 6vw, 2.1rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.inc { margin: 0; padding: 12px 0 0; list-style: none; border-top: 2px dashed var(--tint-ink); display: flex; flex-direction: column; gap: 6px; }
.inc li { display: flex; gap: 8px; font-weight: 500; overflow-wrap: anywhere; }
.inc li::before { content: "\2713"; font-weight: 800; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.verdict { font-weight: 700; font-style: italic; }
.count { font-variant-numeric: tabular-nums; font-size: 0.85rem; font-weight: 700; }
.copy { font: inherit; font-weight: 700; background: var(--tint-ink); color: var(--tint); border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
a.copy { text-decoration: none; display: inline-block; }
.sharenote { font-size: 0.8rem; opacity: .8; }
.via { font-size: 0.8rem; font-weight: 700; opacity: .85; } /* ADDED: "via Long Story Short + web address" (locked) */
.err { color: var(--accent); font-weight: 500; margin: 0; }
.thinking { opacity: 0.7; }

/* ADDED: calm safety message (handover 3.5). Neutral colours on purpose: no pink/blue fun, no red. */
.safety { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.safety h2 { font-family: var(--font-body); font-size: 1.15rem; font-weight: 700; margin: 0; }
.safety p { margin: 0; }
.safety .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.safety a { color: var(--ink); }
.safety .small { font-size: 0.85rem; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .ticket.pop { animation: pop .28s ease-out; }
  @keyframes pop { from { transform: translateY(8px) scale(.98); opacity: .4; } to { transform: none; opacity: 1; } }
}
footer { color: var(--muted); font-size: 0.8rem; }
footer a { color: var(--muted); }

/* ADDED (addendum v1.2): logo mark beside the wordmark. Ink square stays dark in both modes. */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { flex: none; width: clamp(40px, 10vw, 56px); height: auto; aspect-ratio: 1; }
.lg-sq { fill: #232042; }
.lg-her { fill: var(--her); }
.lg-acc { fill: var(--accent); }
.lg-him { fill: var(--him); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lg-sq { stroke: var(--line); stroke-width: 2; } }
:root[data-theme="dark"] .lg-sq { stroke: var(--line); stroke-width: 2; }

/* ADDED (addendum v1.2): Share this app, footer line, iPhone hint. */
.shareapp { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shareapp-msg { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
footer .a2hs { color: inherit; font-size: inherit; }
/* Prototype v2.0: Share and unlock panel. */
.sharebox { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.qr { background: #ffffff; padding: 8px; border-radius: 12px; width: 136px; height: 136px; flex: none; }
.qr img, .qr canvas { display: block; width: 120px; height: 120px; }
.sharebox .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sharebox h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 0; letter-spacing: -0.01em; }
.sharebox p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.kofi { font: inherit; font-weight: 700; text-decoration: none; text-align: center; background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 11px 14px; }
@media (max-width: 420px) { .sharebox { grid-template-columns: 1fr; justify-items: center; } .sharebox .col { width: 100%; } }
.iphone-hint {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px));
  max-width: 480px; margin: 0 auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); z-index: 10; font-size: 0.9rem;
}
.iphone-hint[hidden] { display: none; }
.iphone-hint p { margin: 0; flex: 1; }
.hint-close { font: inherit; font-weight: 700; background: var(--ink); color: var(--bg); border: 0; border-radius: 10px; padding: 8px 12px; cursor: pointer; flex: none; }

/* ADDED (milestone 2): voice states. Accent colour, never red. */
.mic[data-state="listening"] { background: var(--accent); color: var(--accent-ink); }
.mic[data-state="working"] { opacity: .6; cursor: progress; }
.micnote.live::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
@media (prefers-reduced-motion: no-preference) {
  .mic[data-state="listening"] { animation: ring 1.4s ease-out infinite; }
  .micnote.live::before { animation: blink 1s ease-in-out infinite; }
  @keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
  @keyframes blink { 50% { opacity: .25; } }
}
.micnote { color: var(--ink); }
.voiceprivacy { margin: -8px 0 0; font-size: 0.8rem; color: var(--muted); }

/* ADDED (milestone 2): free tries line, unlock card (calm, neutral). */
.tries { margin: 0; font-size: 0.8rem; color: var(--muted); }
.linkish { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.unlock { background: var(--surface); color: var(--ink); border: 2px solid var(--accent); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.unlock h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; margin: 0; }
.unlock p { margin: 0; }
.unlock .small { font-size: 0.85rem; color: var(--muted); }
.coderow { display: flex; gap: 8px; flex-wrap: wrap; }
.coderow input { flex: 1 1 100%; min-width: 0; font: inherit; font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 11px 12px; text-transform: uppercase; }
.coderow input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.go.compact { width: auto; font-size: 1rem; padding: 11px 18px; }
.codemsg { font-weight: 700; min-height: 1em; }
.codemsg:empty { display: none; }
.codemsg a { color: inherit; }
.hint[hidden] { display: none; }

/* Addendum v1.3: "Reply in" dropdown (one small control under the style chips). */
.replyin { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.replyin select {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--surface); border: 2px solid var(--line, currentColor);
  border-radius: 999px; padding: 6px 30px 6px 14px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.replyin select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Result text in another language: no tight letter-spacing (it breaks joined scripts), room for tall scripts. */
.xl { letter-spacing: 0; }
.short.xl { line-height: calc(1.1 * var(--lh, 1)); }
.inc.xl li, .verdict.xl, .xlhelp { line-height: calc(1.5 * var(--lh, 1)); }
.short[dir="rtl"], .inc[dir="rtl"], .verdict[dir="rtl"] { text-align: right; }
.unlock .kofi { align-self: flex-start; text-decoration: none; }
