/* Kitty Board admin. The colour tokens, base, buttons, chips and fields are copied from site/css/app.css
   (keep them in step with the app); the admin layout, tables, panels and dialogs follow. */
:root {
  --bg: #FFF7F2;
  --bg2: #FFEFE7;
  --surface: #FFFFFF;
  --surface2: #FBF6F9;
  --fill: rgba(43, 34, 54, .06);
  --fill2: rgba(43, 34, 54, .1);
  --ink: #2B2236;
  --soft: #756A80;
  --faint: #91879A;
  --line: #F0E6EC;
  --line2: #E4D7DF;
  --list-bg: rgba(255, 255, 255, .66);
  --pink: #FF5C8A;
  --pink-deep: #C93C6A;
  --pink-soft: #FFE4EC;
  --blue: #4E8CFF;
  --blue-soft: #E3EDFF;
  --lilac: #A67CFF;
  --lilac-soft: #EFE7FF;
  --mint: #22B98F;
  --mint-soft: #DCF5EE;
  --sun: #FFB547;
  --sun-soft: #FFF1D9;
  --red: #BD3359;
  --red-soft: #FFE1E8;
  --kitty: #FF5C8A; /* person pink: fixed, so app themes (which re-tint --pink) never change hearts or jars */
  --kitty-soft: #FFE4EC;
  --kitty-deep: #E8457A;
  --logo: #E8645A;
  --accent2: #FF9A6B;
  --jo: var(--blue);
  --jo-soft: var(--blue-soft);
  --olivia: var(--mint);
  --olivia-soft: var(--mint-soft);
  --both: var(--lilac);
  --both-soft: var(--lilac-soft);
  --navbar: #2B2236;
  --navbar-ink: #A9A0B5;
  --overlay: rgba(30, 22, 40, .45);
  --shadow-sm: 0 2px 6px rgba(43, 34, 54, .06);
  --shadow: 0 6px 16px rgba(43, 34, 54, .08);
  --shadow-lg: 0 20px 44px rgba(43, 34, 54, .2);
  --f-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --f-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17131D; --bg2: #1D1724; --surface: #231C2B; --surface2: #2A2233; --fill: rgba(255, 255, 255, .06); --fill2: rgba(255, 255, 255, .11);
    --ink: #F4EEF8; --soft: #B3A8C0; --faint: #7E7389; --line: #33293D; --line2: #43374E; --list-bg: rgba(35, 28, 43, .78);
    --pink: #FF6E97; --pink-deep: #FF5C8A; --pink-soft: #3B1F2D; --blue: #74A3FF; --blue-soft: #1E2A46; --lilac: #B795FF; --lilac-soft: #2D2346;
    --mint: #3FD3A8; --mint-soft: #15342C; --sun: #FFC266; --sun-soft: #3A2E18; --red: #FF6B8E; --red-soft: #401D29;
    --kitty: #FF6E97; --kitty-soft: #3B1F2D; --kitty-deep: #FF5C8A;
    --navbar: #0F0C14; --navbar-ink: #8D8399; --overlay: rgba(5, 3, 8, .62);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .3); --shadow: 0 6px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 20px 44px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17131D; --bg2: #1D1724; --surface: #231C2B; --surface2: #2A2233; --fill: rgba(255, 255, 255, .06); --fill2: rgba(255, 255, 255, .11);
  --ink: #F4EEF8; --soft: #B3A8C0; --faint: #7E7389; --line: #33293D; --line2: #43374E; --list-bg: rgba(35, 28, 43, .78);
  --pink: #FF6E97; --pink-deep: #FF5C8A; --pink-soft: #3B1F2D; --blue: #74A3FF; --blue-soft: #1E2A46; --lilac: #B795FF; --lilac-soft: #2D2346;
  --mint: #3FD3A8; --mint-soft: #15342C; --sun: #FFC266; --sun-soft: #3A2E18; --red: #FF6B8E; --red-soft: #401D29;
  --kitty: #FF6E97; --kitty-soft: #3B1F2D; --kitty-deep: #FF5C8A;
  --navbar: #0F0C14; --navbar-ink: #8D8399; --overlay: rgba(5, 3, 8, .62);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .3); --shadow: 0 6px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 20px 44px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-body); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-family: var(--f-display); font-weight: 600; text-wrap: balance; }
hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--pink) 55%, transparent); outline-offset: 2px; }
.muted { color: var(--soft); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.push { margin-left: auto; }
.grow { flex: 1; min-width: 0; }
.wrap-row { flex-wrap: wrap; margin-top: 8px; }

/* ---------- Buttons and controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--fill);
  color: var(--ink); padding: 9px 16px; border-radius: 999px; font-weight: 800; font-size: 14px;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--fill2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--pink)); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--fill); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 13px 22px; font-size: 16px; }
.btn.full { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; background: transparent;
  border-radius: 12px; color: var(--soft); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--fill); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.link { background: none; border: 0; padding: 0; color: var(--pink-deep); font-weight: 800; font-size: 13px; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--red); }
.link:disabled { color: var(--soft); cursor: default; text-decoration: none; }

.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; background: var(--surface);
  border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--ink); white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: transform .1s, background .15s;
}
.chip-btn:hover { background: var(--surface2); }
.chip-btn:active { transform: scale(.96); }
.chip-btn.on { background: var(--ink); color: var(--bg); }
.chip-btn.danger { color: var(--red); }
.chip-btn:disabled { opacity: .45; cursor: default; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; border: 0;
  color: #fff; font-size: 12px; font-weight: 800; line-height: 1.55;
}
.chip.add { background: var(--fill); color: var(--soft); padding: 2px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 800; color: var(--soft); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select {
  width: 100%; border: 2px solid var(--line2); border-radius: 14px; padding: 10px 12px; background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pink) 18%, transparent); }
textarea { resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--mint); cursor: pointer; flex: none; }
.error { color: var(--red); font-weight: 700; font-size: 14px; margin: 4px 0 10px; }

/* Empty states */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 16px; color: var(--soft); }
.empty-state strong { font-family: var(--f-display); font-weight: 600; font-size: 18px; color: var(--ink); }
.empty-state p { margin: 0 0 6px; max-width: 42ch; }
.illo { filter: drop-shadow(0 6px 10px rgba(43, 34, 54, .1)); flex: none; }
.illo .i-paper { fill: var(--surface); stroke: var(--line2); stroke-width: 2; }
.illo .i-ink { fill: var(--ink); }
.illo .i-pink { fill: var(--pink); }
.illo .i-blue { fill: var(--blue); }
.illo .i-lilac { fill: var(--lilac); }
.illo .i-mint { fill: var(--mint); }
.illo .i-sun, .illo .i-sunray { fill: var(--sun); }
.illo .i-line { fill: var(--line2); }
.illo .i-edge { fill: none; stroke: var(--line2); stroke-width: 2; }
.illo .i-face { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.illo .i-face-light { fill: none; stroke: var(--sun); stroke-width: 2.5; stroke-linecap: round; }

/* ---------- Keyframes (from app.css) ---------- */
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(26px) scale(.98); } }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
@keyframes shimmer { 50% { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Shell ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: calc(10px + var(--safe-top)) 20px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand h1 { font-size: 21px; white-space: nowrap; }
.brand h1 span { color: var(--soft); font-weight: 500; }
.env-badge { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.env-dev { background: var(--blue-soft); color: var(--blue); }
.env-staging { background: var(--sun-soft); color: color-mix(in srgb, var(--sun) 55%, var(--ink)); }
.env-prod { background: var(--red-soft); color: var(--red); }
.who-box { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-box .email { font-size: 13px; font-weight: 700; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26ch; }
.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 20px 10px; scrollbar-width: none; scroll-snap-type: x proximity;
  position: sticky; top: calc(54px + var(--safe-top)); z-index: 19; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs .pill { flex: none; scroll-snap-align: start; text-decoration: none; color: var(--ink); }
.tabs .pill[aria-current="page"] { background: var(--ink); color: var(--bg); }
.tabs .count { background: var(--pink); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.page { max-width: 1240px; margin: 0 auto; padding: 8px 20px calc(80px + var(--safe-bottom)); }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.page-head h2 { font-size: 26px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border-radius: 22px; padding: 16px 18px; box-shadow: var(--shadow-sm); margin-bottom: 14px; min-width: 0; }
.panel h3 { font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.panel h3 .link, .panel h3 .btn { margin-left: auto; font-family: var(--f-body); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.cols > .panel { margin-bottom: 0; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--surface); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.stat .value { font-family: var(--f-display); font-weight: 600; font-size: 30px; line-height: 1.1; }
.stat .sub { font-size: 13px; color: var(--soft); }
.stat.pink { background: var(--pink-soft); }
.stat.mint { background: var(--mint-soft); }
.stat.lilac { background: var(--lilac-soft); }
.stat.sun { background: var(--sun-soft); }
.spark { width: 100%; height: 64px; display: block; }
.spark .area { fill: color-mix(in srgb, var(--pink) 18%, transparent); }
.spark .line { fill: none; stroke: var(--pink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .dot { fill: var(--pink); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .when { font-size: 12px; color: var(--soft); white-space: nowrap; }

/* Filters */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-row .fp-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); min-width: 74px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search input { padding-left: 38px; border-radius: 999px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .push { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; background: var(--fill); color: var(--soft); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.lilac { background: var(--lilac-soft); color: color-mix(in srgb, var(--lilac) 70%, var(--ink)); }
.tag.sun { background: var(--sun-soft); color: color-mix(in srgb, var(--sun) 45%, var(--ink)); }
.tag.mint { background: var(--mint-soft); color: color-mix(in srgb, var(--mint) 70%, var(--ink)); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.pink { background: var(--pink-soft); color: var(--pink-deep); }
.code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-weight: 700; font-size: 13.5px; letter-spacing: .04em; background: var(--surface2); border-radius: 8px; padding: 2px 7px; white-space: nowrap; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; }

/* Tables (cards under 700px) */
.tbl-wrap { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); padding: 12px 12px 8px; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--surface2); }
.tbl tr.selected { background: var(--pink-soft); }
.tbl .msg { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.tbl .nowrap { white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.check-cell, .tbl th.check-cell { width: 36px; padding-right: 0; }
.tbl .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.tbl .open { text-align: left; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .tbl-wrap { background: transparent; box-shadow: none; overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl tbody tr { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-sm); padding: 10px 14px; margin-bottom: 10px; position: relative; }
  .tbl td { border: 0; padding: 3px 0; display: flex; gap: 10px; align-items: baseline; }
  .tbl td[data-label]::before { content: attr(data-label); flex: 0 0 96px; font-size: 12px; font-weight: 800; color: var(--soft); }
  .tbl td.lead { font-size: 15px; font-weight: 800; padding-bottom: 6px; }
  .tbl td.lead::before { display: none; }
  .tbl td.check-cell { position: absolute; right: 12px; top: 10px; width: auto; }
  .tbl td.check-cell::before { display: none; }
  .tbl .msg { max-width: none; }
  .tbl .num { text-align: left; }
  .tbl .row-actions { justify-content: flex-start; }
}
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin: 12px 0; font-size: 13px; color: var(--soft); font-weight: 700; }

/* Loading */
.skeleton { border-radius: 14px; height: 18px; margin: 10px 0; background: linear-gradient(90deg, var(--fill), var(--fill2), var(--fill)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.tall { height: 90px; border-radius: 20px; }
.loading-line { color: var(--soft); font-weight: 700; padding: 18px 4px; }

/* Overlays: dialogs (centred) and slide-over panels (from the right) */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: flex; justify-content: center; align-items: flex-start;
  overflow-y: auto; padding: calc(40px + var(--safe-top)) 16px 40px; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.overlay.on-top { z-index: 60; }
.dialog { width: 100%; max-width: 520px; background: var(--bg); border-radius: 28px; box-shadow: var(--shadow-lg); padding: 22px 24px 24px; animation: sheet-up .22s ease-out; }
.dialog.wide { max-width: 760px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dialog-head h2 { font-size: 22px; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.overlay.slide { justify-content: flex-end; padding: 0; }
.slide-panel { width: min(640px, 100%); min-height: 100%; background: var(--bg); padding: calc(16px + var(--safe-top)) 20px calc(30px + var(--safe-bottom)); box-shadow: var(--shadow-lg); animation: slide-in .22s ease-out; }
.slide-panel .dialog-head { position: sticky; top: calc(-16px - var(--safe-top)); background: var(--bg); padding: 8px 0; z-index: 2; margin-top: -8px; }
@media (max-width: 600px) {
  .overlay { padding: 0; align-items: flex-end; }
  .dialog { border-radius: 26px 26px 0 0; padding-bottom: calc(24px + var(--safe-bottom)); animation: rise .2s ease-out; max-height: 92dvh; overflow-y: auto; }
}
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--soft); font-weight: 800; font-size: 13px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.message-box { background: var(--surface); border-radius: 18px; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.reply { background: var(--blue-soft); border-radius: 16px; padding: 10px 14px; margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply small { display: block; color: var(--soft); font-weight: 700; margin-bottom: 2px; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); margin: 18px 0 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg-choice { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.seg-choice .chip-btn { background: var(--fill); box-shadow: none; }
.seg-choice .chip-btn.on, .seg-choice .chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filter-row .chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.hint { font-size: 13px; color: var(--soft); margin: -8px 0 12px; }
.md-out { width: 100%; min-height: 320px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }
.danger-zone { border: 2px solid var(--red-soft); }
.danger-zone h3 { color: var(--red); }
.notice { background: var(--sun-soft); border-radius: 16px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }
.ok-dot, .bad-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--mint); vertical-align: 1px; }
.bad-dot { background: var(--red); }

/* Toasts */
#toasts { position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 24px; max-width: 100%;
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 800; animation: rise .22s ease-out; transition: opacity .25s, transform .25s;
}
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast.error { background: var(--red); color: #fff; }
.toast.good { background: linear-gradient(135deg, var(--pink), var(--lilac)); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* Sign-in */
.lock {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--pink) 30%, var(--bg)), transparent 45%),
    radial-gradient(circle at 85% 85%, color-mix(in srgb, var(--lilac) 28%, var(--bg)), transparent 45%), var(--bg);
}
.lock-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 28px; padding: 30px 26px; box-shadow: var(--shadow-lg); text-align: center; animation: sheet-up .3s ease-out; }
.lock-card h1 { font-size: 28px; margin: 10px 0 4px; }
.lock-card form { text-align: left; margin-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.lock-logo { display: grid; place-items: center; }
.code-input { text-align: center; font-size: 22px !important; letter-spacing: .3em; font-weight: 800; }
.qr { display: grid; place-items: center; margin: 14px auto 8px; background: #fff; border-radius: 18px; padding: 10px; width: 200px; height: 200px; }
.qr img { width: 180px; height: 180px; }
.secret { display: flex; align-items: center; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.secret .code { font-size: 12.5px; white-space: normal; overflow-wrap: anywhere; }
.small-print { font-size: 13px; color: var(--soft); margin-top: 12px; }

@media (max-width: 600px) {
  .top { padding: calc(8px + var(--safe-top)) 14px 6px; }
  .brand h1 { font-size: 18px; }
  .brand h1 span { display: none; }
  .who-box .email { display: none; }
  .tabs { padding: 4px 14px 10px; top: calc(50px + var(--safe-top)); }
  .page { padding: 6px 14px calc(80px + var(--safe-bottom)); }
  .page-head h2 { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .value { font-size: 24px; }
  .cols { grid-template-columns: 1fr; }
  .search { max-width: none; }
}
.sr-only, .sr-copy { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lock-card .btn-row { justify-content: center; margin-top: 10px; }
.filter-row .field { margin-bottom: 0; min-width: 170px; flex: 1; max-width: 300px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface);
  border: 0; font-weight: 800; font-size: 14px; box-shadow: var(--shadow-sm); transition: transform .1s;
}
.pill:hover { background: var(--surface2); }
.pill:active { transform: scale(.96); }
.link.open { text-align: left; min-width: 0; }
.mini-list .link.open { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .code { overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.search input { padding-left: 38px !important; }
@media (max-width: 600px) {
  .filter-row:has(.chip-btn) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px 4px; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row .chip-btn { flex: none; }
  .filter-row .fp-label { min-width: 0; flex: none; }
  .tbl td.lead { padding-right: 34px; }
  .page-head .actions { margin-left: 0; }
}
.tbl .num { white-space: nowrap; }
.panel .tbl-wrap { box-shadow: none; }
.slide-panel:focus, .dialog:focus { outline: none; }
/* Tag and badge text mixed towards the ink so it reads on the soft tints (4.5:1 in light and dark). */
.tag { color: color-mix(in srgb, var(--soft) 70%, var(--ink)); }
.tag.blue, .env-dev { color: color-mix(in srgb, var(--blue) 55%, var(--ink)); }
.tag.lilac { color: color-mix(in srgb, var(--lilac) 60%, var(--ink)); }
.tag.mint { color: color-mix(in srgb, var(--mint) 55%, var(--ink)); }
.tag.pink { color: color-mix(in srgb, var(--pink-deep) 75%, var(--ink)); }
.stat.pink .label, .stat.pink .sub, .stat.mint .label, .stat.mint .sub, .stat.lilac .label, .stat.lilac .sub, .stat.sun .label, .stat.sun .sub { color: color-mix(in srgb, var(--soft) 65%, var(--ink)); }
/* Slide-over panels fill the height on phones too (bottom-aligned, a tall panel's top would be out of reach). */
.overlay.slide { align-items: stretch; }
.cols { margin-bottom: 14px; }
.panel h3 .btn { white-space: nowrap; flex: none; }
.reply small { color: color-mix(in srgb, var(--soft) 60%, var(--ink)); }
.dialog-body > .btn-row:first-child { margin-bottom: 12px; }
.env-staging, .tag.sun { color: color-mix(in srgb, var(--sun) 35%, var(--ink)); }
/* Guide (tabs/guide.js): sections in a sidebar on wide screens, a pill row of sections on phones. */
.guide { display: grid; grid-template-columns: minmax(220px, 290px) 1fr; gap: 16px; align-items: start; }
.guide-nav { position: sticky; top: calc(110px + var(--safe-top)); max-height: calc(100vh - 130px); overflow-y: auto; padding: 2px 4px 12px 2px; }
.guide-pills { display: none; }
.guide-group h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); margin: 14px 0 6px; }
.guide-group:first-child h3 { margin-top: 2px; }
.guide-group ul, .guide-results { list-style: none; margin: 0; padding: 0; }
.guide-link-item { display: block; padding: 6px 10px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; line-height: 1.3; }
.guide-link-item:hover { background: var(--surface2); }
.guide-link-item[aria-current="page"] { background: var(--ink); color: var(--bg); }
.guide-link-item .tag { margin-left: 4px; font-size: 11px; padding: 0 7px; }
.guide-article { padding: 20px 26px 26px; min-height: 320px; }
.guide-head h2 { font-size: 26px; margin: 2px 0 4px; }
.guide-head h2:focus { outline: none; }
.guide-head .link { margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; }
.guide-results li { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.guide-results li:last-child { border-bottom: 0; }
.guide-results a { color: var(--pink-deep); text-decoration: none; }
.guide-results p { margin: 4px 0 0; color: var(--soft); }
.md { font-size: 15px; line-height: 1.6; max-width: 76ch; overflow-wrap: anywhere; }
.md h3 { font-size: 19px; margin: 22px 0 8px; }
.md h4, .md h5 { font-size: 16px; margin: 18px 0 6px; }
.md p, .md ul, .md ol { margin: 0 0 12px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 3px 0; }
.md a { color: var(--pink-deep); font-weight: 700; }
.md code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; background: var(--surface2); border-radius: 6px; padding: 1px 5px; }
.md-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 16px; background: var(--sun-soft); }
.md-note p:last-child { margin-bottom: 0; }
.md-block { position: relative; margin: 0 0 14px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--line2); }
.md-block pre { margin: 0; padding: 14px 16px 12px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.md-block pre code { background: none; padding: 0; font-size: 13px; line-height: 1.55; }
.md-reply { background: var(--blue-soft); border-color: transparent; }
.md-reply pre code { font-family: var(--f-body); font-size: 14.5px; }
.md-copy { display: flex; margin: 0 12px 12px auto; }
.md-table-wrap { overflow-x: auto; margin: 0 0 14px; }
.md-table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.md-table th, .md-table td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.md-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
.guide-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
@media (max-width: 800px) {
  .guide { grid-template-columns: 1fr; }
  .guide-nav { position: static; max-height: none; overflow: visible; padding: 0; }
  .guide-pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 8px; padding: 2px 20px 6px; }
  .guide-pills::-webkit-scrollbar { display: none; }
  .guide-pills .pill { flex: none; color: var(--ink); }
  .guide-pills .pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
  .guide-group { display: none; }
  .guide-group.open { display: block; }
  .guide-group h3 { display: none; }
  .guide-group ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .guide-link-item { background: var(--surface); box-shadow: var(--shadow-sm); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
  .guide-article { padding: 16px 16px 20px; }
  .guide-head h2 { font-size: 22px; }
}
