/*
 * RMySitesUp UI skin. Built on the rapttor/yii2-themes tokens (--bg --surface --text --muted --line --brand --brand-ink --link --accent
 * --elev*), so every theme works. Only the status colours are fixed, and they always travel with a word or a shape.
 * Mobile first: the base rules are for a phone; wider screens are added with min-width queries.
 * Bootstrap's grid and form plumbing is still loaded; everything below restyles it, so old markup looks like the new app.
 */
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --font-ui: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage", "Figtree", ui-sans-serif, system-ui, sans-serif;
  --r-sheet: 24px; --r-card: 18px; --r-ctl: 13px;
  --gutter: 16px; --bar-h: 60px; --tab-h: 68px;
  --ok: #0d7a53; --bad: #c0282d; --warn: #9a5b00;
  --ok-soft: color-mix(in srgb, var(--ok) 13%, var(--surface));
  --bad-soft: color-mix(in srgb, var(--bad) 13%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) 14%, var(--surface));
  --brand-soft: color-mix(in srgb, var(--brand) 13%, var(--surface));
  --ring: color-mix(in srgb, var(--brand) 55%, transparent);
  --shadow: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent), 0 8px 24px color-mix(in srgb, var(--text) 7%, transparent);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
[data-mode="dark"] { --ok: #52d6a4; --bad: #ff8183; --warn: #f2b658; }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) { --ok: #52d6a4; --bad: #ff8183; --warn: #f2b658; } }

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 12px); }
body.app { font-family: var(--font-ui); font-size: 1rem; line-height: 1.5; background: var(--bg); color: var(--text); font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
body.app h1, body.app h2, body.app h3, body.app .h1, body.app .h2, body.app .h3, body.app .h4, body.app .h5, body.app .h6 { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; color: var(--text); }
body.app h1, body.app .h3 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.2rem); }
body.app h2, body.app .h5 { font-size: 1.2rem; }
body.app .h6 { font-size: 1rem; }
body.app a { text-underline-offset: 3px; }
body.app :focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
body.app .text-body-secondary, body.app .form-text, body.app small { color: var(--muted) !important; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; vertical-align: -0.2em; }

/* ---------- shell: top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--bar-h); display: flex; align-items: center; gap: .5rem; padding: 0 var(--gutter); background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar .menu-btn { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 15px; background: var(--brand-soft); color: var(--text); cursor: pointer; margin-left: -4px; }
.topbar .menu-btn:hover { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); }
.topbar .menu-btn .ic { width: 28px; height: 28px; }
.topbar .brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; }
.topbar .brand .word { display: none; }
.topbar .where { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; color: var(--text); }
.topbar .spacer { flex: 1; }
.topbar .light { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .7rem .35rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.topbar .light .d { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.topbar .light.ok .d { background: var(--ok); } .topbar .light.bad .d { background: var(--bad); border-radius: 3px; }
.topbar .light .t { display: none; }
.topbar .who { display: none; }

/* ---------- shell: bottom bar (phones) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; height: calc(var(--tab-h) + var(--safe-b)); padding: 0 6px var(--safe-b); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
.tabbar .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tab-h); min-width: 0; padding: 0 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 600; text-decoration: none; cursor: pointer; position: relative; }
.tabbar .tab .ic { width: 25px; height: 25px; }
.tabbar .tab span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbar .tab[aria-current="page"], .tabbar .tab.on { color: var(--text); }
.tabbar .tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
.tabbar .go { height: auto; margin-top: -26px; padding-bottom: 6px; color: var(--text); }
.tabbar .go .disc { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 42%, transparent), 0 0 0 5px var(--bg); }
.tabbar .go .disc .ic { width: 28px; height: 28px; }
.tabbar .go:active .disc { transform: scale(.95); }
@media (prefers-reduced-motion: no-preference) {
  /* the one orchestrated moment: the main button breathes once when the page opens */
  .tabbar .go .disc { animation: breathe 1.6s ease-out .4s 1; }
  @keyframes breathe { 0% { box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 42%, transparent), 0 0 0 5px var(--bg), 0 0 0 5px var(--ring); } 100% { box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 42%, transparent), 0 0 0 5px var(--bg), 0 0 0 26px transparent; } }
}
.app main { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 28px); }

