/* Socdy · 2026 interface.
   Brand kept from v1: red #D72134, orange #F79623, the orange pictogram, the coffee photo (full on the
   welcome screen, behind a veil everywhere else).
   Working screens: warm light background, clean cards, one main action per screen, thumb-reach tab bar on phones.
   System fonts only: no third-party call. */
:root {
  --red: #D72134; --red-dark: #B01B2B; --orange: #F79623; --orange-ink: #9A5200; --success: #16803A;
  --bg: #FAF6F1; --surface: #FFFFFF; --surface-2: #F3ECE4; --text: #2B2522; --muted: #6F6660; --line: #E8DFD5;
  --primary: var(--red); --primary-hover: var(--red-dark); --on-primary: #FFFFFF;
  --link: var(--red); --accent-soft: #FFF1DF; --ring: rgba(247, 150, 35, .55);
  --shadow: 0 1px 2px rgba(43, 37, 34, .05), 0 6px 20px rgba(43, 37, 34, .06);
  --shadow-lift: 0 2px 4px rgba(43, 37, 34, .06), 0 14px 32px rgba(43, 37, 34, .10);
  --radius: 18px; --radius-sm: 12px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar: rgba(250, 246, 241, .82);
  --veil: rgba(250, 246, 241, .84);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110F; --surface: #1E1A17; --surface-2: #29231F; --text: #F2ECE6; --muted: #B3A9A0; --line: #352E29;
    --primary: #E5303F; --primary-hover: #F04452; --link: #FFB25C; --orange-ink: #FFB25C; --accent-soft: #33240F;
    --success: #4CC873; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 14px 32px rgba(0, 0, 0, .45); --bar: rgba(20, 17, 15, .82);
    --veil: rgba(20, 17, 15, .86);
    color-scheme: dark;
  }
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; }
/* The coffee photo behind every screen, veiled so cards and text stay readable. A fixed layer
   rather than background-attachment: fixed, which iOS Safari ignores. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--veil), var(--veil)), #2A1A12 url("img/cafe-mobile.3ac7e2d6ae61.jpg") center / cover no-repeat; }
@media (min-width: 900px) {
  body::before { background: linear-gradient(var(--veil), var(--veil)), #2A1A12 url("img/cafe.946c73a05a4a.jpg") center / cover no-repeat; }
}
body.welcome::before { display: none; }
a { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
h1, h2 { line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem); font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 .8rem; }
.icon { flex: none; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .65rem max(16px, env(safe-area-inset-left)); padding-top: max(.65rem, env(safe-area-inset-top));
  background: var(--bar); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none;
  font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; }
.brand img { display: block; }
.menu { display: none; gap: .2rem; margin-left: auto; }
.menu a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 600; padding: .45rem .8rem; border-radius: 999px; }
.menu a:hover { color: var(--text); background: var(--surface-2); }
.menu a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.menu a.animator { color: var(--primary); }
.bell { position: relative; display: grid; place-items: center; width: 42px; height: 42px; margin-left: auto; border-radius: 999px;
  color: var(--text); text-decoration: none; }
.bell:hover, .bell[aria-current="page"] { background: var(--surface-2); }
.bell .count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg); }
@media (min-width: 900px) {
  .menu { display: flex; }
  .bell { margin-left: 0; }
}

/* Page */
.page { max-width: 680px; margin: 0 auto; padding: 1.4rem 16px 3rem; }
.page > h1 { margin: .4rem 0 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem;
  margin: 0 0 1rem; box-shadow: var(--shadow); }
