/* Paddl status page. Brand from apps/marketing (variables.css): primary teal
   scale, zinc greys, Inter + Space Grotesk with full system fallbacks. State
   colours stay semantic; "working" is a true green, never the brand teal. */
:root {
  --p50: #f0fdfa; --p100: #ccfbf1; --p300: #5eead4; --p400: #2dd4bf;
  --p500: #14b8a6; --p600: #0d9488; --p700: #0f766e; --p800: #115e59;

  --bg: #fafafa;          /* gray-50 */
  --surface: #ffffff;
  --ink: #18181b;         /* gray-900 */
  --muted: #52525b;       /* gray-600 */
  --line: #e4e4e7;        /* gray-200 */
  --brand: var(--p500);
  --link: var(--p700);
  --link-hover: var(--p800);
  --btn: var(--p700);
  --btn-hover: var(--p800);
  --btn-ink: #ffffff;
  --brand-soft: var(--p50);
  --brand-line: var(--p100);
  --head-bg: rgba(255, 255, 255, 0.85);
  --foot-bg: #18181b;     /* gray-900, as the marketing footer */
  --foot-ink: #a1a1aa;    /* gray-400 */
  --foot-strong: #ffffff;
  --foot-line: #27272a;   /* gray-800 */

  --ok: #15803d;  --ok-bar: #16a34a; --ok-soft: #f0fdf4;
  --warn: #b45309; --warn-bar: #f59e0b; --warn-soft: #fffbeb;
  --bad: #b91c1c;  --bad-bar: #dc2626; --bad-soft: #fef2f2;
  --info: #1d4ed8; --info-bar: #3b82f6; --info-soft: #eff6ff;
  --none: #d4d4d8;        /* gray-300 */

  --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-xl: 1rem;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --surface: #18181b; --ink: #f4f4f5; --muted: #a1a1aa; --line: #27272a;
    --brand: var(--p400); --link: var(--p300); --link-hover: #99f6e4;
    --btn: var(--p400); --btn-hover: var(--p300); --btn-ink: #042f2e;
    --brand-soft: #042f2e; --brand-line: #134e4a;
    --head-bg: rgba(24, 24, 27, 0.85); --foot-bg: #18181b; --foot-line: #27272a;
    --ok: #4ade80; --ok-bar: #22c55e; --ok-soft: #052e16;
    --warn: #fbbf24; --warn-bar: #f59e0b; --warn-soft: #2a1a05;
    --bad: #f87171; --bad-bar: #ef4444; --bad-soft: #2c0b0b;
    --info: #93c5fd; --info-bar: #60a5fa; --info-soft: #0c1a33;
    --none: #3f3f46;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --surface: #18181b; --ink: #f4f4f5; --muted: #a1a1aa; --line: #27272a;
  --brand: var(--p400); --link: var(--p300); --link-hover: #99f6e4;
  --btn: var(--p400); --btn-hover: var(--p300); --btn-ink: #042f2e;
  --brand-soft: #042f2e; --brand-line: #134e4a;
  --head-bg: rgba(24, 24, 27, 0.85); --foot-bg: #18181b; --foot-line: #27272a;
  --ok: #4ade80; --ok-bar: #22c55e; --ok-soft: #052e16;
  --warn: #fbbf24; --warn-bar: #f59e0b; --warn-soft: #2a1a05;
  --bad: #f87171; --bad-bar: #ef4444; --bad-soft: #2c0b0b;
  --info: #93c5fd; --info-bar: #60a5fa; --info-soft: #0c1a33;
  --none: #3f3f46;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font-body);
  overflow-wrap: anywhere;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header, after the marketing header: translucent white, logo 32px, primary-700 button */
.top { position: sticky; top: 0; z-index: 10; background: var(--head-bg); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; transition: opacity 0.15s; }
.logo:hover { opacity: 0.8; color: var(--ink); }
.logo img { height: 30px; width: auto; display: block; }
.logo .word { font: 600 1.2rem/1 var(--font-head); letter-spacing: -0.01em; padding-left: 10px; border-left: 1px solid var(--line); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font: 600 0.875rem var(--font-body); padding: 8px 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--btn); background: var(--btn); color: var(--btn-ink); text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface); border-color: var(--brand); color: var(--ink); }

/* Body */
main.wrap { display: grid; gap: 16px; padding-top: 32px; padding-bottom: 48px; }
#content { display: grid; gap: 28px; min-width: 0; }
section { display: grid; gap: 10px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); overflow: hidden; }
.muted { color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 0.88rem; }

