/* HostDC v3: friendly & colorful. Indigo primary, mint + coral + sunshine accents, rounded, roomy, big type.
   The one compiled stylesheet (spec §24 item 140), ported from design/mockup/assets/style.css.
   Sections: tokens · base · header · buttons · badges · cards · meters · landing · ads ·
             app · bot page · content · account · auth · errors · animation layer · compat. */
/* Nunito, self-hosted (SIL Open Font License 1.1 — see OFL.txt).
   Public pages must have no third-party origin, so every src below is a local
   path and no font CDN is referenced. Refresh with scripts/fetch_fonts.py. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/nunito-600.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/nunito-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/static/fonts/nunito-800.woff2") format("woff2");
}
:root {
  --bg: #fbfaff;
  --surface: #ffffff;
  --surface-2: #f3f1ff;
  --text: #1e1b4b;
  --muted: #6b6a8a;
  --border: #e6e4f5;
  --primary: #5b5bd6;
  --primary-hover: #4949c4;
  --primary-fg: #ffffff;
  --primary-soft: #ebebff;
  --mint: #2ec4a6; --mint-soft: #dcf7f0;
  --coral: #ff6b6b; --coral-soft: #ffe3e3;
  --sun: #ffc857; --sun-soft: #fff1cc;
  --ok: #1fa37f; --ok-soft: #dcf7f0;
  --warn: #c98700; --warn-soft: #fff1cc;
  --danger: #e04848; --danger-soft: #ffe3e3;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px;
  --shadow: 0 10px 30px rgba(30, 27, 75, 0.08);
  --shadow-sm: 0 2px 8px rgba(30, 27, 75, 0.06);
  --sans: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #1c1d2b;
  --surface: #262737;
  --surface-2: #2f3044;
  --text: #f3f2ff;
  --muted: #a9a7c7;
  --border: rgba(255, 255, 255, 0.09);
  --primary: #8a8aff;
  --primary-hover: #a3a3ff;
  --primary-fg: #14142a;
  --primary-soft: rgba(138, 138, 255, 0.16);
  --mint-soft: rgba(46, 196, 166, 0.16);
  --coral-soft: rgba(255, 107, 107, 0.16);
  --sun-soft: rgba(255, 200, 87, 0.16);
  --ok: #3fd4a8; --ok-soft: rgba(46, 196, 166, 0.16);
  --warn: #ffc857; --warn-soft: rgba(255, 200, 87, 0.16);
  --danger: #ff7b7b; --danger-soft: rgba(255, 107, 107, 0.16);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: var(--sans); font-size: 16px; line-height: 1.55; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; transition: color 150ms ease; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.3rem; font-weight: 800; }
.lead { font-size: 1.3rem; color: var(--muted); line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.mono, code { font-family: var(--mono); font-size: 0.9em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }
mark { background: none; color: var(--primary); padding: 0; border-radius: 0; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 55%, transparent); text-decoration-thickness: 0.12em; text-underline-offset: 0.12em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 72px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.wordmark:hover { color: var(--text); }
.logo { width: 34px; height: 34px; border-radius: 12px; background: var(--primary); display: grid; place-items: center; position: relative; }
.logo::before { content: ""; width: 16px; height: 8px; border-radius: 4px; background: #fff; box-shadow: inset 4px 0 0 var(--primary), inset -4px 0 0 var(--primary); }
.logo::after { content: ""; position: absolute; top: -4px; width: 4px; height: 6px; border-radius: 2px; background: var(--mint); }
.nav { display: flex; gap: 6px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; transition: background 150ms ease, color 150ms ease; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Buttons: chunky pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; font: inherit; font-size: 1rem; font-weight: 800; line-height: 1; white-space: nowrap; cursor: pointer; border: 2px solid transparent; color: var(--text); background: var(--surface-2); transition: transform 160ms var(--ease), background 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.btn:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--primary-soft)); color: var(--text); }
.btn:active { transform: scale(0.96); }
.btn.primary { background: var(--primary); color: var(--primary-fg); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn.primary:hover { background: var(--primary-hover); color: var(--primary-fg); }
.btn.outline { background: transparent; border-color: var(--border); }
.btn.outline:hover { background: var(--surface-2); border-color: var(--border); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.mint { background: var(--mint); color: #062a22; }
.btn.mint:hover { background: #29b397; color: #062a22; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.lg { height: 56px; padding: 0 32px; font-size: 1.1rem; }
.btn.sm { height: 36px; padding: 0 16px; font-size: 0.9rem; }
.btn.icon { width: 36px; padding: 0; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 800; white-space: nowrap; }
.badge.mono, .badge.wrap { white-space: normal; word-break: break-all; padding: 4px 10px; line-height: 1.3; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.brand { color: var(--primary); background: var(--primary-soft); }
.badge.mono { font-family: var(--mono); font-weight: 600; font-size: 0.78rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card.tint-primary { background: var(--primary-soft); border-color: transparent; }
.card.tint-mint { background: var(--mint-soft); border-color: transparent; }
.card.tint-coral { background: var(--coral-soft); border-color: transparent; }
.card.tint-sun { background: var(--sun-soft); border-color: transparent; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.card-body { padding: 20px 24px 24px; }

/* Meters */
.meter { display: grid; gap: 8px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; }
.meter-top span { font-weight: 800; }
.meter-top b { font-family: var(--mono); font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar span { height: 100%; background: var(--primary); border-radius: 999px; transition: width 400ms var(--ease); }
.bar span.alloc { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.bar span.bonus { background: var(--mint); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; background: var(--primary); }
.legend i.alloc { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.legend i.bonus { background: var(--mint); }

/* Landing */
.hero { padding: 96px 0 72px; text-align: center; position: relative; }
body { overflow-x: hidden; }
.hero .lead { max-width: 40ch; margin: 22px auto 34px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.5; transform: translateZ(0); z-index: -1; pointer-events: none; }
.blob.a { width: 420px; height: 420px; background: var(--primary-soft); left: -120px; top: 20px; }
.blob.b { width: 360px; height: 360px; background: var(--mint-soft); right: -80px; top: 80px; }
.blob.c { width: 300px; height: 300px; background: var(--sun-soft); left: 40%; bottom: -120px; }
.showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 980px; margin: 56px auto 0; align-items: end; }
@media (max-width: 1024px) { .showcase { grid-template-columns: 1fr; } .showcase .tile:nth-child(2) { margin-bottom: 0; } }
.showcase .tile:nth-child(2) { margin-bottom: 18px; }
.section { padding: 88px 0; }
.section.tinted { background: var(--surface-2); }
.section-head { max-width: 62ch; margin: 0 auto 44px; text-align: center; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { font-size: 1.15rem; color: var(--muted); }
.counters { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: -32px; }
.counter { display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px 12px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-weight: 700; }
.counter .n { font-family: var(--mono); font-weight: 700; font-size: 1.15rem; color: var(--text); }
.counter .l { color: var(--muted); font-size: 0.95rem; }
.counter i { width: 12px; height: 12px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { padding: 32px 28px; border-radius: var(--r-xl); display: grid; gap: 12px; align-content: start; border: 0; }
.step .k { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; background: var(--surface); box-shadow: var(--shadow-sm); }
.step h3 { font-size: 1.4rem; }
.step p { color: var(--muted); font-size: 1.02rem; }
.step pre { margin: 8px 0 0; padding: 12px 14px; background: var(--surface); border-radius: var(--r-md); font-family: var(--mono); font-size: 0.85rem; color: var(--text); overflow-x: auto; box-shadow: var(--shadow-sm); }
.runtimes { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.runtime { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 800; font-size: 1.05rem; box-shadow: var(--shadow-sm); }
.runtime .badge { background: var(--surface-2); color: var(--text); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
.plan { padding: 0; overflow: hidden; border-radius: var(--r-xl); display: grid; }
.plan-top { padding: 28px 28px 22px; }
.plan-top h3 { font-size: 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.plan .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-top: 10px; }
.plan .price small { font-size: 1rem; font-weight: 700; letter-spacing: 0; opacity: 0.75; margin-left: 6px; }
.plan .tag { font-weight: 700; opacity: 0.8; margin-top: 8px; }
.plan-body { padding: 24px 28px 28px; display: grid; gap: 18px; background: var(--surface); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan li { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.plan li span:first-child { color: var(--muted); font-weight: 600; }
.plan li.off { opacity: 0.5; }
.plan.free .plan-top { background: var(--mint-soft); }
.plan.lite .plan-top { background: var(--sun-soft); }
.plan.pro .plan-top { background: var(--primary); color: #fff; }
.plan.pro { box-shadow: var(--shadow); margin-top: -12px; border-color: transparent; }
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 22px; }
.faq summary { cursor: pointer; font-weight: 800; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--primary); font-weight: 800; flex-shrink: 0; transition: transform 200ms var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin-top: 10px; font-size: 1.02rem; }
.cta { text-align: center; padding: 56px 24px; border-radius: var(--r-xl); background: var(--primary); color: #fff; }
.cta h2 { margin-bottom: 10px; }
.cta p { opacity: 0.85; font-size: 1.15rem; margin-bottom: 28px; }
.cta .btn { background: #fff; color: var(--primary); }
.cta .btn:hover { background: #f3f1ff; color: var(--primary); }
.site-footer { padding: 40px 0; color: var(--muted); font-weight: 700; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--text); }

/* Ads */
.ad { border: 2px dashed var(--border); border-radius: var(--r-lg); padding: 18px; }
.ad .tag { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; margin-bottom: 8px; }
.ad h4 { font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.ad p { color: var(--muted); font-size: 0.92rem; }
.ad a { color: var(--primary); font-weight: 800; font-size: 0.92rem; display: inline-block; margin-top: 10px; }

/* App */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding: 0 0 40px; align-items: start; }
.app-main, .app-side { min-width: 0; }
.app-main { display: grid; gap: 24px; }
.app-side { display: grid; gap: 18px; }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r-md); background: var(--sun-soft); font-weight: 700; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topline h1 { font-size: 2.2rem; }
.topline .actions { display: flex; gap: 10px; }
.renew { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 28px; }
.renew .t { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.renew.grace { background: var(--danger-soft); border-color: transparent; }
.ring { width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--primary) 0 74%, var(--surface-2) 74% 100%); display: grid; place-items: center; }
.ring::after { content: "74%";  width: 48px; height: 48px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--mono); font-size: 0.8rem; font-weight: 700; }
.pools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pool { padding: 20px 22px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tile { padding: 20px 22px; display: grid; gap: 14px; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); } }
.tile-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex-shrink: 0; }
.avatar.p { background: var(--primary-soft); color: var(--primary); }
.avatar.m { background: var(--mint-soft); color: var(--ok); }
.avatar.c { background: var(--coral-soft); color: var(--danger); }
.avatar.s { background: var(--sun-soft); color: var(--warn); }
.tile-head h3 { font-size: 1.15rem; }
.tile-head .sub { color: var(--muted); font-size: 0.88rem; font-weight: 700; }
.tile-head .badge { margin-left: auto; }
.tile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile-stats div { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 12px; }
.tile-stats .l { color: var(--muted); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.tile-stats .v { font-family: var(--mono); font-weight: 700; }
.tile-actions { display: flex; gap: 8px; }
.checklist { display: grid; gap: 12px; }
.checklist label { display: flex; gap: 12px; align-items: center; font-weight: 700; }
.checklist .box { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; }
.checklist .done .box { background: var(--mint); border-color: var(--mint); color: #062a22; }
.checklist .done { color: var(--muted); text-decoration: line-through; }
.progress-pill { display: inline-flex; align-items: center; gap: 8px; }

/* Bot page */
.bot-header { display: flex; align-items: center; gap: 14px; padding: 28px 0 0; flex-wrap: wrap; }
.bot-header h1 { font-size: 2rem; }
.bot-header .spacer { flex: 1; }
.crumb { color: var(--muted); font-weight: 800; }
.crumb:hover { color: var(--primary); }
.tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--surface-2); margin-top: 22px; overflow-x: auto; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 800; color: var(--muted); white-space: nowrap; transition: color 150ms ease, background 150ms ease; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.tabs a.locked { opacity: 0.45; }
.console-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 20px 0 48px; align-items: start; }
.pane { min-width: 0; }
.console { display: grid; grid-template-rows: auto 1fr auto; height: calc(100vh - 260px); min-height: 480px; overflow: hidden; background: #1c1d2b; color: #f3f2ff; border-radius: var(--r-lg); border: 0; }
.console-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-wrap: wrap; }
.console .btn { background: rgba(255,255,255,0.08); color: #f3f2ff; }
.console .btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.input { height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; }
.console .input { background: rgba(255,255,255,0.06); border-color: transparent; color: #f3f2ff; }
.input.mono { font-family: var(--mono); font-size: 0.85rem; }
.input::placeholder { color: var(--muted); font-weight: 600; }
.console-bar .input { flex: 1; min-width: 160px; }
.chips { display: flex; gap: 6px; }
.chip { height: 28px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; background: rgba(255,255,255,0.06); color: #a9a7c7; cursor: pointer; transition: transform 160ms var(--ease); }
.chip:active { transform: scale(0.95); }
.chip.on { color: #f3f2ff; background: rgba(255,255,255,0.16); }
.log { overflow: auto; padding: 12px 16px; font-family: var(--mono); font-size: 0.82rem; line-height: 1.65; }
.log div { display: grid; grid-template-columns: 72px 46px 1fr; gap: 12px; white-space: pre-wrap; padding: 1px 0; }
.log .ts { color: #7d7b9e; }
.log .lv { font-weight: 700; }
.log .info .lv { color: #3fd4a8; }
.log .warn .lv { color: #ffc857; }
.log .err .lv { color: #ff7b7b; }
.log .err { background: rgba(255, 107, 107, 0.14); margin: 0 -16px; padding: 2px 16px; }
.log .sys { color: #7d7b9e; font-style: italic; }
.stdin { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.stdin .input { flex: 1; }
.kv { display: grid; gap: 10px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-weight: 700; }
.kv span:first-child { color: var(--muted); font-weight: 600; }
.kv span:last-child { font-family: var(--mono); font-size: 0.88rem; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 40px; margin-top: 12px; }
.spark i { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; opacity: 0.8; }

/* Entry motion is driven by assets/animations.js; CSS shows final states when JS or motion is off. */

@media (max-width: 1024px) { .app, .console-wrap { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .plans, .steps, .pools, .tiles, .showcase { grid-template-columns: 1fr; }
  .showcase .tile:nth-child(2) { margin-bottom: 0; }
  .plan.pro { margin-top: 0; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .nav a { flex-shrink: 0; }
  .hero { padding: 56px 0 40px; }
  .section { padding: 56px 0; }
  .console { height: 70vh; }
}

/* Animation layer support */
[data-anim] .hero h1 .w, [data-anim] .hero .lead, [data-anim] .hero .actions, [data-anim] .hero .hero-note, [data-anim] .showcase .tile, [data-anim] .section-head, [data-anim] .counters > *, [data-anim] .steps > *, [data-anim] .runtimes > *, [data-anim] .plans > *, [data-anim] .faq > *, [data-anim] .howto > *, [data-anim] .cta, [data-anim] .ptable tbody tr, [data-anim] [data-page=app] .banner, [data-anim] .topline, [data-anim] .renew, [data-anim] .pools > *, [data-anim] .tiles > *, [data-anim] .app-side > *, [data-anim] .log div, [data-anim] .checklist label { opacity: 0; }
.hero h1 .w { display: inline-block; will-change: transform; }
.tabs.has-pill { position: relative; }
.tabs.has-pill a.active { background: transparent; box-shadow: none; }
.tab-pill { position: absolute; top: 5px; left: 0; height: 38px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); pointer-events: none; }
.tabs.has-pill a { position: relative; z-index: 1; }
.ring { --p: 74%; background: conic-gradient(var(--primary) 0 var(--p), var(--surface-2) var(--p) 100%); }
.ring::after { content: attr(data-label); }
.spark i { transform-origin: bottom; }
.btn:active { transform: none; }
@media (hover: hover) and (pointer: fine) { .tile:hover { transform: none; box-shadow: var(--shadow-sm); } }

/* Pricing table and the two-step how-to (were inline in the pricing mockup) */
.ptable { width: 100%; border-collapse: separate; border-spacing: 0; font-weight: 700; }
.ptable th, .ptable td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); }
.ptable th { font-size: 1.15rem; font-weight: 800; }
.ptable th small { display: block; font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.ptable td { font-family: var(--mono); font-weight: 600; font-size: 0.95rem; }
.ptable td:first-child { font-family: var(--sans); color: var(--muted); font-weight: 700; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable th.pro { color: var(--primary); }
.table-card { overflow-x: auto; border-radius: var(--r-xl); }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 900px; margin: 0 auto; }
.howto .card { padding: 28px; }
.howto h3 { margin-bottom: 8px; }
@media (max-width: 900px) { .howto { grid-template-columns: 1fr; } }

/* States the real app needs and the mockup did not have */
.banner.info { background: var(--primary-soft); }
.banner.warning { background: var(--sun-soft); }
.banner.critical { background: var(--danger-soft); color: var(--danger); }
.badge.flagged { color: var(--danger); background: var(--danger-soft); }
.badge.queued { color: var(--warn); background: var(--warn-soft); }
.badge.idle { color: var(--muted); background: var(--surface-2); }
.renew.grace { background: var(--danger-soft); border-color: transparent; }
.renew.grace .t { color: var(--danger); }
.renew.expired { background: var(--surface-2); border-color: var(--border); }
.grace { color: var(--danger); }
.empty { text-align: center; padding: 40px 28px; display: grid; gap: 14px; justify-items: center; }
.empty h3 { font-size: 1.4rem; }
.empty p { color: var(--muted); max-width: 46ch; }
.empty .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: var(--r-md);
  padding: 12px 16px; font-weight: 700; }
.form-ok { color: var(--ok); background: var(--ok-soft); border-radius: var(--r-md);
  padding: 12px 16px; font-weight: 700; }
.tab.locked, .tabs a.locked { opacity: 0.45; cursor: not-allowed; }

/* Auth: its own minimal shell, no nav, no ads, no banner */
.auth-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.auth-wrap { display: grid; place-items: center; padding: 16px 24px 48px; }
.auth-card { width: min(440px, 100%); margin: 0 auto; padding: 32px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 1.8rem; }
.field { display: grid; gap: 6px; font-weight: 700; }
.field .input { width: 100%; }
.field .hint { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.or::before, .or::after { content: ""; height: 1px; background: var(--border); }
.stack { display: grid; gap: 14px; }

/* Content pages (Markdown from content/) */
.prose { max-width: 72ch; margin: 0 auto; display: grid; gap: 18px; font-size: 1.05rem; }
.prose h2 { font-size: 1.7rem; margin-top: 18px; }
.prose h3 { font-size: 1.2rem; margin-top: 10px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.prose a { color: var(--primary); font-weight: 800; }
.prose pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 0.88rem; }
.prose code { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.answer { font-size: 1.2rem; font-weight: 700; }
.updated { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.breadcrumbs { display: flex; gap: 8px; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.breadcrumbs a:hover { color: var(--primary); }

/* Account page */
.account { display: grid; gap: 20px; max-width: 820px; margin: 0 auto; padding: 24px 0 64px; }
.account .card-body { display: grid; gap: 14px; }
.account table { width: 100%; border-collapse: collapse; }
.account th, .account td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
  font-weight: 700; }
.account th { color: var(--muted); font-size: 0.85rem; }
details.danger { border: 2px solid var(--danger-soft); border-radius: var(--r-lg); padding: 16px 20px; }
details.danger summary { cursor: pointer; font-weight: 800; color: var(--danger); }

/* Error pages */
.error-page { text-align: center; padding: 96px 24px; display: grid; gap: 16px; justify-items: center; }
.error-page h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.error-page p { color: var(--muted); font-size: 1.1rem; max-width: 52ch; }
.error-page .code { font-family: var(--mono); font-weight: 700; color: var(--muted); }

/* Compatibility: pages still on the v1 markup (tickets, editor, templates, admin).
   Same tokens, so they inherit the theme and the dark toggle. */
.container { max-width: 1120px; margin: 24px auto; padding: 0 24px; }
.container.wide { max-width: 1280px; }
.inline { display: inline; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 18px 0; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
.card > h3, .card > h1 { margin-bottom: 10px; }
.card.padded, .container .card { padding: 20px 24px; margin-bottom: 18px; }
.btn-primary { background: var(--primary); color: var(--primary-fg);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-lg { height: 56px; padding: 0 32px; font-size: 1.1rem; }
.btn-discord { background: #5865f2; color: #fff; width: 100%; }
.btn-start { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.btn-stop { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
label { display: block; margin: 10px 0; font-weight: 700; }
input, select, textarea { width: 100%; padding: 10px 14px; margin-top: 4px; font: inherit;
  font-weight: 600; background: var(--surface); color: var(--text);
  border: 2px solid var(--border); border-radius: var(--r-sm); }
input[type="checkbox"], input[type="radio"] { width: auto; margin: 0; flex-shrink: 0; accent-color: var(--primary); }
textarea { min-height: 90px; resize: vertical; }
.check-label { display: flex; gap: 8px; align-items: center; }
.check-label input, .pkg input { width: auto; margin: 0; }
.row-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.row-form label { margin: 0; }
.stack-form { display: flex; flex-direction: column; gap: 8px; }
.flash { max-width: 1120px; margin: 12px auto; padding: 12px 18px; border-radius: var(--r-md);
  font-weight: 700; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--danger-soft); color: var(--danger); }
.badge-running { color: var(--ok); background: var(--ok-soft); }
.badge-starting, .badge-stopping, .badge-expired, .badge-over_pool { color: var(--warn);
  background: var(--warn-soft); }
.badge-crashed, .badge-node_down { color: var(--danger); background: var(--danger-soft); }
.bot-list { display: grid; gap: 12px; }
.bot-card { display: block; padding: 16px 20px; }
.empty-state { text-align: center; color: var(--muted); padding: 28px; }
.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.workspace { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 1000px) { .workspace { grid-template-columns: 1fr; } }
.ws-left, .ws-side, .dash-main, .dash-side { display: grid; gap: 18px; align-content: start; }
#editor { height: 480px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.console-card .console, pre.console { background: #1c1d2b; color: #f3f2ff; border-radius: var(--r-md);
  padding: 14px 16px; height: 360px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
  font-family: var(--mono); font-size: 0.82rem; display: block; }
.pkg-list { max-height: 300px; overflow-y: auto; }
.pkg { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: var(--r-sm); }
.pkg:hover { background: var(--surface-2); }
.pkg small { color: var(--muted); margin-left: auto; }
.ticket { border-left: 3px solid var(--border); padding-left: 12px; }
.ticket-msg { background: var(--surface-2); border-radius: var(--r-md); padding: 14px; margin: 10px 0; }
.ticket-msg-admin { border-left: 3px solid var(--primary); }
.hidden { display: none !important; }
.ad-row { margin: 18px 0; }
.ad-slot { display: block; border: 2px dashed var(--border); border-radius: var(--r-lg);
  padding: 16px; margin: 10px 0; color: var(--muted); font-weight: 700; }
.house-ad-title { display: block; font-weight: 800; color: var(--text); }
.house-ad-text { display: block; font-size: 0.9rem; }
.house-ad img { max-width: 100%; border-radius: var(--r-sm); }
.legal { display: grid; gap: 14px; }
.cookie { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); padding: 14px 20px;
  border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; gap: 16px;
  align-items: center; z-index: 50; max-width: 92vw; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 700; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { padding: 8px 14px; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); font-weight: 700; }
.admin-nav a:hover, .admin-nav a.active { color: var(--primary); background: var(--primary-soft); }
.page td .btn { height: 34px; padding: 0 14px; font-size: 0.85rem; }

/* Reduced motion: no movement, fades only, and never a hidden element. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  [data-anim] .hero h1 .w, [data-anim] .hero .lead, [data-anim] .hero .actions,
  [data-anim] .hero .hero-note, [data-anim] .showcase .tile, [data-anim] .section-head,
  [data-anim] .counters > *, [data-anim] .steps > *, [data-anim] .runtimes > *,
  [data-anim] .plans > *, [data-anim] .faq > *, [data-anim] .howto > *, [data-anim] .cta,
  [data-anim] .ptable tbody tr, [data-anim] [data-page=app] .banner, [data-anim] .topline,
  [data-anim] .renew, [data-anim] .pools > *, [data-anim] .tiles > *, [data-anim] .app-side > *,
  [data-anim] .log div, [data-anim] .checklist label { opacity: 1; }
}


/* Console: a real terminal pane (spec §16). */
.m5-console { display: grid; grid-template-rows: auto 1fr auto; background: #0f1117; color: #e6e8ef; border-radius: var(--r-lg); overflow: hidden; border: 1px solid rgba(255,255,255,0.08); min-height: 480px; height: calc(100vh - 300px); }
.m5-console-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: #161923; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.85rem; font-weight: 700; color: #a9adbb; }
.m5-console-bar label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.m5-console-bar .m5-filter { flex: 1; min-width: 160px; height: 34px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); background: #0f1117; color: #e6e8ef; padding: 0 12px; font: inherit; font-family: var(--mono); font-size: 0.82rem; }
.m5-console-bar button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); background: transparent; color: #e6e8ef; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.m5-console-bar button:hover { background: rgba(255,255,255,0.08); }
.m5-console-out { margin: 0; padding: 14px 16px; overflow: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: #d7dae3; background: #0f1117; }
.m5-console-out:empty::before { content: "Waiting for output… start or deploy the bot and its build and log lines appear here."; color: #6b7080; font-style: italic; }
.m5-console-out .line-error { color: #ff7b7b; } .m5-console-out .line-warn { color: #ffc857; } .m5-console-out .line-build { color: #8a8aff; } .m5-console-out .line-sys { color: #6b7080; font-style: italic; }
.m5-stdin-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.08); background: #161923; }
.m5-stdin-form .m5-stdin { flex: 1; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: #0f1117; color: #e6e8ef; padding: 0 12px; font-family: var(--mono); font-size: 0.85rem; }
.m5-stdin-form .m5-stdin::before { content: "$ "; }
.m5-stdin-form button { height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--primary); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.m5-stdin-hint { color: #ffc857; font-size: 0.8rem; align-self: center; }


/* Page container (base.html main) and nested wraps */
.page { padding-top: 28px; padding-bottom: 64px; }
.page.app { padding: 28px 24px 64px; }
.page .wrap { padding-left: 0; padding-right: 0; }
.page > .app { padding-top: 0; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 2rem; }

/* Pool meters: keep the numbers on one line */
.meter-top { gap: 12px; flex-wrap: wrap; }
.meter-top b { white-space: nowrap; }
.tile-stats .v { font-size: 0.95rem; white-space: nowrap; }
.checklist label { white-space: normal; line-height: 1.3; }

/* Health card (M5 partial) in the site's card style */
.m5-health { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.m5-health h3 { margin-bottom: 12px; }
.m5-health-grid { display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; margin: 0; font-size: 0.92rem; }
.m5-health-grid dt { color: var(--muted); font-weight: 600; }
.m5-health-grid dd { margin: 0; font-family: var(--mono); font-size: 0.85rem; text-align: right; font-weight: 700; }
.m5-health-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.m5-health-grid dd, .kv span:last-child { overflow-wrap: anywhere; min-width: 0; }

/* Admin: dense but padded tables inside cards */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.admin-nav a { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.admin-nav a:hover, .admin-nav a.active { color: var(--primary); background: var(--primary-soft); }
.page td .btn { height: 34px; padding: 0 14px; font-size: 0.85rem; }
.page table { width: 100%; border-collapse: collapse; }
.page th, .page td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 0.93rem; }
.page th { color: var(--muted); font-weight: 700; }
.admin-main .card > h3, .admin-main .card > h2 { padding: 18px 22px 0; }
.admin-main .card > table, .admin-main .card > p, .admin-main .card > form, .admin-main .card > ul, .admin-main .card > dl, .admin-main .card > pre { padding: 12px 22px 18px; margin: 0; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }

/* Usage graph range chips */
.m5-usage-ranges { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); margin-bottom: 12px; }
.m5-usage-ranges button { height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 800; cursor: pointer; }
.m5-usage-ranges button.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
/* Template cards */
.template-card { padding: 22px; display: grid; gap: 10px; align-content: start; }
.template-card .btn { justify-self: start; margin-top: 6px; }
.template-card > h3, .template-card > p { padding: 0; }
.template-card .badge { justify-self: start; }

/* Status page: component rows with 90-day bars */
.status-hero { display: flex; align-items: center; gap: 16px; padding: 22px 26px; border-radius: var(--r-lg); margin-bottom: 20px; background: var(--ok-soft); }
.status-hero.status-degraded { background: var(--warn-soft); } .status-hero.status-major { background: var(--danger-soft); }
.status-hero h1 { font-size: 1.7rem; margin-bottom: 2px; }
.status-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 25%, transparent); flex-shrink: 0; }
.status-degraded .status-dot { background: var(--warn); box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 25%, transparent); }
.status-major .status-dot { background: var(--danger); box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 25%, transparent); }
.status-dot.small { width: 10px; height: 10px; box-shadow: none; display: inline-block; margin-right: 8px; }
.status-dot.small.degraded { background: var(--warn); } .status-dot.small.offline { background: var(--danger); }
.status-card { padding: 22px 26px; margin-bottom: 18px; }
.status-card h2 { font-size: 1.2rem; margin-bottom: 12px; padding: 0; }
.status-component + .status-component { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.status-component-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 800; }
.status-pct { color: var(--muted); font-family: var(--mono); font-weight: 600; font-size: 0.9rem; }
.status-bars { display: flex; gap: 3px; height: 34px; }
.bar-day { flex: 1; min-width: 0; border-radius: 3px; background: var(--ok); transition: transform 120ms var(--ease); }
.bar-day.degraded { background: var(--warn); } .bar-day.down { background: var(--danger); } .bar-day.none { background: var(--surface-2); }
.status-bars .bar-day:hover { transform: scaleY(1.18); }
.status-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.78rem; font-weight: 700; margin-top: 6px; }
.status-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 20px; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.status-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.incident + .incident { margin-top: 16px; }
.incident h3 { font-size: 1rem; margin-bottom: 6px; }
.incident ul { margin: 0; padding-left: 18px; }

/* Support tickets */
.tickets-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ticket-new { padding: 0; margin-bottom: 20px; }
.ticket-new > summary { cursor: pointer; font-weight: 800; padding: 18px 22px; list-style: none; }
.ticket-new > summary::-webkit-details-marker { display: none; }
.ticket-new > summary::before { content: "+"; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); margin-right: 10px; font-weight: 800; }
.ticket-new[open] > summary::before { content: "–"; }
.ticket-form { padding: 0 22px 22px; }
.ticket-form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.ticket-form-row .field { flex: 1; min-width: 200px; }
.ticket-form .field { display: grid; gap: 6px; margin-bottom: 14px; }
.ticket-form .field label { font-weight: 800; }
.ticket-form textarea.input, .composer textarea.input { height: auto; padding: 12px 14px; border-radius: var(--r-md); resize: vertical; font-weight: 600; }
.ticket-form input[type=file].input, .composer input[type=file] { height: auto; padding: 10px 14px; }
.ticket-form .actions, .composer .actions { display: flex; gap: 10px; align-items: center; }
.ticket-form .actions .spacer, .composer .actions .spacer { flex: 1; }
.ticket-list { display: grid; gap: 10px; }
.ticket-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
.ticket-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.ticket-status { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex-shrink: 0; }
.ticket-status.answered { background: var(--ok); } .ticket-status.closed { background: var(--muted); }
.ticket-main { flex: 1; min-width: 0; }
.ticket-subject { font-weight: 800; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-report { padding: 18px 22px; margin-bottom: 18px; background: var(--danger-soft); border-color: transparent; }
.ticket-report h3 { margin-bottom: 8px; }
.thread { display: grid; gap: 14px; margin: 18px 0; }
.bubble { display: flex; gap: 12px; align-items: flex-start; max-width: 85%; }
.bubble.from-you { margin-left: auto; flex-direction: row-reverse; }
.bubble-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.bubble.from-you .bubble-body { background: var(--primary-soft); border-color: transparent; }
.bubble-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.attachment { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; margin-right: 8px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.85rem; font-weight: 700; }
.composer { padding: 18px 22px; }
.composer .field { margin-bottom: 12px; }
.page .status-card > h2, .page .status-card > h3 { padding: 0; }

/* Dark mode: softer hero blobs (no clipped rectangle) and an indigo highlight instead of yellow */
[data-theme="dark"] .blob { opacity: 0.28; filter: blur(70px); }


/* Admin shell: sidebar + main column */
.admin-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.admin-sidebar { position: sticky; top: 88px; }
.admin-sidebar-title { font-weight: 800; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 0 12px 8px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a { padding: 8px 12px; border-radius: var(--r-sm); color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.admin-sidebar nav a:hover { color: var(--text); background: var(--surface-2); }
.admin-sidebar nav a.active { color: var(--primary); background: var(--primary-soft); }
.admin-main { min-width: 0; }
.admin-topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-search { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.admin-search .input { flex: 1; height: 38px; }
.admin-counts { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.admin-main .page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-main .page-head h1 { font-size: 1.7rem; margin: 0; }
.admin-main .card { margin-bottom: 18px; overflow-x: auto; }
.admin-main .card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.admin-main .card dt { color: var(--muted); font-weight: 700; }
.admin-main .card dd { margin: 0; font-family: var(--mono); font-size: 0.9rem; }
.admin-main .grid-3 .card h3 { font-size: 1.8rem; padding-bottom: 0; }
.admin-main .grid-3 .card p { padding-top: 4px; color: var(--muted); font-weight: 700; }
.admin-main .card table .btn { height: 30px; padding: 0 11px; font-size: 0.82rem; }
.admin-main pre { font-family: var(--mono); font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border-radius: var(--r-sm); }
.admin-main .flash { margin-bottom: 14px; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; }
}
.admin-main .card > h2 { font-size: 1.15rem; }
.admin-main .card > h3 { font-size: 1rem; }
.announcements { display: grid; gap: 8px; }
.announcements .banner { margin-top: 12px; }
.announcements .banner { border-radius: var(--r-md); padding: 12px 16px; display: flex; gap: 12px; align-items: center; background: var(--primary-soft); color: var(--text); font-weight: 600; }
.announcements .banner-warn { background: var(--sun-soft); } .announcements .banner-danger { background: var(--danger-soft); }
.announcements .banner-warning { background: var(--sun-soft); }
.announcements .banner-level { font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); }
.announcements .banner-warn .banner-level { color: var(--warn); } .announcements .banner-danger .banner-level { color: var(--danger); }
.announcements .banner-warning .banner-level { color: var(--warn); }
.file-view { margin: 0; padding: 16px 20px !important; max-height: 70vh; overflow: auto; font-size: 0.82rem; line-height: 1.5; }
.settings-group { margin-bottom: 12px; }
.settings-group > summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; font-weight: 800; list-style: none; }
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary::before { content: "▸"; margin-right: 10px; color: var(--primary); }
.settings-group[open] > summary::before { content: "▾"; }
.setting-help { margin-top: 3px; font-weight: 600; line-height: 1.3; }

.history-day + .history-day { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.history-date { font-weight: 800; color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }

.account-card { padding: 22px 24px !important; }
.account-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.account-email { font-size: 1.3rem; font-weight: 800; }
.account-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.account-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.account-grid > div { display: grid; gap: 2px; font-size: 0.9rem; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.account-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
@media (max-width: 900px) { .account-grid { grid-template-columns: 1fr 1fr; } }
