/*
 * Moserwood - After Hours (CH-395 W1, TST_PROPERTY_DASHBOARD_SPEC.md section 7).
 * Dark-first; light mode by prefers-color-scheme or data-theme="light";
 * data-night="1" dims the dark theme for the tablet. 2 px corners, hairline
 * borders, a double brass hairline on featured tiles only, no shadows, no
 * texture. Status is shape + text label, never colour alone.
 */

@font-face {
  font-family: "Bodoni Moda";
  src: url("fonts/bodoni-moda-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0C1320;
  --surface: #131D30;
  --surface2: #1B283F;
  --ink: #F2EBDD;
  --muted: #9BA5B6;
  --line: #27354E;
  --brand: #C9A55A;
  --brand-ink: #0C1320;
  --accent: #C9A55A;
  --ok: #6FCB91;
  --warn: #FF8A3D;
  --bad: #FF7B6C;
  --stale: #7D879A;
  --logo-dark: inline;
  --logo-light: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F5F1E8;
    --surface: #FFFFFF;
    --surface2: #ECE6D9;
    --ink: #111A2B;
    --muted: #566073;
    --line: #D8D0BF;
    --brand: #14213D;
    --brand-ink: #F5F1E8;
    --accent: #86651F;
    --ok: #1F7047;
    --warn: #A34E00;
    --bad: #B3261E;
    --stale: #6F7585;
    --logo-dark: none;
    --logo-light: inline;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F5F1E8;
  --surface: #FFFFFF;
  --surface2: #ECE6D9;
  --ink: #111A2B;
  --muted: #566073;
  --line: #D8D0BF;
  --brand: #14213D;
  --brand-ink: #F5F1E8;
  --accent: #86651F;
  --ok: #1F7047;
  --warn: #A34E00;
  --bad: #B3261E;
  --stale: #6F7585;
  --logo-dark: none;
  --logo-light: inline;
  color-scheme: light;
}
:root[data-night="1"] body { filter: brightness(0.62); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
h1, h2, h3 { font-family: "Bodoni Moda", Georgia, serif; font-weight: 500; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin: 28px 0 12px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 48px; }

/* Header */
.hdr { border-bottom: 1px solid var(--line); background: var(--surface2); }
.hdr .wrap { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.hdr img.mark { width: 31px; height: 40px; }
.mark-dark { display: var(--logo-dark); }
.mark-light { display: var(--logo-light); }
.wordmark { font-family: "Bodoni Moda", Georgia, serif; font-weight: 600; text-transform: uppercase; letter-spacing: 0.32em; font-size: 1rem; }
.hdr .spacer { flex: 1; }
.hdr form { margin: 0; }
.hdr .btn { padding: 0 12px; }
@media (max-width: 480px) { .hdr .wordmark { letter-spacing: 0.2em; font-size: 0.9rem; } .hdr .btn { padding: 0 10px; letter-spacing: 0.08em; } }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 16px 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; color: var(--muted); text-decoration: none; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; font-weight: 500; border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .sep { width: 1px; background: var(--line); margin: 10px 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 48px; padding: 0 20px; border-radius: 2px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }

/* Status strip */
.strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); font-size: 0.9rem; }
.chip .k { color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.7rem; }

/* Tiles */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px; min-height: 96px; }
.tile.featured { border: 3px double var(--accent); }
.tile .lbl { color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.7rem; font-weight: 500; }
.tile .val { font-size: 1.6rem; font-weight: 500; margin: 6px 0 4px; overflow-wrap: anywhere; }
.tile .note { color: var(--muted); font-size: 0.85rem; }
.tile[data-state="stale"] .val, .tile[data-state="nodata"] .val { color: var(--muted); }
.tile[data-state="nodata"] .val { font-size: 1.05rem; font-style: italic; }
.zone h3 { font-size: 1.1rem; margin-bottom: 8px; }
.list .tile { min-height: 0; }

/* Status marker: dot = ok, triangle = warn, square = alert, hollow ring = stale, dash = no data */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.st::before { content: ""; display: inline-block; width: 10px; height: 10px; flex: none; }
.st[data-state="ok"]::before     { background: var(--ok); border-radius: 50%; }
.st[data-state="warn"]::before   { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--warn); }
.st[data-state="alert"]::before  { background: var(--bad); }
.st[data-state="stale"]::before  { border: 2px solid var(--stale); border-radius: 50%; }
.st[data-state="nodata"]::before { height: 2px; background: var(--stale); }
.st[data-state="ok"] { color: var(--ok); }
.st[data-state="warn"] { color: var(--warn); }
.st[data-state="alert"] { color: var(--bad); }
.st[data-state="stale"], .st[data-state="nodata"] { color: var(--stale); }

/* Forms (sign-in) */
.card { max-width: 420px; margin: 48px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 28px 24px; }
.card .emblem-wrap { text-align: center; margin-bottom: 8px; }
.card .emblem { width: 160px; height: auto; vertical-align: top; }
.card .wordmark { display: block; text-align: center; margin-bottom: 20px; }
label { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; margin: 14px 0 6px; }
input[type="text"], input[type="password"] { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 2px; border: 1px solid var(--line); background: var(--surface2); color: var(--ink); font: inherit; font-size: 1.05rem; }
input[type="checkbox"] { width: 22px; height: 22px; vertical-align: middle; }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--ink); }
.msg { border: 1px solid var(--bad); color: var(--bad); padding: 10px 12px; border-radius: 2px; margin-bottom: 14px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; background: var(--surface2); padding: 8px 10px; border-radius: 2px; }
.codes { columns: 2; font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; }
.muted { color: var(--muted); }
.updated { color: var(--muted); font-size: 0.8rem; margin-top: 24px; }