.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--warn);
  background: var(--warn-soft); color: var(--ink);
  padding: 10px 14px; border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 0.92rem;
}
.loading { color: var(--muted); padding: 24px 0; }

/* Overall banner */
.overall { border-radius: var(--radius-xl); padding: 18px 20px; display: flex; gap: 12px; align-items: center; font: 600 1.2rem/1.3 var(--font-head); letter-spacing: -0.01em; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.overall .dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; flex: none; }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-info { background: var(--info-soft); color: var(--info); }

/* Incident cards */
.incs { display: grid; gap: 14px; }
.inc-top { padding: 14px 18px; display: grid; gap: 6px; border-bottom: 1px solid var(--line); }
.inc-top h3 a { color: inherit; }
.inc-top .meta { color: var(--ink); opacity: 0.82; }
.upds { list-style: none; margin: 0; padding: 0; }
.upd { padding: 12px 18px; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 16px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.upd:last-child { border-bottom: 0; }
.upd .st { font-weight: 700; }
.upd .bd { white-space: pre-line; }
.upd .tm { grid-column: 2; color: var(--muted); font-size: 0.8rem; font-family: var(--font-mono); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.tag { font: 600 0.72rem var(--font-body); padding: 1px 8px; border-radius: 9999px; background: var(--brand-soft); color: var(--link); border: 1px solid var(--brand-line); }

/* Services */
.comp { list-style: none; margin: 0; padding: 0; }
.crow { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.crow:last-child { border-bottom: 0; }
.crow-top { display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.crow-top .nm { font-weight: 600; }
.crow-top .ds { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.state { font-weight: 650; font-size: 0.86rem; }
.state.ok { color: var(--ok); } .state.warn { color: var(--warn); } .state.bad { color: var(--bad); } .state.info { color: var(--info); }
.bars { display: flex; gap: 2px; height: 28px; }
.bars .bar { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--ok-bar); cursor: pointer; }
.bars .bar.w { background: var(--warn-bar); }
.bars .bar.b { background: var(--bad-bar); }
.bars .bar.m { background: var(--info-bar); }
.bars .bar.n { background: var(--none); }
.bars .bar.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.bars .bar:hover { filter: brightness(1.1); }
.barlegend { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.75rem; font-family: var(--font-mono); }
.barlegend .up { color: var(--ink); }
.daydetail { font-size: 0.82rem; color: var(--ink); min-height: 0; }
.daydetail:empty { display: none; }
.short { display: none; }
@media (max-width: 560px) {
  .bars .bar.old { display: none; }
  .long { display: none; }
  .short { display: inline; }
  .upd { grid-template-columns: 1fr; }
  .upd .tm { grid-column: 1; }
  .crow, .upd, .inc-top { padding-left: 14px; padding-right: 14px; }
}

/* Past incidents */
.past { list-style: none; margin: 0; padding: 0; }
.past li { padding: 12px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
.past li:last-child { border-bottom: 0; }
.past .d { font-weight: 600; font-size: 0.86rem; color: var(--muted); }
.past a { font-weight: 600; }
.empty { padding: 14px 18px; color: var(--muted); }

/* Incident page */
.ihead { display: grid; gap: 8px; }
.ihead h1 { font-size: 1.75rem; }
.call { border: 1px solid var(--brand-line); border-left: 3px solid var(--brand); background: var(--brand-soft); padding: 16px 20px; border-radius: 0 var(--radius-lg) var(--radius-lg) 0; display: grid; gap: 8px; }
.call h3 { font-size: 0.95rem; margin-top: 4px; }
.call h3:first-child { margin-top: 0; }
.call p { max-width: 70ch; white-space: pre-line; }

/* Footer, after the marketing footer: gray-900 band, white mark, gray-400 links */
.site-foot { background: var(--foot-bg); color: var(--foot-ink); border-top: 1px solid var(--foot-line); }
.foot { display: grid; gap: 14px; padding-top: 28px; padding-bottom: 32px; font-size: 0.875rem; }
.foot-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.foot-mark { display: inline-flex; }
.foot-mark img { height: 22px; width: auto; display: block; filter: brightness(0) invert(1); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.foot a { color: var(--foot-ink); text-decoration: none; transition: color 0.15s; }
.foot a:hover { color: var(--foot-strong); text-decoration: underline; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding-top: 14px; border-top: 1px solid var(--foot-line); color: var(--foot-ink); }
.foot :focus-visible { outline-color: var(--p400); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
