/* The Daily With — dashboard, auth and operator console. */

/* ---------------------------------------------------------- themes
   The signed-in creator picks one in Settings and it is stamped on <html>
   as data-theme. Every colour below is a token; no component ever names a
   colour directly, so a new theme is one block of overrides and nothing
   else. "system" follows the phone's own light/dark setting.
   ------------------------------------------------------------------- */

:root,
:root[data-theme="light"],
:root[data-theme="system"] {
  color-scheme: light;
  --bg: #f7f4f8;
  --surface: #ffffff;
  --raise: #fbf8fc;
  --line: #e6dfe9;
  --line-strong: #cfc4d4;
  --text: #1c1722;
  --muted: #6b6276;
  --accent: #b2365f;
  --accent-text: #ffffff;
  --accent-wash: #fbeff4;
  --ok: #2d7350;
  --ok-wash: #eaf5ee;
  --warn: #8a5f12;
  --warn-wash: #fbf4e7;
  --stop: #a8303f;
  --stop-wash: #fcf0f1;
  --info: #2f5b8a;
  --info-wash: #ecf2f9;
  --code: #f1ecf2;
  --radius: 12px;
}

:root[data-theme="system"] { color-scheme: light dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]),
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #110e15;
    --surface: #18141d;
    --raise: #1e1a25;
    --line: #2b2533;
    --line-strong: #3c3449;
    --text: #f2eef6;
    --muted: #a79eb3;
    --accent: #e8699a;
    --accent-text: #1a0a11;
    --accent-wash: #27151f;
    --ok: #74cf99;
    --ok-wash: #14211a;
    --warn: #dcab57;
    --warn-wash: #241e12;
    --stop: #ec7682;
    --stop-wash: #251317;
    --info: #86b3e6;
    --info-wash: #15202d;
    --code: #221d29;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #110e15;
  --surface: #18141d;
  --raise: #1e1a25;
  --line: #2b2533;
  --line-strong: #3c3449;
  --text: #f2eef6;
  --muted: #a79eb3;
  --accent: #e8699a;
  --accent-text: #1a0a11;
  --accent-wash: #27151f;
  --ok: #74cf99;
  --ok-wash: #14211a;
  --warn: #dcab57;
  --warn-wash: #241e12;
  --stop: #ec7682;
  --stop-wash: #251317;
  --info: #86b3e6;
  --info-wash: #15202d;
  --code: #221d29;
}

:root[data-theme="rose"] {
  color-scheme: light;
  --bg: #fdf6f7;
  --surface: #fffdfd;
  --raise: #fef8f9;
  --line: #f0dfe3;
  --line-strong: #dcc0c7;
  --text: #2a1a20;
  --muted: #7a636c;
  --accent: #c2185b;
  --accent-text: #ffffff;
  --accent-wash: #fde9f0;
  --ok: #2f6f52;
  --ok-wash: #ecf5f0;
  --warn: #8a5a12;
  --warn-wash: #fbf2e5;
  --stop: #b02a3c;
  --stop-wash: #fdeef0;
  --info: #35598a;
  --info-wash: #edf1f8;
  --code: #f7e9ed;
}

:root[data-theme="sage"] {
  color-scheme: light;
  --bg: #f4f7f3;
  --surface: #ffffff;
  --raise: #fafbf8;
  --line: #e0e6db;
  --line-strong: #c0ccb8;
  --text: #1b211a;
  --muted: #5f6b5c;
  --accent: #3b6b4a;
  --accent-text: #ffffff;
  --accent-wash: #e7f1e9;
  --ok: #2d7350;
  --ok-wash: #e7f1e9;
  --warn: #7d5d14;
  --warn-wash: #f7f1e2;
  --stop: #a33a36;
  --stop-wash: #f8ecea;
  --info: #35608a;
  --info-wash: #ecf1f7;
  --code: #ebeee9;
}

:root[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #121a30;
  --raise: #18213b;
  --line: #25304e;
  --line-strong: #37486e;
  --text: #e9eefb;
  --muted: #94a3c4;
  --accent: #6aa6ff;
  --accent-text: #06101f;
  --accent-wash: #16233c;
  --ok: #5fd3a0;
  --ok-wash: #10231c;
  --warn: #e0b35c;
  --warn-wash: #241f12;
  --stop: #f1808c;
  --stop-wash: #261419;
  --info: #7fb6f0;
  --info-wash: #12202f;
  --code: #16203a;
}