/* ---------- shell: full-screen menu ---------- */
.menu { position: fixed; inset: 0; z-index: 60; display: none; flex-direction: column; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
.menu.open { display: flex; }
.menu .menu-top { display: flex; align-items: center; gap: .6rem; height: var(--bar-h); padding: 0 var(--gutter); flex: none; }
.menu .menu-top .close { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 15px; background: var(--brand-soft); color: var(--text); cursor: pointer; margin-left: -4px; }
.menu .menu-body { width: 100%; max-width: 980px; margin: 0 auto; padding: .5rem var(--gutter) 2rem; }
.menu h2 { font-size: 1.45rem; margin: .4rem 0 1rem; }
.menu .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu .mcard { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; min-height: 132px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; box-shadow: var(--elev-sm, none); }
.menu .mcard:hover { border-color: var(--brand); }
.menu .mcard[aria-current="page"] { border-color: var(--brand); background: var(--brand-soft); }
.menu .mcard .tile { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--text); margin-bottom: .2rem; }
.menu .mcard b { font-family: var(--font-display); font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; }
.menu .mcard span.d { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.menu .menu-foot { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: grid; gap: 1.1rem; font-size: .92rem; }
.menu .menu-foot .links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.menu .menu-foot a { color: var(--text); }
.menu .menu-foot .fine { color: var(--muted); font-size: .84rem; }
.menu .social { display: flex; gap: .6rem; }
.menu .social a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
body.menu-open { overflow: hidden; }

/* ---------- shell: help ---------- */
.help { position: fixed; z-index: 70; display: none; background: var(--surface); color: var(--text); box-shadow: 0 -10px 40px color-mix(in srgb, var(--text) 22%, transparent); left: 0; right: 0; bottom: 0; max-height: 86vh; border-radius: var(--r-sheet) var(--r-sheet) 0 0; overflow-y: auto; overscroll-behavior: contain; padding: .6rem var(--gutter) calc(1.5rem + var(--safe-b)); }
.help.open { display: block; }
.help .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto .9rem; }
.help .head { display: flex; align-items: flex-start; gap: .75rem; }
.help .head h2 { flex: 1; font-size: 1.35rem; margin: 0 0 .35rem; }
.help .close { width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; background: var(--brand-soft); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.help .lead { color: var(--muted); margin: 0 0 1rem; max-width: 62ch; }
.help h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.help ul.can { padding-left: 1.2rem; margin: 0; } .help ul.can li { margin-bottom: .3rem; }
.help details { border-top: 1px solid var(--line); padding: .65rem 0; }
.help details:last-of-type { border-bottom: 1px solid var(--line); }
.help summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: "+"; font-family: var(--font-display); font-size: 1.2rem; line-height: 1; color: var(--muted); }
.help details[open] summary::after { content: "\2212"; }
.help details p { margin: .5rem 0 0; color: var(--muted); max-width: 62ch; }
.help .more { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1.1rem; font-weight: 600; }
.scrim { position: fixed; inset: 0; z-index: 65; display: none; background: color-mix(in srgb, #000 42%, transparent); }
.scrim.open { display: block; }
.help-fab { display: none; }

/* hover / tap explanations */
.hint { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-left: .35rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .72rem; font-weight: 700; line-height: 1; cursor: help; vertical-align: .08em; }
.hint:hover, .hint:focus-visible { color: var(--text); border-color: var(--brand); }
.tip { position: fixed; z-index: 90; max-width: min(300px, calc(100vw - 24px)); padding: .65rem .8rem; border-radius: 12px; background: var(--text); color: var(--bg); font-size: .86rem; line-height: 1.4; box-shadow: var(--shadow); pointer-events: none; }

/* ---------- footer (desktop) ---------- */
.site-footer { display: none; }

/* ---------- page furniture ---------- */
.app .container { max-width: 1180px; padding-left: var(--gutter); padding-right: var(--gutter); }
.page { padding-top: 1.1rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: .25rem 0 0; max-width: 60ch; }
.pt-4 { padding-top: 1.1rem !important; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.crumbs a { color: var(--muted); }

.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1rem; box-shadow: var(--elev-sm, none); }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--elev-sm, none); }
.rows > .row-item, .rows > a.row-item { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; text-decoration: none; color: var(--text); border-top: 1px solid var(--line); min-height: 60px; }
.rows > :first-child { border-top: 0; }
.rows > a.row-item:hover { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.row-item .lead-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .s { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .go-ic { color: var(--muted); }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 1.25rem; }
.stat { padding: .85rem .9rem; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--elev-sm, none); }
.stat .n { display: block; font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .l { display: block; margin-top: .35rem; color: var(--muted); font-size: .85rem; line-height: 1.25; }
.stat.ok .n { color: var(--ok); } .stat.bad .n { color: var(--bad); }

.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .65rem .22rem .5rem; border-radius: 999px; font-size: .82rem; font-weight: 650; background: var(--brand-soft); color: var(--text); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.up { background: var(--ok-soft); color: var(--ok); } .pill.up::before { background: var(--ok); }
.pill.down { background: var(--bad-soft); color: var(--bad); } .pill.down::before { background: var(--bad); border-radius: 2px; }
.pill.maint { background: var(--warn-soft); color: var(--warn); } .pill.maint::before { background: var(--warn); border-radius: 2px; transform: rotate(45deg); }
.pill.idle::before { background: transparent; border: 2px solid var(--muted); }

/* the pulse strip: one bar per day, newest on the right */
.pulse { display: flex; align-items: flex-end; gap: 2px; height: 30px; }
.pulse i { flex: 1; min-width: 2px; height: 100%; border-radius: 3px; background: var(--ok); opacity: .9; }
.pulse i.w { background: var(--warn); } .pulse i.b { background: var(--bad); }
.pulse-legend { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .25rem; }

.empty { text-align: center; padding: 2.2rem 1.2rem; border: 1.5px dashed var(--line); border-radius: var(--r-card); }
.empty h2 { margin-bottom: .4rem; } .empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 1.1rem; }

