/* Snuggler admin. Brand tokens from site/index.html (cream, plum, orange, teal), self-hosted Nunito.
   One stylesheet, no inline styles anywhere: sizes are SVG attributes, colours are classes. */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600 900; font-display: swap; src: url(/fonts/nunito-latin.woff2) format("woff2"); }
:root {
  --bg: #fff6ec; --card: #ffffff; --ink: #3a2d3f; --muted: #6a5a70; --plum: #4a3a52; --orange: #ffa06a; --teal: #8fd4c5; --line: #eadfd2;
  --soft: #fbefe1; --good: #1f7a62; --good-bg: #dff3ec; --warn: #8a5a00; --warn-bg: #fff0cf; --bad: #b3261e; --bad-bg: #fde4e1; --info: #2f5e9e; --info-bg: #e3edfb;
  --bar: #4a3a52; --bar2: #ffa06a; --focus: #2f5e9e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1520; --card: #261e2d; --ink: #f4ecf6; --muted: #b6a8bc; --plum: #6f5a7a; --orange: #ffa06a; --teal: #8fd4c5; --line: #3a2f43;
    --soft: #2f2537; --good: #7fdcbf; --good-bg: #1c3a31; --warn: #ffd37a; --warn-bg: #3d3115; --bad: #ff9d94; --bad-bg: #44211f; --info: #9cc2f5; --info-bg: #1f2f48;
    --bar: #ffa06a; --bar2: #8fd4c5; --focus: #9cc2f5; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1520; --card: #261e2d; --ink: #f4ecf6; --muted: #b6a8bc; --plum: #6f5a7a; --line: #3a2f43;
  --soft: #2f2537; --good: #7fdcbf; --good-bg: #1c3a31; --warn: #ffd37a; --warn-bg: #3d3115; --bad: #ff9d94; --bad-bg: #44211f; --info: #9cc2f5; --info-bg: #1f2f48;
  --bar: #ffa06a; --bar2: #8fd4c5; --focus: #9cc2f5; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.55 "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-wrap: anywhere; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.01em; margin: 0; font-weight: 900; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin-bottom: 4px; }
h3 { font-size: 1.05rem; margin-bottom: 6px; }
h4 { font-size: .95rem; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
p { margin: 0 0 10px; }
code { font: 600 .88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
code.wrap { display: block; padding: 8px 10px; word-break: break-all; }
small { font-size: .82em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* shell: phone first (bottom tab bar), sidebar from 900px */
body.app { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 3px solid var(--plum); padding-bottom: env(safe-area-inset-bottom, 0px); }
.side .brand, .side .who { display: none; }
.nav { display: grid; grid-template-columns: repeat(6, 1fr); }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; padding: 6px 2px; text-decoration: none; color: var(--muted); font-weight: 800; font-size: .68rem; }
.nav-item.on { color: var(--ink); background: var(--soft); box-shadow: inset 0 3px 0 var(--orange); }
.ico { flex: none; }
main { max-width: 1040px; margin: 0 auto; padding: 16px 16px 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ctl-label { font-weight: 800; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--line); background: var(--card); text-decoration: none; font-weight: 800; font-size: .9rem; }
.chip.on { border-color: var(--plum); background: var(--soft); }
.foot { margin-top: 28px; color: var(--muted); font-size: .82rem; text-align: center; }
@media (min-width: 900px) {
  body.app { padding-bottom: 0; padding-left: 232px; }
  .side { top: 0; right: auto; bottom: 0; width: 232px; border-top: 0; border-right: 3px solid var(--plum); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; }
  .side .brand { display: flex; }
  .side .who { display: flex; margin-top: auto; align-items: center; justify-content: space-between; gap: 8px; }
  .nav { display: flex; flex-direction: column; gap: 4px; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 14px; font-size: .98rem; }
  .nav-item.on { box-shadow: inset 4px 0 0 var(--orange); }
  main { padding: 28px 32px 40px; }
  .top { flex-direction: row; align-items: center; justify-content: space-between; }
  h1 { font-size: 1.9rem; }
}
.brand { align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.02em; }
.brand small { font-weight: 800; color: var(--muted); font-size: .8rem; margin-left: -4px; }
.brand.big { display: flex; font-size: 1.5rem; margin-bottom: 14px; }
.dot { width: 22px; height: 22px; border-radius: 7px; border: 3px solid var(--plum); background: var(--orange); box-shadow: 3px 3px 0 var(--teal); }
.who-link { font-weight: 800; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.who-link:hover { background: var(--soft); }

/* cards, tiles */
.card { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; margin: 0 0 16px; }
.card > .note { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.card .tiles { margin: 10px 0 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.tile { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.card .tile { background: var(--soft); border-color: transparent; }
.tile-label { font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile-value { font-size: 1.55rem; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: .8rem; color: var(--muted); }
.tile.muted .tile-value { color: var(--muted); }
.two { display: grid; gap: 16px; }
@media (min-width: 720px) { .two { grid-template-columns: 1fr 1fr; } }

/* buttons and pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 3px solid var(--plum); background: var(--orange); color: #2b2030; font: 900 1rem/1 "Nunito", system-ui, sans-serif; text-decoration: none; box-shadow: 0 4px 0 var(--plum); cursor: pointer; text-align: center; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--plum); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--plum); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.big { min-height: 56px; padding: 0 26px; font-size: 1.1rem; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: .92rem; }
.btn.secondary { background: var(--card); color: var(--ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); box-shadow: 0 4px 0 var(--bad); }
.inline { font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; display: inline-block; padding: 10px 0; margin-right: 12px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; border: 2px solid currentColor; line-height: 1.4; white-space: nowrap; }
.pill.good { color: var(--good); background: var(--good-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.info { color: var(--info); background: var(--info-bg); }
.pill.neutral { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row form { margin: 0; }

/* tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
th.num, td.num { text-align: right; }
td.num { white-space: nowrap; }
td .meter { width: 100%; min-width: 70px; max-width: 160px; }
.meter { display: block; height: 8px; }
.meter-bg { fill: var(--line); }
.meter-fg { fill: var(--orange); }

/* banners and states */
.banner { background: var(--warn-bg); color: var(--warn); border: 2px solid var(--warn); border-radius: 14px; padding: 10px 14px; margin: 0 0 14px; font-weight: 700; }
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.unavail { background: var(--warn-bg); color: var(--warn); border: 2px dashed var(--warn); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.ok-line { color: var(--good); font-weight: 800; }
.bad-line { color: var(--bad); font-weight: 800; }
.foot-note { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.hl { background: var(--bad-bg); color: var(--bad); padding: 1px 6px; border-radius: 6px; font-weight: 800; }
.notes { margin: 0; padding-left: 20px; }
.notes li { margin: 4px 0; }
.todo-list { margin: 0 0 10px; padding-left: 20px; }
.todo-list li { margin: 6px 0; }
.skipped { margin-top: 12px; color: var(--muted); font-size: .9rem; }
.skipped summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.status { min-height: 1.5em; font-weight: 800; }

/* recommendations */
.recs { display: grid; gap: 12px; }
@media (min-width: 900px) { .recs { grid-template-columns: 1fr 1fr; } }
.rec { border: 2px solid var(--line); border-left: 8px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card); }
.rec.sev-high { border-left-color: var(--bad); }
.rec.sev-medium { border-left-color: var(--orange); }
.rec.sev-low { border-left-color: var(--info); }
.rec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.rec-id { font-weight: 900; color: var(--muted); font-size: .8rem; }
.rec-area { color: var(--muted); font-size: .8rem; margin-left: auto; text-transform: uppercase; letter-spacing: .05em; }
.rec h3 { margin: 0 0 4px; }
.rec p { margin: 0 0 6px; font-size: .92rem; }
.rec-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
.mkt-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; text-decoration: none; border: 2px solid var(--line); background: var(--card); min-height: 48px; }
.mkt-line.idle { border-color: var(--orange); background: var(--soft); }
.mkt-line .go { margin-left: auto; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.health { display: grid; gap: 8px; }
.hc { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* charts */
.charts { display: grid; gap: 16px; }
@media (min-width: 900px) { .charts { grid-template-columns: 1fr 1fr; } }
figure { margin: 0; }
figcaption { font-size: .82rem; color: var(--muted); margin-top: 4px; }
svg.chart { width: 100%; height: auto; max-width: 100%; display: block; }
.chart .bar { fill: var(--bar); }
.chart .line { stroke: var(--bar); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--bar2); stroke: var(--bar); stroke-width: 1.5; }
.chart .axis { fill: var(--muted); font: 700 9px "Nunito", system-ui, sans-serif; }

/* campaigns */
.hero { border: 3px solid var(--plum); box-shadow: 0 5px 0 var(--plum); }
.hero.idle { background: var(--soft); }
.hero-line { font-size: clamp(1.5rem, 5vw, 2.1rem); margin-bottom: 8px; }
.hero.idle .hero-line { color: var(--ink); }
.hero.running .hero-line { color: var(--good); }
.section-title { margin: 24px 0 10px; font-size: 1.35rem; }
.homes { display: grid; gap: 14px; }
@media (min-width: 640px) { .homes { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.home p { margin: 6px 0 0; font-size: .86rem; }
.home .btn { width: 100%; }
.campaign { background: var(--card); border: 2px solid var(--line); border-left: 8px solid var(--line); border-radius: 18px; padding: 16px; margin: 0 0 16px; scroll-margin-top: 16px; }
.campaign.st-live { border-left-color: var(--good); }
.campaign.st-draft, .campaign.st-in_review { border-left-color: var(--orange); }
.camp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.camp-id { font-size: .78rem; color: var(--muted); }
.camp-obj { margin: 8px 0 12px; }
.camp-open { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.camp-open .btn { width: 100%; }
@media (min-width: 560px) { .camp-open .btn { width: auto; } }
.camp-cols { display: grid; gap: 16px; margin-bottom: 10px; }
@media (min-width: 800px) { .camp-cols { grid-template-columns: 1fr 1fr; } }
.copy { margin: 0; }
.copy dt { font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.copy dd { margin: 2px 0 0; padding: 8px 12px; background: var(--soft); border-radius: 10px; font-weight: 700; }
.facts { display: grid; grid-template-columns: 1fr; gap: 2px 14px; margin: 12px 0; }
.facts dt { font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.facts dd { margin: 0; }
@media (min-width: 700px) { .facts { grid-template-columns: 140px 1fr; } .facts dt { margin-top: 0; padding-top: 3px; } .facts dd { margin-bottom: 6px; } }
.captions, .needs { margin-top: 10px; }
.captions summary, .needs summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.assets { display: flex; flex-wrap: wrap; gap: 12px; }
.asset { width: 120px; }
.asset img { width: 120px; height: auto; max-height: 260px; object-fit: cover; object-position: top; border-radius: 12px; border: 2px solid var(--line); background: var(--soft); }
.asset figcaption { font-size: .75rem; }
.asset.cmd { width: 100%; background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.asset.cmd p { margin: 2px 0 6px; font-size: .85rem; }
.checks { list-style: none; margin: 8px 0 0; padding: 0; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.checks .box { flex: none; width: 22px; height: 22px; margin-top: 2px; border: 3px solid var(--plum); border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; line-height: 1; font-size: .8rem; }
.checks li.done .box { background: var(--teal); color: #1c3a31; }
.checks li.done { color: var(--muted); }
.checks.big li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.progress-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.progress-top .meter { flex: 1; height: 12px; }
.variant { padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.variant:last-child { border-bottom: 0; }

/* forms and auth */
label { display: block; font-weight: 800; font-size: .85rem; margin: 10px 0 4px; }
input[type="text"], input[type="email"] { width: 100%; max-width: 360px; min-height: 48px; padding: 0 14px; border: 2px solid var(--plum); border-radius: 12px; background: var(--card); color: var(--ink); font: 700 1rem "Nunito", system-ui, sans-serif; }
.search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.search label { width: 100%; margin: 0; }
.search input { flex: 1 1 160px; }
body.bare { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
body.bare main { width: 100%; max-width: 480px; padding-top: 8px; }
.auth-card { background: var(--card); border: 3px solid var(--plum); border-radius: 22px; box-shadow: 0 6px 0 var(--plum); padding: 24px 20px; }
.auth-card h1 { margin-bottom: 8px; }
.auth-card .btn { width: 100%; margin: 12px 0 4px; }
.props { font-size: .85rem; color: var(--muted); }
.side .who .pill { font-size: .65rem; }

@media (max-width: 520px) {
  th, td { padding: 8px 5px; font-size: .84rem; }
  th { font-size: .64rem; white-space: normal; letter-spacing: .03em; }
  .card { padding: 14px 12px; }
}

.nowrap { white-space: nowrap; }
code { word-break: break-word; }

/* Authenticator-app sign-in and enrolment */
[hidden] { display: none !important; }
.auth-card form { margin: 12px 0; }
.auth-card label { display: block; margin: 10px 0 4px; font-weight: 800; }
.auth-card .or { text-align: center; color: var(--muted); margin: 14px 0 0; font-weight: 800; }
.secret { font: 800 1.15rem ui-monospace, Menlo, Consolas, monospace; word-break: break-all; padding: 10px 12px; border: 2px dashed var(--plum); border-radius: 12px; background: var(--card); user-select: all; }
.recovery { font: 800 1.05rem ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; padding: 10px 12px; border: 2px solid var(--plum); border-radius: 12px; background: var(--card); user-select: all; }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { width: 220px; height: 220px; border-radius: 8px; }
