/* F-150 Tracker - self-hosted, no CDN, no web fonts, no third-party assets.
   Protocol 17 (offline) and 05 (CSP style-src 'self'). */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0b0f14;
  --panel: #121a23;
  --panel-2: #17222e;
  --line: #24303d;
  --ink: #e6edf3;
  --muted: #8b9bab;
  --accent: #ff6a2b;
  --down: #3fb950;
  --up: #f85149;
}

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
}

/* Header ------------------------------------------------------------------ */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 20, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.06rem;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--accent); }
.top nav {
  display: flex;
  gap: 1.15rem;
  flex-wrap: wrap;
  margin-left: auto;
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}
.top nav a:hover, .top nav a:focus-visible { color: var(--ink); }
.top nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Hero -------------------------------------------------------------------- */
.hero { padding: 26px 0 6px; }
.hero h1 {
  font-size: clamp(1.55rem, 3.1vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 0.55rem;
}
.lede {
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 1.6rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.stats__item,
.stat {
  background: var(--panel);
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}
.stat .n {
  font-size: clamp(1.04rem, 2.2vw, 1.36rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat .l {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.updated {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 0 1.75rem;
}

/* Cards ------------------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.2rem 1.35rem;
  margin-bottom: 1.15rem;
}
.card h2 {
  font-size: 1.06rem;
  margin: 0 0 0.22rem;
  letter-spacing: 0.005em;
}
.card .sub {
  color: var(--muted);
  font-size: 0.855rem;
  margin: 0 0 1.05rem;
  max-width: 78ch;
}
.card .note {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.9rem 0 0;
}
.empty {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}

/* Tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.44rem 0.7rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 550;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.075em;
}
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
tbody tr:hover td { background: var(--panel-2); }

.down { color: var(--down); }
.up { color: var(--up); }

.toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 0 0 0.9rem;
}
.toolbar .sub { margin: 0; }
.sorts { color: var(--muted); font-size: 0.82rem; }
.sorts a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--line); }
.sorts b { color: var(--ink); font-weight: 600; }
/* Sortable listing table ------------------------------------------------- */
.listbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  flex-wrap: wrap;
  margin: 0 0 0.85rem;
}
.listbar-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.listbar-count b { color: var(--ink); font-weight: 600; }
.listbar-hint { margin-left: 0.45rem; opacity: 0.75; }

.seg {
  display: inline-flex;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}
.seg-label {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.seg a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.9rem;
  min-height: 44px;
  padding: 0 0.6rem;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.seg a:hover { color: var(--ink); background: var(--panel); }
.seg a[aria-current="true"] {
  background: var(--accent);
  color: #0b0f14;
  font-weight: 650;
}

thead th.sortable { padding: 0; }
thead th.sortable > a {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 44px;
  padding: 0.2rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
}
thead th.num.sortable > a { justify-content: flex-end; }
thead th.sortable > a:hover {
  color: var(--ink);
  background: var(--panel-2);
}
thead th.sortable > a:focus-visible {
  color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
thead th.sortable[aria-sort="ascending"],
thead th.sortable[aria-sort="descending"] {
  background: rgba(255, 106, 43, 0.08);
  box-shadow: inset 0 -2px 0 var(--accent);
}
thead th.sortable[aria-sort="ascending"] > a,
thead th.sortable[aria-sort="descending"] > a { color: var(--ink); }
th.th-plain { padding: 0.44rem 0.7rem; }

.sort-arrow {
  display: inline-flex;
  flex: none;
  opacity: 0.4;
}
.sort-arrow svg { display: block; }
th[aria-sort="ascending"] .sort-arrow,
th[aria-sort="descending"] .sort-arrow {
  opacity: 1;
  color: var(--accent);
}
th.sortable > a:hover .sort-arrow { opacity: 1; }
th.sortable > a { cursor: pointer; }

@media (max-width: 720px) {
  .listbar { align-items: flex-start; }
  .listbar-hint { display: block; margin: 0.15rem 0 0; }
  .seg { width: 100%; justify-content: space-between; }
  .seg a { min-width: 0; flex: 1; }
  .seg-label { display: none; }
}

.pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.pager a { color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 7px; padding: 0.28rem 0.6rem; }
.small { color: var(--muted); font-size: 0.8rem; }
.watchdog { color: var(--ink); margin-left: 0.5rem; text-decoration: none; border-bottom: 1px dotted var(--line); }

/* Public capacity test ---------------------------------------------------- */
.notes { margin: 0 0 0 1.1rem; padding: 0; color: var(--muted); font-size: 0.88rem; max-width: 82ch; }
.notes li { margin: 0.35rem 0; }
.notes b { color: var(--ink); }

.month {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.4rem 0 0.8rem;
}
.month-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--panel-2);
}
.month-day strong { color: var(--ink); font-size: 0.82rem; }
.month-day--clean { border-color: rgba(63, 185, 80, 0.5); background: rgba(63, 185, 80, 0.12); }
.month-day--challenge { border-color: rgba(248, 81, 73, 0.55); background: rgba(248, 81, 73, 0.13); }
.month-day--error { border-color: rgba(210, 153, 34, 0.55); background: rgba(210, 153, 34, 0.12); }
.month-day--empty { opacity: 0.8; }
.month-day--future { opacity: 0.55; border-style: dashed; }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.78rem; }
.dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.25rem; }
.dot--clean { background: var(--down); }
.dot--challenge { background: var(--up); }
.dot--error { background: #d29922; }
.dot--empty { background: var(--line); }
.dot--future { background: var(--panel-2); border: 1px solid var(--line); }

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0 0 1.2rem;
}
.scenario {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: var(--panel-2);
}
.scenario h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.scenario p { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.5rem; }
.scenario .scenario-num {
  font-size: 1.8rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin: 0.2rem 0;
}
.scenario--best { border-color: rgba(63, 185, 80, 0.45); }
.scenario--expected { border-color: rgba(255, 106, 43, 0.45); }
.scenario--worst { border-color: rgba(248, 81, 73, 0.45); }

@media (max-width: 900px) {
  .month { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .scenario-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .month { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .month-day { min-height: 70px; }
}
.flat { color: var(--muted); }

/* Value page -------------------------------------------------------------- */
.thesis {
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
  border-radius: 0 10px 10px 0;
  padding: 0.9rem 1.05rem;
  margin: 0 0 1.6rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 82ch;
}
.thesis b { color: var(--ink); }

.mini {
  font-size: 0.9rem;
  margin: 1.3rem 0 0.45rem;
  letter-spacing: 0.005em;
}

.tiers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.tier {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  padding: 0.9rem 0.95rem 1rem;
  min-width: 0;
}
.tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.tier-kicker {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.085em;
}
.badge {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge--measured { color: #0b0f14; background: var(--down); border-color: var(--down); }
.badge--modelled { color: var(--accent); border-color: rgba(255, 106, 43, 0.55); }
.badge--assumed { color: #d29922; border-color: rgba(210, 153, 34, 0.55); }

.tier-records {
  margin: 0.35rem 0 0.7rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tier-money {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0 0 0.7rem;
}
.tier-money > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.tm-k {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tm-v {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tm-v small { font-size: 0.7rem; color: var(--muted); }
.tm-r { color: var(--muted); font-size: 0.72rem; }
.tier-why {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
  max-width: 46ch;
}

.card.gate {
  border-color: rgba(210, 153, 34, 0.5);
  background: rgba(210, 153, 34, 0.06);
}
.card.gate h2 { color: #e8b649; }

.table-wrap table.textual th,
.table-wrap table.textual td { white-space: normal; }
.table-wrap table.textual td:first-child { min-width: 11rem; }
.table-wrap table.textual code { white-space: nowrap; }

.sources {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 82ch;
}
.sources li { margin: 0.45rem 0; }
.sources b, .sources a { color: var(--ink); }

@media (max-width: 900px) {
  .tiers { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tier-money { grid-template-columns: 1fr; }
}

/* Mileage model ----------------------------------------------------------- */
.fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.2rem;
}
.fit-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.62rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  font-size: 0.875rem;
}
.fit-row span { color: var(--muted); }
.fit-row b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Method ------------------------------------------------------------------ */
.method {
  margin: 0.1rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.885rem;
  max-width: 80ch;
}
.method li { margin: 0.42rem 0; }
.method b { color: var(--ink); font-weight: 600; }

/* Footer ------------------------------------------------------------------ */
.foot {
  padding: 0.4rem 0 2.4rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.foot p { margin: 0; }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top .wrap { min-height: 0; padding: 0.65rem 0; gap: 0.6rem; }
  .top nav { margin-left: 0; width: 100%; gap: 0.85rem; }
  .wrap { width: calc(100% - 1.6rem); }
  .card { padding: 1rem 0.9rem 1.15rem; }
  th, td { padding: 0.4rem 0.5rem; font-size: 0.855rem; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 32rem; }
  .fit { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Admin console
   Scope indicator is visible on every admin page (protocol 26: admin uses a
   distinct context, and hiding it is not a permission control).
   --------------------------------------------------------------------------- */

.brand { letter-spacing: 0.02em; }

.scope {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #fbbf24;
  border: 1px solid #b45309;
  background: rgba(180, 83, 9, 0.22);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.top nav { gap: 1.1rem; }
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

form.inline { display: inline; }
.top form.inline { margin-left: 0.4rem; }

.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.62rem 1rem;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b0f14; }
.btn.danger { border-color: #b42318; color: #fda4a2; }
.btn.small { padding: 0.45rem 0.8rem; min-height: 34px; min-width: 0; font-size: 0.8rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn:hover:not([disabled]) { filter: brightness(1.06); }

.alert {
  border: 1px solid #b42318;
  border-left-width: 4px;
  background: rgba(180, 35, 24, 0.14);
  padding: 0.75rem 0.95rem;
  border-radius: 8px;
  margin: 0 0 1rem;
  max-width: 70ch;
}
.ok {
  border: 1px solid #2e7d32;
  border-left-width: 4px;
  background: rgba(46, 125, 50, 0.14);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  margin: 0 0 1rem;
  max-width: 70ch;
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.55rem 0 1.15rem;
  max-width: 74ch;
}

/* Key/value summary: label above value, so long numbers never crush the label. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem 1rem;
  margin: 0 0 1.4rem;
  padding: 0;
}
.grid > div {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  padding: 0.6rem 0.72rem;
  min-width: 0;
}
.grid dt {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 0.24rem;
}
.grid dd {
  margin: 0;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 0.5rem;
}

.progress-text {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* Settings inputs must fit inside a 390px card without overflow. */
.stack { max-width: 46rem; }
.stack label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.85rem 0 0.25rem;
}
.stack input[type="number"] {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding: 0.55rem 0.65rem;
  min-height: 44px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.stack input:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.stack small {
  display: block;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.45;
  margin: 0.28rem 0 0;
  max-width: 62ch;
}
.stack button { margin-top: 1.1rem; }

code.detail {
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  overflow-wrap: anywhere;
}

/* Sign-in card: centered, narrow, one column AA. */
.auth {
  max-width: 420px;
  margin: 6vh auto 0;
  padding: 1.6rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.auth h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.auth .sub { margin: 0 0 1.25rem; }
.auth .stack { max-width: none; }

/* Health ------------------------------------------------------------------ */
.health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  white-space: nowrap;
}
.pill--ok { color: #0b0f14; background: var(--down); border-color: var(--down); }
.pill--degraded { color: #0b0f14; background: #d29922; border-color: #d29922; }
.pill--stalled { color: #ffffff; background: var(--up); border-color: var(--up); }
.pill--paused { color: var(--muted); background: var(--panel-2); }

.stats--health { margin-top: 0.2rem; }
.stats--watchdog { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem 1.2rem;
  margin: 0 0 1rem;
}
.health-grid > div { display: flex; flex-direction: column; gap: 0.12rem; }
.health-grid .k {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.health-grid .v { font-variant-numeric: tabular-nums; font-size: 0.92rem; }

progress.bar {
  width: 100%;
  height: 0.55rem;
  appearance: none;
  border: 0;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
progress.bar::-webkit-progress-bar { background: var(--panel-2); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.2rem 0 0.1rem;
  padding: 0;
  list-style: none;
}
.week-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.4rem;
  text-align: center;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.week-rate { font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.week-name {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.week-day--ok { border-color: rgba(63, 185, 80, 0.55); background: rgba(63, 185, 80, 0.14); }
.week-day--warn { border-color: rgba(210, 153, 34, 0.55); background: rgba(210, 153, 34, 0.14); }
.week-day--bad { border-color: rgba(248, 81, 73, 0.55); background: rgba(248, 81, 73, 0.14); }
.week-day--none { opacity: 0.55; }

@media (max-width: 720px) {
  .top form.inline { margin-left: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { margin-top: 1.2rem; padding: 1.25rem 1rem; }
  .table-wrap table { min-width: 40rem; }
  .stats--health { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-grid { grid-template-columns: 1fr; }
  .week-rate { font-size: 0.78rem; }
  .week-name { font-size: 0.62rem; }
}

.day-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.day-highlight { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: rgba(255,255,255,0.02); }
.day-highlight--clean { border-color: rgba(63,185,80,0.45); background: rgba(63,185,80,0.08); }
.day-highlight--challenge { border-color: rgba(248,81,73,0.5); background: rgba(248,81,73,0.09); }
.day-highlight--error { border-color: rgba(210,153,34,0.5); background: rgba(210,153,34,0.08); }
.day-highlight--empty { opacity: 0.85; }
.day-highlight h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.day-highlight p { margin: 0.45rem 0; }
.day-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.8rem; margin: 0.6rem 0 0; font-size: 0.82rem; }
.day-facts dt { color: var(--muted); }
.day-facts dd { margin: 0; }
.day-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.day-row { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; }
.day-row--challenge { border-color: rgba(248,81,73,0.45); background: rgba(248,81,73,0.05); }
.day-row--error { border-color: rgba(210,153,34,0.45); background: rgba(210,153,34,0.05); }
.day-row--empty { opacity: 0.85; }
.day-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
.day-worker { font-size: 0.85rem; color: var(--muted); margin: 0.15rem 0 0.45rem; }
.day-row p { margin: 0.35rem 0; }
@media (max-width: 760px) { .day-highlights { grid-template-columns: 1fr; } }

/* Marketplace tabs ------------------------------------------------------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}
.tabs .tab {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}
.tabs .tab:hover, .tabs .tab:focus-visible { color: var(--ink); border-color: var(--accent); }
.tabs .tab--current {
  color: #14181d;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
tr.group-start td { border-top: 2px solid var(--line); }