.meter { height: 8px; border-radius: 5px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 5px; background: var(--brand); }
.meter.hot > span { background: var(--warn); }

.cols { display: grid; gap: 1.25rem; }

/* ---------- Bootstrap restyled ---------- */
.app .btn { --bs-btn-border-radius: var(--r-ctl); font-weight: 650; padding: .62rem 1.05rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: var(--r-ctl); transition: transform .08s, background-color .15s, border-color .15s; }
.app .btn:active { transform: scale(.98); }
.app .btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .9rem; border-radius: 11px; }
.app .btn-lg { min-height: 52px; font-size: 1.05rem; }
.app .btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.app .btn-outline-primary, .app .btn-outline-secondary { --bs-btn-color: var(--text); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-soft); --bs-btn-active-color: var(--text); background: var(--surface); }
.app .btn-outline-danger { --bs-btn-color: var(--bad); --bs-btn-border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); --bs-btn-hover-bg: var(--bad); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--bad); background: var(--surface); }
.app .btn-link { color: var(--link); text-decoration: none; }
.app .form-control, .app .form-select { min-height: 48px; border-radius: var(--r-ctl); border: 1px solid var(--line); background-color: var(--surface); color: var(--text); font-size: 1rem; padding: .6rem .9rem; box-shadow: none; }
.app textarea.form-control { min-height: 96px; }
.app .form-control:focus, .app .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background-color: var(--surface); color: var(--text); }
.app .form-label { font-weight: 650; margin-bottom: .35rem; }
.app .input-group-text { background: var(--brand-soft); border: 1px solid var(--line); color: var(--muted); border-radius: var(--r-ctl); }
.app .form-check-input { width: 1.2rem; height: 1.2rem; border-color: var(--muted); background-color: var(--surface); }
.app .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.app .alert { border-radius: var(--r-card); border: 1px solid var(--line); padding: .85rem 1rem; }
.app .alert-success { background: var(--ok-soft); color: var(--text); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.app .alert-warning { background: var(--warn-soft); color: var(--text); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.app .alert-danger { background: var(--bad-soft); color: var(--text); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.app .alert-info { background: var(--brand-soft); color: var(--text); }
.app .card, .app .list-group-item { background: var(--surface); border-color: var(--line); border-radius: var(--r-card); }
.app .list-group { border-radius: var(--r-card); box-shadow: var(--elev-sm, none); }
.app .list-group-item { border-radius: 0; padding: .85rem 1rem; }
.app .list-group-item:first-child { border-top-left-radius: var(--r-card); border-top-right-radius: var(--r-card); }
.app .list-group-item:last-child { border-bottom-left-radius: var(--r-card); border-bottom-right-radius: var(--r-card); }
.app .badge { font-weight: 650; border-radius: 999px; padding: .32em .7em; }
.app .badge.text-bg-success { background: var(--ok-soft) !important; color: var(--ok) !important; }
.app .badge.text-bg-danger { background: var(--bad-soft) !important; color: var(--bad) !important; }
.app .badge.text-bg-warning { background: var(--warn-soft) !important; color: var(--warn) !important; }
.app .badge.text-bg-secondary, .app .badge.text-bg-light { background: var(--brand-soft) !important; color: var(--text) !important; }
.app .table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--line); font-size: .93rem; }
.app .table > :not(caption) > * > * { padding: .65rem .5rem; }
.app .table thead th { color: var(--muted); font-weight: 600; font-size: .85rem; border-bottom-width: 1px; }
.app pre, .app code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; }
.app pre { background: color-mix(in srgb, var(--text) 5%, var(--surface)); border: 1px solid var(--line) !important; border-radius: var(--r-ctl); padding: .8rem .9rem !important; overflow-x: auto; color: var(--text); }
.app code { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); padding: .1em .35em; border-radius: 6px; }
.app pre code { background: none; padding: 0; }
.app details > summary { cursor: pointer; }

