:root {
  --ot-sage: #7D9B76; --ot-rose: #D4A0A0; --ot-caramel: #A67C52; --ot-ink: #2B241E;
  --ot-espresso: #453A31; --ot-ivory: #FAF6EE; --ot-linen: #EFE7DA;
  --bg: var(--ot-ivory); --surface: #fff; --text: var(--ot-ink); --muted: #6f6359; --line: var(--ot-linen);
  --accent: var(--ot-espresso); --error: #9b2c2c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1f1a16; --surface: var(--ot-ink); --text: #f3ece1; --muted: #b9ab9c; --line: #3b322b;
          --accent: var(--ot-linen); --error: #f0a0a0; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Lato, system-ui, sans-serif; }
h1, h2, h3, .ot-brand { font-family: "Playfair Display", Georgia, serif; font-weight: 600; }
a { color: var(--accent); }
.ot-muted { color: var(--muted); }
.ot-error { color: var(--error); }
.ot-header { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ot-brand { color: var(--text); text-decoration: none; font-size: 1.15rem; margin: 0; }
.ot-signout button { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px;
  padding: 6px 12px; font: inherit; cursor: pointer; }
.ot-main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.ot-auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.ot-auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 24px; }
.ot-auth-card form { display: grid; gap: 8px; margin: 16px 0; }
.ot-auth-card input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); }
.ot-auth-card button { font: inherit; font-weight: 700; padding: 10px 12px; border: 0; border-radius: 8px;
  background: var(--ot-espresso); color: var(--ot-ivory); cursor: pointer; margin-top: 8px; }

/* Layout: left nav from 768 px, a drawer below it. */
.ot-layout { display: grid; grid-template-columns: 1fr; }
.ot-nav { display: none; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ot-nav[data-open] { display: block; }
.ot-nav ul { list-style: none; margin: 0 0 12px; padding: 0; }
.ot-nav a { display: block; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--text); }
.ot-nav a[aria-current="page"] { background: var(--line); font-weight: 700; }
.ot-nav-group { margin: 8px 0 4px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ot-nav-toggle { font: inherit; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 10px; }
@media (min-width: 768px) {
  .ot-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .ot-nav { display: block; border-bottom: 0; border-right: 1px solid var(--line); min-height: calc(100vh - 57px); }
  .ot-nav-toggle { display: none; }
}
.ot-header .ot-brand { margin-right: auto; }

/* Page */
/* width: auto margins on a grid item would shrink it to its content. */
.ot-main { min-width: 0; width: 100%; }
.ot-page-head h1 { margin: 4px 0 8px; }
.ot-through { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: .875rem; }
.ot-through-label { color: var(--muted); }
.ot-through-item::before { content: "●"; margin-right: 4px; color: var(--muted); }
.ot-status-ok::before { color: #2D7A4B; }
.ot-status-late::before { color: #BF7A26; }
.ot-status-stale::before, .ot-status-never::before { color: var(--error); }
.ot-built { font-size: .8rem; margin: 4px 0 0; }
.ot-banner { margin: 16px 0; padding: 12px 16px; border-radius: 8px; background: var(--ot-rose); color: var(--ot-ink); font-weight: 700; }
.ot-banner a { color: var(--ot-ink); }
.ot-section { margin-top: 28px; }
.ot-section h2 { font-size: 1.25rem; margin: 0 0 12px; }
.ot-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.ot-grid--kpi { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.ot-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.ot-card--table { grid-column: 1 / -1; }
.ot-card h3 { font-family: Lato, system-ui, sans-serif; font-size: .95rem; font-weight: 700; margin: 0 0 8px; }
.ot-chart-body { min-height: 60px; }
.ot-echart { width: 100%; height: 300px; }
.ot-source, .ot-note { font-size: .75rem; color: var(--muted); margin: 8px 0 0; }
.ot-state { margin: 24px 0; text-align: center; }
.ot-kpi-value { font-family: "Playfair Display", Georgia, serif; font-size: 2rem; margin: 0; line-height: 1.2; }
.ot-kpi-delta { margin: 4px 0 0; font-size: .875rem; }
.ot-kpi-meta { margin: 2px 0 0; font-size: .75rem; }
.ot-low { color: var(--muted); }
.ot-badge { display: inline-block; margin: 8px 6px 0 0; padding: 2px 8px; border-radius: 999px; font-size: .75rem; background: var(--line); color: var(--text); }
.tabulator { font-size: .875rem; background: transparent; border: 0; }
.tabulator .tabulator-row.ot-low { color: var(--muted); }
.ot-card--gallery.ot-card--table { grid-column: auto; }
.ot-type { font-size: .75rem; margin: -4px 0 6px; }