.step, .source { color: var(--muted); font-size: .88rem; margin: 0 0 .35rem; }
.summary { font-size: 1.12rem; }
.lede { color: var(--muted); margin: 0 0 1rem; }
.progress { display: flex; gap: .35rem; margin: 0 0 .9rem; }
.progress span { flex: 1; height: 5px; border-radius: 999px; background: var(--surface-2); }
.progress span.done { background: var(--orange); }
.objectives { display: grid; gap: .6rem; }
.objective { display: flex; flex-direction: column; gap: .15rem; text-align: left; width: 100%; min-height: 44px;
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.objective strong { font-size: 1.05rem; }
.objective span { color: var(--muted); font-size: .92rem; }
.objective:hover { border-color: var(--orange); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.back { margin-top: 1rem; background: none; border: 0; padding: .4rem 0; color: var(--muted); font: 600 .92rem var(--font); cursor: pointer; }
.back:hover { color: var(--text); }
.objective-tag { display: inline-block; margin: 0 0 .4rem; padding: .25rem .7rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--orange-ink); font-weight: 650; font-size: .9rem; }
.targets { padding-left: 1.3rem; margin: .3rem 0 1rem; }
.targets > li { margin-bottom: .55rem; }
.targets ul { margin: .2rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.topics { display: flex; flex-wrap: wrap; gap: .4rem; }
.topics span { padding: .2rem .65rem; border-radius: 999px; background: var(--surface-2); font-size: .88rem; }
.post { margin: .4rem 0 .9rem; font-size: 1.02rem; }
.plain { margin: 0; padding-left: 1.1rem; }
.links { text-align: center; color: var(--muted); }
.on-dark { color: var(--muted); }
h2.on-dark { color: var(--text); margin-top: 1.4rem; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.card > .actions:first-child { margin-top: 0; }
.actions + form { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.button, .mode { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px;
  padding: .6rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: 650 1rem var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s, box-shadow .15s; }
.button:hover { background: var(--surface-2); }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--primary); border-color: transparent; color: var(--on-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 16px color-mix(in srgb, var(--primary) 28%, transparent); }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { border-color: var(--primary); color: var(--primary); }
details.cancel summary { cursor: pointer; font-weight: 650; }
details.cancel[open] summary { margin-bottom: .6rem; }
.button.big { font-size: 1.08rem; min-height: 54px; padding: .8rem 1.6rem; }
.button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.mode { min-height: 36px; padding: .35rem .9rem; font-size: .9rem; }
.read-link { color: var(--text); }
.read-aloud { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; color: var(--muted);
  cursor: pointer; font: 600 .92rem var(--font); padding: 0 0 .7rem; }
.read-aloud:hover { color: var(--text); }

/* Fields */
textarea, input[type=url], input[type=text], input[type=email], input[type=number], input[type=time], input[type=date], select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .75rem .85rem; margin: .3rem 0; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 3rem; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--accent-soft); }
::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.choices { border: 0; padding: 0; margin: 0 0 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.choices legend { font-weight: 700; margin-bottom: .4rem; }
.choices label { display: flex; align-items: center; gap: .55rem; }
.choices input[type=radio], .choices input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); }
.choices input[type=number], .choices input[type=time] { width: 7rem; margin: 0; padding: .45rem .6rem; }
.stacked p { display: flex; flex-direction: column; gap: .3rem; }
.stacked label, .share-form label { font-weight: 700; }
.share-form label { display: block; margin-top: .8rem; }
.stacked .helptext { color: var(--muted); font-size: .85rem; }
.errorlist { color: var(--primary); margin: 0; padding-left: 1rem; }
.error-text { color: var(--primary); }

/* Dictation: one big « Parler » button */
.dictation { display: flex; flex-direction: column; gap: .55rem; }
.mic { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 56px; padding: .9rem 1rem;
  border: 0; border-radius: 999px; background: var(--orange); color: #2A1806; font: 700 1.08rem var(--font); cursor: pointer;
  box-shadow: 0 6px 18px rgba(247, 150, 35, .35); transition: transform .1s, background-color .15s; }
.mic:hover { background: #FFA43A; }
.mic:active { transform: scale(.99); }
.mic .icon { width: 24px; height: 24px; }
.mic[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); }
  60% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--primary) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .mic[aria-pressed="true"] { animation: none; } * { transition: none !important; } }
.mic-note { margin: 0; font-size: .92rem; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--accent-soft);
  color: var(--text); }