/* ---------- wider screens ---------- */
@media (min-width: 560px) { .menu .cards { grid-template-columns: repeat(3, 1fr); } .stat .n { font-size: 2.3rem; } }

@media (min-width: 840px) {
  :root { --gutter: 28px; --bar-h: 64px; }
  .app main { padding-bottom: 3rem; }
  .tabbar { display: none; }
  .topbar .brand .word { display: inline; }
  .topbar .where { flex: none; max-width: 36vw; text-align: left; margin-left: .75rem; padding-left: 1rem; border-left: 1px solid var(--line); font-size: 1rem; color: var(--muted); font-weight: 600; }
  .topbar .spacer { display: block; }
  .topbar .light .t { display: inline; }
  .topbar .who { display: inline-flex; align-items: center; gap: .6rem; padding: .25rem .8rem .25rem .3rem; border-radius: 999px; text-decoration: none; color: var(--text); border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .92rem; }
  .topbar .who:hover { border-color: var(--brand); }
  .topbar .who .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-family: var(--font-display); font-weight: 700; }
  .topbar .who .nm { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .primary-desktop { display: inline-flex; }
  .page { padding-top: 1.75rem; }
  .cols.two { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; gap: 1.75rem; }
  .menu .menu-body { padding-top: 1.5rem; }
  .menu .cards { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .menu .mcard { min-height: 150px; padding: 1.15rem; }
  .menu .mcard:hover { transform: translateY(-2px); transition: transform .15s; }

  .help { left: auto; top: 0; bottom: 0; right: 0; width: 440px; max-height: none; border-radius: var(--r-sheet) 0 0 var(--r-sheet); padding: 1.2rem 1.5rem 2rem; }
  .help .grab { display: none; }
  .help-fab { display: grid; place-items: center; position: fixed; right: 24px; bottom: 24px; z-index: 55; width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; }
  .help-fab:hover { border-color: var(--brand); background: var(--brand-soft); }
  .help-fab .ic { width: 26px; height: 26px; }

  .site-footer { display: block; margin-top: 3rem; background: var(--surface); border-top: 1px solid var(--line); }
  .site-footer .wrap { max-width: 1180px; margin: 0 auto; padding: 2.75rem var(--gutter) 1.5rem; display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 2rem; }
  .site-footer .tag { color: var(--muted); max-width: 30ch; margin: .75rem 0 0; }
  .site-footer h3 { font-size: .95rem; margin: 0 0 .75rem; }
  .site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
  .site-footer a { color: var(--muted); text-decoration: none; } .site-footer a:hover { color: var(--text); text-decoration: underline; }
  .site-footer .base { max-width: 1180px; margin: 0 auto; padding: 1rem var(--gutter) 1.75rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .86rem; }
  .site-footer .base .trust { display: flex; gap: 1.2rem; flex-wrap: wrap; }
}
@media (min-width: 1100px) { .stat-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 839.98px) { .primary-desktop { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- sign-in (guests) ---------- */
.auth-wrap { min-height: 100svh; display: grid; place-items: center; padding: 1.5rem var(--gutter) 3rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .logo-mark { display: block; margin: 0 0 1.4rem; }
.auth-card h1 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.5rem); margin: 0 0 .6rem; }
.auth-card .lead { color: var(--muted); font-size: 1.08rem; margin: 0 0 1.5rem; }
.auth-card .form-control { min-height: 56px; font-size: 1.1rem; }
.auth-card .btn { min-height: 56px; font-size: 1.05rem; width: 100%; }
.auth-card .fine { color: var(--muted); font-size: .88rem; margin-top: 1rem; }
.auth-foot { position: fixed; left: 0; right: 0; bottom: 0; padding: .9rem var(--gutter) calc(.9rem + var(--safe-b)); text-align: center; font-size: .85rem; color: var(--muted); }
.auth-foot a { color: var(--muted); margin: 0 .5rem; }
.code-input { letter-spacing: .4em; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem !important; }

.auth-foot ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: .3rem 1.1rem; margin: 0; padding: 0; }
.auth-foot a { color: var(--muted); }
.legal-links ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.menu .legal-links a { color: var(--text); }
kbd { font-family: var(--font-display); font-size: .85em; padding: .05em .45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); }