:root[data-theme="noir"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0d0d0d;
  --raise: #141414;
  --line: #2e2e2e;
  --line-strong: #4d4d4d;
  --text: #ffffff;
  --muted: #bdbdbd;
  --accent: #ffd166;
  --accent-text: #000000;
  --accent-wash: #231d0d;
  --ok: #5ddc8f;
  --ok-wash: #0d1f14;
  --warn: #ffc24d;
  --warn-wash: #221a07;
  --stop: #ff8e8e;
  --stop-wash: #220f0f;
  --info: #8fc4ff;
  --info-wash: #0d1a26;
  --code: #171717;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--code); padding: 1px 6px; border-radius: 5px; }
h1 { font-size: 1.5rem; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 6px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.good { color: var(--ok); }
.bad { color: var(--stop); }
.eyebrow {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 10px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ----------------------------------------------------------- shell */

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: -.01em; }
.who { margin-left: auto; color: var(--muted); text-decoration: none; font-size: .9rem; }
.logout { margin: 0; }
.tabs {
  display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto; padding: 7px 12px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .92rem;
}
.tabs a[aria-current="page"] { background: var(--accent-wash); color: var(--accent); }
.tabs a.ops { margin-left: auto; }
.wrap { max-width: 820px; margin: 0 auto; padding: 18px 14px 60px; display: flex; flex-direction: column; gap: 16px; }

.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs a {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  text-decoration: none; color: var(--muted); font-size: .9rem; background: var(--surface);
}
.subtabs a[aria-current="page"] { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.subtabs .count { opacity: .7; margin-left: 4px; font-size: .8rem; }

/* ----------------------------------------------------------- cards */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* ----------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span { font-size: .85rem; color: var(--muted); font-weight: 500; }
.field small { font-size: .8rem; color: var(--muted); }
.field small.good { color: var(--ok); }
.field small.bad { color: var(--stop); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--text);
  background: var(--raise); border: 1px solid var(--line-strong); border-radius: 10px;
  min-height: 44px;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .linkbtn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input[type="file"] { font-size: .9rem; color: var(--muted); max-width: 100%; }
.prefixed { display: flex; align-items: stretch; }
.prefixed .prefix {
  display: flex; align-items: center; padding: 0 10px; font-size: .9rem; color: var(--muted);
  background: var(--code); border: 1px solid var(--line-strong); border-right: 0; border-radius: 10px 0 0 10px; white-space: nowrap;
}
.prefixed input { border-radius: 0 10px 10px 0; }
.handle-status.is-ok { color: var(--ok); }
.handle-status.is-bad { color: var(--stop); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks.inline { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  font: inherit; font-size: .82rem; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--raise); color: var(--text); cursor: pointer;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-block { width: 100%; }
.btn-small { min-height: 34px; padding: 5px 10px; font-size: .85rem; font-weight: 500; }
.btn.danger { color: var(--stop); }
.btn.research { border-style: dashed; color: var(--muted); font-weight: 500; }
.linkbtn {
  background: none; border: 0; padding: 4px 2px; font: inherit; font-size: .88rem;
  color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

/* ---------------------------------------------------------- notices */

.notice { padding: 11px 14px; border-radius: 10px; font-size: .93rem; border: 1px solid; }
.notice ul { margin: 0; padding-left: 18px; }
.notice.ok { background: var(--ok-wash); border-color: var(--ok); }
.notice.warn { background: var(--warn-wash); border-color: var(--warn); }
.notice.info { background: var(--info-wash); border-color: var(--info); }
.notice.error { background: var(--stop-wash); border-color: var(--stop); }
.notice.big { font-size: 1rem; padding: 14px 16px; }

/* ------------------------------------------------------------- auth */

body.auth { display: flex; min-height: 100vh; }
.auth-wrap { margin: auto; width: 100%; max-width: 420px; padding: 32px 16px; display: flex; flex-direction: column; gap: 18px; }
.auth-card { padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.auth-foot { text-align: center; font-size: .82rem; color: var(--muted); }
.auth-foot a { color: inherit; }

/* ------------------------------------------------------------- home */

.share-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.share-url { font-size: 1.25rem; font-weight: 700; color: var(--text); text-decoration: none; word-break: break-all; letter-spacing: -.01em; }
.share-body { display: grid; grid-template-columns: 160px 1fr; gap: 18px; margin-top: 14px; align-items: start; }
@media (max-width: 560px) { .share-body { grid-template-columns: 1fr; } }
.qr svg { width: 160px; height: 160px; border-radius: 8px; background: #fff; padding: 6px; }
.share-variants ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.share-variants li { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; font-size: .88rem; }
.share-variants li code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .share-variants li { grid-template-columns: 1fr auto; } .share-variants li span { grid-column: 1 / -1; color: var(--muted); } }
/* The Instagram set-up, folded under the share links. */
.ig-setup { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.ig-setup summary { font-size: .9rem; font-weight: 600; cursor: pointer; }
.ig-steps { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; line-height: 1.5; }
.ig-steps em { font-style: normal; color: var(--accent); }
.status-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.status h2 { font-size: 1.5rem; margin: 0; }
.todo { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.funnel-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.funnel-mini div { display: flex; flex-direction: column; }
.funnel-mini strong { font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.funnel-mini span { font-size: .8rem; color: var(--muted); }
.big-number { font-size: 1.05rem; margin-bottom: 8px; }
.big-number strong { font-size: 1.6rem; }
progress { width: 100%; height: 10px; border-radius: 999px; overflow: hidden; border: 0; background: var(--line); accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

/* ------------------------------------------------------------- page */

.editor { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .editor { grid-template-columns: 1fr; } .preview { order: -1; } }
.hero-pick { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.hero-current { width: 96px; aspect-ratio: 4 / 5; border-radius: 10px; background: var(--code); overflow: hidden; }
.hero-current img { width: 100%; height: 100%; object-fit: cover; }
/* The preview paints with the public-page palette from themes.css, so it
   shows exactly what a visitor gets under the creator's chosen theme. */
.phone {
  width: 100%; max-width: 260px; margin: 0 auto; border: 3px solid var(--line-strong); border-radius: 26px;
  background: var(--pub-bg); color: var(--pub-text); padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.ph-hero { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--pub-surface-2); }
.ph-hero img { width: 100%; height: 100%; object-fit: cover; }
.ph-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgb(var(--pub-shade) / 0) 40%, rgb(var(--pub-shade) / 1) 100%); }
.ph-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 12px 10px; display: flex; flex-direction: column; gap: 2px; color: #f6f1f7; }
.ph-text strong { font-size: 1.3rem; line-height: 1.05; }
.ph-text span { font-size: .78rem; color: rgba(255, 255, 255, .8); line-height: 1.3; }
.ph-btn { padding: 11px; border-radius: 12px; text-align: center; font-weight: 600; font-size: .85rem; background: linear-gradient(135deg, var(--pub-accent), var(--pub-accent-deep)); color: var(--pub-on-accent); }

/* ----------------------------------------------------------- photos */

.standard p { font-size: .93rem; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 22px 14px; border: 2px dashed var(--line-strong); border-radius: 12px; cursor: pointer;
  background: var(--raise);
}
.dropzone input { width: 100%; max-width: 280px; }
.dz-title { font-weight: 600; }
.dz-sub { font-size: .8rem; color: var(--muted); }
.dz-count { font-size: .85rem; color: var(--accent); font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs:empty { display: none; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.photo-list, .link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.photo-row, .link-row {
  display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
}
.photo-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.photo-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.caption-form { display: flex; gap: 8px; align-items: center; }
.caption-form input { min-height: 38px; padding: 7px 10px; }
/* "Saving…" / "Saved" beside a caption that saves itself. Fixed width so the
   row does not shuffle as the word changes. */
.caption-form .saved { flex: 0 0 auto; min-width: 54px; }
.saved.is-warn { color: var(--stop); }
.photo-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-tools form { margin: 0; }
.link-row { grid-template-columns: 40px 1fr; align-items: center; }
.link-row.is-hidden { opacity: .5; }
.link-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--code); display: flex; align-items: center; justify-content: center; }
.link-icon .icon { width: 20px; height: 20px; }
.link-main { display: flex; flex-direction: column; min-width: 0; }
.link-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .photo-tools { grid-column: 1 / -1; }
@media (min-width: 640px) { .link-row { grid-template-columns: 40px 1fr auto; } .link-row .photo-tools { grid-column: auto; } }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ stats */

.funnel { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 560px) { .funnel { grid-template-columns: 1fr 1fr; } }
.funnel li { display: flex; flex-direction: column; padding: 12px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line); position: relative; }
.funnel strong { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.funnel span { font-size: .8rem; color: var(--muted); }
.funnel em { font-style: normal; position: absolute; top: 10px; right: 10px; font-size: .78rem; color: var(--accent); font-weight: 600; }
.chart svg { width: 100%; height: auto; display: block; }
.bar-view { fill: var(--line-strong); }
.bar-gate { fill: var(--accent); }
.bar-label { fill: var(--muted); font-size: 11px; }
.legend { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 8px; vertical-align: middle; }
.sw.view { background: var(--line-strong); }
.sw.gate { background: var(--accent); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.card.tablewrap { padding: 0 6px; }

/* --------------------------------------------------------- calendar */

.daynav { display: flex; align-items: center; gap: 12px; }
.daynav-title { flex: 1; text-align: center; }
.daynav h1 { margin: 0; }
.time { font-size: .8rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.pill {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px; background: var(--code); color: var(--muted);
}
.pill.ok { background: var(--ok-wash); color: var(--ok); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.ghost { background: transparent; border: 1px solid var(--line-strong); }
.notice.small { padding: 8px 11px; font-size: .85rem; }
.inline { display: inline; margin: 0; }

/* Plan: the day strip */
.days { display: flex; gap: 6px; align-items: stretch; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; scroll-snap-type: x proximity; }
.days::-webkit-scrollbar { display: none; }
.days-arrow { flex: 0 0 auto; display: flex; align-items: center; padding: 0 6px; color: var(--muted); text-decoration: none; font-size: 1.2rem; }
.day {
  flex: 1 0 46px; min-width: 46px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 4px 7px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--text); scroll-snap-align: start;
}
.day span { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.day strong { font-size: 1.2rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.day.is-past { opacity: .6; }
.day.is-today strong { color: var(--accent); }
.day.is-selected { border-color: var(--accent); background: var(--accent-wash); opacity: 1; }
.day-dots { display: flex; gap: 2px; margin-top: 4px; height: 5px; }
.day-dots b { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.day-dots b.on { background: var(--accent); }

.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.plan-head h1 { margin: 0 0 2px; }
.plan-date { font-weight: 400; color: var(--muted); font-size: 1.05rem; margin-left: 4px; }
.plan-nav { display: flex; gap: 6px; }
.working { display: flex; align-items: center; gap: 10px; }
.working form { margin-left: auto; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Next up */
.nextup {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--accent-wash); border: 1px solid var(--accent);
}
.nextup.is-clear { background: var(--ok-wash); border-color: var(--ok); }
.nextup .eyebrow { margin: 0 0 2px; color: var(--accent); }
.nextup.is-clear .eyebrow { color: var(--ok); }
.nextup-main { display: flex; flex-direction: column; min-width: 0; }
.nextup-main strong { font-size: 1.02rem; line-height: 1.3; }
.nextup-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.countdown { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none; }
.countdown.is-late { color: var(--stop); }
.btn.is-on { border-color: var(--ok); color: var(--ok); }

/* Trend chips on the plan */
.trends-compact { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.trend-chip { display: inline-flex; align-items: center; gap: 6px; }
.trend-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.trend-chip.heat-rising i { background: var(--ok); }
.trend-chip.heat-peak i { background: var(--accent); }
.trend-chip.heat-fading i { background: var(--warn); }
.trend-chip[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.trend-detail { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line); font-size: .9rem; }
.trend-detail form { margin: 0; }
.trend-cta { align-items: center; }
.trend-cta form { margin: 0; }

/* Post cards */
.post {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 110px;
}
.post.goal-reach { border-left-color: var(--accent); }
.post.goal-engage { border-left-color: var(--ok); }
.post.goal-traffic { border-left-color: var(--info); }
.post.goal-fans { border-left-color: var(--warn); }
.post.is-done { opacity: .55; }
.post.is-skipped { opacity: .5; border-style: dashed; }
.post.is-busy { opacity: .6; }
.post-hero { box-shadow: 0 10px 30px color-mix(in srgb, var(--text) 8%, transparent); }
.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.goal { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.goal i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.goal-reach .goal { color: var(--accent); } .goal-reach .goal i { background: var(--accent); }
.goal-engage .goal { color: var(--ok); } .goal-engage .goal i { background: var(--ok); }
.goal-traffic .goal { color: var(--info); } .goal-traffic .goal i { background: var(--info); }
.goal-fans .goal { color: var(--warn); } .goal-fans .goal i { background: var(--warn); }
.post-when { margin-left: auto; display: flex; gap: 6px; align-items: baseline; }
.post-when b { color: var(--text); font-variant-numeric: tabular-nums; }
.post.is-late:not(.is-done) .post-when b { color: var(--stop); }
.post-done { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--muted); }
.post-when + .post-done { margin-left: 4px; }
.post-done input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.post-concept { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.post-hero .post-concept { font-size: 1.35rem; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.frame {
  position: relative; margin: 0; border-radius: 10px; border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(160deg, var(--raise), var(--code)); display: flex; align-items: flex-end; padding: 8px; aspect-ratio: 4 / 5;
}
.board-9-16 .frame { aspect-ratio: 9 / 16; }
.board-1-1 .frame { aspect-ratio: 1 / 1; }
.frame-n { position: absolute; top: 6px; left: 8px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.frame figcaption { font-size: .78rem; line-height: 1.25; font-weight: 500; overflow-wrap: anywhere; }
.frame-pic { padding: 0; grid-column: span 2; }
.frame-pic img { width: 100%; height: 100%; object-fit: cover; }
.post-scene { font-size: .92rem; }
.post-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.post-copy textarea[readonly] {
  background: var(--code); border-color: var(--line); font-size: 1rem; line-height: 1.5; min-height: 0;
  padding: 12px 14px; resize: none; white-space: pre-wrap; border-radius: 12px;
}
.post-title-line { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--code); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.post-actions form { margin: 0; }
.post-more summary { font-size: .85rem; color: var(--muted); cursor: pointer; }
.post-more .stack { margin-top: 10px; }
.post-by { font-size: .78rem; color: var(--muted); }
.post-empty { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.post-empty form { margin: 0; }
.draft-block { display: flex; flex-direction: column; gap: 5px; }
.draft-label {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.draft-label .btn-small { min-height: 28px; padding: 3px 9px; font-size: .78rem; }
.draft-text { font-size: .92rem; background: var(--code); border-radius: 10px; padding: 8px 11px; white-space: pre-wrap; }
.hooks { list-style: none; margin: 0; padding: 0; }
.hooks li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.hooks li:last-child { border-bottom: 0; }
.hooks .linkbtn { flex: none; }
.shots { margin: 0; padding-left: 20px; font-size: .9rem; display: flex; flex-direction: column; gap: 3px; }
.checklist { margin: 0; padding-left: 20px; font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.note-form textarea, .note-form input { font-size: .9rem; min-height: 38px; padding: 8px 10px; }

/* Quick ones */
.quick-row { display: flex; flex-direction: column; gap: 6px; }
.quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; scroll-snap-type: x proximity; }
.quick::-webkit-scrollbar { display: none; }
.post-quick { flex: 0 0 250px; padding: 12px; gap: 8px; scroll-snap-align: start; }
.post-quick .post-concept { font-size: 1rem; }
.post-quick .board { grid-auto-columns: 64px; }
.post-quick .post-copy textarea[readonly] { font-size: .9rem; padding: 9px 11px; }

/* Routines */
.routines { display: flex; flex-direction: column; gap: 6px; }
.routines ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.routine label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .85rem; cursor: pointer; }
.routine input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.routine em { font-style: normal; font-size: .66rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.routine.is-done label { opacity: .5; text-decoration: line-through; }

/* Trends: the full weekly panel on Week */
.trends-wrap > summary { font-weight: 600; cursor: pointer; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.trends-wrap[open] > summary { border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
.trends-wrap[open] > .card { border-radius: 0 0 var(--radius) var(--radius); }
.trends { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 110px; }
.trends-head { display: flex; flex-direction: column; gap: 10px; }
.trends-head h2 { margin: 0; font-size: 1.2rem; }
.tabs-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  font: inherit; font-size: .88rem; font-weight: 500; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.tab[aria-selected="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.tab .tick { color: var(--ok); margin-left: 4px; }
.tab-panel { display: flex; flex-direction: column; gap: 12px; }
.trend-platform { margin: 0; font-size: 1rem; }
.trends-summary { font-size: 1rem; }
.trends-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.trend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .trend-list { grid-template-columns: 1fr 1fr; } }
.trend {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--raise);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.trend.fits { border-color: var(--accent); }
.trend h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.trend-top { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.heat {
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.heat-rising { background: var(--ok-wash); color: var(--ok); }
.heat-peak { background: var(--accent-wash); color: var(--accent); }
.heat-fading { background: var(--warn-wash); color: var(--warn); }
.trend-why, .trend-how, .trend-shoot { font-size: .88rem; }
.trend-why { color: var(--muted); }
.trend-hook {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  font-style: italic; font-size: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px 6px 10px;
}
.trend-hook .btn-small { min-height: 28px; padding: 3px 9px; font-size: .78rem; font-style: normal; flex: none; }
.trend-src { font-size: .76rem; display: flex; gap: 10px; flex-wrap: wrap; }
.trend-src a { color: var(--muted); }
.trend-cols { display: grid; gap: 12px; }
@media (min-width: 720px) { .trend-cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.trend-aside { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.trend-aside h3 { margin: 0; font-size: .95rem; }
.trend-aside ul { margin: 0; padding-left: 18px; font-size: .88rem; display: flex; flex-direction: column; gap: 4px; }
.sources summary { font-size: .85rem; color: var(--muted); cursor: pointer; }
.sources ul { margin: 6px 0 0; padding-left: 18px; font-size: .82rem; display: flex; flex-direction: column; gap: 3px; }
.trend-empty { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.trend-empty form { margin: 0; }

/* Week: the timeline */
.week-summary { display: flex; flex-direction: column; gap: 8px; }
.week-figures { font-size: 1rem; }
.week-figures strong { font-size: 1.35rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl-day { display: grid; grid-template-columns: 54px 1fr; gap: 0 12px; }
@media (min-width: 720px) { .tl-day { grid-template-columns: 84px 1fr; gap: 0 18px; } }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-date {
  position: sticky; top: 104px; z-index: 1;
  display: flex; flex-direction: column; align-items: center; width: 50px; padding: 7px 0 6px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
}
.tl-date strong { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tl-date span { font-size: 1.3rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tl-day.is-today .tl-date { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.tl-day.is-today .tl-date strong { color: var(--accent); }
.tl-line { flex: 1; width: 2px; background: var(--line); margin: 6px 0 0; min-height: 24px; }
.tl-day:last-child .tl-line { background: linear-gradient(var(--line), transparent); }
.tl-body { min-width: 0; padding: 2px 0 28px; display: flex; flex-direction: column; gap: 4px; }
.tl-day.is-past .tl-body { opacity: .72; }
.tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.tl-head h2 { margin: 0; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-head form { margin: 0; }
.tl-moment { display: flex; gap: 8px; align-items: baseline; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.tl-moment strong { color: var(--text); font-weight: 600; }
.tl-period {
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600;
  margin: 10px 0 2px;
}
.tl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tl-item {
  display: grid; grid-template-columns: 50px 8px 30px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 7px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem;
}
.tl-item.is-main { border-color: var(--line-strong); background: var(--raise); padding: 10px; }
.tl-item.is-main .tl-title { font-weight: 600; font-size: .95rem; }
.tl-item.is-done { opacity: .55; }
.tl-item.is-done .tl-title { text-decoration: line-through; }
.tl-item.is-skipped { opacity: .5; border-style: dashed; }
.tl-time { font-size: .78rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.tl-item.goal-reach .tl-dot { background: var(--accent); }
.tl-item.goal-engage .tl-dot { background: var(--ok); }
.tl-item.goal-traffic .tl-dot { background: var(--info); }
.tl-item.goal-fans .tl-dot { background: var(--warn); }
.tl-plat {
  font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-align: center; padding: 3px 0;
  border-radius: 6px; background: var(--code); color: var(--muted);
}
.tl-title { color: var(--text); text-decoration: none; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.tl-flags { display: flex; gap: 4px; }
.tl-flags:empty { display: none; }
.tl-anytime { flex-direction: row; flex-wrap: wrap; }
.tl-anytime .tl-item { grid-template-columns: 8px 30px minmax(0, 1fr) auto; padding: 5px 9px; font-size: .82rem; }
.tl-now { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: .72rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.tl-now::after { content: ""; flex: 1; height: 2px; background: var(--accent); border-radius: 2px; }
.tl-routines { font-size: .78rem; color: var(--muted); margin-top: 8px; }

/* Settings: reminders */
.cal-url { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* -------------------------------------------------------------- ops */

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr 1fr; } }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }
.ops-table .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ops-table .actions form { margin: 0; display: flex; gap: 6px; align-items: center; }
.ops-table .actions input[type="text"] { min-height: 34px; padding: 5px 8px; font-size: .85rem; width: 180px; }
.ops-table tr.is-off { opacity: .5; }
.ops-table tr.is-new td { background: var(--ok-wash); }

/* ------------------------------------------------- offer thumbnails */

.offer-heading { font-size: .95rem; margin: 0; }
.thumbpick {
  display: flex; gap: 6px; padding: 2px 0 4px;
  overflow-x: auto; scrollbar-width: none;
}
.thumbpick::-webkit-scrollbar { display: none; }
.thumbpick label {
  position: relative; flex: 0 0 auto; cursor: pointer;
  border-radius: 10px; border: 2px solid transparent; line-height: 0;
}
.thumbpick input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.thumbpick img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; display: block; }
.thumbpick label:has(input:checked) { border-color: var(--accent); }
.thumbpick label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumbpick-none span {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 8px;
  background: var(--code); color: var(--muted); font-size: .72rem; line-height: 1;
}

/* ----------------------------------------------------------- themes */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.theme-option { position: relative; }
.theme-option input {
  position: absolute; inset: 0; margin: 0;
  width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.theme-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--surface); pointer-events: none;
}
.theme-option input:checked + .theme-card { border-color: var(--accent); }
.theme-option input:focus-visible + .theme-card { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-swatch {
  display: flex; height: 44px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line);
}
.theme-swatch i { flex: 1; }
.theme-swatch i:last-child { flex: 0 0 26%; }
.theme-swatch i:nth-child(1) { background: var(--sw1); }
.theme-swatch i:nth-child(2) { background: var(--sw2); }
.theme-swatch i:nth-child(3) { background: var(--sw3); }

/* Swatch paint lives here, not in a style attribute: the CSP forbids inline
   styles. Keep these in step with config/dailywith.php — a test fails if a
   theme is added there without a rule here. */
.sw-system   { --sw1: #f7f4f8; --sw2: #18141d; --sw3: #b2365f; }
.sw-light    { --sw1: #f7f4f8; --sw2: #ffffff; --sw3: #b2365f; }
.sw-dark     { --sw1: #110e15; --sw2: #18141d; --sw3: #e8699a; }
.sw-rose     { --sw1: #fdf6f7; --sw2: #fffdfd; --sw3: #c2185b; }
.sw-sage     { --sw1: #f4f7f3; --sw2: #ffffff; --sw3: #3b6b4a; }
.sw-midnight { --sw1: #0b1020; --sw2: #121a30; --sw3: #6aa6ff; }
.sw-noir     { --sw1: #000000; --sw2: #0d0d0d; --sw3: #ffd166; }
.theme-name { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 6px; }
.theme-name .tick { color: var(--accent); opacity: 0; }
.theme-option input:checked + .theme-card .tick { opacity: 1; }
.theme-hint { font-size: .78rem; color: var(--muted); line-height: 1.35; }

/* ------------------------------------------- plain-language plan cards */

.post-what { font-size: .85rem; color: var(--muted); line-height: 1.4; }
.post-what b { color: var(--text); font-weight: 600; }
.post-section { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 4px; }
.post-reply { display: flex; flex-direction: column; gap: 5px; }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--ok); font-weight: 600; }
.unverified { color: var(--warn); }
.trend-chip .tick { font-size: .72rem; color: var(--ok); }
.times { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.times-row { display: flex; gap: 6px 10px; align-items: baseline; flex-wrap: wrap; }
.times-row .slot { white-space: nowrap; }
.times-row .ok { color: var(--ok); font-weight: 600; }
.times-row .off { color: var(--warn); font-weight: 600; }
.times-src { font-size: .76rem; color: var(--muted); }
.times-src a { color: inherit; }
.plan-tz { font-size: .78rem; color: var(--muted); }
.check-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.unconfirmed summary { font-size: .85rem; color: var(--muted); cursor: pointer; }
.unconfirmed ul { margin: 6px 0 0; padding-left: 18px; font-size: .85rem; color: var(--muted); }

/* ---------------------------------------------------------------- Viewing as
   The bar an operator sees while signed in as a creator. Deliberately loud:
   it is the one thing that stops a change landing in the wrong account. */
.viewing-as {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--warn-wash);
  color: var(--warn);
  border-bottom: 2px solid var(--warn);
  font-size: 14px;
}
.viewing-as strong { color: var(--text); }
.viewing-as form { margin: 0; }