.voice-note { margin: 0 0 .9rem; }
.voice-note p { margin: 0 0 .4rem; }
.mic-note label { display: flex; align-items: center; gap: .45rem; margin-top: .4rem; font-size: .85rem; color: var(--muted); cursor: pointer; }
.mic-note input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--primary); }
/* In text mode the field comes first and the mic is discreet. */
body[data-input-mode="text"] .dictation { flex-direction: column-reverse; }
body[data-input-mode="text"] .mic { align-self: flex-start; min-height: 40px; padding: .45rem .95rem; font-size: .95rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
body[data-input-mode="text"] .mic .icon { width: 20px; height: 20px; color: var(--orange-ink); }

/* Messages and states */
.notice { border-radius: var(--radius-sm); padding: .8rem 1rem; margin: 0 0 1rem; background: var(--accent-soft); color: var(--text); }
.notice.error { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.notice.success { background: color-mix(in srgb, var(--success) 14%, var(--surface)); }
.notice-card, .unread { box-shadow: inset 4px 0 0 var(--orange), var(--shadow); }
.campaign { box-shadow: inset 4px 0 0 var(--primary), var(--shadow); }
.path, .advice { background: var(--surface-2); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.waiting { color: var(--muted); }
.waiting::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .5em; vertical-align: -.05em;
  border: 2px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.htmx-indicator { display: none; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }

/* Articles and drafts */
.article { padding-top: 0; overflow: hidden; }
.thumb { width: calc(100% + 2.5rem); margin: 0 -1.25rem 1rem; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  background: var(--surface-2); }
.article h2 { font-size: 1.2rem; }
.variant { transition: box-shadow .2s; }
.variant.chosen { box-shadow: 0 0 0 2px var(--orange), var(--shadow-lift); }
.source-line { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem 0;
  border-bottom: 1px solid var(--line); }
.source-line:last-child { border-bottom: 0; }

/* PBI, levels, badges, ranking */
.score { font-size: 3.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--text); margin: .3rem 0 1rem; }
.score small { font-size: 1.1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.trend { display: inline-block; margin-left: .6rem; padding: .15rem .55rem; border-radius: 999px; font-size: .95rem; font-weight: 700;
  letter-spacing: 0; vertical-align: middle; }
.trend.up { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.trend.down { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.bar { display: flex; flex-direction: column; gap: .3rem; margin: .8rem 0; font-size: .95rem; }
.bar meter { width: 100%; height: 10px; }
meter { appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--surface-2); }
meter::-webkit-meter-bar { background: var(--surface-2); border: 0; border-radius: 999px; height: 10px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value {
  background: linear-gradient(90deg, var(--orange), var(--primary)); border-radius: 999px; }
meter::-moz-meter-bar { background: linear-gradient(90deg, var(--orange), var(--primary)); border-radius: 999px; }
.levels { padding-left: 1.3rem; color: var(--muted); }
.levels li { margin: .3rem 0; }
.levels li.on { color: var(--text); font-weight: 700; }
.levels li.on::marker { color: var(--orange); }
.badge { display: inline-flex; align-items: center; gap: .3rem; background: var(--accent-soft); border-radius: 999px;
  padding: .3rem .8rem; margin: .2rem; font-size: .92rem; font-weight: 600; }
.ranking li { margin: .25rem 0; }
.ranking li.me { font-weight: 700; color: var(--primary); }

/* Animator space */
.submenu { display: flex; gap: .3rem; overflow-x: auto; white-space: nowrap; margin: 0 -16px 1.2rem; padding: .2rem 16px;
  scrollbar-width: none; }
.submenu::-webkit-scrollbar { display: none; }
.submenu a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .95rem;
  color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 600; }
.submenu a:hover { background: var(--surface-2); }
.submenu a[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .7rem; margin: .5rem 0; }
.figures div { display: flex; flex-direction: column; background: var(--surface-2); border-radius: var(--radius-sm); padding: .8rem .9rem;
  color: var(--muted); font-size: .88rem; }
.figures strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; color: var(--text); }

/* Phone tab bar */
.tabbar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: .35rem max(8px, env(safe-area-inset-left)) max(.45rem, env(safe-area-inset-bottom));
  background: var(--bar); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line); }
.tabbar > a, .tabbar summary { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem 0;
  color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; cursor: pointer; list-style: none; border-radius: 12px; }
.tabbar summary::-webkit-details-marker { display: none; }
.tabbar [aria-current="page"] { color: var(--primary); }
.tabbar [aria-current="page"] .icon { stroke-width: 2.3; }
.more { position: relative; }
.more .sheet { position: absolute; right: 0; bottom: calc(100% + .7rem); min-width: 220px; padding: .4rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.more .sheet a { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: var(--radius-sm); color: var(--text);
  text-decoration: none; font-weight: 600; }
.more .sheet a:hover { background: var(--surface-2); }
.more .sheet .icon { color: var(--muted); }
body.has-tabbar .page { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .tabbar { display: none; }
  body.has-tabbar .page { padding-bottom: 3rem; }
}

/* Welcome: the coffee cup of the v1 sign-in page, the only screen with a photo. */
body.welcome { background: #2A1A12 url("img/cafe-mobile.3ac7e2d6ae61.jpg") center / cover fixed no-repeat; }
@media (min-width: 900px) { body.welcome { background-image: url("img/cafe.946c73a05a4a.jpg"); } }
body.welcome .top { background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.welcome .brand { color: #FFFFFF; }
.hero { min-height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  gap: .4rem; padding: 2rem 1.4rem; margin: 2rem 0; border-radius: 28px; color: #FFFFFF;
  background: linear-gradient(180deg, rgba(20, 12, 8, .35), rgba(20, 12, 8, .72)); }
.hero img { width: 88px; height: 88px; margin-bottom: .6rem; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.8rem); font-weight: 800; max-width: 16ch; }
.hero p { font-size: 1.15rem; max-width: 34ch; color: rgba(255, 255, 255, .88); }
.hero .button { margin-top: .8rem; }

/* Editing a proposal, proofreading before it leaves */
.edit { margin: .2rem 0 .4rem; }
.edit summary { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; list-style: none;
  color: var(--muted); font-weight: 600; font-size: .92rem; padding: .3rem 0; }
.edit summary::-webkit-details-marker { display: none; }
.edit summary:hover { color: var(--text); }
.edit summary .icon { width: 18px; height: 18px; }
.edit[open] summary { color: var(--text); }
.variant:has(.edit[open]) .post, .variant:has(.edit[open]) .read-aloud { display: none; }
.publish .actions { margin-top: .4rem; }
.remarks { padding-left: 0; list-style: none; margin: .4rem 0 .6rem; display: grid; gap: .55rem; }
.remarks li { padding: .7rem .85rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.remarks .kind { display: inline-block; margin-right: .35rem; padding: .05rem .55rem; border-radius: 999px; font-size: .8rem;
  font-weight: 700; background: var(--accent-soft); color: var(--orange-ink); }
.remarks .kind.kindness { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.actions.three .button { flex: 1 1 12rem; justify-content: center; text-align: center; }
.actions.three .button[aria-expanded="true"] { border-color: var(--orange); background: var(--accent-soft); }
.proposal { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* Waiting for articles: a cup of coffee filling slowly */
.brewing { display: none; position: fixed; inset: 0; z-index: 60; padding: 16px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(6px) saturate(1.2); -webkit-backdrop-filter: blur(6px) saturate(1.2); }
.brewing.htmx-request, .brewing.on { display: grid; place-items: center; animation: brewing-in .25s ease-out; }
.brewing-card { width: min(100%, 360px); text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 1.6rem 1.4rem 1.2rem; }
.cup { width: 140px; height: 130px; display: block; margin: 0 auto .6rem; }
.cup .mug { stroke: var(--text); }
.cup .saucer { fill: var(--surface-2); }
.cup .coffee rect { fill: #6B3E26; }
.cup .coffee .crema { fill: #C89B6D; }
.cup .coffee { transform: translateY(62px); animation: brewing-fill 40s cubic-bezier(.3, .6, .35, 1) forwards; }
.cup .steam { stroke: color-mix(in srgb, var(--muted) 60%, transparent); opacity: 0; }
.cup .steam path { animation: brewing-steam 2.6s ease-in-out infinite; opacity: 0; }
.cup .steam path:nth-child(2) { animation-delay: .8s; }
.cup .steam path:nth-child(3) { animation-delay: 1.6s; }
.brewing.htmx-request .cup .steam, .brewing.on .cup .steam { animation: brewing-show 1s 4s forwards; }
.brewing-lines { position: relative; min-height: 3.2em; margin: 0 0 .3rem; font-weight: 650; }
.brewing-lines span { position: absolute; inset: 0; opacity: 0; }
.brewing-lines .l1 { animation: brewing-line 8s forwards; }
.brewing-lines .l2 { animation: brewing-line 8s 8s forwards; }
.brewing-lines .l3 { animation: brewing-show .6s 16s forwards; }
@keyframes brewing-in { from { opacity: 0; } }
@keyframes brewing-fill { to { transform: translateY(6px); } }
@keyframes brewing-steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes brewing-show { to { opacity: 1; } }
@keyframes brewing-line { 0%, 100% { opacity: 0; } 8%, 88% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cup .coffee { animation: none; transform: translateY(30px); }
  .cup .steam path, .brewing.htmx-request .cup .steam, .brewing.on .cup .steam { animation: none; opacity: 0; }
  .brewing-lines .l1 { animation: none; opacity: 1; }
  .brewing-lines .l2, .brewing-lines .l3 { animation: none; }
}

/* Campaign form: each zone says what it is for */
.campaign-form .field { border: 0; margin: 0 0 1.4rem; padding: 0; min-width: 0; }
.campaign-form .field > label, .campaign-form legend { display: block; font-weight: 700; margin-bottom: .2rem; padding: 0; }
.campaign-form .hint { color: var(--muted); font-size: .9rem; margin: 0 0 .45rem; }
.campaign-form .optional { font-weight: 500; color: var(--muted); font-size: .85rem; margin-left: .3rem; }
.campaign-form select { width: 100%; }
.modes { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.mode-card { position: relative; display: flex; flex-direction: column; gap: .25rem; padding: .85rem 1rem .9rem 2.6rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  transition: border-color .15s, box-shadow .15s; }
.mode-card input { position: absolute; left: .95rem; top: 1.05rem; width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }
.mode-card span { color: var(--muted); font-size: .88rem; }
.mode-card:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 0 3px var(--accent-soft); }
.mode-card:has(input:disabled) { cursor: default; }
.mode-card:has(input:disabled:not(:checked)) { opacity: .45; }
.when-row { display: grid; gap: .8rem 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.when-row label { display: block; font-weight: 650; font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .15rem 0 .2rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .3rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 .88rem var(--font); cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"], .chip:has(input:checked) { border-color: var(--orange); background: var(--accent-soft); color: var(--orange-ink); }
.choices-chips .chip input { position: absolute; opacity: 0; pointer-events: none; }
.choices-chips .chip:has(input:focus-visible) { outline: 3px solid var(--ring); outline-offset: 2px; }
.when-summary { margin: 0 0 .4rem; padding: .75rem .9rem; border-radius: var(--radius-sm); background: var(--accent-soft);
  color: var(--text); font-weight: 650; }
.when-line { font-weight: 650; }
.campaign-form textarea[name="content"] { font-size: 1.05rem; }
.campaign-form .lede { font-weight: 650; color: var(--text); }
.detect { margin: .5rem 0 0; padding: .7rem .85rem; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: .95rem; }
.advanced { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.advanced > summary { cursor: pointer; font-weight: 650; color: var(--muted); padding: .3rem 0; }
.advanced > summary:hover, .advanced[open] > summary { color: var(--text); }
.advanced[open] > summary { margin-bottom: .6rem; }
.campaign-form .check { display: flex; align-items: center; gap: .55rem; font-weight: 650; }
.campaign-form .check input { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); }
.command fieldset { border: 0; padding: 0; margin: 0 0 .6rem; }
.skip { text-align: center; margin: .4rem 0 1.2rem; }
.skip .link { background: none; border: 0; padding: .4rem; font: 600 .92rem var(--font); text-decoration: underline; cursor: pointer; }

/* Animator's campaign list: running, coming day by day, past folded away */
.agenda-day h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.campaign-card h3 { margin: .1rem 0 .4rem; font-size: 1.08rem; }
.campaign-card .badge { font-size: .8rem; padding: .15rem .6rem; vertical-align: middle; }
.campaign-card.cancelled h3 a { color: var(--muted); }
.tally { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .2rem 0; font-weight: 600; }
.tally .failed { color: var(--primary); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin: .5rem 0 0; }
details.past summary { cursor: pointer; font-weight: 700; font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
.link-choice { display: block; margin: .6rem 0 .2rem; }
.link-choice .step { display: inline; }
.card-quote { margin: .4rem 0 .6rem; }
.card-quote label { display: block; font-weight: 600; }
.card-quote textarea { margin-top: .3rem; }
.card-quote img { display: block; width: min(100%, 320px); height: auto; margin-top: .6rem; border-radius: 10px; border: 1px solid var(--line); }
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatches .actions { flex-basis: 100%; }
.swatch { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .9rem; border-radius: 10px;
  background: var(--swatch); color: var(--swatch-ink); font-weight: 650; cursor: pointer; border: 2px solid transparent; }
.swatch input { margin-right: .5rem; accent-color: var(--swatch-ink); }
.swatch:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
