/*
 * styles.css — road lot model for Visibuild.
 *
 * The whole palette derives from a single --primary colour via color-mix(), so
 * setting --primary (injected per-request from Settings) re-themes the app.
 * Status/priority badge colours stay semantic (they are not brand colours).
 */

/* ==== Design tokens ==== */
:root {
  /* Brand colour — overridden at runtime with the value from Settings. */
  --primary: #5C7E6A;

  /* Brand shades derived from --primary */
  --sage:        var(--primary);
  --sage-dark:   color-mix(in srgb, var(--primary) 74%, #11201a);
  --sage-mid:    color-mix(in srgb, var(--primary) 62%, #ffffff);
  --sage-light:  color-mix(in srgb, var(--primary) 16%, #ffffff);
  --sage-xlight: color-mix(in srgb, var(--primary) 7%,  #ffffff);
  --focus-ring:  color-mix(in srgb, var(--primary) 22%, transparent);
  --primary-glow:color-mix(in srgb, var(--primary) 38%, transparent);

  /* Warm neutrals, lightly tinted by the brand so the theme stays cohesive */
  --cream:  color-mix(in srgb, var(--primary) 4%,  #faf8f4);
  --sand:   color-mix(in srgb, var(--primary) 8%,  #ece8e0);
  --border: color-mix(in srgb, var(--primary) 10%, #dad5cc);

  --terra: #c17a5b;

  /* Ink (text) — stable darks for legibility */
  --ink:       #1e2b25;
  --ink-mid:   #3d4f47;
  --ink-muted: #6b7c74;
  --ink-faint: #9aada5;

  --card-bg: #ffffff;

  --shadow-xs: 0 1px 2px rgba(30,43,37,.05);
  --shadow-sm: 0 2px 8px rgba(30,43,37,.07);
  --shadow-md: 0 4px 16px rgba(30,43,37,.09);
  --shadow-lg: 0 8px 32px rgba(30,43,37,.12);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  200ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--sage-dark); }

/* Sticky footer scaffold */
.app-main { flex: 1 0 auto; display: flex; flex-direction: column; }
.app-main > .container,
.app-main > .login-wrap { flex: 1 0 auto; }

/* ==== Navigation ==== */
.app-nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-icon {
  width: 36px; height: 36px;
  background: var(--sage);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  transition: transform var(--dur) var(--ease);
}
.nav-brand:hover .brand-icon { transform: scale(1.06); }
.brand-icon img { width: 32px; height: 32px; object-fit: contain; }
.brand-icon--lg { width: 60px; height: 60px; margin: 0 auto 18px; }
.brand-icon--lg img { width: 52px; height: 52px; }
.brand-logo { height: 34px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.login-logo { max-height: 60px; max-width: 220px; object-fit: contain; margin: 0 auto 18px; display: block; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink); }
.nav-center-group { display: flex; align-items: center; gap: 4px; margin-left: 8px; flex: 1; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 7px 12px; border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
/* Sign out is a <button> in a logout form — make it identical to the link. */
button.nav-link { font-family: inherit; background: none; border: none; cursor: pointer; }
.nav-link:hover { background: var(--sage-xlight); color: var(--sage-dark); }
.nav-link.active { background: var(--sage-light); color: var(--sage-dark); font-weight: 600; }
.nav-link svg { width: 15px; height: 15px; }

/* ==== Footer ==== */
.app-footer {
  flex-shrink: 0;
  text-align: center;
  padding: 22px 24px;
  font-size: 12.5px;
  color: var(--ink-faint);
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.app-footer a { color: var(--ink-muted); text-decoration: none; font-weight: 600; }
.app-footer a:hover { color: var(--sage-dark); text-decoration: underline; text-underline-offset: 2px; }

/* ==== Layout ==== */
.container { max-width: 1100px; width: 100%; margin: 0 auto; padding: 32px 24px 48px; }
.container--sm { max-width: 600px; }
.container--wide { max-width: 2000px; }

.page-title { font-size: 27px; font-weight: 700; letter-spacing: -0.5px; }
.page-subtitle { color: var(--ink-muted); font-size: 15px; margin-top: 4px; }
.page-header { margin-bottom: 24px; }
.page-header--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.header-filter { display: flex; align-items: center; gap: 8px; }
.header-filter select { width: auto; min-width: 180px; padding: 10px 36px 10px 14px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; }

/* ==== Cards ==== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  transition: box-shadow var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }

/* ==== Buttons ==== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600; white-space: nowrap;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; color: var(--ink-mid);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform 80ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--sage); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--sage-dark); box-shadow: 0 4px 12px var(--primary-glow); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--ink-mid); }
.btn-ghost:hover:not(:disabled) { background: var(--sand); border-color: var(--ink-faint); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { color: #92291A; border-color: #F5B8AE; }
.btn-danger:hover:not(:disabled) { background: #FEF4F2; border-color: #E38A7C; }

/* ==== Forms ==== */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-mid); margin-bottom: 6px; }

input[type="text"], input[type="password"], input[type="url"], input[type="number"], textarea, select {
  width: 100%; padding: 11px 14px; background: var(--card-bg);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; color: var(--ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  appearance: none; -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--focus-ring);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7C74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer;
}
/* The numeric caps hold two or three digits, so a full-width field would read
   as a mistake. Everything else about them matches the text inputs. */
input[type="number"] {
  max-width: 150px;
  /* The shared rule strips the native appearance; number inputs want their
     stepper back, since these are values people nudge rather than type. */
  appearance: auto;
  -webkit-appearance: auto;
}

input[type="color"] {
  width: 56px; height: 42px; padding: 4px; background: var(--card-bg);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row code { font-family: var(--mono); font-size: 13px; color: var(--ink-muted); }

.form-section-title {
  font-size: 13px; font-weight: 600; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 28px 0 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--sand);
}
.form-section-title:first-child { margin-top: 0; }
.field-hint { font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); margin-top: 7px; }
.field-hint a { color: var(--sage-dark); text-decoration: underline; text-underline-offset: 2px; }

/* ==== Login pages ==== */
.login-wrap { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 390px; text-align: center; }
.login-title { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; }
.login-sub { color: var(--ink-muted); font-size: 14px; margin: 6px 0 24px; }
.login-card form { text-align: left; }
.login-foot { margin-top: 20px; font-size: 13px; color: var(--ink-faint); }
.login-foot a { color: var(--ink-muted); }

/* ==== Messages ==== */
.message {
  font-size: 14px; padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  display: flex; align-items: flex-start; gap: 10px; line-height: 1.45;
}
.message::before { font-weight: 700; flex-shrink: 0; }
.message.error   { background: #FEF4F2; color: #92291A; border: 1px solid #F5B8AE; }
.message.error::before   { content: "!"; }
.message.success { background: #F0FBF4; color: #1A5C35; border: 1px solid #A8E0BF; }
.message.success::before { content: "\2713"; }
.message.info    { background: var(--sage-xlight); color: var(--sage-dark); border: 1px solid var(--sage-light); }
.message a { color: inherit; font-weight: 600; }

/* ==== Toolbar / filters ==== */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.toolbar .form-group { margin-bottom: 0; }
.toolbar label { margin-bottom: 5px; }
.toolbar select { min-width: 220px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill {
  font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 7px 15px; border-radius: 999px;
  background: var(--card-bg); color: var(--ink-mid); border: 1px solid var(--border);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.pill:hover { border-color: var(--sage); color: var(--sage-dark); }
.pill.active { background: var(--sage); color: #fff; border-color: var(--sage); }
.pill .count { opacity: .7; margin-left: 5px; font-weight: 500; }

/* ==== Data tables ==== */
.table-wrap { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow-sm); }
.card > .table-wrap { border: none; box-shadow: none; border-radius: 0; margin: -26px; width: calc(100% + 52px); }
/* After a title or hint, bleed to the sides and bottom only, so the table sits below them. */
.card > * + .table-wrap { margin: 14px -26px -26px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-muted); padding: 14px 16px; background: var(--sage-xlight); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--sand); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table a { color: var(--sage-dark); text-decoration: none; }
.data-table a:hover { text-decoration: underline; text-underline-offset: 2px; }
/* The sync log's detail column carries lists, so it needs room to breathe. */
.event-table td:last-child { width: 55%; font-size: 13px; line-height: 1.55; }

/* ==== Badges (semantic, not themed) ==== */
.badge {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; letter-spacing: .2px;
  padding: 3px 10px; border-radius: 999px; text-transform: capitalize; white-space: nowrap;
}
/* Visi status, as reported by Visibuild */
.visi-open        { background: #DBEAFE; color: #1740A0; }
.visi-in-progress { background: #FEF9C3; color: #7A4F10; }
.visi-in-review   { background: #FFEDD5; color: #8A3010; }
.visi-closed      { background: #DCFCE7; color: #145C2A; }
.visi-n-a         { background: var(--sand); color: var(--ink-muted); }
.visi-cant-close  { background: #FEE2E2; color: #8E1C14; }
.visi-unknown     { background: var(--sand); color: var(--ink-muted); }

/* What the sync did to one visi */
.action-create   { background: #DCFCE7; color: #145C2A; }
.action-update   { background: #DBEAFE; color: #1740A0; }
.action-skip     { background: var(--sand); color: var(--ink-muted); }
.action-conflict { background: #FFEDD5; color: #8A3010; }
.action-error    { background: #FEE2E2; color: #8E1C14; }

/* How a whole run ended */
.run-running { background: #DBEAFE; color: #1740A0; }
.run-ok      { background: #DCFCE7; color: #145C2A; }
.run-partial { background: #FEF9C3; color: #7A4F10; }
.run-failed  { background: #FEE2E2; color: #8E1C14; }

/* Connection health */
.health-ok  { background: #DCFCE7; color: #145C2A; }
.health-bad { background: #FEE2E2; color: #8E1C14; }

/* ==== Empty state ==== */
.empty-state { text-align: center; padding: 64px 24px; color: var(--ink-muted); }
.empty-title { font-size: 17px; font-weight: 700; color: var(--ink-mid); margin-bottom: 6px; }
.empty-body { font-size: 14px; max-width: 420px; margin: 0 auto; }

/* ==== Definition lists ==== */
.detail-dl { display: grid; grid-template-columns: 160px 1fr; gap: 11px 16px; font-size: 14px; }
.detail-dl dt { color: var(--ink-muted); font-weight: 600; }
.detail-dl dd { color: var(--ink); word-break: break-word; }
.text-muted { color: var(--ink-faint); }
.text-error { color: #92291A; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--sage-xlight); padding: 1px 5px; border-radius: 4px; }
.copy-target { user-select: all; font-size: 13px; padding: 6px 9px; display: inline-block; word-break: break-all; }

/* ==== Mapping rows ==== */
/* Each row is "Visibuild value -> Revizto value", so it reads as the mapping it is. */
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--sand); }
.map-row:last-of-type { border-bottom: none; }
.map-from { font-size: 14px; font-weight: 600; color: var(--ink); min-width: 0; }
.map-from .text-muted { display: block; font-size: 12px; font-weight: 400; }
.map-arrow { color: var(--ink-faint); text-align: center; font-size: 13px; }
.map-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin: 18px 0 6px; }

/* ==== Per-location overrides ==== */
.override-block { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.override-block summary { font-size: 13px; font-weight: 600; color: var(--ink-mid); cursor: pointer; }
.override-block[open] summary { margin-bottom: 10px; }
.loc-override { padding: 10px 0; border-bottom: 1px solid var(--sand); }
.loc-override:last-child { border-bottom: none; }
.loc-override-name { font-size: 13px; font-weight: 600; color: var(--ink-mid); margin-bottom: 6px; }
.loc-override-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; }
.loc-override-fields input { font-size: 13px; padding: 7px 10px; }

/* ==== Sync log detail ==== */
.event-list { list-style: none; margin: 4px 0 0; display: flex; flex-direction: column; gap: 3px; }
.event-list li { font-size: 13px; line-height: 1.5; }
.event-note { margin-top: 8px; padding: 9px 12px; background: #FFF7ED; border: 1px solid #FDBA74; border-radius: var(--radius-sm); font-size: 13px; color: #7C2D12; }
.event-note code { background: rgba(255,255,255,.6); }

/* A follow-on block inside a card, separated from the form above it. */
.section-divider { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--sand); }

/* ==== Webhooks ==== */
.webhook-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sand); }
.webhook-row:last-of-type { border-bottom: none; }
.webhook-row .text-muted { font-size: 12.5px; margin-top: 3px; }
.webhook-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--sand); }

/* ==== Settings ==== */
.checkbox-list { display: flex; flex-wrap: wrap; gap: 8px 18px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.checkbox-item { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.checkbox-item input { width: auto; }
.checkbox-item .code { margin-left: auto; font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }
.column-list { max-height: none; }
.column-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.column-item input[type="checkbox"] { width: auto; }
.column-item label { flex: 1; margin: 0; font-size: 14px; font-weight: 500; cursor: pointer; }
.column-move { display: inline-flex; gap: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--ink-muted); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--sage-xlight); color: var(--sage-dark); border-color: var(--sage-light); }
.icon-btn svg { width: 14px; height: 14px; }
.actions-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 780px) {
  .nav-center-group { gap: 0; }
  .nav-link { padding: 7px 9px; }
}

@media (max-width: 640px) {
  .detail-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .detail-dl dt { margin-top: 10px; }
  /* Stacked, the arrow between a mapping's two halves stops making sense. */
  .map-row { grid-template-columns: 1fr; gap: 4px; }
  .map-arrow { display: none; }
  .card > .table-wrap { margin: -18px; width: calc(100% + 36px); }
  .card > * + .table-wrap { margin: 12px -18px -18px; }
  .card { padding: 18px; }
}

/* ==== Road lot model ==== */
:root {
  --st-released: #4f9d69;
  --st-testing:  #dd9d33;
  --st-placed:   #4a7fc1;
  --st-wet:      #c0392b;
  --wx-dry:      #6f8f7c;
  --wx-showers:  #8fb3d4;
  --wx-wet:      #4b78a8;
  --wx-washout:  #2a4a72;
  --rain:        #5b8fc7;
}
input[type="date"] {
  font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card-bg);
}
textarea.code, .code-block { font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.code-block { background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; overflow: auto; max-height: 420px; white-space: pre; }
section.card, .container > .card { margin-bottom: 20px; }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 4px; }
.eyebrow a { color: inherit; }
.lead { font-size: 15px; color: var(--ink-mid); margin-top: 8px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.small { font-size: 12.5px; }
.text-warn { color: #8a5a10; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
.grid-2 > .card { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.checkbox-list.inline { display: flex; flex-wrap: wrap; gap: 6px 16px; }
input.metres { width: 110px; text-align: right; }
.steps { margin: 10px 0 0 20px; display: grid; gap: 6px; font-size: 14px; }
.copy-block { display: flex; align-items: center; gap: 12px; background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0 12px; }
.copy-block > :first-child { flex: 1; word-break: break-all; font-size: 14px; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 24px; align-items: end; margin-bottom: 20px; }
.hero .actions-row { margin-top: 14px; }
.plan-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); }
.kpi-value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }

/* Badges */
.lot-released { background: #DCFCE7; color: #145C2A; }
.lot-testing  { background: #FEF3C7; color: #7A4F10; }
.lot-placed   { background: #DBEAFE; color: #1740A0; }
.lot-wet      { background: #FEE2E2; color: #8E1C14; }
.lot-unknown, .wx-unknown { background: var(--sand); color: var(--ink-muted); }
.badge.wx-dry     { background: #EEF2EF; color: #3d5546; }
.badge.wx-showers { background: #E6F0F8; color: #2d5579; }
.badge.wx-wet     { background: #D6E4F2; color: #1f4570; }
.badge.wx-washout { background: #23406a; color: #fff; }

/* Charts */
.chart-wrap { overflow-x: auto; margin: 6px 0 4px; }
.chart { display: block; width: 100%; height: auto; font-family: inherit; }
.chart.register, .chart.weather { min-width: 820px; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { stroke: var(--ink-faint); stroke-width: 1; }
.chart .tick { font-size: 12px; fill: var(--ink-muted); }
.chart .panel-label { font-size: 12px; font-weight: 600; fill: var(--ink-mid); }
.chart .row-label { font-size: 12.5px; fill: var(--ink-muted); }
.chart .row-cw { font-weight: 700; fill: var(--ink); }
.chart .hatch-bg { fill: var(--cream); }
.chart .hatch-line { stroke: var(--border); stroke-width: 1.2; }
.chart .lotbar { stroke: var(--card-bg); stroke-width: 1; }
.chart a:hover .lotbar { filter: brightness(1.12); }
.chart .lotbar.st-released { fill: var(--st-released); }
.chart .lotbar.st-testing  { fill: var(--st-testing); }
.chart .lotbar.st-placed   { fill: var(--st-placed); }
.chart .lotbar.st-wet      { fill: var(--st-wet); }
.chart .lotbar.is-new      { stroke: var(--ink); stroke-width: 2.2; }
.chart .lotbar.is-trimmed  { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3; }
.chart .lotbar.is-focus    { stroke: var(--ink); stroke-width: 3; }
.chart .lot-label { font-size: 11px; font-weight: 600; fill: #fff; pointer-events: none; }
.chart .lot-label.st-testing { fill: #3b2a08; }
.chart .rainbar { fill: var(--rain); }
.chart .prodbar.wx-dry     { fill: var(--wx-dry); }
.chart .prodbar.wx-showers { fill: var(--wx-showers); }
.chart .prodbar.wx-wet     { fill: var(--wx-wet); }
.chart .prodbar.wx-washout { fill: var(--wx-washout); }
.chart .prodbar-none { fill: var(--border); }
.chart .plan-all { fill: none; stroke: var(--border); stroke-width: 5; stroke-linecap: round; }
.chart .plan-extent { fill: none; stroke: var(--ink-faint); stroke-width: 5; }
.chart .plan-done { fill: none; stroke: var(--st-released); stroke-width: 5; }
.chart .plan-dot { fill: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.st-released { background: var(--st-released); }
.legend i.st-testing  { background: var(--st-testing); }
.legend i.st-placed   { background: var(--st-placed); }
.legend i.st-wet      { background: var(--st-wet); }
.legend i.st-none     { background: repeating-linear-gradient(45deg, var(--cream) 0 3px, var(--border) 3px 4px); outline: 1px solid var(--border); }
.legend i.rain        { background: var(--rain); }
.legend i.wx-dry      { background: var(--wx-dry); }
.legend i.wx-showers  { background: var(--wx-showers); }
.legend i.wx-wet      { background: var(--wx-wet); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