/* ---------- page patterns ---------- */
.row-item.stack { flex-direction: column; align-items: stretch; gap: .55rem; }
.row-item.stack .top { display: flex; align-items: center; gap: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions form { margin: 0; }
.panel-bad { border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); background: var(--bad-soft); border-radius: var(--r-card); padding: 1rem 1.1rem; }
.panel-bad h2 { font-size: 1.15rem; margin: 0 0 .3rem; }
.panel-bad p { margin: 0 0 .35rem; }
.score { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; border: 4px solid var(--ok); background: var(--surface); }
.score.mid { border-color: var(--warn); } .score.low { border-color: var(--bad); }
.hello { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.hello.ok b { color: var(--ok); } .hello.bad b { color: var(--bad); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.steps li { display: flex; gap: .85rem; align-items: flex-start; }
.steps .lead-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); }
.steps b { display: block; font-weight: 650; } .steps span.d { color: var(--muted); font-size: .92rem; }
.hero-input { display: flex; flex-direction: column; gap: .75rem; }
.hero-input .form-control { min-height: 58px; font-size: 1.15rem; }
@media (min-width: 560px) { .hero-input { flex-direction: row; } .hero-input .btn { min-width: 190px; min-height: 58px; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; } .kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; }
.page .pt-4 { padding-top: 0 !important; }

/* cookie notice (rapttor/yii2-legal markup), styled as a calm card above the bottom bar */
.legal-cookie-banner { position: fixed; z-index: 58; left: 10px; right: 10px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); padding: .95rem 1rem; border-radius: var(--r-card); background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .9rem; line-height: 1.4; }
.auth-wrap ~ .legal-cookie-banner, .auth-foot ~ .legal-cookie-banner { bottom: 56px; }
.legal-cookie-banner p { margin: 0 0 .7rem; color: var(--text); }
.legal-cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.legal-btn { min-height: 40px; padding: .45rem .95rem; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; }
.legal-btn[value="accept_all"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.legal-btn-link { color: var(--muted); font-weight: 600; margin-left: .25rem; }
@media (min-width: 840px) { .legal-cookie-banner { right: auto; left: 24px; bottom: 24px; max-width: 420px; } .auth-wrap ~ .legal-cookie-banner, .auth-foot ~ .legal-cookie-banner { bottom: 24px; } }

/* rows must be allowed to shrink, otherwise one long line pushes the page wider than the phone */
.rows, .rows > .row-item, .row-item .top, .row-item .grow, .stat, .surface, .cols > * { min-width: 0; }
.row-item.stack .top { width: 100%; }
.row-item.stack .pulse { width: 100%; }
html, body.app { max-width: 100%; overflow-x: clip; }
.cols, .app .d-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 840px) { .cols.two { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); } }
.row-item.stack .s { white-space: normal; }

/* admin: a small tag next to the brand so nobody mistakes it for the customer app */
.badge-admin { margin-left: .25rem; padding: .12rem .5rem; border-radius: 8px; font-size: .72rem; font-weight: 700; background: var(--accent, var(--brand)); color: var(--bg); letter-spacing: 0; }
.is-admin .topbar { border-bottom-color: var(--accent, var(--line)); }
@media (min-width: 840px) { .cols.two.rev { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.65fr); } }

/* ---------- public status page ---------- */
.status-body .app-main { padding: 0 0 3rem; }
.status-body .container.page { max-width: 820px; padding-top: 1.5rem; }
.status-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.status-head img { max-height: 56px; max-width: 220px; border-radius: 8px; }
.status-head h1 { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2rem); }
.status-head p { margin: .15rem 0 0; color: var(--muted); }
.banner { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); margin-bottom: 1.75rem; }
.banner .b-ic { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); }
.banner b { display: block; font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1.2; }
.banner span.d { color: var(--muted); font-size: .92rem; }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); } .banner.ok .b-ic { background: var(--ok); color: var(--bg); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); } .banner.bad .b-ic { background: var(--bad); color: var(--bg); }
.banner.maint { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); } .banner.maint .b-ic { background: var(--warn); color: var(--bg); }
.status-svc { padding: 1rem 1.1rem; }
.status-svc .top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .6rem; }
.status-svc .top b { font-family: var(--font-display); font-size: 1.05rem; }
.status-svc .top .r { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; }
.day { margin-top: 1.5rem; } .day h3 { font-size: .95rem; color: var(--muted); font-family: var(--font-ui); font-weight: 650; margin: 0 0 .5rem; }
.status-foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; justify-content: space-between; }
.status-foot a { color: var(--muted); }
.pulse i { min-width: 0; }
.status-svc .pulse, .row-item .pulse { gap: 1px; }
