/* ══════════════════════════════════════════════════════════
   IOI BrewDash — v0.2 Dashboard
   Dark brewery operations UI · Vanilla CSS · No framework
   Layout: left sidebar + main content area
   ══════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --bg:            #0e1117;
  --bg-card:       #161b27;
  --bg-card-2:     #1c2235;
  --bg-hover:      #1e2840;
  --border:        #2a3050;
  --border-light:  #3a4060;
  --chart-grid:    rgba(42,48,80,0.35);
  --accent:        #f5a623;
  --accent-dim:    rgba(245, 166, 35, 0.12);
  --accent-dim2:   rgba(245, 166, 35, 0.06);
  --text:          #e0e6f0;
  --text-dim:      #7a88a8;
  --text-muted:    #4a5570;
  --sidebar-w:     220px;

  /* Status colours */
  --c-operating:   #22c55e;
  --c-cip:         #3b82f6;
  --c-maintenance: #f59e0b;
  --c-defect:      #ef4444;
  --c-empty:       #334155;

  /* Urgency */
  --c-critical:    #ef4444;
  --c-high:        #f59e0b;
  --c-normal:      #7a88a8;

  --radius:    8px;
  --radius-sm: 5px;
  --shadow:    0 2px 10px rgba(0,0,0,0.5);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --beer-swatch-outline: rgba(255,255,255,0.18);
  --beer-swatch-shadow:  rgba(0,0,0,0.22);
  --tooltip-bg: #171d2a;
  --tooltip-bg-top: #1c2235;
  --tooltip-border: rgba(245, 166, 35, 0.22);
  --tooltip-shadow: 0 10px 28px rgba(0,0,0,0.42);

  /* Tank SVG metal fill colours (overridden in light mode) */
  --tank-body-a: #141c2e;
  --tank-body-b: #1e2840;
  --tank-body-c: #151d30;
  --tank-stroke:  #2e3c58;
  --tank-hi:      #3a4a6a;
  --tank-fit:     #1a2234;   /* fittings/valves */
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* subtle left-edge stripe */
  box-shadow: inset -1px 0 0 var(--border), 2px 0 12px rgba(0,0,0,0.3);
}
.sidebar::-webkit-scrollbar { display: none; }

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, color 0.15s;
}
.sidebar-logo,
.sidebar-logo:hover,
.sidebar-logo:focus-visible,
.sidebar-logo:active {
  text-decoration: none !important;
}
.sidebar-logo:hover,
.sidebar-logo:focus-visible {
  background: var(--bg-hover);
  text-decoration: none;
}
.sidebar-logo:active {
  background: var(--accent-dim2);
}

.logo-svg {
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(245,166,35,0.3));
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.logo-brewdash {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.1;
}

.logo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Theme toggle button */
.theme-btn {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}

.theme-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

/* Theme strip (between Pulse and Services) */
.theme-strip {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: auto 12px 8px;
  padding: 3px 4px;
  background: rgba(0,0,0,0.07);
  border-radius: 20px;
  flex-shrink: 0;
}
[data-theme="dark"] .theme-strip {
  background: rgba(255,255,255,0.07);
}

.theme-strip-btn {
  background: none;
  border: none;
  border-radius: 14px;
  width: 28px;
  height: 22px;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.15s, background 0.15s, box-shadow 0.15s;
  line-height: 1;
}

.theme-strip-btn:hover { opacity: 0.75; }

.theme-strip-btn.ts-active {
  background: #fff;
  opacity: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.theme-strip-divider {
  width: 1px;
  height: 12px;
  background: var(--border);
  margin: 0 3px;
  flex-shrink: 0;
}

.theme-strip-user {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  text-align: right;
  padding: 0 2px 0 2px;
  line-height: 22px;
}

.theme-strip-logout {
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0 4px;
  line-height: 22px;
  border-radius: 10px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
}
.theme-strip-logout:hover {
  opacity: 1;
  color: var(--accent);
}
a.theme-strip-user {
  text-decoration: none;
  transition: color 0.15s;
}
a.theme-strip-user:hover { color: var(--accent); }

/* Nav */
.sidebar-nav {
  padding: 10px 0;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.nav-item,
.nav-item:hover,
.nav-item:focus-visible,
.nav-item:active {
  text-decoration: none !important;
}
.nav-item:hover:not(.nav-active),
.nav-item:focus-visible:not(.nav-active) {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}
.nav-item:hover:not(.nav-active) .nav-icon,
.nav-item:focus-visible:not(.nav-active) .nav-icon {
  text-decoration: none;
}
.nav-item:visited { color: var(--text-dim); }
.nav-item.nav-active:visited { color: var(--accent) !important; }
.nav-active {
  color: var(--accent) !important;
  border-left-color: var(--accent);
  background: var(--accent-dim2);
}
.nav-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  color: inherit;
}

.nav-label { font-size: 13px; flex: 1; min-width: 0; }


/* ── Brewery Pulse strip (dashboard main content) ── */
/* ── Brewery KPI block — two rows: operational + production ── */
/* ── KPI — Option U layout ── */
.kpi-u {
  display: flex; flex-direction: column; gap: 7px;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* Stat strip */
.kpi-strip {
  display: flex; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: linear-gradient(180deg, rgba(15,23,42,0.78), rgba(15,23,42,0.58));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.kpi-strip-cell {
  padding: 9px 14px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  flex: 1;
  background: linear-gradient(180deg, rgba(22,28,41,0.94), rgba(16,23,36,0.94));
}
.kpi-strip-cell:last-child { border-right: none; }
a.kpi-strip-cell {
  color: inherit;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
a.kpi-strip-cell:hover {
  background: var(--bg-hover);
  text-decoration: none;
}
a.kpi-strip-cell:hover .kpi-strip-lbl,
a.kpi-strip-cell:hover .kpi-strip-note {
  color: var(--text);
}
.kpi-strip-row { display: flex; align-items: center; gap: 6px; }
.kpi-strip-row-stack {
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

/* Shared badge */
.kpi-badge {
  width: 18px; height: 18px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; flex-shrink: 0;
}
.kpi-badge svg { width: 10px; height: 10px; }
.kpi-badge-y { background: rgba(245,166,35,.15); color: var(--accent); }
.kpi-badge-r { background: rgba(248,113,113,.15); color: #f87171; }
.kpi-badge-b { background: rgba(96,165,250,.12);  color: #60a5fa; }
.kpi-badge-stock { background: rgba(56,189,248,.15); color: #67e8f9; }
.kpi-badge-alarm { background: rgba(248,113,113,.16); color: #fca5a5; }

.kpi-strip-lbl  { font-size: 10px; color: var(--text-dim); flex: 1; }
.kpi-strip-pct  { font-size: 10px; font-weight: 700; }
.kpi-strip-val  { font-size: 17px; font-weight: 800; line-height: 1; color: var(--text); }
.kpi-strip-sub  { font-size: 11px; color: var(--text-muted); }
.kpi-strip-flag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  background: rgba(103, 232, 249, 0.08);
  color: #a5f3fc;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.kpi-strip-flag.is-critical {
  border-color: rgba(248, 113, 113, 0.26);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}
.kpi-accent     { color: var(--accent); }
.kpi-red        { color: #f87171; }
.kpi-strip-bar  { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 4px 0 2px; }
.kpi-strip-fill { height: 100%; border-radius: 2px; }
.kpi-fill-y     { background: var(--accent); }
.kpi-fill-r     { background: #f87171; }
.kpi-fill-stock { background: linear-gradient(90deg, #22d3ee, #38bdf8); }
.kpi-fill-alert { background: linear-gradient(90deg, #fb7185, #f97316); }
.kpi-strip-note {
  font-size: 10px;
  color: var(--text-dim);
}
.kpi-strip-cell-link {
  position: relative;
}
.kpi-strip-cell-stock {
  background:
    linear-gradient(180deg, rgba(56,189,248,0.12), rgba(56,189,248,0.03) 62%, rgba(16,23,36,0.94));
}
.kpi-strip-cell-alarm {
  background:
    linear-gradient(180deg, rgba(248,113,113,0.14), rgba(248,113,113,0.04) 62%, rgba(16,23,36,0.94));
}

.alarm-jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245,166,35,0.24);
  background: rgba(245,166,35,0.10);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.alarm-jump-btn:hover {
  background: rgba(245,166,35,0.16);
  border-color: rgba(245,166,35,0.38);
  color: #ffd38b;
}

/* FV dot grid */
.kpi-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.kpi-dot  { width: 7px; height: 7px; border-radius: 1.5px; flex-shrink: 0; }
.kpi-dot-on  { background: var(--accent); }
.kpi-dot-off { background: var(--border); }

/* Task split */
.kpi-task-split { display: flex; gap: 12px; margin: 3px 0 0; }
.kpi-task-half  { display: flex; flex-direction: column; }
.kpi-task-sep   { width: 1px; background: var(--border); align-self: stretch; margin: 2px 0; }
.kpi-task-lbl   { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.kpi-task-val   { font-size: 17px; font-weight: 800; color: #f87171; line-height: 1.1; }
.kpi-task-link  { text-decoration: none; color: inherit; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; transition: background .15s; }
.kpi-task-link:hover { background: var(--bg-hover); }
.kpi-task-link:hover .kpi-task-val { color: var(--accent); }

/* Production chart card */
.kpi-chart-card {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 13px; background: var(--bg-card);
  position: relative;
}
.kpi-chart-hdr {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 8px;
}
.kpi-chart-lbl     { font-size: 10px; color: var(--text-dim); margin-bottom: 1px; }
.kpi-chart-val-row { display: flex; align-items: baseline; gap: 6px; }
.kpi-chart-val     { font-size: 16px; font-weight: 800; color: var(--text); }
.kpi-chart-sub     { font-size: 11px; color: var(--text-muted); }
.kpi-chart-legend  { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }
.kpi-chart-leg     { display: flex; align-items: center; gap: 4px; font-size: 9px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-chart-leg-dot   { width: 8px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.kpi-chart-leg-bar   { background: rgba(167,139,250,.6); height: 10px; width: 3px; border-radius: 1px; }
.kpi-chart-leg-line  { background: #60a5fa; }
.kpi-chart-svg       { display: block; overflow: visible; }
.kpi-chart-marker-line { stroke: var(--border-light); stroke-width: .6; stroke-dasharray: 2,2; opacity: .42; }
.kpi-chart-marker-line.is-month { stroke: var(--accent); stroke-width: .9; stroke-dasharray: 0; opacity: .55; }
.kpi-chart-event { cursor: pointer; }
.kpi-chart-step-line { stroke: rgba(96,165,250,.68); stroke-width: 1.7; transition: stroke .12s, stroke-width .12s, opacity .12s; opacity: .74; }
.kpi-chart-bar { fill: rgba(167,139,250,.3); transition: fill .12s, opacity .12s; opacity: .82; }
.kpi-chart-hit { fill: transparent; }
.kpi-chart-event.is-selected .kpi-chart-step-line,
.kpi-chart-event.is-selected .kpi-chart-bar,
.kpi-chart-event:focus .kpi-chart-step-line,
.kpi-chart-event:focus .kpi-chart-bar { opacity: 1; }
.kpi-chart-event.is-selected .kpi-chart-step-line,
.kpi-chart-event:focus .kpi-chart-step-line { stroke: #8cc8ff; stroke-width: 1.95; }
.kpi-chart-event.is-selected .kpi-chart-bar,
.kpi-chart-event:focus .kpi-chart-bar { fill: rgba(167,139,250,.42); }
@media (hover: hover) and (pointer: fine) {
  .kpi-chart-event:hover .kpi-chart-step-line { stroke: #8cc8ff; stroke-width: 1.95; }
  .kpi-chart-event:hover .kpi-chart-bar { fill: rgba(167,139,250,.42); }
}
.kpi-chart-tooltip {
  position: absolute;
  z-index: 12;
  min-width: 128px;
  max-width: 180px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: color-mix(in srgb, var(--bg-card) 96%, var(--bg) 4%);
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
  pointer-events: none;
}
.kpi-chart-tip-batch { font-size: 11px; font-weight: 700; color: var(--text); }
.kpi-chart-tip-meta { font-size: 10px; color: var(--text-dim); line-height: 1.35; }
.kpi-chart-selection {
  margin-top: 7px;
  padding: 7px 0 0;
  border-top: 1px solid var(--border);
}
.kpi-chart-sel-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.kpi-chart-selection-batch {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  min-width: 0;
}
.kpi-chart-selection-meta {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.35;
}
.kpi-chart-selection-btn {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border) 60%);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card) 92%);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.kpi-chart-selection-btn:hover { background: color-mix(in srgb, var(--accent) 16%, var(--bg-card) 84%); color: var(--accent); }
.kpi-chart-selection-btn.is-disabled {
  border-color: var(--border);
  color: var(--text-muted);
  background: transparent;
  pointer-events: none;
}
.kpi-chart-scale {
  position: relative;
  height: 18px;
  margin-top: 4px;
}
.kpi-chart-scale-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}
.kpi-chart-scale-mark.is-month {
  color: var(--accent);
  font-weight: 700;
}
@media (max-width: 640px) {
  .kpi-chart-scale {
    height: 32px;
  }
  .kpi-chart-scale-mark {
    font-size: 8px;
  }
  .kpi-chart-scale-mark:nth-child(even) {
    top: 12px;
  }
  .kpi-chart-selection-meta {
    white-space: normal;
  }
}

/* Log check pills */
.kpi-log-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.kpi-log-pill {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; width: 62px; height: 58px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-card); cursor: pointer;
  transition: border-color .15s, background .15s;
  text-decoration: none; flex-shrink: 0;
}
.kpi-log-pill svg { display: block; stroke: var(--text-muted); }
.kpi-log-pill-time { font-size: 9px; font-weight: 700; color: var(--text-muted); line-height: 1; }
.kpi-log-pill.done { border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.07); }
.kpi-log-pill.done svg { stroke: #4ade80 !important; }
.kpi-log-pill.done .kpi-log-pill-time { color: #4ade80; }
.kpi-log-pill:hover { border-color: var(--border-light); background: var(--bg-hover); }
.kpi-log-pill.done:hover { border-color: rgba(74,222,128,.7); background: rgba(74,222,128,.13); }
.kpi-log-pill::after {
  content: attr(data-label);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--bg-card-2); color: var(--text);
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 5px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .15s; border: 1px solid var(--border-light); z-index: 10;
}
.kpi-log-pill:hover::after { opacity: 1; }

/* ── External link pills (Breww / Notion) ── */
:root {
  --source-breww-bg: rgba(14,165,233,0.15);
  --source-breww-text: #38bdf8;
  --source-breww-border: rgba(14,165,233,0.32);
  --source-rapt-bg: rgba(168,85,247,0.14);
  --source-rapt-text: #c084fc;
  --source-rapt-border: rgba(168,85,247,0.32);
  --source-brewdash-bg: rgba(245,158,11,0.12);
  --source-brewdash-text: #fbbf24;
  --source-brewdash-border: rgba(245,158,11,0.32);
  --source-manual-bg: rgba(251,191,36,0.14);
  --source-manual-text: #fde68a;
  --source-manual-border: rgba(251,191,36,0.3);
  --source-ha-bg: rgba(37,99,235,0.16);
  --source-ha-text: #93c5fd;
  --source-ha-border: rgba(37,99,235,0.34);
  --source-notion-bg: rgba(148,163,184,0.14);
  --source-notion-text: #d1d5db;
  --source-notion-border: rgba(148,163,184,0.3);
  --source-other-bg: rgba(148,163,184,0.12);
  --source-other-text: #e5e7eb;
  --source-other-border: rgba(148,163,184,0.24);
}

.src-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  flex-shrink: 0;
  font-family: var(--font);
}
.src-badge-breww { background: var(--source-breww-bg); color: var(--source-breww-text); border-color: var(--source-breww-border); }
.src-badge-rapt { background: var(--source-rapt-bg); color: var(--source-rapt-text); border-color: var(--source-rapt-border); }
.src-badge-brewdash,
.src-badge-dash { background: var(--source-brewdash-bg); color: var(--source-brewdash-text); border-color: var(--source-brewdash-border); }
.src-badge-manual { background: var(--source-manual-bg); color: var(--source-manual-text); border-color: var(--source-manual-border); }
.src-badge-ha { background: var(--source-ha-bg); color: var(--source-ha-text); border-color: var(--source-ha-border); }
.src-badge-notion { background: var(--source-notion-bg); color: var(--source-notion-text); border-color: var(--source-notion-border); }
.src-badge-other { background: var(--source-other-bg); color: var(--source-other-text); border-color: var(--source-other-border); }
.src-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.src-label,
.src-tail {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.src-tail {
  color: var(--text-dim);
}
.src-inline--table .src-tail,
.src-inline--table .src-label {
  font-size: 10px;
}

.ext-link-pill,
.td-ext-pill,
.td-cat-badge,
.td-rec-badge,
.td-date-badge,
.detail-fv-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ext-link-pill {
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.15s, border-color 0.15s, background 0.15s, color 0.15s;
}
.ext-link-pill:hover { opacity: 1; }
.ext-link-breww  { background: var(--source-breww-bg); color: var(--source-breww-text); border: 1px solid var(--source-breww-border); }
.ext-link-batch  { background: rgba(148,163,184,0.12); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.28); }
.ext-link-notion { background: rgba(148,163,184,0.12); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.28); }
.ext-link-rapt   { background: var(--source-rapt-bg); color: var(--source-rapt-text); border: 1px solid var(--source-rapt-border); }

/* Task panel header pills */
.td-ext-pill {
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.td-ext-pill:hover { opacity: 1; }
.td-notion-pill { background: rgba(187,135,252,0.15); color: #bb87fc; border: 1px solid rgba(187,135,252,0.3); }
.td-breww-pill  { background: var(--source-breww-bg); color: var(--source-breww-text); border: 1px solid var(--source-breww-border); }
.td-batch-pill  { background: rgba(148,163,184,0.12); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.28); }
.td-fv-pill     { background: rgba(148,163,184,0.12); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.28); }

/* Fermenter detail header — FV pill + external links */
.detail-header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  row-gap: 6px;
  margin-bottom: 4px;
}
.detail-fv-pill {
  background: rgba(245,158,11,0.12);
  color: var(--accent);
  border: 1px solid rgba(245,158,11,0.35);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Service status section (bottom of sidebar) */
/* Status dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}

.status-ok      { background: var(--c-operating); box-shadow: 0 0 4px rgba(34,197,94,0.5); }
.status-pending { background: var(--text-muted); opacity: 0.45; }
.status-error   { background: var(--c-defect); box-shadow: 0 0 4px rgba(239,68,68,0.5); }

/* Compact 2-column service grid (IOI-193) */
.svc-list {
  padding: 2px 10px 8px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4px;
  row-gap: 1px;
}
.svc-row {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 1px 0;
}
.svc-list .status-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
}
.svc-name {
  flex: 1;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.svc-time {
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.65;
  white-space: nowrap;
  flex-shrink: 0;
}
.svc-btn {
  background: none;
  border: none;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
.svc-btn:hover { opacity: 1; color: var(--accent); }
.svc-ext {
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.4;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}
.svc-ext:hover { opacity: 1; color: var(--accent); }
.svc-ext-na { cursor: default; }
.svc-row-full { grid-column: 1 / -1; }
.svc-sync-result {
  grid-column: 1 / -1;
  font-size: 9px;
  color: var(--text-muted);
  display: block;
  min-height: 0;
}

/* ══════════════════════════════════════════════════════════
   MOBILE NAV TOGGLE
   ══════════════════════════════════════════════════════════ */

.nav-toggle {
  display: none; /* replaced by .mobile-topbar on small screens */
}

/* ── Mobile top bar ── */
.mobile-topbar {
  display: none;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 148;
}

/* ══════════════════════════════════════════════════════════
   MAIN WRAP
   ══════════════════════════════════════════════════════════ */

.main-wrap {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  padding: 0 20px 32px;
  max-width: 100%;
}

/* Page header */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  gap: 12px;
}

.page-header-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title-icon {
  font-size: 15px;
  color: var(--accent);
  opacity: 0.85;
  flex-shrink: 0;
}

.page-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.page-header-right { flex-shrink: 0; }

.header-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
/* Section */
.section {
  margin-bottom: 22px;
}

.section-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.section-hint {
  font-size: 10px;
  color: var(--text-muted);
}

/* Loading */
.loading-msg {
  color: var(--text-muted);
  font-size: 12px;
  padding: 12px 0;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   VESSEL GROUPS + TANK CARDS
   ══════════════════════════════════════════════════════════ */

.vessel-group {
  margin-bottom: 18px;
}

.vessel-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.vessel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;  /* all cards start at same top edge */
}

/* Tank card */
.tank-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 150px;
  height: 258px;      /* fixed — all cards identical, task+stage+vessel fit */
  padding: 5px 5px 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  position: relative;
  user-select: none;
}

.tank-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.tank-card:active {
  transform: translateY(0);
}

/* Status-driven card border accent */
.tank-operating  { border-bottom: 2px solid var(--c-operating); }
.tank-cip        { border-bottom: 2px solid var(--c-cip); }
.tank-maintenance{ border-bottom: 2px solid var(--c-maintenance); }
.tank-defect     { border-bottom: 2px solid var(--c-defect); }
.tank-empty      { border-bottom: 2px solid var(--c-empty); opacity: 0.75; }

/* Temp alert border pulse */
.tank-temp-alert {
  border-color: rgba(239,68,68,0.5) !important;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.2);
  animation: tank-alert-pulse 1.8s ease-in-out infinite;
}

.tank-temp-warn {
  border-color: rgba(245,158,11,0.45) !important;
}

@keyframes tank-alert-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(239,68,68,0.15); }
  50%       { box-shadow: 0 0 0 3px rgba(239,68,68,0.28); }
}

/* Uniform SVG vessel size for all card types */
.tank-vessel {
  width: 91px;
  height: 150px;
  flex-shrink: 0;
  display: block;
}

/* All fermenter card sizes uniform */
.tank-card.tank-sz-xl,
.tank-card.tank-sz-lg,
.tank-card.tank-sz-md,
.tank-card.tank-sz-sm { width: 150px; }
.tank-sz-xl .tank-vessel,
.tank-sz-lg .tank-vessel,
.tank-sz-md .tank-vessel,
.tank-sz-sm .tank-vessel { width: 91px; height: 150px; }
/* Barrels same card width, taller vessel */
.tank-card.tank-sz-sm[id^="card-FVF"],
.tank-card.tank-sz-sm[id^="card-FVG"] { width: 150px; }
.tank-card.tank-sz-sm[id^="card-FVF"] .tank-vessel,
.tank-card.tank-sz-sm[id^="card-FVG"] .tank-vessel { width: 91px; height: 100px; }

/* Tank label */
/* ── Tank card header ── */
.tank-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding-bottom: 2px;
}

.tank-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
}

.tank-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 128px;
  line-height: 1.2;
  margin-bottom: 5px;
}
.tank-sub.sub-cip     { color: var(--c-cip); }
.tank-sub.sub-maint   { color: var(--c-maintenance); }
.tank-sub.sub-defect  { color: var(--c-defect); }
.tank-sub.sub-empty   { color: var(--text-muted); }

/* ── Middle row: data column left + SVG right ── */
.tank-middle {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 4px;
}

/* Narrow data column to the left of the vessel */
.tank-data-col {
  width: 45px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 3px;
  overflow: visible;
}

.td-row {
  font-size: 10px;
  color: var(--text);
  line-height: 1.45;
  white-space: nowrap;
  overflow: visible;
}

.td-stale      { color: var(--text-muted) !important; opacity: 0.7; }
.td-muted      { color: var(--text-muted); }
.td-sep        { border-top: 1px solid var(--border); margin-top: 2px; padding-top: 2px; }
.td-sep-spaced { margin-top: 5px; }
.td-rapt-label { font-size: 8px; font-weight: 900; letter-spacing: 0.14em;
                 font-family: 'Courier New', Courier, monospace;
                 color: var(--text-dim); line-height: 1.2; margin-top: 1px; }
.td-rapt-spacer { height: calc(8px * 1.2 + 1px); }

/* ── Temperature trend indicators ── */
.trend-cooling  { color: #06b6d4; }
.trend-warming  { color: #f97316; }
.trend-rising   { color: #f59e0b; }
.trend-falling  { color: #60a5fa; }
.trend-stable   { color: var(--text-muted); }

/* ── Pressure status colours ── */
.psi-ok    { color: #22c55e; }
.psi-warn  { color: #f59e0b; }
.psi-alert { color: #ef4444; font-weight: 600; }
.psi-low   { color: #f97316; }

/* ── pH status colours ── */
.ph-ok     { color: var(--text-dim); }
.ph-warn   { color: #f59e0b; }
.ph-alert  { color: #ef4444; }

/* ── Fermentation stage pill ── */
.tank-stage-row {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20px;
  flex-shrink: 0;
}

.tank-stage {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-pitched {
  background: rgba(132,204,22,0.10); color: #65a30d;
  border-color: rgba(132,204,22,0.28);
}
.stage-no_yeast, .stage-other {
  background: rgba(100,116,139,0.08); color: #64748b;
  border-color: rgba(100,116,139,0.18);
}
.stage-active, .stage-secondary {
  background: rgba(34,197,94,0.10); color: #22c55e;
  border-color: rgba(34,197,94,0.28);
}
.stage-cold_crash, .stage-chilling {
  background: rgba(6,182,212,0.10); color: #06b6d4;
  border-color: rgba(6,182,212,0.25);
}
.stage-heat_to_temp {
  background: rgba(249,115,22,0.10); color: #f97316;
  border-color: rgba(249,115,22,0.25);
}
.stage-diacetyl {
  background: rgba(168,85,247,0.10); color: #a855f7;
  border-color: rgba(168,85,247,0.25);
}
.stage-dry_hop_1, .stage-dry_hop_2 {
  background: rgba(245,158,11,0.10); color: #f59e0b;
  border-color: rgba(245,158,11,0.25);
}
.stage-conditioning, .stage-carbonating, .stage-gelatin {
  background: rgba(168,85,247,0.08); color: #9b59b6;
  border-color: rgba(168,85,247,0.2);
}
.stage-lagering, .stage-maturing {
  background: rgba(100,116,139,0.10); color: #94a3b8;
  border-color: rgba(100,116,139,0.2);
}
.stage-ready, .stage-kegging, .stage-canning {
  background: rgba(20,184,166,0.10); color: #14b8a6;
  border-color: rgba(20,184,166,0.25);
}
.stage-qc_wait, .stage-check_carb, .stage-dump_yeast {
  background: rgba(245,158,11,0.10); color: #d97706;
  border-color: rgba(245,158,11,0.25);
}
.stage-in_barrel {
  background: rgba(120,53,15,0.12); color: #b45309;
  border-color: rgba(120,53,15,0.22);
}
.stage-vessel-cip {
  background: rgba(6,182,212,0.10); color: #06b6d4;
  border-color: rgba(6,182,212,0.25);
}
.stage-vessel-maint {
  background: rgba(245,158,11,0.10); color: #d97706;
  border-color: rgba(245,158,11,0.25);
}
.stage-vessel-defect {
  background: rgba(239,68,68,0.10); color: #ef4444;
  border-color: rgba(239,68,68,0.25);
}
.stage-vessel-empty {
  background: rgba(100,116,139,0.08); color: #94a3b8;
  border-color: rgba(100,116,139,0.18);
}

/* ── Today's task row — fixed height so all cards align ── */
.tank-task-row {
  padding: 4px 4px 0;
  height: 39px;
  flex-shrink: 0;
  overflow: hidden;
}

.tank-today-task {
  font-size: 8.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  height: 31px;
  line-height: 1.35;
  box-sizing: border-box;
  width: 100%;
  padding: 4px 6px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tank-today-task:active { opacity: 0.75; }
.tank-today-task.task-high {
  color: #f59e0b;
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.07);
}

/* ── Card health — bottom border ── */
.tank-health-ok    { border-bottom: 2px solid #22c55e !important; }
.tank-health-warn  { border-bottom: 2px solid #f59e0b !important; }
.tank-health-alert { border-bottom: 3px solid #ef4444 !important; }
.tank-health-cip   { border-bottom: 2px solid #06b6d4 !important; }

/* ── Alert attention dot (top-right of card) ── */
.tank-health-alert::before {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: alert-dot-pulse 1.6s ease-in-out infinite;
  z-index: 1;
}
@keyframes alert-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Check-in square indicator (top-left of card) ── */
/* RAPT badge in table FV-ID cell */
.fvt-rapt-badge {
  display: inline-block;
  margin-left: 3px;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(251,146,60,0.18);
  border: 1px solid rgba(251,146,60,0.4);
  color: #fb923c;
  font-size: 8px;
  font-weight: 800;
  vertical-align: middle;
  line-height: 1.6;
}

.fv-checkin {
  position: absolute;
  top: 6px;
  left: 5px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1.5px solid #f59e0b;
  background: transparent;
  z-index: 1;
  box-sizing: border-box;
}
.fv-checkin.checkin-ok {
  border-color: #22c55e;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fv-checkin.checkin-ok::after {
  content: '✓';
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-top: -1px;
}

/* ══════════════════════════════════════════════════════════
   FERMENTER DETAIL PANEL
   ══════════════════════════════════════════════════════════ */

.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(245,166,35,0.08);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.detail-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.beer-code {
  color: var(--accent);
}

.detail-batch {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.btn-close {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.btn-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-block h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.detail-table td {
  padding: 3px 6px 3px 0;
  color: var(--text-dim);
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.detail-table td:nth-child(2),
.detail-table td:nth-child(4) {
  color: var(--text);
  font-weight: 500;
}

.detail-metric-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  border-bottom: 1px dotted rgba(122, 136, 168, 0.42);
}

.detail-metric-wrap:focus-visible {
  outline: 1px solid rgba(245, 166, 35, 0.55);
  outline-offset: 2px;
  border-bottom-color: var(--accent);
  border-radius: 2px;
}

.detail-metric-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  display: none;
  min-width: 118px;
  padding: 7px 28px 8px 9px;
  border: 1px solid var(--tooltip-border);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--tooltip-bg-top), var(--tooltip-bg));
  box-shadow: var(--tooltip-shadow);
  z-index: 20;
  pointer-events: none;
}

.detail-metric-wrap:hover .detail-metric-pop,
.detail-metric-wrap:focus-visible .detail-metric-pop {
  display: block;
}

.detail-metric-pop::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 100%;
  width: 8px;
  height: 8px;
  background: var(--tooltip-bg);
  border-right: 1px solid var(--tooltip-border);
  border-bottom: 1px solid var(--tooltip-border);
  transform: rotate(45deg) translateY(-4px);
}

.detail-metric-pop-label,
.detail-metric-pop-date,
.detail-metric-pop-source,
.detail-metric-pop-time {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}

.detail-metric-pop-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.detail-metric-pop-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.detail-metric-pop-source {
  position: absolute;
  top: 7px;
  right: 8px;
  margin-bottom: 0;
}

.detail-metric-pop-time {
  font-size: 10px;
  color: var(--text-dim);
}

.detail-observations {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-card-2);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
}
.detail-obs-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}

.temp-ok    { color: #22c55e !important; }
.temp-warn  { color: #f59e0b !important; }
.temp-alert { color: #ef4444 !important; }
.detail-notes {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg-card-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--text-dim);
}

.detail-empty {
  padding: 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* Status badges in detail panel */
.badge-cip         { color: var(--c-cip);         font-size: 11px; }
.badge-maintenance { color: var(--c-maintenance);  font-size: 11px; }
.badge-defect      { color: var(--c-defect);       font-size: 11px; }
.badge-empty       { color: var(--c-empty);        font-size: 11px; }


.reading-form {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-row label {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-input {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  padding: 4px 8px;
  width: 90px;
  font-family: var(--font);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #0e1117;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  align-self: flex-start;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-card-2);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text);
}

.detail-form-error {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
  color: #fca5a5;
  font-size: 11px;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════
   BOTTOM ROW
   ══════════════════════════════════════════════════════════ */

.bottom-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  align-items: start;
}

.bottom-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  min-height: 160px;
  max-height: 480px;
  overflow-y: auto;
}

.bottom-panel .section-hdr {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Custom scrollbar for panels */
.bottom-panel::-webkit-scrollbar { width: 4px; }
.bottom-panel::-webkit-scrollbar-track { background: transparent; }
.bottom-panel::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

/* ══════════════════════════════════════════════════════════
   TANK ACTIONS PANEL
   ══════════════════════════════════════════════════════════ */

.action-tank {
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

.action-tank:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.action-tank-hdr {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.action-fvid {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}

.action-beercode {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.action-beername {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.action-days {
  font-size: 9.5px;
  color: var(--text-muted);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0px 4px;
  margin-left: auto;
}

.action-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  font-size: 11px;
  line-height: 1.4;
}

.urgency-critical {
  background: rgba(239,68,68,0.08);
  border-left-color: var(--c-critical);
  color: #fca5a5;
}

.urgency-high {
  background: rgba(245,158,11,0.07);
  border-left-color: var(--c-high);
  color: #fcd34d;
}

.urgency-normal {
  background: transparent;
  border-left-color: var(--border);
  color: var(--text-dim);
}

.action-icon {
  flex-shrink: 0;
  font-size: 11px;
  margin-top: 1px;
}

.action-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.action-idle {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  padding: 3px 0;
  text-align: center;
}

.action-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
  font-style: italic;
}


/* ── task completion confirm modal ── */
.tcm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 900;
  animation: tcm-fade-in 0.15s ease;
}
.tcm-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 901;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px 20px;
  width: min(340px, calc(100vw - 32px));
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: tcm-slide-up 0.18s ease;
}
.tcm-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-operating, #22c55e);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.tcm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.tcm-task {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
  max-width: 260px;
}
.tcm-assignee {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
}
.tcm-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
}
.tcm-btn {
  flex: 1;
  padding: 12px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  font-family: var(--font);
  transition: opacity 0.12s, background 0.12s;
}
.tcm-btn--cancel {
  background: var(--bg-card-2);
  color: var(--text-muted);
}
.tcm-btn--cancel:hover { color: var(--text); background: var(--bg-hover); }
.tcm-btn--confirm {
  background: var(--c-operating, #22c55e);
  color: #fff;
  border-color: var(--c-operating, #22c55e);
}
.tcm-btn--confirm:hover { opacity: 0.88; }
@keyframes tcm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes tcm-slide-up {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

.tasks-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 18px 0;
}

/* ══════════════════════════════════════════════════════════
   STOCK ALERTS PANEL
   ══════════════════════════════════════════════════════════ */

.stock-group {
  margin-bottom: 10px;
}

.stock-group:last-child { margin-bottom: 0; }

.stock-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.stock-group-label.critical { color: var(--c-critical); }
.stock-group-label.low      { color: var(--c-high); }

.stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  font-size: 11.5px;
}

.stock-critical {
  background: rgba(239,68,68,0.08);
  border-left: 2px solid var(--c-critical);
}

.stock-low {
  background: rgba(245,158,11,0.07);
  border-left: 2px solid var(--c-high);
}

.stock-item {
  flex: 1;
  color: var(--text);
  min-width: 0;
}

.stock-level {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.stock-ok {
  color: var(--c-operating);
  font-size: 12px;
  padding: 14px 0;
  text-align: center;
}

/* ── Breww sync status badge ── */
.sync-badge {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin-left: auto;
}
.sync-ok      { background: rgba(34,197,94,0.10);  color: #22c55e; border: 1px solid rgba(34,197,94,0.25); }

/* ══════════════════════════════════════════════════════════
   HTMX INDICATORS
   ══════════════════════════════════════════════════════════ */

.htmx-request .section-hint::after {
  content: ' ⟳';
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≤ 1100px)
   ══════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .bottom-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤ 880px)
   ══════════════════════════════════════════════════════════ */

@media (max-width: 880px) {
  body { display: block; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 150;
    box-shadow: 4px 0 24px rgba(0,0,0,0.6);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .nav-toggle { display: none; }

  /* Mobile top bar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 149;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }

  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
  }

  .mobile-topbar-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
  }

  .mobile-topbar-burger {
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    line-height: 1;
  }

  .mobile-topbar-burger:hover {
    background: var(--bg-hover);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-wrap {
    padding: 64px 12px 28px; /* 48px topbar + 16px gap */
  }

  .page-header {
    margin-bottom: 14px;
  }

  .bottom-row {
    grid-template-columns: 1fr;
  }

  .bottom-panel {
    max-height: 320px;
  }

  .vessel-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
  }

  .tank-card {
    width: 100%;
    min-height: 244px;
    height: auto;
    padding: 4px 4px 4px;
  }

  .tank-vessel {
    width: 80px;
    height: 132px;
  }

  .tank-data-col { width: 36px; }
  .tank-sub, .tank-today-task { max-width: 100%; }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Small mobile (≤ 480px)
   ══════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .vessel-row {
    grid-template-columns: repeat(2, 1fr); /* always 2 cols on small phones */
  }

  .tank-card {
    width: 100%;
    min-height: 252px;
    height: auto;
  }

  .tank-vessel {
    width: 83px;
    height: 138px;
  }

  .tank-data-col { width: 41px; font-size: 8.5px; }
  .tank-sub, .tank-today-task { max-width: 100%; }

  .action-beername {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 380px;
  padding: 24px 16px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  box-shadow: var(--shadow);
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-field { display: flex; flex-direction: column; gap: 6px; }

.login-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.login-select {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s;
  min-height: 48px;   /* tablet touch target */
}

.login-select:focus {
  outline: none;
  border-color: var(--accent);
}

.login-btn {
  background: var(--accent);
  color: #0e1117;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.15s;
  min-height: 48px;
  width: 100%;
}

.login-btn:hover { opacity: 0.88; }

.login-footer {
  font-size: 11px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════
   NOTION OFFLINE BANNER
   ══════════════════════════════════════════════════════════ */

.notion-offline-banner {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.30);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: #fcd34d;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.btn-offline-refresh {
  background: none;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  color: #f59e0b;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
}

.notion-offline-inline {
  font-size: 11px;
  color: #f59e0b;
  padding: 6px 10px;
  margin-bottom: 10px;
  background: rgba(245, 158, 11, 0.07);
  border-radius: var(--radius-sm);
  border-left: 2px solid #f59e0b;
}

/* ══════════════════════════════════════════════════════════
   TASK CARDS (full /tasks page)
   ══════════════════════════════════════════════════════════ */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.task-card:hover { background: var(--bg-hover); }

.task-card.priority-high   { border-left-color: var(--c-high); }
.task-card.priority-medium { border-left-color: var(--border-light); }
.task-card.priority-low    { border-left-color: var(--border); }

/* Main row */
.tc-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px 10px 10px;
  min-height: 48px;   /* 48px touch target */
}

/* Checkbox button */
.tc-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-light);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 11px;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  margin-top: 1px;
}

.tc-check.tc-confirming {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  width: auto;
  min-width: 22px;
  padding: 0 5px;
}
.tc-check.tc-confirming::after {
  content: '✓?';
}

.tc-check:hover {
  border-color: var(--c-operating);
  background: rgba(34, 197, 94, 0.10);
  color: var(--c-operating);
}

.tc-check.tc-done {
  border-color: var(--c-operating);
  background: rgba(34, 197, 94, 0.15);
  color: var(--c-operating);
}

.tc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tc-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.tc-strikethrough {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Assignee pills */
.tc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tc-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.tc-pill-me {
  background: rgba(245, 166, 35, 0.10);
  border-color: rgba(245, 166, 35, 0.30);
  color: var(--accent);
}

/* Right meta area — pills + icons (no longer absolute) */
.tc-meta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
}

/* Pills inside tc-meta: no-wrap, compact */
.tc-meta .tc-pills {
  flex-wrap: nowrap;
  overflow: hidden;
  max-width: 150px;
}

/* Admin date-shift buttons on card */
.tc-date-btns {
  display: flex;
  gap: 2px;
}
.tc-date-btn {
  font-size: 10px;
  padding: 3px 6px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.tc-date-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* Log form */
.tc-log-form {
  border-top: 1px solid var(--border);
  padding: 10px 12px 12px;
  background: var(--bg-card-2);
}

.btn-cancel {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cancel:hover { background: var(--bg-hover); }

/* Log submitted confirmation */
.log-submitted {
  font-size: 12px;
  color: var(--c-operating);
  padding: 6px 0 2px;
}

/* Fade-out on optimistic done */
@keyframes taskDoneFade {
  0%   { opacity: 1; }
  60%  { opacity: 0.4; }
  100% { opacity: 0; max-height: 0; padding: 0; margin: 0; overflow: hidden; }
}

.task-card-done {
  animation: taskDoneFade 0.6s ease-out forwards;
  pointer-events: none;
}

/* Task category divider */
.task-category-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
  opacity: 0.5;
}

/* HTMX request indicator on task card */
.task-card.htmx-request .tc-check {
  border-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

/* ══════════════════════════════════════════════════════════
   MAINTENANCE GROUPS
   ══════════════════════════════════════════════════════════ */

.maint-group {
  margin-bottom: 16px;
}

.maint-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.maint-group-overdue .maint-group-label {
  color: #fca5a5;
  border-bottom-color: rgba(239, 68, 68, 0.28);
}
.maint-group-overdue .task-card {
  background: rgba(239, 68, 68, 0.07);
  border-left-color: #ef4444 !important;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12);
}
.maint-group-overdue .task-card:hover {
  background: rgba(239, 68, 68, 0.11);
}
.maint-group-overdue .tc-title,
.maint-group-overdue .tc-chevron,
.maint-group-overdue .tc-rec-dot {
  color: #fecaca;
}

/* ══════════════════════════════════════════════════════════
   ALPINE.JS TRANSITIONS
   ══════════════════════════════════════════════════════════ */

[x-cloak] { display: none !important; }

.tc-slide-enter {
  transition: max-height 0.22s ease, opacity 0.18s ease;
}
.tc-slide-enter-start { max-height: 0; opacity: 0; }

.tc-slide-leave {
  transition: max-height 0.15s ease, opacity 0.12s ease;
  max-height: 0 !important;
  opacity: 0 !important;
}

/* ══════════════════════════════════════════════════════════
   TASKS PAGE RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* Tablet + mobile: move task meta below title, expose date-shift buttons for admin */
@media (max-width: 1100px) {
  .tc-main {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 6px 10px;
    min-height: 52px;
  }

  .tc-check {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .tc-body {
    grid-column: 2;
  }

  .tc-title {
    font-size: 14px;
    line-height: 1.45;
  }

  .tc-meta {
    grid-column: 2;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding-right: 0;
  }

  .tc-meta .tc-pills {
    max-width: none;
    flex-wrap: wrap;
  }

  .tc-date-btns {
    display: flex;
  }

  .tc-date-btn {
    font-size: 12px;
    padding: 6px 10px;
    min-height: 30px;
    min-width: 36px;
  }

  .tc-chevron {
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .tc-meta .tc-pills { max-width: none; }
  .login-card { padding: 22px 16px; }
  .task-section-card { padding: 12px; }
}

/* ══════════════════════════════════════════════════════════
   TASK TABS
   ══════════════════════════════════════════════════════════ */

.task-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}
.task-tab-bar::-webkit-scrollbar { display: none; }

.task-tab {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  padding: 8px 14px 9px;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.task-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.task-tab:hover { color: var(--text); background: var(--bg-hover); }
.task-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.task-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-dim);
}

.task-tab-content { /* always fills width */ }

.task-page-section {
  margin-bottom: 0;
}

.task-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
}

.task-section-hdr {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.task-section-body {
  min-height: 120px;
}

.task-section-card .loading-msg {
  padding: 14px 0 8px;
}

.tomorrow-planning-note {
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 12px;
}

/* Overdue tab — red accent */
#tab-btn-overdue { color: #f87171; }
#tab-btn-overdue:hover { color: #ef4444; background: rgba(239,68,68,0.08); }
#tab-btn-overdue.task-tab-active { color: #ef4444; border-bottom-color: #ef4444; background: rgba(239,68,68,0.12); }

/* ══════════════════════════════════════════════════════════
   TASK CATEGORY HEADERS
   ══════════════════════════════════════════════════════════ */

.task-cat-spacer { height: 10px; }

.task-cat-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.task-cat-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Category colors — border on cards + header tint */
.task-cat-hdr.task-cat-1  { background: rgba(52, 211, 153, 0.10); }
.task-cat-hdr.task-cat-2  { background: rgba(245, 166, 35,  0.12); }
.task-cat-hdr.task-cat-3  { background: rgba(59, 130, 246,  0.10); }
.task-cat-hdr.task-cat-4  { background: rgba(249, 115, 22,  0.10); }
.task-cat-hdr.task-cat-5  { background: rgba(168, 85, 247,  0.09); }
.task-cat-hdr.task-cat-6  { background: rgba(100, 116, 139, 0.09); }
.task-cat-hdr.task-cat-7  { background: rgba(234, 179, 8,   0.10); }
.task-cat-hdr.task-cat-8  { background: rgba(100, 116, 139, 0.07); }
.task-cat-hdr.task-cat-9  { background: rgba(100, 116, 139, 0.05); }
.task-cat-hdr.task-cat-0  { background: rgba(100, 116, 139, 0.06); }

.task-cat-1  .task-cat-label { color: #34d399; }
.task-cat-2  .task-cat-label { color: var(--accent); }
.task-cat-3  .task-cat-label { color: #60a5fa; }
.task-cat-4  .task-cat-label { color: #fb923c; }
.task-cat-5  .task-cat-label { color: #c084fc; }
.task-cat-6  .task-cat-label { color: #94a3b8; }
.task-cat-7  .task-cat-label { color: #facc15; }
.task-cat-8  .task-cat-label { color: #94a3b8; }
.task-cat-9  .task-cat-label { color: #64748b; }
.task-cat-0  .task-cat-label { color: var(--text-muted); }

/* Card left border by category */
.task-card.task-cat-1 { border-left-color: #34d399; }
.task-card.task-cat-2 { border-left-color: var(--accent); }
.task-card.task-cat-3 { border-left-color: #60a5fa; }
.task-card.task-cat-4 { border-left-color: #fb923c; }
.task-card.task-cat-5 { border-left-color: #c084fc; }
.task-card.task-cat-6 { border-left-color: #94a3b8; }
.task-card.task-cat-7 { border-left-color: #facc15; }
.task-card.task-cat-8 { border-left-color: #94a3b8; }
.task-card.task-cat-9 { border-left-color: #475569; }
.task-card.task-cat-0 { border-left-color: var(--border-light); }

/* Detail panel category badge */
.td-cat-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}
.task-cat-badge-1 { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.task-cat-badge-2 { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(245,166,35,0.3); }
.task-cat-badge-3 { background: rgba(59,130,246,0.10); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.task-cat-badge-4 { background: rgba(249,115,22,0.10); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.task-cat-badge-5 { background: rgba(168,85,247,0.09); color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }
.task-cat-badge-6 { background: rgba(100,116,139,0.09); color: #94a3b8; border: 1px solid rgba(100,116,139,0.2); }
.task-cat-badge-7 { background: rgba(234,179,8,0.10); color: #facc15; border: 1px solid rgba(234,179,8,0.3); }
.task-cat-badge-8 { background: rgba(100,116,139,0.07); color: #94a3b8; border: 1px solid rgba(100,116,139,0.15); }
.task-cat-badge-9 { background: rgba(71,85,105,0.08); color: #64748b; border: 1px solid rgba(71,85,105,0.2); }
.task-cat-badge-0 { background: var(--bg-card-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════
   TASK CARD — active state + new meta elements
   ══════════════════════════════════════════════════════════ */

.task-card-active {
  border-color: var(--accent) !important;
  background: var(--accent-dim) !important;
  box-shadow: 0 0 0 1px var(--accent);
}

.alarm-card.task-card-active {
  border-color: rgba(245,166,35,0.42) !important;
  background: linear-gradient(135deg, rgba(245,166,35,0.10), rgba(15,23,42,0.94) 52%, rgba(15,23,42,0.98)) !important;
  box-shadow: 0 0 0 1px rgba(245,166,35,0.16);
}

.alarm-page-copy {
  margin: 0;
  max-width: 720px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.alarm-board-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.alarm-board-copy {
  min-width: 0;
}

.alarm-board-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.alarm-board-note {
  max-width: 760px;
  padding: 9px 11px;
  border: 1px solid rgba(168, 81, 69, 0.34);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(168, 81, 69, 0.12), rgba(168, 81, 69, 0.06));
  color: #d6b2aa;
  font-size: 11px;
  line-height: 1.5;
}

.alarm-board-note-footer {
  margin-top: 12px;
}

.alarm-toolbar-card {
  margin-bottom: 14px;
  padding: 12px 12px 10px;
  background: linear-gradient(180deg, rgba(25,33,48,0.96), rgba(20,27,41,0.96));
  border-color: rgba(72,94,138,0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.alarm-tab-bar {
  margin-bottom: 10px;
}

.alarm-tab-bar .task-tab {
  color: #8ca0c8;
  padding: 7px 13px 8px;
}

.alarm-tab-bar .task-tab:hover {
  background: rgba(245,166,35,0.10);
  color: #f3f4f6;
}

.alarm-tab-bar .task-tab-active {
  color: #ffd38b;
  border-bottom-color: #f5a623;
  background: rgba(245,166,35,0.14);
}

.alarm-toolbar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.alarm-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.alarm-filter-search {
  grid-column: span 2;
}

.alarm-filter-inline {
  justify-content: flex-end;
}

.alarm-inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.alarm-filter-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.alarm-search-input,
.alarm-filter-field .form-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.alarm-select-input {
  min-height: 30px;
}

.alarm-filter-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(72,94,138,0.36);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(29,38,55,0.94), rgba(21,30,45,0.92));
}

.alarm-filter-panel-wide {
  grid-column: span 2;
}

.alarm-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alarm-check-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(54,68,95,0.78), rgba(40,52,74,0.72));
  color: #c5d0e6;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  font-size: 11px;
  line-height: 1.2;
}

.alarm-check-chip:hover {
  border-color: var(--accent);
  color: #f8fafc;
  background: linear-gradient(180deg, rgba(245,166,35,0.22), rgba(245,166,35,0.14));
  box-shadow: inset 0 0 0 1px rgba(245,166,35,0.12);
}

.alarm-check-chip input[type="checkbox"] {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1;
}

.alarm-check-chip span {
  pointer-events: none;
}

.alarm-check-chip-on {
  border-color: rgba(245,166,35,0.72);
  background: linear-gradient(180deg, rgba(245,166,35,0.24), rgba(245,166,35,0.14));
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(245,166,35,0.18);
}

.alarm-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(72,94,138,0.36);
  border-radius: 999px;
  background: rgba(33,44,64,0.72);
  color: #dbe4f2;
  font-size: 11px;
}

.alarm-inline-check input[type="checkbox"] {
  accent-color: #f5a623;
}

.alarm-inline-check-wide {
  margin-top: 2px;
}

.alarm-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.alarm-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.alarm-stat-card-button,
.alarm-bar-row-button {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.alarm-stat-card-button:hover,
.alarm-stat-card-button:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 14px 28px rgba(2,6,23,0.28);
}

.alarm-bar-row-button {
  border: 0;
  background: transparent;
  padding: 0;
}

.alarm-bar-row-button:hover .alarm-bar-head,
.alarm-bar-row-button:focus-visible .alarm-bar-head {
  color: var(--text);
}

.alarm-bar-row-button:hover .alarm-bar-track,
.alarm-bar-row-button:focus-visible .alarm-bar-track {
  background: rgba(148,163,184,0.16);
}

.alarm-stat-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(91,110,149,0.26);
  border-radius: var(--radius-sm);
  padding: 10px 10px 9px;
  background: linear-gradient(180deg, rgba(24,31,45,0.98), rgba(15,21,33,0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 12px 24px rgba(2,6,23,0.22);
}

.alarm-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(148,163,184,0.45);
}

.alarm-stat-card::after {
  content: "";
  position: absolute;
  inset: -26px -30px auto auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.10), rgba(255,255,255,0) 68%);
  pointer-events: none;
}

.alarm-stat-card-neutral {
  border-color: rgba(148,163,184,0.26);
  background: linear-gradient(135deg, rgba(71,85,105,0.40), rgba(17,24,39,0.98) 58%, rgba(15,23,42,0.96));
}

.alarm-stat-card-alert {
  border-color: rgba(248,113,113,0.34);
  background: linear-gradient(135deg, rgba(127,29,29,0.70), rgba(69,10,10,0.52) 34%, rgba(17,24,39,0.98));
}

.alarm-stat-card-due {
  border-color: rgba(245,158,11,0.34);
  background: linear-gradient(135deg, rgba(120,53,15,0.74), rgba(92,40,12,0.48) 34%, rgba(17,24,39,0.98));
}

.alarm-stat-card-today {
  border-color: rgba(56,189,248,0.34);
  background: linear-gradient(135deg, rgba(12,74,110,0.82), rgba(8,47,73,0.52) 34%, rgba(17,24,39,0.98));
}

.alarm-stat-card-owner {
  border-color: rgba(34,197,94,0.32);
  background: linear-gradient(135deg, rgba(20,83,45,0.86), rgba(20,83,45,0.46) 34%, rgba(17,24,39,0.98));
}

.alarm-stat-card-neutral::before { background: linear-gradient(180deg, #cbd5e1, #64748b); }
.alarm-stat-card-alert::before { background: linear-gradient(180deg, #fda4af, #ef4444); }
.alarm-stat-card-due::before { background: linear-gradient(180deg, #fcd34d, #f59e0b); }
.alarm-stat-card-today::before { background: linear-gradient(180deg, #67e8f9, #0ea5e9); }
.alarm-stat-card-owner::before { background: linear-gradient(180deg, #86efac, #22c55e); }

.alarm-stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: #f8fafc;
}

.alarm-stat-label {
  margin-top: 6px;
  color: #edf2fb;
  font-size: 11px;
  font-weight: 700;
}

.alarm-stat-hint {
  margin-top: 3px;
  color: #b1bfd7;
  font-size: 10px;
  line-height: 1.4;
}

.alarm-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.alarm-visual-card {
  border: 1px solid rgba(72,94,138,0.36);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  background: linear-gradient(180deg, rgba(25,33,48,0.96), rgba(18,26,38,0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.alarm-visual-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.alarm-visual-copy {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 10px;
  line-height: 1.45;
}

.alarm-bar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.alarm-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.alarm-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--text-dim);
}

.alarm-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148,163,184,0.14);
  overflow: hidden;
}

.alarm-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.alarm-bar-fill-alert { background: linear-gradient(90deg, #fb7185, #f97316); }
.alarm-bar-fill-stock { background: linear-gradient(90deg, #22d3ee, #38bdf8); }
.alarm-bar-fill-water { background: linear-gradient(90deg, #38bdf8, #60a5fa); }
.alarm-bar-fill-equipment { background: linear-gradient(90deg, #a78bfa, #818cf8); }
.alarm-bar-fill-due { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.alarm-bar-fill-owner { background: linear-gradient(90deg, #34d399, #22c55e); }
.alarm-bar-fill-neutral { background: linear-gradient(90deg, #64748b, #94a3b8); }

.alarm-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 1px;
  border-top: 1px solid var(--border);
}

.alarm-results-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--text-dim);
  font-size: 11px;
}

.alarm-results-copy strong {
  color: var(--text);
  font-size: 12px;
}

.alarm-results-sub {
  color: var(--text-muted);
  font-size: 10px;
}

.alarm-bulk-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alarm-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(245,166,35,0.22);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(245,166,35,0.10), rgba(245,166,35,0.04));
}

.alarm-bulk-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--text-dim);
  font-size: 11px;
}

.alarm-bulk-copy strong {
  color: var(--text);
  font-size: 12px;
}

.alarm-bulk-count {
  color: var(--text-muted);
  font-size: 10px;
}

.alarm-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.task-tab-link {
  text-decoration: none;
}

.alarm-summary-pills {
  justify-content: flex-end;
}

.alarm-summary-pill {
  font-size: 11px;
  padding: 3px 8px;
}

.alarm-summary-pill-critical {
  border-color: rgba(248,113,113,.35);
  color: #f87171;
  background: rgba(248,113,113,.08);
}

.alarm-group .maint-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alarm-group-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.alarm-group .alarm-card + .alarm-card {
  margin-top: 7px;
}

.alarm-card-alert {
  border-left-color: #f87171;
  background: linear-gradient(135deg, rgba(127,29,29,0.22), rgba(15,23,42,0.94) 46%, rgba(15,23,42,0.98));
}

.alarm-card-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, rgba(120,53,15,0.22), rgba(15,23,42,0.94) 46%, rgba(15,23,42,0.98));
}

.alarm-card-checked {
  opacity: 1;
}

.alarm-card-select {
  display: flex;
  align-items: flex-start;
  padding-top: 1px;
}

.alarm-card-selector {
  display: inline-flex;
  align-items: center;
  width: 28px;
  height: 28px;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(148,163,184,0.2);
  background: rgba(15,23,42,0.28);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.alarm-card-selector input {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: #f5a623;
}

.alarm-card-title-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.alarm-card-id {
  align-self: center;
  padding: 2px 3px;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7f8da5;
}

.alarm-card-summary {
  min-width: 0;
  color: #d4dbea;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alarm-card-details-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1fr);
  align-items: start;
  gap: 10px 18px;
  margin-top: 7px;
}

.alarm-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.alarm-card-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
  margin-top: 0;
}

.alarm-meta-group {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.alarm-card-assignees {
  margin-top: 7px;
}

.alarm-card-priority-critical { border-left-color: #ef4444; }
.alarm-card-priority-high { border-left-color: #f97316; }
.alarm-card-priority-normal { border-left-color: #38bdf8; }
.alarm-card-priority-low { border-left-color: #a3a3a3; }
.alarm-card-priority-not_urgent { border-left-color: #94a3b8; }

.alarm-card-priority-critical {
  box-shadow: inset 0 0 0 1px rgba(239,68,68,0.16);
}

.alarm-card-priority-high {
  box-shadow: inset 0 0 0 1px rgba(249,115,22,0.14);
}

.alarm-card-ignored {
  opacity: 1;
  border-style: dashed;
}

.alarm-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.12);
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.25;
}

.alarm-meta-pill-id {
  color: var(--accent);
  border: 1px solid rgba(245,166,35,0.18);
  background: rgba(245,166,35,0.08);
}

.alarm-meta-pill-context {
  background: rgba(96,165,250,.10);
  color: #cbd5e1;
}

.alarm-meta-pill-due {
  background: rgba(245,158,11,.12);
  color: #fcd34d;
}

.alarm-meta-pill-overdue {
  background: rgba(248,113,113,.12);
  color: #fca5a5;
}

.alarm-meta-pill-optional {
  background: rgba(52,211,153,.12);
  color: #86efac;
}

.alarm-meta-pill-missing {
  background: rgba(245,158,11,.12);
  color: #fcd34d;
}

.alarm-meta-pill-ignored {
  background: rgba(148,163,184,.12);
  color: #cbd5e1;
}

.alarm-level-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.alarm-level-badge-alert {
  background: rgba(248,113,113,.14);
  color: #f87171;
}

.alarm-level-badge-warning {
  background: rgba(245,158,11,.14);
  color: #f59e0b;
}

.alarm-level-badge-checked {
  background: rgba(52,211,153,.14);
  color: #34d399;
}

.alarm-priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.alarm-card .tc-main {
  gap: 11px;
  padding: 12px;
  min-height: 64px;
}

.alarm-card .tc-body {
  gap: 3px;
}

.alarm-card .tc-title {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.alarm-message-heading,
.alarm-message-subject,
.alarm-message-note {
  font-weight: 700;
}

.alarm-message-subject,
.alarm-message-separator {
  color: var(--text);
}

.alarm-message-note {
  color: var(--accent);
}

.alarm-card .tc-meta {
  gap: 6px;
  padding-right: 0;
}

.alarm-card .tc-pill {
  min-height: 24px;
  padding: 3px 8px;
  color: #d7deeb;
  font-size: 11px;
  line-height: 1.25;
}

.alarm-priority-badge-critical {
  background: rgba(248,113,113,.16);
  color: #fecaca;
}

.alarm-priority-badge-high {
  background: rgba(249,115,22,.16);
  color: #fdba74;
}

.alarm-priority-badge-normal {
  background: rgba(56,189,248,.16);
  color: #bae6fd;
}

.alarm-priority-badge-low {
  background: rgba(148,163,184,.14);
  color: #cbd5e1;
}

.alarm-priority-badge-not_urgent {
  background: rgba(52,211,153,.12);
  color: #bbf7d0;
}

.alarm-detail-copy {
  color: var(--text);
  line-height: 1.45;
  font-size: 12px;
}

.alarm-detail-lines {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alarm-detail-line {
  color: var(--text-muted);
  font-size: 12px;
}

.alarm-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alarm-detail-date-overdue {
  border-color: rgba(248,113,113,.42);
  color: #fca5a5;
  background: rgba(248,113,113,.10);
}

.alarm-due-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alarm-inline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alarm-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 12px;
}

.alarm-toggle-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148,163,184,0.06);
}

.alarm-toggle-card small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.alarm-due-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.alarm-date-input {
  width: 160px;
}

.alarm-id-badge {
  border-color: rgba(245,166,35,0.34) !important;
  background: rgba(245,166,35,0.12) !important;
  color: #ffd38b !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-panel-alarm {
  border: 2px solid #502a31;
  background: linear-gradient(180deg, rgba(111, 42, 48, 0.30), rgba(26,31,44,0.98) 18%, rgba(18,23,35,1));
  box-shadow: 0 18px 36px rgba(15,23,42,0.28), inset 0 0 0 1px rgba(255,179,128,0.08);
}

.td-panel-alarm .td-header {
  margin-bottom: 8px;
}

.td-panel-alarm .td-title {
  font-size: 14px;
  margin-bottom: 6px;
}

.td-panel-alarm .td-section {
  margin-top: 8px;
  padding: 9px 10px;
}

.td-panel-alarm .td-section-label {
  margin-bottom: 6px;
}

.td-panel-alarm .td-badges {
  gap: 4px;
  row-gap: 4px;
}

.td-panel-alarm .td-date-badge,
.td-panel-alarm .td-cat-badge {
  min-height: 20px;
  padding: 2px 7px;
}

.td-panel-alarm .td-staff-grid {
  gap: 5px;
}

.td-panel-alarm .td-staff-chip {
  padding: 4px 8px;
}

.td-panel-alarm .td-staff-name {
  font-size: 11px;
}

.td-panel-alarm .td-log-textarea {
  min-height: 54px;
}

.alarm-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148,163,184,0.14);
}

.alarm-detail-action-copy {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.td-panel-alarm .btn-task-done {
  margin: 0;
  padding: 6px 12px;
  font-size: 11px;
  white-space: nowrap;
}

.alarm-ignore-card {
  justify-content: space-between;
}

.alarm-inline-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245,166,35,0.28);
  background: rgba(245,166,35,0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.alarm-inline-action-btn:hover {
  background: rgba(245,166,35,0.14);
  border-color: rgba(245,166,35,0.42);
}

.alarm-inline-action-btn.is-active {
  border-color: rgba(248,113,113,0.34);
  background: rgba(248,113,113,0.10);
  color: #fca5a5;
}

.alarm-filter-actions {
  justify-content: flex-end;
}

.alarm-reset-btn {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.alarm-reset-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.alarm-save-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  max-width: min(300px, calc(100vw - 24px));
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(74,222,128,0.34);
  background: linear-gradient(180deg, rgba(16,185,129,0.18), rgba(15,23,42,0.96));
  color: #dcfce7;
  box-shadow: 0 16px 34px rgba(2,6,23,0.32);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.alarm-save-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .alarm-toolbar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .alarm-filter-search {
    grid-column: span 3;
  }

  .alarm-filter-panel-wide {
    grid-column: span 3;
  }

  .alarm-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .alarm-visual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-header {
    padding: 10px 0 10px;
    margin-bottom: 10px;
    gap: 8px;
  }

  .page-header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .page-title {
    font-size: 15px;
    gap: 6px;
  }

  .page-title-icon {
    font-size: 13px;
  }

  .page-date {
    font-size: 11px;
  }

  .kpi-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-strip-cell {
    padding: 8px 9px 7px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-width: 0;
  }

  .kpi-strip-cell:nth-child(2n) {
    border-right: none;
  }

  .kpi-strip-cell:nth-last-child(-n + 2) {
    border-bottom: none;
  }

  .kpi-strip-row {
    align-items: flex-start;
    gap: 5px;
  }

  .kpi-strip-row-stack {
    gap: 6px;
    margin-top: 3px;
  }

  .kpi-strip-lbl {
    font-size: 9px;
  }

  .kpi-strip-val,
  .kpi-task-val {
    font-size: 15px;
  }

  .kpi-strip-sub,
  .kpi-strip-note {
    font-size: 9px;
    line-height: 1.3;
  }

  .kpi-task-split {
    gap: 8px;
  }

  .kpi-task-half {
    min-width: 0;
  }

  .alarm-board-top {
    gap: 8px;
    margin-bottom: 8px;
  }

  .alarm-board-copy .section-title {
    font-size: 15px;
  }

  .alarm-board-side {
    width: 100%;
    align-items: stretch;
  }

  .alarm-page-copy {
    font-size: 10px;
    line-height: 1.35;
  }

  .alarm-board-top {
    flex-direction: column;
  }

  .alarm-board-note {
    max-width: none;
    width: 100%;
    padding: 8px 9px;
    font-size: 10px;
    line-height: 1.35;
  }

  .alarm-toolbar-grid {
    grid-template-columns: 1fr;
  }

  .alarm-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alarm-toolbar-card {
    margin-bottom: 10px;
    padding: 9px 9px 8px;
  }

  .alarm-tab-bar {
    margin-bottom: 8px;
  }

  .task-tab-bar.alarm-tab-bar {
    gap: 5px;
  }

  .task-tab-bar.alarm-tab-bar .task-tab {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 11px;
  }

  .alarm-filter-label {
    font-size: 8px;
  }

  .alarm-filter-search {
    grid-column: auto;
  }

  .alarm-filter-panel-wide {
    grid-column: auto;
  }

  .alarm-visual-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .alarm-visual-card {
    flex: 0 0 84%;
    min-width: 0;
    padding: 8px 9px;
    scroll-snap-align: start;
  }

  .alarm-visual-copy {
    display: none;
  }

  .alarm-bar-list {
    gap: 6px;
    margin-top: 8px;
  }

  .alarm-bar-head {
    font-size: 9px;
  }

  .alarm-bar-track {
    height: 5px;
  }

  .alarm-detail-grid,
  .alarm-detail-grid {
    grid-template-columns: 1fr;
  }

  .alarm-results-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .alarm-bulk-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .alarm-bulk-actions {
    justify-content: stretch;
  }

  .alarm-bulk-actions > button {
    flex: 1 1 0;
  }

  .alarm-detail-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .alarm-card .tc-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 11px;
    gap: 8px 10px;
  }

  .alarm-card-select {
    grid-column: 1;
  }

  .alarm-card .tc-body {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .alarm-card .tc-meta {
    grid-column: 2;
    justify-content: flex-end;
    padding-top: 3px;
  }

  .alarm-card:not(:has(.alarm-card-select)) .tc-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .alarm-card:not(:has(.alarm-card-select)) .tc-body,
  .alarm-card:not(:has(.alarm-card-select)) .tc-meta {
    grid-column: 1;
  }

  .alarm-card-head {
    flex-direction: column;
    gap: 6px;
  }

  .alarm-card .tc-title {
    font-size: 15px;
  }

  .alarm-card-summary {
    font-size: 13px;
  }

  .alarm-card-details-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .alarm-card-meta {
    justify-items: start;
    gap: 5px;
  }

  .alarm-meta-group {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .td-panel-alarm .td-section {
    margin-top: 7px;
    padding: 8px 9px;
  }

  .alarm-date-input {
    width: 100%;
  }
}

.tc-rec-dot {
  font-size: 11px;
  color: var(--text-muted);
}

.tc-chevron {
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0.5;
  margin-left: 2px;
}

/* ══════════════════════════════════════════════════════════
   TASK DETAIL PANEL
   ══════════════════════════════════════════════════════════ */

.td-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}

/* Header row */
.td-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.td-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  row-gap: 6px;
}

.td-rec-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(244,114,182,0.35);
  color: #fb7185;
  background: rgba(244,114,182,0.12);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.td-date-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(245,166,35,0.58);
  color: #cbd5e1;
  background: rgba(245,166,35,0.08);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.td-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.td-close:hover { background: var(--bg-hover); color: var(--text); }

/* Title */
.td-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin: 0 0 8px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Admin editable title */
.td-title-edit-form {
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.td-title-input {
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 10px;
  margin-bottom: 0;
  resize: vertical;
  overflow: hidden;
  min-height: 44px;
  max-height: calc((1.4em * 6) + 12px);
  line-height: 1.4;
  box-sizing: border-box;
  background: var(--bg-card-2);
  border-color: var(--border);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.td-title-input:focus {
  background: var(--bg);
}

/* Fermenter context section */
.td-fv-section { background: var(--bg-card-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.td-fv-section .td-section-label { margin-bottom: 6px; }
.td-fv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.td-fv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  min-width: 0;
}
.td-fv-lbl { color: var(--text-muted); flex-shrink: 0; }
.td-fv-val { color: var(--text); text-align: right; min-width: 0; }
.td-fv-muted { color: var(--text-muted); }
.td-fv-temp-ok    { color: #34d399; }
.td-fv-temp-warn  { color: #fbbf24; }
.td-fv-temp-alert { color: #f87171; }
.td-fv-status { font-size: 12px; color: var(--text-muted); }

@media (max-width: 600px) {
  .td-fv-grid { grid-template-columns: 1fr; }
}

/* Category select */
.td-cat-select { font-size: 12px; padding: 4px 8px; width: 100%; }

/* Date reschedule row */
.td-date-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.td-date-input { flex: 1; min-width: 110px; font-size: 12px; padding: 4px 8px; }
.td-date-input::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }
.td-date-btn {
  font-size: 12px;
  padding: 5px 10px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.td-date-btn:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Error status */
.log-submitted-err { font-size: 11px; color: var(--c-defect); }

/* Notion link */
.td-notion-link {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 14px;
  transition: color 0.15s;
}
/* Section blocks */
.td-section {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.td-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Staff assignment grid */
.td-assign-form { display: flex; flex-direction: column; gap: 8px; }

.td-staff-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.td-staff-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: var(--bg-card-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.td-staff-chip:hover { border-color: var(--accent); background: var(--accent-dim); }

.td-staff-chip input[type="checkbox"] { display: none; }

.td-staff-chip-on {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.td-staff-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

.td-save-status {
  min-height: 16px;
  font-size: 11px;
}

.td-unassigned {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* Recurrence panel form */
.td-rec-form-panel { display: flex; flex-direction: column; gap: 6px; }
.td-rec-select { width: 100%; }
.td-rec-hint {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 4px;
}

/* Log / notes form */
/* Log history (read-only) */
.td-logs-section { padding-bottom: 12px; }
.td-log-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.td-log-entry {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-card-2);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  white-space: pre-wrap;
  line-height: 1.45;
  border-left: 2px solid var(--border);
}

.td-log-form-panel { display: flex; flex-direction: column; gap: 8px; }
.td-log-textarea {
  width: 100%;
  resize: vertical;
  min-height: 64px;
}
.td-log-actions-panel { display: flex; justify-content: flex-end; }

/* Footer */
.td-footer {
  border-top: 1px solid var(--border);
  padding: 14px 4px 4px;
  margin-top: 12px;
}

.td-done-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 8px;
  text-align: center;
}

.btn-task-done {
  display: block;
  margin: 0 auto;
  padding: 7px 20px;
  background: none;
  color: var(--c-operating);
  border: 1px solid var(--c-operating);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-task-done:hover {
  background: var(--c-operating);
  color: #fff;
}

.td-already-done {
  font-size: 13px;
  color: var(--c-operating);
  display: block;
  text-align: center;
  padding: 8px 0;
}

/* ══════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES  (activated by data-theme="light")
   ══════════════════════════════════════════════════════════ */

[data-theme="light"] {
  color-scheme: light;
  --bg:            #f0f4fa;
  --bg-card:       #ffffff;
  --bg-card-2:     #e8edf6;
  --bg-hover:      #dce4f0;
  --border:        #c8d4e8;
  --border-light:  #aab8d0;
  --chart-grid:    rgba(200,212,232,0.55);
  --accent:        #d07000;
  --accent-dim:    rgba(208,112,0,0.10);
  --accent-dim2:   rgba(208,112,0,0.06);
  --text:          #18213a;
  --text-dim:      #3a4a68;
  --text-muted:    #7888a8;

  --c-operating:   #16a34a;
  --c-cip:         #1d4ed8;
  --c-maintenance: #b45309;
  --c-defect:      #dc2626;
  --c-empty:       #94a3b8;
  --c-critical:    #dc2626;
  --c-high:        #b45309;
  --c-normal:      #7888a8;

  --shadow: 0 2px 10px rgba(0,0,0,0.12);
  --beer-swatch-outline: rgba(15,23,42,0.16);
  --beer-swatch-shadow:  rgba(15,23,42,0.10);
  --tooltip-bg: #ffffff;
  --tooltip-bg-top: #f7f9fd;
  --tooltip-border: rgba(208,112,0,0.26);
  --tooltip-shadow: 0 10px 28px rgba(24,33,58,0.16);

  --tank-body-a: #a8b8ce;
  --tank-body-b: #bcc8de;
  --tank-body-c: #9caabe;
  --tank-stroke:  #7888a8;
  --tank-hi:      #8898b8;
  --tank-fit:     #b0c0d4;
}

[data-theme="light"] .sidebar {
  box-shadow: inset -1px 0 0 var(--border), 2px 0 12px rgba(0,0,0,0.08);
}

[data-theme="light"] .urgency-critical { color: #b91c1c; }
[data-theme="light"] .urgency-high     { color: #92400e; }
[data-theme="light"] .urgency-normal   { color: var(--text-dim); }
[data-theme="light"] .detail-panel     { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }

/* Light mode: metal gradients use CSS vars, beer fill unchanged */
[data-theme="light"] .tank-card { background: var(--bg-card); border-color: var(--border); }
[data-theme="light"] .tank-stage { background: rgba(0,0,0,0.04); }
[data-theme="light"] .tank-today-task { border-top-color: var(--border); }
[data-theme="light"] .kpi-strip-cell {
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(239,244,251,0.96));
  border-color: rgba(120,136,168,0.24);
  box-shadow: 0 8px 18px rgba(24,33,58,0.05);
}
[data-theme="light"] .kpi-strip-cell:hover {
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(234,241,250,0.98));
  border-color: rgba(208,112,0,0.22);
}
[data-theme="light"] .kpi-strip-lbl {
  color: #5d6d89;
}
[data-theme="light"] .kpi-strip-val {
  color: #14213a;
}
[data-theme="light"] .kpi-strip-cell-alarm {
  background: linear-gradient(180deg, rgba(255,246,244,0.99), rgba(255,236,232,0.96));
  border-color: rgba(220,38,38,0.18);
}
[data-theme="light"] .kpi-strip-cell-stock {
  background: linear-gradient(180deg, rgba(244,251,255,0.99), rgba(233,246,255,0.96));
  border-color: rgba(14,165,233,0.18);
}
[data-theme="light"] .kpi-strip-sub,
[data-theme="light"] .kpi-strip-foot,
[data-theme="light"] .kpi-log-pill-time {
  color: #5b6b88;
}
[data-theme="light"] .kpi-strip-flag {
  background: rgba(208,112,0,0.10);
  color: #8f4b00;
}
[data-theme="light"] .kpi-strip-flag.is-critical {
  background: rgba(220,38,38,0.10);
  color: #b91c1c;
}
[data-theme="light"] .kpi-badge {
  background: rgba(208,112,0,0.10);
  color: #8f4b00;
  border: 1px solid rgba(208,112,0,0.14);
}
[data-theme="light"] .kpi-badge-alarm {
  background: rgba(220,38,38,0.10);
  color: #b91c1c;
  border: 1px solid rgba(220,38,38,0.14);
}
[data-theme="light"] .kpi-strip-bar {
  background: rgba(120,136,168,0.13);
}
[data-theme="light"] .kpi-log-pill {
  background: rgba(255,255,255,0.92);
  border-color: rgba(120,136,168,0.24);
}
[data-theme="light"] .kpi-log-pill:hover {
  background: rgba(255,255,255,1);
  border-color: rgba(208,112,0,0.26);
}
[data-theme="light"] .kpi-log-pill::after {
  color: #51617d;
}
[data-theme="light"] .alarm-board-note {
  border-color: rgba(138, 60, 51, 0.24);
  background: linear-gradient(180deg, rgba(255,232,226,0.96), rgba(255,242,238,0.92));
  color: #74423a;
}
[data-theme="light"] .alarm-toolbar-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,248,252,0.96));
  border-color: rgba(189,203,228,0.84);
  box-shadow: 0 12px 26px rgba(24,33,58,0.05);
}
[data-theme="light"] .alarm-tab-bar .task-tab {
  color: #66789a;
}
[data-theme="light"] .alarm-tab-bar .task-tab:hover {
  background: rgba(208,112,0,0.08);
  color: #21314c;
}
[data-theme="light"] .alarm-tab-bar .task-tab-active {
  color: #8f4b00;
  border-bottom-color: rgba(208,112,0,0.82);
  background: rgba(255,214,153,0.28);
}
[data-theme="light"] .alarm-filter-panel,
[data-theme="light"] .alarm-visual-card,
[data-theme="light"] .alarm-stat-card {
  border-color: rgba(185,198,222,0.78);
  box-shadow: 0 8px 22px rgba(24,33,58,0.05);
}
[data-theme="light"] .alarm-stat-card {
  box-shadow: 0 10px 22px rgba(24,33,58,0.06);
}
[data-theme="light"] .alarm-stat-value {
  color: #14213a;
}
[data-theme="light"] .alarm-stat-label {
  color: #22324c;
}
[data-theme="light"] .alarm-stat-hint {
  color: #5b6e8c;
}
[data-theme="light"] .alarm-visual-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(244,247,252,0.97));
}
[data-theme="light"] .alarm-filter-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(243,246,251,0.97));
}
[data-theme="light"] .alarm-bulk-bar {
  border-color: rgba(208,112,0,0.24);
  background: linear-gradient(180deg, rgba(255,224,179,0.52), rgba(255,244,229,0.62));
}
[data-theme="light"] .alarm-card-selector {
  border-color: rgba(195,207,230,0.82);
  background: rgba(247,249,252,0.98);
  color: #4a5c79;
}
[data-theme="light"] .alarm-check-chip {
  border-color: rgba(195,207,230,0.82);
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(247,249,252,0.98));
  color: #4a5c79;
}
[data-theme="light"] .alarm-check-chip-on {
  border-color: rgba(208,112,0,0.34);
  background: linear-gradient(180deg, rgba(255,224,179,0.68), rgba(255,237,208,0.54));
  color: #7a4700;
  box-shadow: inset 0 0 0 1px rgba(208,112,0,0.10);
}
[data-theme="light"] .alarm-inline-check {
  border-color: rgba(195,207,230,0.82);
  background: rgba(247,249,252,0.98);
  color: #425471;
}
[data-theme="light"] .alarm-stat-card-neutral {
  background: linear-gradient(135deg, rgba(232,238,247,0.96), rgba(255,255,255,0.99) 54%, rgba(244,247,252,0.98));
}
[data-theme="light"] .alarm-stat-card-alert {
  background: linear-gradient(135deg, rgba(254,227,229,0.98), rgba(255,243,243,0.99) 42%, rgba(255,255,255,0.99));
}
[data-theme="light"] .alarm-stat-card-due {
  background: linear-gradient(135deg, rgba(255,241,207,0.98), rgba(255,247,236,0.99) 42%, rgba(255,255,255,0.99));
}
[data-theme="light"] .alarm-stat-card-today {
  background: linear-gradient(135deg, rgba(225,243,255,0.98), rgba(241,249,255,0.99) 42%, rgba(255,255,255,0.99));
}
[data-theme="light"] .alarm-stat-card-owner {
  background: linear-gradient(135deg, rgba(225,251,234,0.98), rgba(242,253,246,0.99) 42%, rgba(255,255,255,0.99));
}
[data-theme="light"] .alarm-card-status {
  background: rgba(255,255,255,0.9);
  color: #21314c;
  border-color: rgba(195,207,230,0.82);
}
[data-theme="light"] .alarm-card.task-card-active {
  background: linear-gradient(135deg, rgba(255,214,153,0.34), rgba(255,255,255,0.99) 52%, rgba(248,250,252,0.98)) !important;
  border-color: rgba(208,112,0,0.32) !important;
  box-shadow: 0 0 0 1px rgba(208,112,0,0.10);
}
[data-theme="light"] .alarm-meta-pill-id {
  color: #8f4b00;
  border-color: rgba(208,112,0,0.18);
  background: rgba(208,112,0,0.10);
}
[data-theme="light"] .alarm-id-badge {
  color: #8f4b00 !important;
  background: rgba(208,112,0,0.10) !important;
  border-color: rgba(208,112,0,0.18) !important;
}
[data-theme="light"] .alarm-card-alert {
  background: linear-gradient(135deg, rgba(254,226,226,0.94), rgba(255,255,255,0.98) 54%, rgba(248,250,252,0.98));
}
[data-theme="light"] .alarm-card-warning {
  background: linear-gradient(135deg, rgba(255,237,213,0.94), rgba(255,255,255,0.98) 54%, rgba(248,250,252,0.98));
}
[data-theme="light"] .alarm-meta-pill {
  background: rgba(120,136,168,0.10);
  color: #4f607e;
}
[data-theme="light"] .alarm-level-badge-alert {
  color: #b91c1c;
}
[data-theme="light"] .alarm-level-badge-warning {
  color: #b45309;
}
[data-theme="light"] .alarm-level-badge-checked {
  color: #15803d;
}
[data-theme="light"] .alarm-meta-pill-context {
  color: #24517e;
}
[data-theme="light"] .alarm-meta-pill-overdue {
  color: #b91c1c;
}
[data-theme="light"] .alarm-priority-badge-critical {
  color: #b91c1c;
}
[data-theme="light"] .alarm-priority-badge-high {
  color: #b45309;
}
[data-theme="light"] .alarm-priority-badge-normal {
  color: #0369a1;
}
[data-theme="light"] .alarm-priority-badge-low,
[data-theme="light"] .alarm-priority-badge-not_urgent {
  color: #475569;
}
[data-theme="light"] .alarm-toggle-card,
[data-theme="light"] .td-section {
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(241,245,251,0.95));
}
[data-theme="light"] .td-panel-alarm {
  border: 2px solid #502a31;
  background: linear-gradient(180deg, rgba(255,232,226,0.95), rgba(255,255,255,0.99) 22%, rgba(248,250,252,0.99));
  box-shadow: 0 14px 30px rgba(24,33,58,0.08), inset 0 0 0 1px rgba(249,115,22,0.05);
}
[data-theme="light"] .alarm-inline-action-btn {
  background: rgba(208,112,0,0.08);
  border-color: rgba(208,112,0,0.22);
  color: #8f4b00;
}
[data-theme="light"] .alarm-inline-action-btn.is-active {
  background: rgba(220,38,38,0.08);
  border-color: rgba(220,38,38,0.20);
  color: #b91c1c;
}
[data-theme="light"] .alarm-save-toast {
  border-color: rgba(34,197,94,0.24);
  background: linear-gradient(180deg, rgba(236,253,245,0.98), rgba(220,252,231,0.94));
  color: #166534;
  box-shadow: 0 12px 28px rgba(24,33,58,0.10);
}

/* ══════════════════════════════════════════════════════════
   RIGHT DETAIL PANEL (slide-out)
   ══════════════════════════════════════════════════════════ */

.right-panel {
  width: 0;
  min-width: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1),
              min-width 0.25s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
  z-index: 90;
}

.right-panel.open {
  width: 520px;
  min-width: 400px;
}

.right-panel-inner {
  width: 100%;
  min-width: unset;
  height: 100%;
  overflow-y: auto;
  padding: 16px;
}

/* Scrollbar in right panel */
.right-panel-inner::-webkit-scrollbar { width: 4px; }
.right-panel-inner::-webkit-scrollbar-track { background: transparent; }
.right-panel-inner::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

/* Active tank highlight */
.tank-active {
  border-color: var(--accent) !important;
  background: var(--accent-dim) !important;
  box-shadow: 0 0 0 1px var(--accent);
}

/* ── Tank hover tooltip (HTML, richer content) ── */

/* ══════════════════════════════════════════════════════════
   FERMENTATION READING BADGE (per tank card)
   ══════════════════════════════════════════════════════════ */

.temp-badge-ok    { color: #3b82f6; }
.temp-badge-warn  { color: #f59e0b; }
.temp-badge-alert { color: #ef4444; }
.temp-badge-none  { color: var(--text-muted); }

/* ── Detail panel — v0.351 additions ── */
.detail-fvid {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.detail-style {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
a.detail-style-link {
  color: var(--accent);
  text-decoration: none;
  display: block;
  cursor: pointer;
}
a.detail-style-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.detail-style-link-local {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  text-decoration: none;
}
.detail-style-link-local:hover,
.detail-style-link-local:visited,
.detail-style-link-local:active,
.detail-style-link-local:focus {
  color: var(--text);
  text-decoration: none;
}
.detail-beernam {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}
.detail-section {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.detail-section-hdr {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* ── Task items in fermenter detail panel ── */
.btn-ready-to-package {
  width: 100%;
  font-size: 14px;
  padding: 10px;
  background: rgba(20,184,166,0.15);
  border: 1px solid rgba(20,184,166,0.4);
  color: #14b8a6;
}
.btn-ready-to-package:hover {
  background: rgba(20,184,166,0.25);
  border-color: rgba(20,184,166,0.6);
}

.fv-task-item {
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
  padding: 7px 10px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.fv-task-item:hover  { background: var(--bg-hover); border-color: var(--border-light); }
.fv-task-item:last-child { margin-bottom: 0; }
.fv-task-item.fv-task-high { color: #f59e0b; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.06); }
.fv-task-item.fv-task-done { color: var(--text-muted); text-decoration: line-through; opacity: 0.65; cursor: default; }
.fv-task-check { margin-right: 4px; color: #22c55e; font-size: 10px; }

.breww-ack {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #22c55e;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 3px;
  padding: 1px 5px;
  cursor: default;
  text-transform: none;
}
.process-phase-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  margin-bottom: 8px;
  display: inline-block;
}
.process-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.process-step {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 11px;
  color: var(--text-dim);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.step-next {
  background: var(--accent-dim2);
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-weight: 500;
}
.step-num {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 14px;
  padding-top: 1px;
}
.step-next .step-num { color: var(--accent); }
.step-text { flex: 1; }

/* ══════════════════════════════════════════════════════════
   UTILITY & ENVIRONMENTAL SECTION
   ══════════════════════════════════════════════════════════ */


.util-main-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.util-form-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.util-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.util-card-sm {
  flex: 1;
}

.util-card-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.util-card-icon {
  font-size: 14px;
  line-height: 1;
}

.util-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 1;
}

.util-logged-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--c-operating);
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 4px;
  padding: 1px 5px;
}

.util-logged-tag.util-partial {
  color: var(--c-maintenance);
  background: rgba(245,158,11,0.10);
  border-color: rgba(245,158,11,0.25);
}

.util-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.util-table th {
  text-align: left;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 6px 6px 0;
  white-space: nowrap;
}

.util-table td {
  padding: 3px 4px 3px 0;
  vertical-align: middle;
}

.util-src-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  padding-right: 10px !important;
  min-width: 72px;
}

.util-in {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 11px;
  padding: 4px 6px;
  width: 72px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  transition: border-color 0.15s;
  text-align: right;
}

.util-in:focus {
  outline: none;
  border-color: var(--accent);
}

.util-in-lg {
  width: 100px;
  text-align: left;
}

.util-env-row {
  display: flex;
  gap: 10px;
}

.util-single-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.util-field-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.util-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.util-unit {
  font-size: 11px;
  color: var(--text-muted);
}

.util-current-val {
  font-size: 10px;
  color: var(--c-operating);
  font-weight: 600;
}

.util-submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.util-last-saved {
  font-size: 10px;
  color: var(--text-muted);
}

.util-saved-banner {
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-sm);
  color: var(--c-operating);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  margin-bottom: 4px;
}

/* pH calibration card */
.util-ph-card {
  height: 100%;
}

.util-ph-table { margin-top: 2px; }

.util-drift {
  text-align: center;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
}

.util-drift-ok   { color: var(--c-operating); font-weight: 700; }
.util-drift-warn { color: var(--c-defect);    font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE UPDATES (v0.35)
   ══════════════════════════════════════════════════════════ */

/* Right panel on tablet — narrower */
@media (max-width: 1300px) {
  .right-panel.open {
    width: 420px;
    min-width: 340px;
  }
  .right-panel-inner {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 1100px) {
  .util-ph-card {
    height: auto;
  }
}

/* Tablet: larger touch targets for task date-shift buttons (IOI-203) */
@media (min-width: 601px) and (max-width: 1200px) {
  .tc-date-btn {
    font-size: 12px;
    padding: 6px 10px;
    min-height: 30px;
  }
}

/* Right panel: full-screen overlay on mobile */
@media (max-width: 880px) {
  .alarm-summary-pills {
    justify-content: flex-start;
  }

  .right-panel.open {
    position: fixed;
    right: 0;
    top: 48px;                      /* sit below the mobile topbar */
    height: calc(100vh - 48px);    /* don't cover the topbar */
    width: min(100vw, 380px);
    min-width: min(100vw, 280px);
    z-index: 160;
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  }
  .right-panel-inner {
    width: 100%;
    min-width: unset;
  }
  .util-env-row {
    flex-direction: column;
  }
  .util-table { font-size: 11px; }
  .util-in { width: 62px; }

  /* Larger close button for touch (IOI-227) */
  .td-close {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Task panel backdrop overlay (IOI-227) */
.task-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 155;
  background: rgba(0,0,0,0.35);
}
.task-panel-overlay.active {
  display: block;
}

/* ══════════════════════════════════════════════════════════
   WIDE SCREEN (≥1400px): right panel always open
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1400px) {
  .right-panel {
    width: 500px;
    min-width: 400px;
  }
  .right-panel.open {
    width: 500px;
  }
}

/* ── Yeast Calculator ─────────────────────────────────── */
.calc-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; gap: 16px; }
}

.calc-section {
  margin-bottom: 20px;
}
.calc-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.calc-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.calc-field label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.calc-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calc-stack { display: flex; flex-direction: column; gap: 10px; }
.calc-row-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}
.calc-input-wrap { position: relative; display: flex; align-items: center; }
.calc-input-wrap input,
.calc-input-wrap select {
  padding-right: 5.25rem;
  width: 100%;
}
.calc-input-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.calc-input-wrap input::-webkit-outer-spin-button,
.calc-input-wrap input::-webkit-inner-spin-button {
  opacity: 1;
  margin-left: 8px;
}
.calc-unit {
  position: absolute;
  right: 3rem;
  font-size: 11px; color: var(--text-muted); pointer-events: none;
}
.calc-input-wrap-prominent input,
.calc-input-wrap-prominent select {
  font-size: 18px !important;
  font-weight: 700;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
}
.calc-input-wrap-prominent .calc-unit {
  right: 3rem;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.calc-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.calc-toggle-row { display: flex; gap: 8px; }
.calc-toggle-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 8px; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; font-size: 13px;
  color: var(--text-muted); transition: background 0.15s, color 0.15s;
}
.calc-toggle-btn input[type="radio"] { display: none; }
.calc-toggle-btn:has(input:checked) {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}

/* Results panel */
.calc-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.calc-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.calc-kpi {
  background: var(--bg-card-2);
  border-left: 3px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
}
.calc-kpi--accent  { border-left-color: var(--accent); }
.calc-kpi--success { border-left-color: #4CAF50; }
.calc-kpi--gold    { border-left-color: #C9963A; }
.calc-kpi-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.calc-kpi-value { font-size: 22px; font-weight: 500; line-height: 1.1; }
.calc-kpi-unit  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Pitch bar */
.calc-bar-wrap { margin-bottom: 16px; }
.calc-bar-labels {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
}
.calc-bar-center-label { font-weight: 500; color: var(--text); }
.calc-bar-bg {
  height: 10px; border-radius: 5px;
  background: var(--border); overflow: hidden;
}
.calc-bar-fill { height: 100%; border-radius: 5px; transition: width 0.4s ease; }
.calc-bar-fill--ok         { background: #4CAF50; }
.calc-bar-fill--underpitch { background: #E53935; }
.calc-bar-fill--overpitch  { background: #FF9800; }
.calc-bar-ends {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted); margin-top: 3px;
}

/* Alerts */
.calc-alert {
  border-radius: 6px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 12px;
}
.calc-alert--ok      { background: rgba(76,175,80,0.1);  border: 1px solid rgba(76,175,80,0.3);  color: #4CAF50; }
.calc-alert--warning { background: rgba(255,152,0,0.1);  border: 1px solid rgba(255,152,0,0.3);  color: #FF9800; }
.calc-alert--danger  { background: rgba(229,57,53,0.1);  border: 1px solid rgba(229,57,53,0.3);  color: #E53935; }

.calc-sachet-note {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; margin-bottom: 12px;
}
.calc-formula {
  margin-top: 12px; font-size: 12px;
}
.calc-formula summary {
  cursor: pointer; color: var(--text-muted); user-select: none;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
}
.calc-formula code {
  display: block; font-family: monospace;
  color: var(--text-muted); margin-top: 6px; font-size: 11px;
  line-height: 1.8;
}

/* Input / select reset for calc form */
.calc-inputs input[type="number"],
.calc-inputs input[type="text"],
.calc-inputs select {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  padding: 5px 8px;
  font-family: var(--font);
  transition: border-color 0.15s;
  width: 100%;
}
.calc-batch-select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.5em 100%;
  background-repeat: no-repeat;
  padding-right: 34px !important;
  min-height: 34px;
  background-color: var(--bg-card-2);
}
.calc-batch-select option {
  background: var(--bg-card);
  color: var(--text);
}
.calc-source-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.calc-source-tab {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 10px 10px 11px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  min-height: 56px;
  min-width: 0;
}
.calc-source-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.calc-source-tab:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.calc-source-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.calc-source-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-dim);
}
.calc-source-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.calc-source-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.calc-source-pill:hover {
  border-color: rgba(245,166,35,0.35);
  background: rgba(245,166,35,0.06);
}
.calc-source-pill-active {
  border-color: rgba(245,166,35,0.45);
  background: rgba(245,166,35,0.10);
}
.calc-source-pill-fv {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #38bdf8;
}
.calc-source-pill-batch {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.calc-batch-select:focus,
.calc-load-btn:focus,
.btn-secondary:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245,166,35,0.14);
}
.calc-inputs input[type="number"]:focus,
.calc-inputs input[type="text"]:focus,
.calc-inputs select:focus {
  outline: none;
  border-color: var(--accent);
}
.calc-default-value {
  color: var(--text-muted) !important;
}
.calc-default-value:focus,
.calc-default-value:not(:placeholder-shown) {
  color: var(--text) !important;
}
.calc-summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.calc-summary p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}
.calc-notes-block {
  margin-top: 16px;
}
.calc-notes-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}
.calc-note-line strong {
  color: var(--text);
  font-weight: 700;
}
.calc-note-line--accent {
  color: var(--accent);
  font-weight: 700;
}
.calc-note-line--warn {
  color: #f59e0b;
}
.calc-note-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.calc-note-link {
  font-size: 11px;
}
.calc-note-link--batch {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(245,166,35,0.3);
}
.calc-result-hero {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(245,166,35,0.06), rgba(255,255,255,0.01));
}
.calc-result-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.calc-result-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  margin-top: 4px;
}
.calc-result-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}
.calc-result-sub strong {
  color: var(--text);
  font-weight: 800;
}
@media (max-width: 760px) {
  .calc-source-tabs {
    grid-template-columns: 1fr;
  }
  .calc-source-tab {
    justify-content: flex-start;
    text-align: left;
    min-height: 0;
  }
  .calc-field-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .calc-results {
    padding: 14px;
  }
  .calc-result-value {
    font-size: 28px;
  }
  .calc-result-metrics {
    grid-template-columns: 1fr;
  }
  .calc-option-grid {
    grid-template-columns: 1fr;
  }
  .calc-source-pill-grid {
    grid-template-columns: 1fr;
  }
  .calc-notes-links {
    flex-direction: column;
    align-items: flex-start;
  }
}
.calc-result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 12px 0 2px;
}
.calc-metric {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
}
.calc-metric--accent { border-left: 4px solid var(--accent); }
.calc-metric--psi { border-left: 4px solid #38bdf8; }
.calc-metric--temp { border-left: 4px solid #ef4444; }
.calc-metric--accent .calc-metric-value { color: var(--accent); }
.calc-metric--psi .calc-metric-value { color: #38bdf8; }
.calc-metric--temp .calc-metric-value { color: #ef4444; }
.calc-metric-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.calc-metric-value {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
}
.calc-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}
.calc-carbstone-panel {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(56,189,248,0.25);
  background: linear-gradient(180deg, rgba(56,189,248,0.10), rgba(255,255,255,0.02));
}
.calc-option-grid .calc-carbstone-panel {
  margin: 0;
}
.calc-carbstone-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #38bdf8;
}
.calc-carbstone-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}
.calc-carbstone-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.calc-action-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}
.calc-action-list li + li {
  margin-top: 4px;
}
.calc-notes-panel {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(56,189,248,0.03));
}
.calc-notes-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calc-notes-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}
.calc-notes-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.calc-notes-link {
  font-size: 12px;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.calc-notes-link:hover {
  color: #38bdf8;
}
.calc-kpi-value.co2-stat-alert,
.calc-result-value.co2-stat-alert { color: #ef4444 !important; }
.calc-kpi-value.co2-stat-warn,
.calc-result-value.co2-stat-warn { color: #f59e0b !important; }
.calc-kpi-value.co2-stat-ok,
.calc-result-value.co2-stat-ok { color: #22c55e !important; }
.calc-kpi-value.co2-stat-dim,
.calc-result-value.co2-stat-dim { color: var(--text-dim) !important; }
.co2-stat-ok { color: #22c55e !important; }
.co2-stat-warn { color: #f59e0b !important; }
.co2-stat-alert { color: #ef4444 !important; }
.co2-stat-dim { color: var(--text-dim) !important; }

/* Strain catalog display */
.calc-strain-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  min-height: 14px;
}
.calc-cpg-display {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 0;
}

/* Strain badge in results panel */
.calc-strain-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 10px;
  background: var(--bg-card-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  flex-wrap: wrap;
}
.calc-strain-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.calc-strain-mfr {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
}
.calc-strain-temp {
  font-size: 11px;
  color: var(--accent);
  margin-left: auto;
}

/* Yeast calc button in fermenter detail */
.btn-yeast-calc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--radius-sm);
  background: var(--accent-dim2);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-yeast-calc:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  text-decoration: none;
}
/* ── End Yeast Calculator ─────────────────────────────── */

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL — Beer Style Admin
   ═══════════════════════════════════════════════════════════ */

.admin-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}
.admin-intro p { margin: 0 0 8px; }
.admin-intro p:last-child { margin-bottom: 0; }
.admin-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Admin action button */
.admin-sync-btn,
.admin-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim2);
  border: 1px solid rgba(245,166,35,0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.admin-sync-btn:hover,
.admin-action-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  text-decoration: none;
}
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sync status bar */
.admin-sync-bar {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}
.admin-sync-ok     { background: rgba(34,197,94,0.1);  color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.admin-sync-offline{ background: rgba(239,68,68,0.1);  color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.admin-sync-warn   { background: rgba(245,166,35,0.1); color: var(--accent); border: 1px solid var(--accent-dim); }

/* Table */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.beer-style-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.beer-style-view-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}
.beer-style-view-tab:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.beer-style-view-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.beer-style-view-tab.active {
  background: var(--accent-dim2, rgba(99,102,241,0.15));
  border-color: var(--accent);
  color: var(--accent);
}
.beer-style-table-toggle-form {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.beer-style-table-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.beer-style-table-toggle input {
  margin: 0;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table thead tr {
  background: var(--bg-card-2);
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  padding: 0;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}
.beer-style-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.beer-style-sort-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.beer-style-sort-btn.active {
  color: var(--accent);
}
.beer-style-sort-arrow {
  font-size: 11px;
  line-height: 1;
}
.admin-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.05));
  vertical-align: middle;
  color: var(--text-dim);
}
.admin-table .admin-row:last-child td { border-bottom: none; }
.admin-row:hover td { background: var(--bg-card-2); }
.admin-row-selected td { background: var(--accent-dim2) !important; }
.admin-row-inactive { opacity: 0.45; }

.col-yeast  { min-width: 130px; }
.col-strain { min-width: 90px; }
.col-flag   { text-align: center; width: 40px; }
.col-src    { text-align: center; width: 50px; }

/* Code badge */
.admin-code-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid var(--beer-swatch-outline);
  box-shadow: inset 0 0 0 1px var(--beer-swatch-shadow);
  background-clip: padding-box;
}
.admin-name-cell {
  color: var(--text);
  font-weight: 500;
  min-width: 140px;
}
.beer-style-table-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
.admin-notion-link {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 4px;
  text-decoration: none;
  opacity: 0.6;
}
.admin-notion-link:hover { opacity: 1; color: var(--accent); }

/* Yeast text cells */
.admin-yeast-text   { color: var(--text); }
.admin-strain-matched {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(34,197,94,0.12);
  color: #22c55e;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}
.admin-strain-unknown {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}
.admin-strain-fallback {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(245,166,35,0.1);
  color: var(--accent);
  border-radius: 3px;
  font-size: 11px;
}
.admin-text-muted { color: var(--text-muted); }

/* Flag column */
.admin-flag        { color: var(--text-muted); font-size: 12px; }
.admin-flag-on     { color: #22c55e; }

/* Status badges */
.admin-status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.admin-status-active  { background: rgba(34,197,94,0.12); color: #22c55e; }
.admin-status-pilot   { background: rgba(139,92,246,0.12); color: #a78bfa; }
.admin-status-not-active,
.admin-status-inactive { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.admin-status-local   { background: rgba(245,166,35,0.1);  color: var(--accent); }

/* Source badges */
.admin-src-notion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 3px;
  background: rgba(139,92,246,0.15);
  color: #a78bfa;
  font-size: 10px;
  font-weight: 700;
}
.admin-src-local {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 3px;
  background: rgba(245,166,35,0.1);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
/* ── End Admin Panel ──────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════
   NAV GROUPS — collapsible Admin / Stock sections
   ═══════════════════════════════════════════════════════════ */

.nav-group { position: relative; }

.nav-group-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  width: 100%;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font);
}
.nav-group-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-group.open > .nav-group-btn {
  color: var(--text);
}
.nav-group.open.has-active > .nav-group-btn {
  color: var(--accent);
  background: var(--accent-dim2);
  border-left-color: var(--accent);
}

.nav-group-arrow {
  margin-left: auto;
  font-size: 15px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  line-height: 1;
}
.nav-group.open .nav-group-arrow { transform: rotate(90deg); }

.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease;
  background: rgba(0,0,0,0.12);
  border-bottom: 1px solid transparent;
}
.nav-group.open .nav-group-items {
  max-height: 300px;
  border-bottom-color: var(--border);
}

.nav-subitem {
  display: flex;
  align-items: center;
  padding: 5px 14px 5px 40px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  letter-spacing: 0.02em;
}
.nav-subitem:hover {
  background: var(--bg-hover);
  color: var(--text-dim);
  text-decoration: none;
}
.nav-subitem:visited { color: var(--text-muted); }
.nav-subitem.nav-active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim2);
}
.nav-subitem.nav-active:visited { color: var(--accent); }
.nav-section-header {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 12px 4px;
  margin-top: 6px;
  border-top: 1px solid var(--border-light);
}
/* Lock badge on group buttons sits between label and arrow */
.nav-group-btn .nav-phase-badge { margin-right: 2px; }
/* Lock badge on sub-items pushes to the far right */
.nav-subitem .nav-phase-badge { margin-left: auto; padding-right: 2px; }
.nav-group-btn {
  display: flex;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════
   BEER STYLE DETAIL PANEL
   ═══════════════════════════════════════════════════════════ */

.style-detail { padding: 4px 0; }

.style-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.style-detail-swatch {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--beer-swatch-outline);
  background-clip: padding-box;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.style-detail-title { flex: 1; min-width: 0; }
.style-detail-code {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1.1;
}
.style-detail-name {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.3;
}
.style-detail-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.style-detail-close:hover { color: var(--text); }

.style-detail-section {
  margin-bottom: 16px;
}
.style-detail-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.style-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
.style-detail-kv {
  background: var(--bg-card-2);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}
.style-kv-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 1px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.style-kv-val {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.style-kv-val.accent { color: var(--accent); }

/* Yeast option cards within detail panel */
.style-yeast-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  margin-bottom: 6px;
}
.style-yeast-card.style-yeast-primary {
  border-color: rgba(245,166,35,0.3);
  background: var(--accent-dim2);
}
.style-yeast-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.style-yeast-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.style-yeast-primary-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 1px 5px;
  border-radius: 3px;
}
.style-yeast-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.style-detail-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 0;
}
.style-detail-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--bg-card-2);
  border-radius: var(--radius-sm);
}
.style-detail-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.style-recipes-hist { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.style-recipes-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem; margin-bottom: 10px;
}
.style-recipes-table th {
  background: var(--bg-card-2); color: var(--text-muted);
  font-size: 0.63rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 7px; text-align: left; border-bottom: 1px solid var(--border);
}
.style-recipes-table td { padding: 4px 7px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.style-recipes-table tr:last-child td { border-bottom: none; }
.style-recipe-link { color: var(--accent); text-decoration: none; }
.style-recipe-link:hover { text-decoration: underline; }
.style-recipe-old { font-size: 0.65rem; color: var(--text-dim); }
.style-recipe-new-btn {
  display: inline-block; font-size: 0.78rem; color: var(--accent);
  border: 1px solid var(--accent-dim); border-radius: 5px;
  padding: 4px 10px; text-decoration: none;
}
.style-recipe-new-btn:hover { background: var(--accent-dim); }
.beer-style-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.beer-style-form {
  display: block;
}
.beer-style-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.beer-style-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.beer-style-field-wide {
  grid-column: 1 / -1;
}
.beer-style-field input,
.beer-style-field select,
.beer-style-field textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
}
.beer-style-field textarea {
  resize: vertical;
  min-height: 72px;
}
.style-kv-readonly {
  padding: 8px 10px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12px;
}
.style-detail-section-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 6px 0 0;
}
.style-kv-inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.style-kv-inline-row input {
  width: 70px;
  flex: none;
}
.style-kv-inline-suffix {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: none;
  white-space: nowrap;
}
.beer-style-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.beer-style-color-preview {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
[data-theme="light"] .beer-style-color-preview {
  border-color: rgba(15,23,42,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55);
}
.beer-style-pill-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 8px 0;
}
.beer-style-pill-field .style-kv-label {
  display: inline-block;
  min-width: 96px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.beer-style-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.beer-style-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.beer-style-pill input {
  accent-color: var(--accent);
  margin: 0;
  width: auto;
}
.beer-style-pill:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.beer-style-pill:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim2, rgba(99,102,241,0.12));
  font-weight: 600;
}
.beer-style-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.beer-style-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.beer-style-archive-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
}
.style-detail-notion-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card-2);
  transition: color 0.15s, border-color 0.15s;
}
.style-detail-notion-btn:hover { color: var(--text); border-color: var(--border-light); text-decoration: none; }

@media (max-width: 880px) {
  .beer-style-table-toggle {
    width: 100%;
  }
}

/* Status badges (reused in detail panel) */
.style-status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.style-status-active        { background: rgba(34,197,94,0.12);  color: #22c55e; }
.style-status-pilot         { background: rgba(139,92,246,0.12); color: #a78bfa; }
.style-status-seasonal      { background: rgba(245,166,35,0.12); color: var(--accent); }
.style-status-archived      { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.style-status-not-active,
.style-status-one-off       { background: rgba(255,255,255,0.06); color: var(--text-muted); }

@media (max-width: 720px) {
  .beer-style-form-grid,
  .style-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   BEER STYLE CHIPS (small tags on yeast & other pages)
   ═══════════════════════════════════════════════════════════ */

.style-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.style-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
  opacity: 0.85;
}
.style-chip:hover { opacity: 1; text-decoration: none; }
.style-chip-none { color: var(--text-muted); font-style: italic; font-weight: 400; }

/* ═══════════════════════════════════════════════════════════
   STOCK — YEAST PAGE
   ═══════════════════════════════════════════════════════════ */

.stock-page-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.yeast-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.yeast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.yeast-table thead tr {
  background: var(--bg-card-2);
  border-bottom: 1px solid var(--border);
}
.yeast-table th {
  padding: 0;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}
.yeast-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.yeast-sort-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.yeast-sort-btn.active {
  color: var(--accent);
}
.yeast-sort-arrow {
  font-size: 11px;
  line-height: 1;
}
.yeast-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.05));
  vertical-align: middle;
  color: var(--text-dim);
}
.yeast-table tr:last-child td { border-bottom: none; }
.yeast-table tr.yeast-row:hover td { background: var(--bg-card-2); cursor: pointer; }
.yeast-row-selected td { background: var(--accent-dim2) !important; }

.yeast-id-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
}
.yeast-type-dry      { color: var(--accent);  }
.yeast-type-slurry   { color: #60a5fa; }
.yeast-type-liquid   { color: #a78bfa; }
.yeast-type-nutrient { color: #f59e0b; }
.yeast-type-blend    { color: #f472b6; }

/* Yeast strain detail panel (right panel content) */
.strain-detail { padding: 4px 0; }
.strain-detail-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.strain-detail-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.strain-detail-id {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}
.strain-detail-mfr {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.strain-detail-section { margin-bottom: 14px; }
.strain-detail-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════
   SCAFFOLD PAGE (coming soon)
   ═══════════════════════════════════════════════════════════ */

.scaffold-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 20px;
}
.scaffold-icon { font-size: 36px; opacity: 0.4; }
.scaffold-title { font-size: 16px; font-weight: 600; color: var(--text-dim); }
.scaffold-sub { font-size: 13px; max-width: 360px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   DAILY LOG PAGE  (/fermentation/log)
   Mobile-first — targets 390px+ viewports
   ═══════════════════════════════════════════════════════════ */

/* ── Page wrapper ── */
.dl-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 80px;   /* bottom pad for sticky save button */
}

/* ── Sticky tab bar ── */
.dl-tab-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: pan-x;
}
.dl-tab-bar::-webkit-scrollbar { display: none; }

.dl-tab {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
  position: relative;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.dl-tab-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dl-tab-icon svg { width: 100%; height: 100%; }
.dl-tab:hover  { color: var(--text); background: var(--bg-hover); }
.dl-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dl-tab-active { color: var(--accent); border-bottom-color: var(--accent); background: var(--accent-dim); }

/* badge on tab (✓ done / ! alert / — partial) */
.dl-tab-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 9px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 700;
}
.dl-badge-done  { background: rgba(34,197,94,0.18);  color: #22c55e; }
.dl-badge-alert { background: rgba(239,68,68,0.18);  color: #ef4444; }
.dl-badge-warn  { background: rgba(245,158,11,0.18); color: #f59e0b; }

/* ── Tab content area ── */
.dl-tab-content { padding: 0; }

/* ── Section wrapper ── */
.dl-section { padding: 12px 12px 0; max-width: 1000px; margin-left: auto; margin-right: auto; }

/* ── Saved / alert banners ── */
.dl-saved-banner {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #22c55e;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}
.dl-alerts { margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.dl-alert {
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
}
.dl-alert-warning {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: #f59e0b;
}
.dl-alert-alert {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
}
.dl-alert-modal-box { width: min(92vw, 560px); }
.dl-alert-modal-list { display: flex; flex-direction: column; gap: 8px; }

/* HA badge */
.dl-ha-badge {
  font-size: 11px;
  color: #60a5fa;
  background: rgba(96,165,250,0.08);
  border: 1px solid rgba(96,165,250,0.2);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  margin-bottom: 10px;
}

/* ── Cards ── */
.dl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.dl-card-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-2);
}
.dl-card-icon  { font-size: 15px; }
.dl-card-icon-svg { height: 18px; width: auto; flex-shrink: 0; color: var(--text-muted); }
.dl-card-title { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; }
.dl-card-hint  { font-size: 11px; color: var(--text-muted); }
.dl-card-jump {
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  white-space: nowrap;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.dl-card-jump:hover { opacity: 1; background: rgba(var(--accent-rgb,58,144,224),0.08); }
.dl-done-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(34,197,94,0.12);
  color: #22c55e;
}
.dl-done-partial { background: rgba(245,158,11,0.12); color: #f59e0b; }

/* ── Source / FV blocks ── */
.dl-source-block, .dl-fv-block, .dl-cr-block, .dl-phbuf-block {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dl-source-block:last-child, .dl-fv-block:last-child,
.dl-cr-block:last-child, .dl-phbuf-block:last-child { border-bottom: none; }

/* source header row — label + optional ✓ */
.dl-source-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.dl-source-hdr .dl-source-label,
.dl-source-hdr .dl-cr-label,
.dl-source-hdr .dl-phbuf-label { margin-bottom: 0; flex: 1; }

/* ── Water tank SVG icons (IOI-47) ─────────────────────────── */
.dl-source-with-icon {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.dl-tank-icon-wrap {
  flex-shrink: 0;
  width: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}
.dl-tank-svg {
  width: 64px;
  height: auto;
  display: block;
}
.dl-source-fields {
  flex: 1;
  min-width: 0;
}
@media (max-width: 440px) {
  .dl-tank-icon-wrap { display: none; }
  .dl-source-with-icon { display: block; }
}

/* per-row completion checkmark */
.dl-row-check {
  font-size: 10px;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.dl-source-title, .dl-fv-hdr, .dl-cr-label, .dl-phbuf-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.dl-fv-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.dl-fv-id   { font-size: 12px; color: var(--text); font-weight: 700; }
.dl-fv-beer { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; min-width: 120px; }
.dl-fv-code {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-card-2);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}
.dl-fv-block--edit {
  border-color: var(--accent) !important;
  background: rgba(245,158,11, 0.04);
}
.dl-fv-batch {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.02em;
}
.dl-fv-days { font-size: 10px; color: var(--text-muted); }

/* ── Option F: Split-panel form layout ── */
.dl-optf-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 10px;
}
.dl-optf-wrap--fv {
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 12px;
  margin-bottom: 8px;
}
.dl-optf-wrap--water {
  grid-template-columns: minmax(0, 1.9fr) minmax(150px, 0.72fr);
  gap: 12px;
}
@media (max-width: 600px) { .dl-optf-wrap { grid-template-columns: 1fr; } }
.dl-coldroom-svg {
  width: 64px;
  height: 64px;
  display: block;
}
.dl-meter-svg {
  width: 64px;
  height: auto;
  display: block;
}
.dl-meter-svg--mw { width: 50px; }
.dl-optf-col-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.dl-optf-col-hdr-meta {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
}
.dl-optf-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dl-optf-inputs .dl-field input[type="number"],
.dl-optf-inputs .dl-field input[type="text"] { height: 34px; font-size: 0.95rem; }
.dl-optf-inputs--fv { gap: 6px; }
.dl-optf-inputs--fv .dl-field input[type="number"],
.dl-optf-inputs--fv .dl-field input[type="text"] { height: 32px; font-size: 0.9rem; }
.dl-optf-ref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light, #1e2438);
  min-height: 32px;
}
.dl-optf-ref-row:last-child { border-bottom: none; }
.dl-optf-ref-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.dl-optf-ref-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  gap: 8px;
  padding: 5px 0;
  border: none;
  border-bottom: 1px solid var(--border-light, #1e2438);
  border-radius: 0;
  background: transparent;
}
.dl-optf-ref-card:last-child { border-bottom: none; }
.dl-optf-ref-key {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
}
.dl-optf-wrap--water .dl-optf-ref-row { min-height: 26px; padding: 3px 0; }
.dl-optf-wrap--water .dl-optf-ref-card { min-height: 26px; padding: 3px 0; }
.dl-optf-wrap--water .dl-optf-ref-key { font-size: 9px; }
.dl-optf-ref-val {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  justify-content: flex-end;
  text-align: right;
}
.dl-optf-ref-src { font-size: 9px; color: var(--text-muted); font-style: italic; font-weight: 400; }

/* ── Source indicator dots ── */
.dl-src-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dl-src-dot-breww { background: #3b82f6; }
.dl-src-dot-dash  { background: var(--accent); }
.dl-src-dot-rapt  { background: #ef4444; }
.dl-src-dot-ha    { background: #22c55e; }

/* ── Source legend ── */
.dl-src-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--text-muted);
  margin: 10px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--border-light);
}
.dl-src-legend-item { display: flex; align-items: center; gap: 4px; }

/* ── Measurement datetime bar (admin/supervisor only) ── */
.dl-mdt-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(245,166,35,0.05);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.dl-mdt-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.dl-mdt-label {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  margin-right: 2px;
}
.dl-mdt-input {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  padding: 5px 8px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  min-width: 0;
}
.dl-mdt-input:focus {
  outline: none;
  border-color: var(--accent);
}
.dl-mdt-input::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}
.dl-mdt-time { width: 100px; }
.dl-mdt-now-btn {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.dl-mdt-now-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 480px) {
  .dl-mdt-input { font-size: 14px; flex: 1; }
}

/* ── FV quick-jump nav ── */
.dl-fv-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 0 10px;
}
.dl-fv-jump-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(var(--accent-rgb, 245,158,11), 0.08);
  border: 1px solid rgba(var(--accent-rgb, 245,158,11), 0.3);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.dl-fv-jump-chip:hover {
  background: rgba(var(--accent-rgb, 245,158,11), 0.18);
  border-color: var(--accent);
}
.dl-fv-jump-done {
  color: #22c55e;
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.35);
}
.dl-fv-jump-done:hover {
  background: rgba(34,197,94,0.16);
  border-color: rgba(34,197,94,0.6);
}
.dl-fv-jump-past {
  color: var(--text-dim);
  background: rgba(245,166,35,0.06);
  border-color: rgba(245,166,35,0.22);
}
.dl-fv-jump-past:hover {
  background: rgba(245,166,35,0.14);
  border-color: rgba(245,166,35,0.4);
}
.dl-fv-done-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  color: #22c55e;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.dl-fv-done-past {
  background: rgba(245,166,35,0.08);
  border-color: rgba(245,166,35,0.22);
  color: var(--text-dim);
}

/* ── Field rows ── */
.dl-field-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.dl-cr-fields, .dl-phbuf-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.dl-cr-fields .dl-field, .dl-phbuf-fields .dl-field { flex: 1; min-width: 80px; }
.dl-glycol-row { display: flex; align-items: center; gap: 8px; }

/* ── Fields ── */
.dl-field { display: flex; flex-direction: column; gap: 4px; }
.dl-field label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dl-field input[type="number"],
.dl-field input[type="text"] {
  width: 100%;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.1rem;
  padding: 0 8px;
  font-family: var(--font);
  -moz-appearance: textfield;
  appearance: textfield;
}
.dl-field input[type="number"]::-webkit-outer-spin-button,
.dl-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.dl-field input[type="number"]:focus,
.dl-field input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-hover);
}
.dl-field input[type="number"]::placeholder,
.dl-field input[type="text"]::placeholder {
  font-size: 0.66rem;
  color: var(--text-muted);
}
.dl-fv-block .dl-field label { font-size: 9px; }
.dl-fv-block .dl-field input[type="number"],
.dl-fv-block .dl-field input[type="text"] {
  height: 36px;
  font-size: 0.92rem;
}
.dl-fv-block .dl-field input[type="number"]::placeholder,
.dl-fv-block .dl-field input[type="text"]::placeholder { font-size: 0.62rem; }

.dl-sign-wrap { display: flex; gap: 4px; }
.dl-sign-wrap input { flex: 1; min-width: 0; }
.dl-sign-btn {
  display: flex;
  flex-shrink: 0;
  width: 26px;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.dl-sign-btn.dl-sign-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dl-optf-inputs .dl-sign-btn { height: 34px; }
.dl-fv-block .dl-sign-btn { height: 36px; }
.dl-optf-inputs--fv .dl-sign-btn { height: 32px; }

.dl-field-lg { padding: 10px 14px; }

/* ── HA source label ── */
.dl-ha-src {
  font-size: 9px;
  color: #60a5fa;
  background: rgba(96,165,250,0.15);
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}

/* ── Color-coded indicators ── */
.dl-input-warn  { border-color: #f59e0b !important; color: #f59e0b !important; }
.dl-input-alert { border-color: #ef4444 !important; color: #ef4444 !important; }

.dl-cr-diff, .dl-glycol-val, .dl-drift-val {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  min-width: 50px;
  text-align: center;
}
.dl-diff-ok, .dl-drift-ok   { background: rgba(34,197,94,0.1);  color: #22c55e; }
.dl-diff-warn                { background: rgba(245,158,11,0.1); color: #f59e0b; }
.dl-diff-alert               { background: rgba(239,68,68,0.1);  color: #ef4444; }
.dl-drift-empty              { color: var(--text-muted); font-size: 13px; }

/* ── FV meta row ── */
.dl-fv-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 16px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.dl-fv-breww-vals  { flex: 1; min-width: 0; }
.dl-fv-meta-lbl    { font-weight: 600; margin-right: 3px; }
.dl-fv-meta-times  { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-fv-sync        { color: var(--text-muted); }
.dl-fv-last        { color: var(--text-muted); font-style: italic; }

/* ── Submit row ── */
.dl-edit-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: rgba(234,179,8,0.08);
  border: 1px solid rgba(234,179,8,0.28);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #ca8a04;
  margin-bottom: 10px;
}
.dl-edit-cancel {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(234,179,8,0.35);
  color: #ca8a04;
  border-radius: 4px;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font);
}
.dl-edit-cancel:hover { background: rgba(234,179,8,0.12); }
.dl-entry-edit-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 3px 5px;
  cursor: pointer;
  font-family: var(--font);
}
.dl-entry-edit-btn:hover { border-color: var(--accent); color: var(--accent); }

.dl-submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 4px;
}
.dl-save-btn {
  flex: none;
  height: 36px;
  padding: 0 24px;
  background: var(--accent);
  color: #0e1117;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s;
}
.dl-save-btn:hover   { opacity: 0.85; }
.dl-save-btn:active  { opacity: 0.7; }
.dl-fv-save-btn {
  flex-shrink: 0;
  height: 30px;
  padding: 0 10px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, color 0.15s, background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.dl-fv-save-btn:hover  { border-color: var(--border-light); color: var(--text); background: var(--bg-card-2); }
.dl-fv-save-btn:active { opacity: 0.7; }
.dl-last-saved {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Subtle saved note below submit row ── */
.dl-last-saved-note {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 12px 10px;
  text-align: right;
  opacity: 0.7;
}

/* ── Previous-value hint under each input ── */
.dl-prev-val {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1;
  opacity: 0.75;
}

/* ── Empty state ── */
.dl-empty {
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.dl-read-only-note {
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 6px;
  margin: 8px 0 16px;
}

/* ── Fat section headings (form, graphs, table) ── */
.dl-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin: 20px 0 10px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  scroll-margin-top: 56px;
}
.dl-section-hdr svg { color: var(--accent); flex-shrink: 0; }
.dl-section-hdr-sub {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
}
.dl-section-hdr--first { margin-top: 0; }

/* ── History section ── */
/* ── history controls ── */
.dl-history-controls { padding: 6px 0 2px; }
.dl-history-range {
  display: flex;
  gap: 4px;
  padding: 0 0 6px;
  flex-wrap: wrap;
}
.dl-range-btn {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.dl-range-btn:hover { background: var(--bg-hover); }
.dl-range-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── source filter chips ── */
.dl-src-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 0 8px;
}
.dl-src-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 10px;
  padding: 3px 8px 3px 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.dl-src-chip:hover { background: var(--bg-hover); }
.dl-src-chip.active {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-card-2);
}
.dl-src-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── charts ── */
.dl-history-wrap { padding: 4px 0 4px; }
.dl-history-collapsible {
  margin: 6px 0 12px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dl-history-collapsible summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.dl-history-collapsible summary::-webkit-details-marker { display: none; }
.dl-history-collapsible[open] summary {
  border-bottom: 1px solid var(--border);
}
.dl-history-collapsible .dl-history-wrap {
  padding: 8px 10px 4px;
}
/* ── date range picker ── */
.dl-date-sep {
  font-size: 11px;
  color: var(--text-dim);
  padding: 0 2px;
  align-self: center;
}
.dl-date-input {
  font-size: 11px;
  font-family: var(--font);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 3px 6px;
  cursor: pointer;
  height: 26px;
}
.dl-date-input:focus { outline: none; border-color: var(--accent); }

/* ── sortable table header ── */
.dl-sortable { cursor: pointer; user-select: none; }
.dl-sortable:hover { color: var(--text); }

.dl-history-avg-note {
  font-size: 10px;
  color: var(--text-dim);
  padding: 0 4px 6px;
}
.dl-chart-block { margin-bottom: 16px; }
.dl-chart-title {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
  padding: 0 4px;
}
.dl-chart-container { height: 220px; position: relative; background: var(--bg-card-2); border-radius: var(--radius-sm); padding: 4px; }
.dl-chart-container--compact { height: 156px; }
.dl-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 4px 0;
}
.dl-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
}
.dl-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dl-history-loading {
  color: var(--text-dim);
  font-size: 12px;
  padding: 16px 4px;
  text-align: center;
}
.dl-history-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding: 12px 4px;
}

/* ── water tank overview ── */
.dl-tank-overview-hdr { margin-top: 8px; }
.dl-tank-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px 0 10px;
}
@media (max-width: 600px) {
  .dl-tank-overview { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}
.dl-tank-overview-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px 8px 8px;
  box-sizing: border-box;
}
/* Always show tank icons in the overview cards (override the mobile hide rule) */
.dl-tank-overview .dl-tank-icon-wrap {
  display: flex;
  width: 52px;
}
.dl-tank-overview .dl-tank-svg { width: 44px; }
@media (max-width: 440px) {
  .dl-tank-overview .dl-tank-icon-wrap { width: 36px; }
  .dl-tank-overview .dl-tank-svg { width: 30px; }
}
.dl-tank-overview-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dl-tank-overview-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.dl-tank-overview-vol {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.dl-tank-overview-vol.dl-tank-vol-warn { color: var(--warn, #f59e0b); }
/* Trend arrows inside tank overview vol line */
.dl-tank-trend-badge { font-size: 11px; font-weight: 700; margin-left: 4px; vertical-align: middle; }
.dl-trend-up   { color: #60a5fa; }
.dl-trend-down { color: #f59e0b; }
.dl-trend-flat { color: var(--text-muted); }
/* Alarm border on floor overview cards */
.dl-tank-alarm-card { border-color: rgba(239,68,68,0.5) !important; }
/* Floor variant: 3-col grid always (reuses .dl-tank-overview) */
.dl-tank-overview--floor {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 600px) {
  .dl-tank-overview--floor { grid-template-columns: repeat(2, 1fr); }
}
/* Future placeholder section */
.floor-future-section {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-top: 16px;
}
.floor-future-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
}
.floor-future-title {
  font-size: .93rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.floor-future-msg {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.dl-tank-overview-pct {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 3px;
}
.dl-tank-overview-readings {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.dl-tank-overview-readings span {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}
.dl-tank-spark {
  display: block;
  width: 60px;
  height: 18px;
  margin-top: 4px;
  border-radius: 2px;
  overflow: visible;
}
.wm-tank-spark {
  width: 100%;
  height: 20px;
  margin-top: 6px;
  border-radius: 3px;
}

/* ── raw data table ── */
.dl-hist-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 2px;
  font-size: .82rem;
}
.dl-hist-pg-left  { display: flex; align-items: center; gap: 10px; }
.dl-hist-pg-right { display: flex; align-items: center; gap: 6px; }
.dl-hist-pg-label { color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
.dl-hist-pg-select {
  background: var(--bg-card-2); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); padding: 2px 6px; font-size: .82rem; cursor: pointer;
}
.dl-hist-pg-info  { color: var(--text-muted); font-size: .8rem; }
.dl-hist-pg-btn {
  padding: 3px 10px; background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text-dim); cursor: pointer; font-size: .8rem;
  transition: background .15s;
}
.dl-hist-pg-btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.dl-hist-pg-btn:disabled { opacity: .38; cursor: default; }
.dl-hist-table-wrap {
  padding: 0 0 8px;
  overflow-x: auto;
  max-height: 570px;  /* ~15 rows × 34px + header ~60px */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.dl-hist-table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.dl-hist-table-wrap::-webkit-scrollbar-track { background: transparent; }
.dl-hist-table-wrap::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.dl-hist-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.dl-hist-table-hdr {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px 6px;
}
.dl-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.dl-hist-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dl-hist-table td {
  padding: 4px 8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.dl-hist-table tr:last-child td { border-bottom: none; }
.dl-hist-table tr:hover td { background: var(--bg-hover); }
.dl-tbl-note  { max-width: 180px; white-space: normal !important; font-size: 10px; color: var(--text-dim); }
.dl-tbl-by    { max-width: 120px; white-space: normal !important; font-size: 10px; color: var(--text-dim); }
.dl-tbl-batch { font-size: 10px; color: var(--text-dim); }
.dl-tbl-stage { max-width: 140px; white-space: normal !important; font-size: 10px; color: var(--text-dim); }
.dl-tbl-alarm { text-align: center; }
.dl-hist-edit-row td {
  background: var(--bg-card-2) !important;
  padding: 0;
}
.dl-hist-editor {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}
.dl-hist-editor-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.dl-hist-editor-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.dl-hist-editor-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.dl-hist-editor-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dl-hist-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.dl-hist-edit-grid--fermentation {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}
.dl-hist-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dl-hist-edit-field span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dl-hist-edit-field--full {
  width: 100%;
}
.dl-hist-edit-input,
.dl-hist-edit-select {
  width: 100%;
  height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  padding: 0 10px;
  font-family: var(--font);
}
.dl-hist-edit-input:focus,
.dl-hist-edit-select:focus {
  outline: none;
  border-color: var(--accent);
}
.dl-hist-edit-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}
.dl-hist-edit-actions {
  display: flex;
  justify-content: flex-end;
}
.dl-entry-type-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dl-val-warn  { color: #f59e0b; }
.dl-val-alert { color: #ef4444; }

/* ── pH buffer fields ── */
.dl-phbuf-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}
.dl-phbuf-fields .dl-field-drift { min-width: 70px; flex: 0 0 70px; }

/* ── Entry type chip selector ── */
.dl-fv-type-row {
  display: flex;
  gap: 5px;
  margin: 6px 0 4px;
  flex-wrap: wrap;
}
.dl-fv-type-chip {
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.dl-fv-type-chip:hover { border-color: var(--border-light); color: var(--text); }
.dl-fv-type-chip--active[data-type="reading"]  { background: rgba(59,130,246,.12); color: var(--accent); border-color: var(--accent); }
.dl-fv-type-chip--active[data-type="note"]     { background: rgba(139,92,246,.12); color: #a78bfa; border-color: #a78bfa; }
.dl-fv-type-chip--active[data-type="qc"]       { background: rgba(16,185,129,.12); color: #34d399; border-color: #34d399; }
.dl-fv-type-chip--active[data-type="opinion"]  { background: rgba(245,158,11,.12); color: #fbbf24; border-color: #fbbf24; }
.dl-fv-type-chip--active[data-type="task"]     { background: rgba(239,68,68,.12);  color: #f87171; border-color: #f87171; }
/* ── Note + alarm row (water sources, cold room) ── */
.dl-source-note-row, .dl-card-note-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.dl-source-note-row--fv {
  display: grid;
  grid-template-columns: auto auto minmax(260px, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 6px;
}
.dl-card-note-row { padding: 0 14px 12px; }
.dl-fv-type-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  align-items: center;
}
.dl-fv-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.dl-entry-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 6px;
}
.dl-entry-type-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
}
.dl-entry-type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.dl-entry-type-radio {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--border-light);
  background: var(--bg);
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.dl-entry-type-radio::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(.7);
  transition: opacity 0.15s, transform 0.15s;
}
.dl-entry-type-label {
  line-height: 1;
}
.dl-entry-type-option:hover .dl-entry-type-radio {
  border-color: var(--accent);
}
.dl-entry-type-option:hover .dl-entry-type-label {
  color: var(--text);
}
.dl-entry-type-option input[type="radio"]:checked + .dl-entry-type-radio {
  border-color: var(--accent);
}
.dl-entry-type-option input[type="radio"]:checked + .dl-entry-type-radio::after {
  opacity: 1;
  transform: scale(1);
}
.dl-entry-type-option input[type="radio"]:checked ~ .dl-entry-type-label {
  color: var(--accent);
}

.dl-inline-select {
  height: 30px;
  min-width: 118px;
  max-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 11px;
  padding: 0 10px;
  font-family: var(--font);
}
.dl-inline-select:focus {
  outline: none;
  border-color: var(--border-light);
}
.dl-inline-select-stage {
  min-width: 160px;
  flex: 0 1 220px;
}
@media (max-width: 1100px) {
  .dl-source-note-row--fv {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
  .dl-fv-type-chip-row {
    grid-column: 2;
  }
  .dl-note-input--fv {
    grid-column: 1 / -1;
  }
  .dl-fv-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
}
@media (max-width: 640px) {
  .dl-optf-inputs,
  .dl-optf-ref-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dl-optf-ref-grid {
    column-gap: 6px;
  }
  .dl-optf-ref-card:last-child,
  .dl-optf-ref-card:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
  }
  .dl-fv-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }
  .dl-inline-select-stage {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .dl-fv-save-btn {
    width: auto;
    min-width: 88px;
    max-width: none;
  }
  .dl-alarm-check {
    width: 28px;
    height: 28px;
    align-self: center;
  }
  .dl-alarm-icon {
    font-size: 13px;
  }
  .dl-fv-type-chip-row {
    gap: 5px;
    min-height: 28px;
  }
  .dl-fv-type-chip {
    min-height: 24px;
    padding: 2px 9px;
    font-size: 9px;
  }
}
@media (max-width: 340px) {
  .dl-optf-inputs,
  .dl-optf-ref-grid {
    grid-template-columns: 1fr;
  }
}

.dl-note-input {
  flex: 1;
  min-height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12px;
  padding: 8px 10px;
  font-family: var(--font);
  line-height: 1.3;
}
.dl-note-input--fv {
  min-width: 0;
  width: 100%;
}
.dl-note-input::placeholder { color: var(--text-muted); }
.dl-note-input:focus { outline: none; border-color: var(--border-light); }
.dl-note-full { width: 100%; }

/* ── Alarm checkbox ── */
.dl-alarm-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.dl-alarm-check input[type="checkbox"] { display: none; }
.dl-alarm-icon { font-size: 14px; opacity: 0.3; transition: opacity 0.15s; }
.dl-alarm-check:hover .dl-alarm-icon { opacity: 0.6; }
.dl-alarm-active,
.dl-alarm-check:has(input:checked) {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.4);
}
.dl-alarm-active .dl-alarm-icon,
.dl-alarm-check:has(input:checked) .dl-alarm-icon { opacity: 1; }

/* Alarm inline (cold room diff row) */
.dl-alarm-inline { margin-left: auto; }
.dl-cr-diff-inline { flex-shrink: 0; }

/* ── Cold room: set temp narrow, actual grows ── */
.dl-field-settemp { flex: 0 0 68px; min-width: 68px; }
.dl-field-grow { flex: 1; min-width: 80px; }

/* ── 2-col and 3-col field row variants ── */
.dl-field-row-2 { grid-template-columns: repeat(2, 1fr); }
.dl-field-row-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Required field marker ── */
.dl-req { color: var(--accent); font-size: 10px; font-weight: 800; }

/* ── Text input (Hanna sample field, notes in phbuf) ── */
.dl-text-input {
  width: 100%;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 0 8px;
  font-family: var(--font);
}
.dl-text-input:focus { outline: none; border-color: var(--accent); }

/* ── Responsive: narrow screens ── */
@media (max-width: 420px) {
  .dl-field-row { grid-template-columns: repeat(2, 1fr); }
  .dl-tab { font-size: 11px; padding: 7px 10px 8px; gap: 5px; }
  .dl-tab-icon { width: 12px; height: 12px; }
}
/* ── End Nav Groups / Beer Style / Stock ──────────────── */

/* ═══════════════════════════════════════════════════════════
   FERMENTER VIEW TOGGLE  (Grid ⊞ / Table ☰)
   ═══════════════════════════════════════════════════════════ */

.fv-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}
.fv-tab-bar::-webkit-scrollbar { display: none; }
.fv-tab {
  display: flex; flex: 0 0 auto; align-items: center; gap: 7px;
  padding: 8px 14px 9px;
  border: none; background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  font-family: var(--font); cursor: pointer;
  border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.fv-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.fv-tab:hover { color: var(--text); background: var(--bg-hover); }
.fv-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.fv-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════════════════════════
   COMPACT FERMENTER TABLE
   ═══════════════════════════════════════════════════════════ */

.fv-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.fv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fv-table thead tr {
  background: var(--bg-card-2);
  border-bottom: 1px solid var(--border);
}
.fv-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.fv-table th.fvt-num { text-align: right; }

/* Group separator rows */
.fvt-group-row td {
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Data rows */
.fvt-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.fvt-row:last-child { border-bottom: none; }
.fvt-row:hover { background: var(--bg-hover); }
.fvt-active { background: var(--accent-dim2) !important; }

.fvt-row td {
  padding: 7px 10px;
  vertical-align: middle;
}

/* Empty / non-operating rows — dimmed */
.fvt-row-empty, .fvt-row-cip, .fvt-row-maintenance, .fvt-row-defect {
  opacity: 0.55;
}
.fvt-row-empty:hover, .fvt-row-cip:hover,
.fvt-row-maintenance:hover, .fvt-row-defect:hover { opacity: 0.85; }

/* Column widths */
.fvt-id     { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; width: 56px; }
.fvt-beer   { min-width: 140px; }
.fvt-stage  { width: 90px; }
.fvt-num    { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; width: 72px; }
.fvt-status { width: 88px; }
.fvt-task   { max-width: 180px; }

/* Beer cell: code + name + batch */
.fvt-code {
  font-size: 11px;
  font-weight: 700;
  margin-right: 5px;
}
.fvt-name {
  font-size: 12px;
  color: var(--text);
}
.fvt-batch {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}
.fvt-empty-lbl { color: var(--text-muted); }

/* Temp cell */
.fvt-temp { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.fvt-temp-actual { font-weight: 600; }
.fvt-temp-set    { font-size: 11px; color: var(--text-muted); }

/* Stale readings */
.fvt-stale { color: var(--text-muted); font-style: italic; }

/* Status chips */
.fvt-status-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-chip-operating  { background: rgba(34,197,94,0.12);  color: #22c55e; }
.status-chip-cip        { background: rgba(59,130,246,0.12); color: #60a5fa; }
.status-chip-maintenance{ background: rgba(245,158,11,0.12); color: #f59e0b; }
.status-chip-defect     { background: rgba(239,68,68,0.12);  color: #f87171; }
.status-chip-empty      { background: rgba(51,65,85,0.3);    color: var(--text-muted); }

/* Task cell */
.fvt-task-text {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.fvt-task-high { color: var(--c-high); }

/* ── Fermentation Live View ───────────────────────────────── */
.fv-live-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}
.fv-live-stat {
  font-size: 13px;
  color: var(--text-muted);
}
.fv-live-stat-on {
  color: var(--c-operating);
  font-weight: 500;
}
.fv-live-log-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, color 0.15s;
}
.fv-live-log-link:hover { color: var(--text); border-color: var(--border-light); }
.fv-live-log-done {
  color: var(--c-operating);
  border-color: rgba(34,197,94,0.3);
}
.fv-live-section { margin-top: 0; }
/* ── End Fermentation Live View ───────────────────────────── */

/* ── Fermentation Detailed Card View (IOI-207 draft) ─────── */
.fvd-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 12px;
  flex-wrap: wrap;
}
.fvd-filter-pills { display: flex; gap: 6px; }
.fvd-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fvd-pill:hover { color: var(--text); border-color: var(--border-light); }
.fvd-pill-active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.fvd-sort-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.fvd-sort-label { font-size: 11px; color: var(--text-muted); }
.fvd-sort-select {
  font-size: 12px; color: var(--text); background: var(--bg-card-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 3px 6px; cursor: pointer;
}
.fvd-draft-badge {
  font-size: 9px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 3px;
  padding: 2px 5px;
}

.fvd-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.fvd-card {
  width: 210px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.15s, background 0.15s;
}
.fvd-card:hover { background: var(--bg-hover); border-color: var(--border-light); }
.fvd-status-operating { border-bottom: 2px solid var(--c-operating); }
.fvd-status-cip       { border-bottom: 2px solid var(--c-cip); }
.fvd-status-maintenance { border-bottom: 2px solid var(--c-maintenance); }
.fvd-status-defect    { border-bottom: 2px solid var(--c-defect); }
.fvd-status-empty     { border-bottom: 2px solid var(--c-empty); opacity: 0.6; }

.fvd-card-hdr {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.fvd-fv-id { font-size: 12px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.fvd-beer-name { font-size: 11px; color: var(--text); font-weight: 500; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fvd-beer-empty { color: var(--text-muted); font-weight: 400; }
.fvd-beer-code { font-size: 9px; color: var(--text-muted); flex-shrink: 0; }

.fvd-readings {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px 8px;
  margin-bottom: 8px;
}
.fvd-reading { display: flex; flex-direction: column; gap: 1px; }
.fvd-reading-lbl { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.fvd-reading-val { font-size: 12px; color: var(--text); font-weight: 500; }
.fvd-temp-warn { color: var(--c-maintenance); }
.fvd-delta { font-size: 9px; color: var(--c-maintenance); margin-left: 2px; }

.fvd-divider { height: 1px; background: var(--border); margin: 6px 0; }

.fvd-section { margin-bottom: 6px; }
.fvd-section-hdr {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 4px;
}
.fvd-future { opacity: 0.55; }
.fvd-future-tag {
  font-size: 8px; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 2px; padding: 1px 3px;
}

.fvd-atten-bar-wrap { display: flex; align-items: center; gap: 6px; }
.fvd-atten-bar {
  flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.fvd-atten-fill { height: 100%; background: var(--c-operating); border-radius: 3px; transition: width 0.4s; }
.fvd-atten-pct { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
.fvd-days-est { font-size: 9px; color: var(--text-muted); margin-top: 2px; }

.fvd-sparkline-placeholder { background: var(--bg-card-2); border-radius: 4px; padding: 2px; }
.fvd-sparkline-svg { width: 100%; height: 40px; display: block; }

.fvd-rapt-row { display: flex; align-items: center; gap: 6px; }
.fvd-rapt-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.fvd-rapt-unknown { background: var(--text-muted); }
.fvd-rapt-ok      { background: var(--c-operating); }
.fvd-rapt-warn    { background: var(--c-maintenance); }
.fvd-rapt-info { font-size: 10px; color: var(--text-muted); flex: 1; }
.fvd-rapt-batt { font-size: 9px; color: var(--text-muted); }

.fvd-empty-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px 0; min-height: 60px;
}
.fvd-empty-label { font-size: 12px; color: var(--text-muted); }

.fvd-stage-row {
  display: flex; justify-content: center; align-items: center;
  height: 20px; flex-shrink: 0; margin-top: 6px;
}
.fvd-task-row {
  height: 35px; flex-shrink: 0; overflow: hidden;
  padding: 4px 2px 0;
}
.fvd-task {
  font-size: 8.5px; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden; height: 31px; line-height: 1.35;
  width: 100%; padding: 4px 6px;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.fvd-task-high { color: #f59e0b; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.07); }

@media (max-width: 880px) {
  .fvd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .fvd-card { width: 100%; }
}
/* ── End Fermentation Detailed Card View ─────────────────── */

/* ── Detailed view: hide stock, expand actions ────── */
.bottom-row.fv-view-detailed { grid-template-columns: 1fr; }
.bottom-row.fv-view-detailed .panel-stock { display: none; }
body.fv-batch .panel-actions { display: none; }
body.fv-detailed .right-panel { display: none !important; }
/* ─────────────────────────────────────────────────────────── */

/* ── Login — PIN field ────────────────────────────────────── */
.login-input {
  background: var(--bg-input, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
}
.login-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.login-pin { letter-spacing: 6px; font-size: 18px; text-align: center; }
.login-pin-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.login-error {
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35);
  border-radius: var(--radius-sm); color: #f87171;
  font-size: 13px; padding: 8px 12px; margin-bottom: 4px;
}

/* ── Role badges ──────────────────────────────────────────── */
.role-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px; letter-spacing: .03em; text-transform: uppercase;
}
.role-admin      { background: rgba(245,158,11,.18); color: #fbbf24; }
.role-supervisor { background: rgba(99,102,241,.18);  color: #818cf8; }
.role-backoffice { background: rgba(16,185,129,.18);  color: #34d399; }
.role-brewstaff  { background: rgba(148,163,184,.12); color: var(--text-muted); }

/* ── Admin users table ────────────────────────────────────── */
.admin-users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-users-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-users-table th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border); padding: 6px 8px;
}
.admin-users-table td { padding: 9px 8px; border-bottom: 1px solid var(--border-subtle, var(--border)); vertical-align: middle; }
.admin-table-row:hover { background: var(--bg-hover, rgba(255,255,255,.04)); }
.admin-users-name { font-weight: 500; }
.admin-users-nick { color: var(--text-muted); }
.admin-users-staffid { color: var(--text-muted); font-variant-numeric: tabular-nums; width: 3rem; text-align: center; }
.pin-status { font-size: 14px; }
.pin-set    { color: #34d399; }
.pin-unset  { color: var(--text-dim, var(--text-muted)); }
.admin-toggle-btn {
  font-size: 11px; padding: 3px 9px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; font-weight: 500;
}
.toggle-active   { background: rgba(16,185,129,.15); color: #34d399; border-color: rgba(16,185,129,.3); }
.toggle-inactive { background: rgba(148,163,184,.1);  color: var(--text-muted); border-color: var(--border); }
.admin-msg-ok    { color: #34d399; font-size: 12px; }
.admin-msg-error { color: #f87171; font-size: 12px; }
.admin-empty     { color: var(--text-muted); font-size: 13px; padding: 16px 8px; text-align: center; }

/* ── Admin add user form ──────────────────────────────────── */
.admin-add-user-wrap  { margin-bottom: 1.25rem; }
.admin-add-user-btn {
  padding: 9px 20px; font-size: 13px; font-weight: 600;
  background: var(--accent, #3b82f6); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; letter-spacing: .02em;
}
.admin-add-user-btn:hover { filter: brightness(1.12); }
.admin-add-user-collapsible { display: none; margin-top: 12px; }
.admin-add-user-collapsible.open { display: block; }
.admin-add-user-form  { padding: 4px 0; }
.admin-add-user-fields {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.admin-add-user-fields .login-field { min-width: 160px; flex: 1; }
.admin-add-user-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.admin-add-user-submit {
  padding: 9px 20px; font-size: 13px; font-weight: 600;
  background: var(--accent, #3b82f6); color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
}
.admin-add-user-submit:hover { filter: brightness(1.12); }
.req { color: #e05252; font-size: 11px; }

/* ── User detail panel ────────────────────────────────────── */
.detail-user-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.detail-user-name   { font-size: 15px; font-weight: 600; }
.detail-user-nick   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.detail-section     { margin-bottom: 20px; }
.detail-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.detail-section-sub { font-size: 11px; color: var(--text-dim, var(--text-muted)); margin: 0 0 10px; }
.detail-role-form   { display: flex; gap: 8px; align-items: center; }
.detail-role-select { flex: 1; }
.detail-pin-row     { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-pin-form    { display: flex; gap: 8px; align-items: center; }
.detail-pin-input   { flex: 1; max-width: 120px; text-align: center; letter-spacing: 4px; }
.detail-name-form   { display: flex; flex-direction: column; }
.detail-name-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-name-fields .login-field { flex: 1; min-width: 120px; }
.admin-sync-btn-danger {
  color: #e05252;
  background: rgba(224,82,82,.12);
  border-color: rgba(224,82,82,.3);
}
.admin-sync-btn-danger:hover {
  background: rgba(224,82,82,.22);
  border-color: #e05252;
}
.admin-sync-btn-warning {
  color: #f59e0b;
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.3);
}
.admin-sync-btn-warning:hover {
  background: rgba(245,158,11,.22);
  border-color: #f59e0b;
}
.detail-staffid-badge {
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--bg-card, rgba(255,255,255,.06));
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 7px; color: var(--text-muted); letter-spacing: .03em;
}
.detail-danger-zone { border-top: 1px solid var(--border); padding-top: 16px; }
.detail-danger-row  { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-stack-form  { display: flex; flex-direction: column; gap: 0; }
.detail-stack-form .login-field { margin-bottom: 8px; }
.detail-stack-form button[type=submit] { align-self: flex-start; }
.detail-notes-area  { width: 100%; resize: vertical; min-height: 60px; font-size: 12px; line-height: 1.5; }
.detail-section-sub-inline { font-size: 10px; font-weight: 400; color: var(--text-dim, var(--text-muted)); text-transform: none; letter-spacing: 0; }
.admin-add-user-fields-stack { display: flex; flex-direction: column; gap: 0; max-width: 420px; }
.admin-add-user-fields-stack .login-field { margin-bottom: 10px; }

/* User table extras */
.admin-users-whatsapp { font-size: 11px; color: var(--text-muted); max-width: 140px; }
.wa-check { color: #34d399; }
.wa-none  { color: var(--text-dim, var(--text-muted)); }

/* Inactive filter */
.admin-table-controls { margin: 10px 0 8px; }
.admin-filter-toggle {
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 5px; cursor: pointer;
  transition: background .15s, color .15s;
}
.admin-filter-toggle:hover  { background: rgba(255,255,255,.06); color: var(--text); }
.admin-filter-active        { background: rgba(96,165,250,.12); border-color: rgba(96,165,250,.35); color: #60a5fa; }
.admin-users-table tr[data-active="false"] { display: none; }
.admin-users-table.show-inactive tr[data-active="false"] { display: table-row; opacity: .5; }

@media (max-width: 760px) {
  .admin-add-user-btn,
  .admin-filter-toggle,
  .admin-add-user-submit {
    width: 100%;
  }

  .admin-add-user-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-add-user-actions .admin-sync-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-users-table-wrap {
    overflow: visible;
  }

  .admin-users-table,
  .admin-users-table thead,
  .admin-users-table tbody,
  .admin-users-table tr,
  .admin-users-table td {
    display: block;
  }

  .admin-users-table thead {
    display: none;
  }

  .admin-users-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .admin-users-table tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
  }

  .admin-users-table tr[data-active="false"] {
    display: none;
  }

  .admin-users-table.show-inactive tr[data-active="false"] {
    display: block;
    opacity: .58;
  }

  .admin-users-table td {
    display: grid;
    grid-template-columns: minmax(82px, 108px) minmax(0, 1fr);
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  }

  .admin-users-table td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .admin-users-table td.admin-users-name {
    display: block;
    font-size: 15px;
    padding-bottom: 8px;
  }

  .admin-users-table td.admin-users-name::before {
    display: none;
  }

  .admin-users-table td[colspan] {
    display: block;
    padding: 10px 12px 14px;
  }

  .admin-users-table td[colspan]::before {
    display: none;
  }

  .admin-users-table td:last-child {
    border-bottom: none;
  }

  .admin-users-staffid {
    width: auto;
    text-align: left;
  }

  .admin-users-whatsapp {
    max-width: none;
  }

  .admin-toggle-btn {
    width: 100%;
  }
}

/* ── Nav override table ───────────────────────────────────── */
.detail-nav-table   { width: 100%; border-collapse: collapse; font-size: 12px; }
.detail-nav-table th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); text-align: left; padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}
.detail-nav-table td { padding: 6px 6px; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.04)); }
.detail-nav-label   { color: var(--text); }
.nav-row-override   { background: rgba(99,102,241,.06); }
.detail-nav-divider-row td {
  padding: 0;
  border-bottom: 0;
  background: transparent;
}
.detail-nav-divider-cell {
  padding: 12px 0 6px;
}
.detail-nav-divider-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.nav-eff-yes        { color: #34d399; font-weight: 600; }
.nav-eff-no         { color: var(--text-dim, var(--text-muted)); }
.nav-override-tag   {
  font-size: 9px; letter-spacing: .05em; text-transform: uppercase;
  color: #818cf8; background: rgba(99,102,241,.15);
  padding: 1px 5px; border-radius: 8px; margin-left: 4px;
}
.detail-nav-form { display: flex; justify-content: flex-end; }
.detail-nav-choice {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-0);
  overflow: hidden;
}
.detail-nav-btn {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 8px;
  min-width: 40px;
  cursor: pointer;
}
.detail-nav-btn:last-child { border-right: 0; }
.detail-nav-btn:hover { background: var(--bg-hover, rgba(255,255,255,.04)); color: var(--text-secondary); }
.detail-nav-btn.is-active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text-primary); }
.detail-nav-choice .detail-nav-btn:nth-child(1).is-active { color: #cbd5e1; }
.detail-nav-choice .detail-nav-btn:nth-child(2).is-active { color: #6ee7b7; background: rgba(52, 211, 153, 0.12); }
.detail-nav-choice .detail-nav-btn:nth-child(3).is-active { color: #fca5a5; background: rgba(239, 68, 68, 0.12); }

/* ── Admin tabs ───────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  display: flex; flex: 0 0 auto; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; padding: 8px 14px 9px;
  background: none; border: none; border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  color: var(--text-muted); cursor: pointer; margin-bottom: -1px;
  font-family: var(--font); white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.admin-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.admin-tab:hover { color: var(--text); background: var(--bg-hover); }
.admin-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.admin-tab-active { color: var(--accent) !important; border-bottom-color: var(--accent) !important; background: var(--accent-dim) !important; }
.admin-save-flash {
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .16s ease, transform .16s ease;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6ee7b7;
}
.admin-save-flash.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.admin-role-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.admin-role-filter-input {
  max-width: 240px;
  min-width: 180px;
}
.admin-role-filter-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Role management matrix ───────────────────────────────── */
.role-matrix-wrap {
  max-height: min(68vh, 920px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-0);
}
.role-matrix-table  { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: .5rem; }
.role-matrix-table th {
  text-align: center; font-size: 11px; padding: 8px 6px;
  border-bottom: 1px solid var(--border); font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-1, var(--bg-card));
}
.role-matrix-page-col   { text-align: left !important; width: 34%; min-width: 240px; left: 0; z-index: 4 !important; }
.role-matrix-admin-col  { width: 6%; text-align: center !important; }
.role-matrix-role-group { border-left: 1px solid var(--border); width: 8.5%; }
.role-matrix-row td    { padding: 6px 6px; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.04)); vertical-align: middle; }
.role-matrix-row:hover { background: var(--bg-hover, rgba(255,255,255,.03)); }
.role-matrix-row:hover .role-matrix-page-label { background: var(--bg-hover, rgba(255,255,255,.03)); }
.role-matrix-divider-row td {
  padding: 0;
  border-bottom: 0;
  background: transparent;
}
.role-matrix-divider-cell { position: sticky; left: 0; z-index: 2; background: var(--surface-0); }
.role-matrix-divider-cell {
  padding: 12px 0 6px;
}
.role-matrix-divider-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.role-matrix-page-label { font-size: 13px; position: sticky; left: 0; z-index: 1; background: var(--surface-0); }
.role-matrix-cell { text-align: center; }
.role-matrix-cell { border-left: 1px solid var(--border-subtle, rgba(255,255,255,.04)); }
.rmt-fixed-full { color: #34d399; font-size: 15px; font-weight: 700; }

/* Role access segmented selector */
.role-matrix-form  { display: flex; justify-content: center; }
.role-matrix-choice {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-0);
  overflow: hidden;
}
.rmt-choice-btn {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 8px;
  min-width: 42px;
  cursor: pointer;
}
.rmt-choice-btn:last-child { border-right: 0; }
.rmt-choice-btn:hover { background: var(--bg-hover, rgba(255,255,255,.04)); color: var(--text-secondary); }
.rmt-choice-btn.is-active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text-primary); }
.role-matrix-choice .rmt-choice-btn:nth-child(1).is-active {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}
.role-matrix-choice .rmt-choice-btn:nth-child(2).is-active {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}
.role-matrix-choice .rmt-choice-btn:nth-child(3).is-active {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.role-matrix-note  { font-size: 11px; color: var(--text-muted); margin-top: 1rem; }
.task-tab-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  vertical-align: -2px;
}
.task-tab-icon { margin-right: 2px; }

/* ── Admin Settings page ───────────────────────────────────── */
.settings-section          { margin-bottom: 2rem; }
.settings-section-title    { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
                              color: var(--text-muted); margin: 0 0 .75rem; padding-bottom: .4rem;
                              border-bottom: 1px solid var(--border); }
.settings-row              { display: flex; align-items: flex-start; gap: 1.5rem; padding: .75rem 0;
                              border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.04)); }
.settings-row:last-child   { border-bottom: none; }
.settings-label-wrap       { flex: 0 0 280px; }
.settings-label            { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: .2rem; }
.settings-hint             { display: block; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.settings-input-wrap       { display: flex; align-items: center; gap: .5rem; flex: 1; }
.settings-input-wrap-wide  { flex: 1; }
.settings-input-num        { width: 110px; background: var(--bg-input, rgba(255,255,255,.06));
                              border: 1px solid var(--border); border-radius: 6px; color: var(--text);
                              font-size: 13px; padding: 6px 10px; }
.settings-input-url        { width: 100%; max-width: 420px; background: var(--bg-input, rgba(255,255,255,.06));
                              border: 1px solid var(--border); border-radius: 6px; color: var(--text);
                              font-size: 13px; padding: 6px 10px; }
.settings-select           { width: 260px; background: var(--bg-card-2, #1a1f2e) !important;
                              border: 1px solid var(--border); border-radius: 6px; color: var(--text);
                              font-size: 13px; padding: 6px 10px; font-family: var(--font); }
.settings-unit             { font-size: 11px; color: var(--text-muted); }
.settings-default          { font-size: 11px; color: var(--text-muted); }
.settings-actions          { padding-top: 1rem; }
.delta-params-form         { display: flex; flex-direction: column; gap: 1rem; }
.delta-toolbar             { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
                              padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
                              background: rgba(255,255,255,.02); }
.delta-toolbar-group       { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.delta-toolbar-group-search { margin-left: auto; }
.delta-toolbar-label       { font-size: 10px; color: var(--text-muted); text-transform: uppercase;
                              letter-spacing: .06em; font-weight: 700; }
.delta-filter-chip         { padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
                              background: var(--bg-card-2); color: var(--text-dim); font-size: 11px; cursor: pointer; }
.delta-filter-chip:hover   { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.delta-filter-chip.is-active { color: var(--text); border-color: rgba(96,165,250,.5); background: rgba(59,130,246,.16); }
.delta-toolbar-select,
.delta-search-input        { background: var(--bg-input, rgba(255,255,255,.06)); border: 1px solid var(--border);
                              border-radius: 6px; color: var(--text); font-size: 12px; padding: 6px 9px; }
.delta-search-input        { width: 220px; }
.delta-params-table-wrap   { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.delta-params-table        { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 12px; }
.delta-params-table th     { text-align: left; padding: 8px 10px; color: var(--text-muted); font-size: 10px;
                              letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--border);
                              background: rgba(255,255,255,.02); }
.delta-params-table td     { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.04)); }
.delta-params-table tbody tr:nth-child(odd) td { background: rgba(255,255,255,.015); }
.delta-params-table tbody tr:hover td { background: rgba(255,255,255,.03); }
.delta-params-table tbody tr:last-child td { border-bottom: none; }
.delta-asset               { color: var(--text); font-weight: 600; white-space: nowrap; }
.delta-asset-pill          { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px;
                              border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); }
.delta-asset-volume .delta-asset-pill { background: rgba(234,179,8,.14); border-color: rgba(234,179,8,.28); }
.delta-asset-ph .delta-asset-pill { background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.28); }
.delta-asset-tds .delta-asset-pill { background: rgba(59,130,246,.14); border-color: rgba(59,130,246,.28); }
.delta-asset-temp .delta-asset-pill,
.delta-asset-current-temp .delta-asset-pill,
.delta-asset-set-temp .delta-asset-pill,
.delta-asset-condenser-temp .delta-asset-pill { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.24); }
.delta-asset-pressure .delta-asset-pill,
.delta-asset-compressor-pressure .delta-asset-pill { background: rgba(168,85,247,.14); border-color: rgba(168,85,247,.28); }
.delta-metric              { color: var(--text); white-space: nowrap; }
.delta-metric-name         { font-weight: 600; }
.delta-unit                { color: var(--text-muted); font-size: 10px; margin-left: 4px; }
.delta-params-input        { width: 88px; background: var(--bg-input, rgba(255,255,255,.06));
                              border: 1px solid var(--border); border-radius: 6px; color: var(--text);
                              font-size: 12px; padding: 6px 8px; }
.delta-params-empty        { color: var(--text-muted); display: inline-block; width: 88px; text-align: center; }
.delta-message-input       { width: 280px; }

/* Toggle switch */
.settings-toggle           { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.settings-toggle input     { opacity: 0; width: 0; height: 0; }
.settings-toggle-slider    { position: absolute; inset: 0; background: rgba(255,255,255,.12);
                              border-radius: 22px; transition: background .2s; }
.settings-toggle-slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: var(--text-muted); border-radius: 50%; transition: transform .2s, background .2s;
}
.settings-toggle input:checked + .settings-toggle-slider { background: var(--accent, #3b82f6); }
.settings-toggle input:checked + .settings-toggle-slider::before {
  transform: translateX(18px); background: #fff;
}

/* Save banner */
.settings-save-banner      { padding: .6rem 1rem; border-radius: 6px; font-size: 13px; margin-bottom: 1rem; }
.settings-save-ok          { background: rgba(52,211,153,.15); color: #34d399; border: 1px solid rgba(52,211,153,.3); }
.settings-save-err         { background: rgba(239,68,68,.15);  color: #f87171;  border: 1px solid rgba(239,68,68,.3); }

/* RAPT Status card */
.settings-status-card      { background: var(--bg-card, rgba(255,255,255,.04)); border: 1px solid var(--border);
                              border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.settings-status-header    { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.settings-status-title     { font-size: 13px; font-weight: 600; color: var(--text); }
.settings-status-body      { display: flex; flex-direction: column; gap: .35rem; }
.settings-status-row       { display: flex; gap: 1rem; font-size: 12px; }
.settings-status-lbl       { color: var(--text-muted); width: 180px; flex-shrink: 0; }
.settings-status-val       { color: var(--text); }
.settings-status-error .settings-status-val { color: #f87171; }
.backup-status-card        { display: flex; flex-direction: column; gap: 1rem; }
.backup-status-grid        { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; }
.backup-status-columns     { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.backup-status-panel       { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 8px; padding: .9rem 1rem; }
.backup-status-panel-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .75rem; }
.backup-state-pill         { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .18rem .55rem; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.backup-state-ok           { background: rgba(52,211,153,.16); color: #34d399; border: 1px solid rgba(52,211,153,.25); }
.backup-state-warn         { background: rgba(251,191,36,.15); color: #fbbf24; border: 1px solid rgba(251,191,36,.25); }
.backup-state-err          { background: rgba(239,68,68,.16); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.backup-state-offline      { background: rgba(239,68,68,.16); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.backup-state-pending      { background: rgba(96,165,250,.15); color: #60a5fa; border: 1px solid rgba(96,165,250,.25); }
.backup-snapshot-list      { display: flex; flex-direction: column; gap: .65rem; }
.backup-snapshot-row       { padding-bottom: .65rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.backup-snapshot-row:last-child { padding-bottom: 0; border-bottom: none; }
.backup-snapshot-main      { font-size: 12px; color: var(--text); word-break: break-word; }
.backup-snapshot-sub       { margin-top: .2rem; font-size: 11px; color: var(--text-muted); word-break: break-word; }
.backup-restore-fields     { align-items: flex-start; flex-wrap: wrap; }
.backup-restore-check      { display: inline-flex; align-items: center; gap: .45rem; min-height: 34px; color: var(--text); font-size: 12px; }
.backup-restore-check input { margin: 0; }

/* Notion sync status mini-cards */
.notion-sync-cards         { display: flex; gap: 12px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.notion-sync-card          { flex: 1; min-width: 200px; background: var(--bg-card, rgba(255,255,255,.04));
                              border: 1px solid var(--border); border-radius: 8px; padding: .85rem 1rem; }
.notion-sync-card-title    { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: .55rem; }
.notion-sync-card-meta     { display: flex; align-items: center; gap: 8px; margin-bottom: .45rem; }
.notion-sync-mode-badge    { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
                              padding: 2px 7px; border-radius: 4px; }
.notion-sync-mode-background { background: rgba(52,211,153,.15); color: #34d399; border: 1px solid rgba(52,211,153,.25); }
.notion-sync-mode-browser   { background: rgba(96,165,250,.15); color: #60a5fa; border: 1px solid rgba(96,165,250,.25); }
.notion-sync-interval      { font-size: 11px; color: var(--text-muted); }
.notion-sync-last          { display: flex; gap: 6px; font-size: 11px; align-items: baseline; }
.notion-sync-last-lbl      { color: var(--text-dim, var(--text-muted)); flex-shrink: 0; }
.notion-sync-last-val      { color: var(--text); font-variant-numeric: tabular-nums; }
.notion-sync-result-ok       { color: #34d399; }
.notion-sync-result-mismatch { color: #fbbf24; }
.notion-sync-result-skipped  { color: var(--text-muted); }
.notion-sync-spinner       { font-size: 14px; color: var(--text-muted); margin-left: 6px; }
.admin-sync-btn-sm         { padding: 4px 10px; font-size: 11px; }

/* Sync badges (reuse pattern from fermenters) */
.sync-badge                { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
                              padding: 2px 8px; border-radius: 10px; }
.sync-badge-ok             { background: rgba(52,211,153,.15); color: #34d399; }
.sync-badge-warn           { background: rgba(251,191,36,.15);  color: #fbbf24; }
.sync-badge-error          { background: rgba(239,68,68,.15);   color: #f87171; }
/* ─────────────────────────────────────────────────────────── */

/* ── Back-to-top button ── */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 999;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover { transform: translateY(-2px); }

/* ── Admin Settings ───────────────────────────────────────── */
.admin-settings-form   { max-width: 560px; display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1rem; }
.admin-settings-group  { display: flex; flex-direction: column; gap: 6px; }
.admin-settings-label  { font-size: 12px; font-weight: 600; text-transform: uppercase;
                         letter-spacing: .06em; color: var(--text-muted); }
.admin-settings-input  { max-width: 420px; }
.admin-settings-field-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.admin-settings-test-btn  { flex-shrink: 0; }
.admin-settings-actions   { display: flex; align-items: center; gap: 12px; padding-top: 4px; }

@media (max-width: 900px) {
  .backup-status-grid,
  .backup-status-columns {
    grid-template-columns: 1fr;
  }

  .backup-status-card .settings-status-row {
    flex-direction: column;
    gap: .2rem;
  }

  .backup-status-card .settings-status-lbl {
    width: auto;
  }
}

/* ── Profile page — 2-column grid ──────────────────────────── */
.profile-saved-banner { margin-bottom: 12px; font-size: 13px; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 720px) {
  .profile-grid { grid-template-columns: 1fr; }
  .admin-tab { padding: 8px 12px; }
  .delta-params-table { min-width: 640px; }
  .delta-toolbar-group-search { margin-left: 0; width: 100%; }
  .delta-search-input { width: 100%; }
}
.profile-col { display: flex; flex-direction: column; gap: 14px; }

.profile-card { padding: 16px 18px; }

/* Avatar block at top of left card */
.profile-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 4px;
}
.profile-avatar-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-card-2);
  border: 2px solid var(--border);
  margin-bottom: 10px;
}
.profile-avatar-img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar-initials {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700;
  color: var(--accent); background: var(--accent-dim);
}
.profile-avatar-name { font-size: 16px; font-weight: 700; color: var(--text); }
.profile-avatar-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; text-transform: capitalize; }

.profile-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* Fields */
.profile-field { margin-bottom: 14px; }
.profile-field:last-child { margin-bottom: 0; }
.profile-staffid-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-staffid-badge {
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-muted); background: var(--bg-card, rgba(255,255,255,.06));
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 10px;
  letter-spacing: .04em;
}
.profile-label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 6px;
}
.profile-hint {
  font-size: 11px; color: var(--text-muted);
  font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px;
}
.profile-input {
  width: 100%;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
  box-sizing: border-box;
}
.profile-input:focus { outline: none; border-color: var(--accent); }

/* Toggles */
.profile-toggle-group { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-toggle-btn {
  padding: 7px 16px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 13px; font-family: var(--font);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.profile-toggle-btn:hover { border-color: var(--border-light); color: var(--text); }
.profile-toggle-active {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-dim) !important;
  font-weight: 600;
}

/* Save button */
.profile-save-btn {
  display: block; width: 100%;
  height: 40px;
  background: var(--accent); color: #0e1117;
  font-size: 13px; font-weight: 700;
  border: none; border-radius: 6px;
  cursor: pointer; font-family: var(--font);
  transition: opacity .15s;
}
.profile-save-btn:hover { opacity: 0.85; }

/* PIN card */
.profile-input--pin {
  max-width: 140px;
  text-align: center;
  letter-spacing: 6px;
  font-size: 20px;
}
.profile-pin-btn {
  display: block; width: 100%;
  height: 42px; margin-top: 4px;
  background: var(--accent); color: #0e1117;
  border: none; border-radius: 6px;
  font-size: 14px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: opacity .15s;
}
.profile-pin-btn:hover { opacity: 0.85; }

/* ── Water Monitoring page ──────────────────────────────────── */
.wm-last-logged { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.wm-log-btn {
  padding: 6px 14px; background: var(--accent); color: #0e1117;
  font-size: 12px; font-weight: 700; border-radius: 5px;
  text-decoration: none; transition: opacity .15s;
}
.wm-log-btn:hover { opacity: 0.85; }
.wm-tank-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .wm-tank-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
.wm-tank-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wm-tank-card.wm-tank-alarm { border-color: rgba(239,68,68,0.5); }
.wm-tank-top { display: flex; align-items: flex-end; gap: 10px; }
.wm-tank-svg-wrap { width: 56px; flex-shrink: 0; }
.wm-tank-svg-wrap .dl-tank-svg { width: 100%; }
.wm-tank-trend { font-size: 13px; font-weight: 700; margin-left: 4px; vertical-align: middle; }
.wm-trend-up   { color: #60a5fa; }
.wm-trend-down { color: #f59e0b; }
.wm-trend-flat { color: var(--text-muted); }
.wm-tank-info { flex: 1; min-width: 0; }
.wm-tank-name { font-size: 11px; font-weight: 600; color: var(--text-dim); line-height: 1.3; }
.wm-tank-vol  { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 2px; }
.wm-tank-readings {
  display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid var(--border); padding-top: 7px;
}
.wm-tank-reading { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; }
.wm-tank-reading-lbl { color: var(--text-muted); }
.wm-tank-reading-val { font-weight: 600; color: var(--text); }
.wm-val-warn { color: #f59e0b; }
.wm-tank-alarm-tag { font-size: 11px; color: #ef4444; }

.wm-filter-card { margin-bottom: 16px; }
.wm-filter-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 8px; text-transform: none; }
.wm-filter-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.wm-filter-table-wrap::-webkit-scrollbar { height: 4px; }
.wm-filter-table-wrap::-webkit-scrollbar-track { background: transparent; }
.wm-filter-table-wrap::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.wm-filter-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 540px; }
.wm-filter-table th {
  text-align: left; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding: 4px 8px 8px;
  border-bottom: 1px solid var(--border);
}
.wm-filter-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wm-filter-table tr:last-child td { border-bottom: none; }
.wm-filter-name { font-weight: 600; color: var(--text); }
.wm-filter-interval, .wm-filter-date, .wm-filter-age { color: var(--text-dim); }
.wm-filter-due  td { background: rgba(239,68,68,0.05); }
.wm-filter-near td { background: rgba(245,158,11,0.05); }
.wm-filter-status { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.wm-status-ok      { color: #22c55e; background: rgba(34,197,94,0.12); }
.wm-status-near    { color: #f59e0b; background: rgba(245,158,11,0.12); }
.wm-status-due     { color: #ef4444; background: rgba(239,68,68,0.12); }
.wm-status-unknown { color: var(--text-muted); background: var(--bg-card-2); }
.wm-filter-form { display: flex; align-items: center; gap: 6px; }
.wm-filter-date-input {
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); padding: 4px 6px;
  font-size: 12px; font-family: var(--font);
}
.wm-filter-save-btn {
  padding: 4px 10px; background: var(--bg-card-2);
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--accent); font-size: 11px; font-weight: 600;
  font-family: var(--font); cursor: pointer; white-space: nowrap;
}
.wm-filter-save-btn:hover { border-color: var(--accent); }

/* ── Brewery Floor stub pages ───────────────────────────────── */
.floor-stub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  max-width: 480px;
}
.floor-stub-icon  { font-size: 48px; margin-bottom: 14px; }
.floor-stub-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.floor-stub-msg   { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════
   DETAILED FERMENTER VIEW  (fvdl- prefix)
   ══════════════════════════════════════════════════════════ */

/* ── Jump list ─────────────────────────────────────────── */
.fvdl-jumplist {
  display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap; margin-bottom: 10px; padding: 6px 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
}
.fvdl-jump-lbl { font-size: 10px; color: var(--text-muted); margin-right: 4px; white-space: nowrap; }
.fvdl-jump-btn {
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 5px; border: 1px solid var(--border);
  color: var(--text-dim); background: var(--bg-card-2);
  text-decoration: none; transition: all 0.12s; cursor: pointer;
}
.fvdl-jump-btn:hover { color: var(--text); border-color: var(--text-dim); text-decoration: none; }
.fvdl-jump-btn.j-op   { border-left: 3px solid var(--accent); }
.fvdl-jump-btn.j-cip  { border-left: 3px solid var(--c-cip); color: var(--c-cip); }
.fvdl-jump-btn.j-emp  { border-left: 3px solid var(--c-empty); opacity: 0.6; }
.fvdl-jump-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }

/* ── Filter bar ─────────────────────────────────────────── */
.fvdl-bar {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.fvdl-filter-pills { display: flex; gap: 4px; }
.fvdl-pill {
  font-size: 11px; font-weight: 600; padding: 4px 11px;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-dim);
  cursor: pointer; transition: all 0.12s;
}
.fvdl-pill:hover { border-color: var(--accent); color: var(--accent); }
.fvdl-pill-active { background: rgba(245,166,35,0.12); border-color: rgba(245,166,35,0.4); color: var(--accent); }
.fvdl-sort-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.fvdl-sort-label { font-size: 11px; color: var(--text-muted); }
.fvdl-sort-select {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text-dim); font-size: 11px; padding: 3px 8px;
}

/* ── Row card — 4-col × 2-row grid ─────────────────────── */
.fvdl-list { display: flex; flex-direction: column; gap: 10px; }
.fvdl-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  border-left: 3px solid var(--border);
  scroll-margin-top: 14px;
  display: grid;
  grid-template-columns: 120px 195px 1fr 285px;
  grid-template-rows: minmax(280px, 580px) auto;
}
.fvdl-row.fvdl-op  { border-left-color: var(--accent); }
.fvdl-row.fvdl-cip { border-left-color: var(--c-cip); }
.fvdl-row.fvdl-emp { border-left-color: var(--c-empty); opacity: 0.55; }
.fvdl-row.fvdl-mnt { border-left-color: var(--c-maintenance); }

/* ── Col 1: left panel ──────────────────────────────────── */
.fvdl-left {
  grid-column: 1; grid-row: 1;
  display: flex; flex-direction: column; align-items: center;
  border-right: 1px solid var(--border);
  background: var(--bg-card-2); padding-bottom: 8px;
}
.fvdl-fv-id-above {
  font-size: 15px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--accent); padding: 10px 0 4px; text-align: center;
  width: 100%; cursor: pointer;
}
.fvdl-fv-id-above:hover { opacity: 0.75; }
.fvdl-icon { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 4px 4px; }
.fvdl-icon svg { width: 84px; height: auto; }
.fvdl-stage-below { display: flex; justify-content: center; padding: 5px 6px 4px; }
.fvdl-stage-below .tank-stage { font-size: 10px !important; font-weight: 700 !important; padding: 3px 8px !important; text-align: center; white-space: normal !important; overflow: visible !important; text-overflow: initial !important; max-width: 100px; line-height: 1.3; }
.fvdl-rapt-label {
  font-size: 9px; font-weight: 900; letter-spacing: 0.14em;
  font-family: 'Courier New', monospace; color: #a78bfa; padding: 2px 0;
}

/* ── Col 2: data ────────────────────────────────────────── */
.fvdl-data {
  grid-column: 2; grid-row: 1;
  padding: 10px 10px 10px 12px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0;
}
.fvdl-beer-name-big {
  font-size: 15px; font-weight: 700; color: var(--text);
  line-height: 1.2; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fvdl-batch-sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
a.fvdl-batch-sub {
  color: var(--text);
  text-decoration: none;
}
a.fvdl-batch-sub:hover,
a.fvdl-batch-sub:visited,
a.fvdl-batch-sub:active,
a.fvdl-batch-sub:focus {
  color: var(--text);
  text-decoration: none;
}
.fvdl-sg-flow { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.fvdl-sg-item { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.fvdl-sg-lbl { font-size: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.fvdl-sg-val { font-size: 12px; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.fvdl-sg-val.now { color: var(--accent); font-size: 13px; }
.fvdl-sg-arrow { color: var(--text-muted); font-size: 10px; padding-top: 10px; }
.fvdl-data-sep { height: 1px; background: var(--border); margin: 5px 0; }

/* Data rows — icon + value + note */
.fvdl-data-rows { display: flex; flex-direction: column; gap: 0; }
.fd-row {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; padding: 2px 0; white-space: nowrap;
}
.fd-icon { color: var(--text-muted); width: 16px; text-align: center; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.fd-icon svg { opacity: 0.7; }
.fd-val  { font-weight: 600; color: var(--text); }
.fd-note { font-size: 11px; color: var(--text-muted); }
.fd-delta { font-size: 10px; font-weight: 700; color: #ef4444; }
.fd-ok   { color: #22c55e; }
.fd-warn { color: #f59e0b; }
.fd-crit { color: #ef4444; }

/* Log table link */
.fvdl-log-link {
  font-size: 10px; font-weight: 600; color: var(--accent);
  cursor: pointer; text-decoration: none; letter-spacing: 0.02em;
  white-space: nowrap;
}
.fvdl-log-link:hover { text-decoration: underline; }
.fvdl-log-link-mob { display: inline; margin-left: auto; }

/* ── Quick entry ─────────────────────────────────────────── */
.fvdl-quick-entry {
  margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
}
.fvdl-type-row { display: flex; gap: 4px; flex-wrap: wrap; }
.fvdl-note-row, .bt-note-row { display: none; }
.fvdl-note-input, .bt-note-input { width: 100% !important; box-sizing: border-box; }
.fvdl-quick-entry.fvdl-qe-note-mode .fvdl-qe-inputs { display: none; }
.fvdl-quick-entry.fvdl-qe-note-mode .fvdl-note-row { display: flex; }
.bt-quick-entry.bt-qe-note-mode .bt-qe-inputs { display: none; }
.bt-quick-entry.bt-qe-note-mode .bt-note-row { display: flex; }
.fvdl-qe-lbl { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.fvdl-qe-inputs { display: flex; gap: 4px; flex-wrap: wrap; }
.fvdl-qe-input {
  width: 60px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-size: 11px; padding: 3px 6px;
  outline: none; font-family: inherit; -moz-appearance: textfield;
}
.fvdl-qe-input::-webkit-inner-spin-button { display: none; }
.fvdl-qe-input:focus { border-color: var(--accent); }
.fvdl-qe-input::placeholder { color: var(--text-muted); font-size: 9.5px; }
.fvdl-qe-btns { display: flex; align-items: center; gap: 8px; }
.fvdl-qe-btn {
  background: rgba(245,166,35,.15); border: 1px solid rgba(245,166,35,.3);
  color: var(--accent); font-size: 10px; font-weight: 700;
  padding: 4px 12px; border-radius: 4px; cursor: pointer;
}
.fvdl-qe-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}
.fvdl-qe-status {
  min-height: 14px;
  font-size: 11px;
  color: var(--text-muted);
}
.fvdl-qe-status.is-ok { color: #34d399; }
.fvdl-qe-status.is-error { color: #fca5a5; }

/* ── Col 3: graph ───────────────────────────────────────── */
.fvdl-graph {
  grid-column: 3; grid-row: 1;
  display: flex; flex-direction: column;
  padding: 10px 12px 8px; min-width: 0;
  border-right: 1px solid var(--border);
}
.fvdl-canvas-wrap { flex: 1; position: relative; min-height: 220px; }
.fvdl-canvas-wrap canvas {
  position: absolute; top: 0; left: 0;
  width: 100% !important; height: 100% !important;
}
.fvdl-no-data-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted); font-style: italic;
  background: rgba(0,0,0,0.02); pointer-events: none;
}
.fvdl-all-pills {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-top: 7px; padding-top: 7px;
  border-top: 1px solid var(--border); align-items: center;
}
.fvdl-pill-sep { width: 1px; height: 14px; background: var(--border); margin: 0 2px; flex-shrink: 0; }
.fvdl-tog-pill {
  font-size: 10px; font-weight: 600; padding: 3px 9px;
  border-radius: 12px; border: 1px solid var(--border);
  background: none; color: var(--text-muted);
  cursor: pointer; letter-spacing: 0.03em; transition: all 0.12s;
  display: flex; align-items: center; gap: 4px;
}
.fvdl-tog-pill:hover { border-color: var(--text-dim); color: var(--text-dim); }
.fvdl-tog-pill.active { color: #0e1117; border-color: transparent; }
.fvdl-tog-pill .pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fvdl-tog-pill .pill-dash {
  width: 10px; height: 2px; border-radius: 1px; flex-shrink: 0;
  border-top: 2px dashed currentColor; background: none;
}

/* ── Col 4: activity log ────────────────────────────────── */
.fvdl-activity {
  grid-column: 4; grid-row: 1 / 3;
  display: flex; flex-direction: column; overflow: hidden;
  border-left: 1px solid var(--border);
  min-height: 0;
  max-height: 680px;
}
/* Header — 2 rows */
.fvdl-act-hdr {
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.fvdl-act-row1 {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px 5px;
  border-bottom: 1px solid rgba(42,48,80,.4);
}
.fvdl-act-title {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted);
}
.fvdl-act-src { font-size: 9px; color: var(--text-muted); }
.fvdl-act-row2 {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 5px 10px; background: var(--bg-card-2);
}
.fvdl-chip {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); color: var(--text-muted); background: none;
  transition: all 0.12s;
}
.fvdl-chip.on { color: #0e1117; border-color: transparent; }
.fvdl-chip.c-task.on   { background: #f59e0b; }
.fvdl-chip.c-status.on { background: #7c3aed; }
.fvdl-chip.c-temp.on   { background: #0ea5e9; }
.fvdl-chip.c-read.on   { background: #22c55e; }
.fvdl-chip.c-note.on   { background: #3b82f6; }

/* Feed list */
.fvdl-feed-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  min-height: 0;
  scrollbar-width: thin; scrollbar-color: rgba(90,110,180,0.6) rgba(0,0,0,0.2);
}
.fvdl-feed-list::-webkit-scrollbar { width: 6px; }
.fvdl-feed-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.fvdl-feed-list::-webkit-scrollbar-thumb { background: rgba(90,110,180,0.6); border-radius: 3px; }
.fvdl-feed-list::-webkit-scrollbar-thumb:hover { background: rgba(110,140,220,0.8); }
.fvdl-feed-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-muted); font-style: italic; padding: 20px;
}
.fvdl-feed-item {
  display: flex; gap: 8px; padding: 7px 10px;
  border-bottom: 1px solid rgba(42,48,80,0.5);
  transition: background 0.1s; cursor: pointer;
}
.fvdl-feed-item:hover { background: rgba(255,255,255,0.025); }
.fvdl-feed-item.done-item { opacity: 0.5; }
.fvdl-feed-bar { width: 3px; border-radius: 2px; flex-shrink: 0; align-self: stretch; min-height: 28px; }
.fbar-note { background: #3b82f6; } .fbar-task { background: #f59e0b; }
.fbar-done { background: #22c55e; } .fbar-status { background: #7c3aed; }
.fbar-temp { background: #0ea5e9; } .fbar-read  { background: #22c55e; }
.fvdl-feed-inner { flex: 1; min-width: 0; }
.fvdl-feed-top { display: flex; align-items: center; gap: 5px; margin-bottom: 1px; flex-wrap: wrap; }
.fvdl-feed-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 1px 5px; border-radius: 3px;
}
.fb-note { background: rgba(59,130,246,.15); color: #7ab8f5; }
.fb-task { background: rgba(245,158,11,.15); color: #fbbf24; }
.fb-done { background: rgba(34,197,94,.12); color: #86efac; }
.fb-stat { background: rgba(124,58,237,.15); color: #b08bff; }
.fb-temp { background: rgba(14,165,233,.15); color: #7dd3fc; }
.fb-read { background: rgba(34,197,94,.15); color: #86efac; }
.fvdl-feed-src { font-size: 9px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.fvdl-fold-btn {
  font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 3px; cursor: pointer;
  background: rgba(34,197,94,.1); color: #86efac; border: 1px solid rgba(34,197,94,.2);
  white-space: nowrap; flex-shrink: 0;
}
.fvdl-fold-btn:hover { background: rgba(34,197,94,.2); }
.fvdl-feed-child { opacity: 0.85; }
.fvdl-feed-body { font-size: 11px; color: var(--text-dim); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
.fvdl-feed-body strong { color: var(--text); }
.fvdl-feed-body .ov { color: var(--text-muted); text-decoration: line-through; margin-right: 3px; }
.fvdl-feed-body .nv { color: var(--accent); font-weight: 600; }
.fvdl-feed-time { font-size: 9px; color: var(--text-muted); margin-top: 1px; }
.fvdl-add-note {
  padding: 6px 10px; border-top: 1px solid var(--border);
  background: var(--bg-card-2); display: flex; gap: 6px; align-items: flex-end;
}
.fvdl-note-input {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text); font-size: 11px; padding: 5px 8px;
  resize: none; min-height: 28px; outline: none; font-family: inherit;
}
.fvdl-note-input:focus { border-color: var(--accent); }
.fvdl-note-btn {
  background: rgba(245,166,35,.15); border: 1px solid rgba(245,166,35,.3);
  color: var(--accent); font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 5px; cursor: pointer;
}

/* ── Row 2: today's task + pipeline ─────────────────────── */
.fvdl-bottom-task {
  grid-column: 1 / 3; grid-row: 2;
  padding: 8px 10px;
  border-top: 1px solid var(--border); border-right: 1px solid var(--border);
  background: var(--bg-card-2);
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; transition: background 0.1s; min-height: 60px;
}
.fvdl-bottom-task:hover { background: rgba(255,255,255,.025); }
.fvdl-pipeline-area {
  grid-column: 3; grid-row: 2;
  padding: 8px 12px;
  border-top: 1px solid var(--border); border-right: 1px solid var(--border);
  background: var(--bg-card-2); overflow: hidden;
}
.fvdl-today-hdr {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.fvdl-today-hdr::after { content: '↗'; opacity: .45; }
.fvdl-today-task-text {
  font-size: 11px; font-weight: 500; color: var(--text);
  background: rgba(245,166,35,.07); border: 1px solid rgba(245,166,35,.2);
  border-radius: 4px; padding: 4px 7px; line-height: 1.35;
}
.fvdl-no-task-txt { font-size: 11px; color: var(--text-muted); font-style: italic; padding: 2px 0; }

/* Pipeline steps */
.fvdl-pipeline-steps { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0; }
.fvdl-s { display: flex; align-items: flex-start; flex-shrink: 0; }
.fvdl-sn { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 52px; }
.fvdl-sc {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-muted); font-weight: 700; flex-shrink: 0;
  cursor: default;
}
.fvdl-sc.done    { background: rgba(34,197,94,.15); border-color: var(--c-operating); color: var(--c-operating); }
.fvdl-sc.current { background: rgba(245,166,35,.15); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px rgba(245,166,35,.18); animation: pstep 2s infinite; }
.fvdl-sc.future  { opacity: 0.35; }
@keyframes pstep { 0%,100%{box-shadow:0 0 0 3px rgba(245,166,35,.18)}50%{box-shadow:0 0 0 5px rgba(245,166,35,.06)} }
.fvdl-sl { font-size: 8px; color: var(--text-muted); text-align: center; line-height: 1.2; white-space: normal; max-width: 62px; overflow-wrap: break-word; }
.fvdl-sl.done    { color: var(--c-operating); font-weight: 600; }
.fvdl-sl.current { color: var(--accent); font-weight: 700; }
.fvdl-sc-wrap { height: 28px; display: flex; align-items: center; justify-content: center; }
.fvdl-conn { width: 14px; height: 2px; background: var(--border); flex-shrink: 0; margin-top: 13px; }
.fvdl-conn.done { background: rgba(34,197,94,.4); }

/* ── Collapsed rows ──────────────────────────────────────── */
.fvdl-row:has(.fvdl-row-collapsed) { display: block; }
.fvdl-row-collapsed { display: flex; align-items: center; padding: 10px 14px; gap: 12px; min-height: 52px; }
.fvdl-coll-svg { width: 26px; height: 44px; opacity: 0.4; }
.fvdl-coll-id  { font-size: 12px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.06em; }

/* ── Pipeline tooltip ────────────────────────────────────── */
.fvdl-pstep-tip {
  display: none; position: fixed; z-index: 300;
  background: rgba(14,17,23,.97); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 10px; font-size: 10px;
  pointer-events: none; max-width: 190px; line-height: 1.5;
  box-shadow: 0 4px 14px rgba(0,0,0,.5); color: var(--text-dim);
}
.fvdl-pstep-tip strong { color: var(--text); display: block; margin-bottom: 2px; font-size: 11px; }

/* ── Global modal ────────────────────────────────────────── */
.fvdl-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
}
.fvdl-modal-overlay.open { display: flex; }
.fvdl-modal-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; width: min(96vw, 1120px); max-height: 86vh;
  overflow-y: auto; box-shadow: 0 20px 44px rgba(0,0,0,.55);
}
.fvdl-modal-hdr {
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.fvdl-modal-title { font-size: 13px; font-weight: 700; color: var(--text); }
.fvdl-modal-close { font-size: 20px; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 0 2px; line-height: 1; }
.fvdl-modal-close:hover { color: var(--text); }
.fvdl-modal-body { padding: 14px 16px; }
.fvdl-modal-body p { font-size: 12px; color: var(--text-dim); margin: 0 0 10px; line-height: 1.5; }
.m-field { margin-bottom: 10px; }
.m-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.m-val { font-size: 13px; font-weight: 600; color: var(--text); }
.m-input {
  width: 100%; background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text); font-size: 12px; padding: 6px 9px;
  outline: none; font-family: inherit; box-sizing: border-box;
}
.m-input:focus { border-color: var(--accent); }
.m-btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.m-btn-g { background:rgba(34,197,94,.15); border:1px solid rgba(34,197,94,.3); color:#22c55e; font-size:12px; font-weight:600; padding:7px 14px; border-radius:6px; cursor:pointer; }
.m-btn-p { background:rgba(245,166,35,.15); border:1px solid rgba(245,166,35,.3); color:var(--accent); font-size:12px; font-weight:600; padding:7px 14px; border-radius:6px; cursor:pointer; }
.m-btn-s { background:none; border:1px solid var(--border); color:var(--text-muted); font-size:12px; padding:7px 12px; border-radius:6px; cursor:pointer; }
.m-tbl { width:100%; border-collapse:collapse; font-size:11px; }
.m-tbl th { text-align:left; padding:4px 8px; color:var(--text-muted); font-size:9px; font-weight:700; text-transform:uppercase; border-bottom:1px solid var(--border); }
.m-tbl td { padding:5px 8px; border-bottom:1px solid rgba(42,48,80,.4); color:var(--text-dim); }
.m-tbl tr:hover td { background:rgba(255,255,255,.02); }
.m-edit-btn { display:inline-flex; align-items:center; background:transparent; border:1px solid var(--border); color:var(--text-dim); border-radius:4px; padding:2px 5px; cursor:pointer; transition:color .1s,border-color .1s; }
.m-edit-btn:hover { border-color:var(--accent); color:var(--accent); }
.fvdl-log-modal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.fvdl-log-section { margin-bottom: 12px; }
.fvdl-log-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fvdl-log-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg-card-2);
}
.fvdl-log-chip-issue {
  color: #f5a623;
  border-color: rgba(245,166,35,.35);
  background: rgba(245,166,35,.12);
}
.fvdl-log-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.fvdl-log-empty { font-size: 12px; color: var(--text-muted); }
.fvdl-log-note-card {
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  border-radius: 8px;
  padding: 9px 10px;
}
.fvdl-log-note-top { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.fvdl-log-note-body { font-size: 12px; color: var(--text); line-height: 1.45; white-space: pre-wrap; }
.fvdl-log-table-wrap { overflow-x: auto; margin-top: 6px; }
.fvdl-log-table { min-width: 960px; }
.fvdl-log-main-row td { vertical-align: top; }
.fvdl-log-when { display: flex; align-items: center; gap: 8px; }
.fvdl-log-when-child { padding-left: 24px; }
.fvdl-log-expand-btn {
  flex: 0 0 auto;
  min-width: 36px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.fvdl-log-expand-btn:hover { border-color: var(--accent); }
.fvdl-log-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; }
.fvdl-log-fold { color: var(--accent); text-transform: none; margin-left: 6px; }
.fvdl-log-context-row td {
  background: rgba(255,255,255,.02);
  white-space: normal;
  padding-top: 7px;
  padding-bottom: 7px;
}
.fvdl-log-context-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-right: 10px;
}
.fvdl-log-context-row .fvdl-log-chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  vertical-align: middle;
}
.fvdl-log-note-row td {
  font-size: 11px;
  color: var(--text);
  background: rgba(255,255,255,.02);
  white-space: normal;
}
.fvdl-log-child-row td { background: rgba(255,255,255,.015); }
.fvdl-log-note-label { font-weight: 700; color: var(--text-muted); margin-right: 6px; }
.fvdl-log-act-cell { width: 54px; text-align: right; }
.fvdl-log-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.fvdl-log-edit-notes { min-height: 92px; resize: vertical; }
@media (max-width: 860px) {
  .fvdl-log-modal-meta,
  .fvdl-log-edit-grid { grid-template-columns: 1fr; }
}

/* ── Mobile-only today's task ────────────────────────────── */
.fvdl-mob-task {
  display: none; flex-direction: column; gap: 4px;
  padding: 8px 12px; background: var(--bg-card-2);
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.fvdl-mob-task:hover { background: rgba(255,255,255,.02); }

/* ── Mobile meta in left col ─────────────────────────────── */
.fvdl-left-mobile-meta { display: none; }
.fvdl-mob-fvid { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.fvdl-mob-beer { font-size: 12px; color: var(--text-dim); margin-top: 1px; }

/* ── Mobile responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .fvdl-row { display: flex; flex-direction: column; }
  .fvdl-left {
    flex-direction: row; align-items: center;
    padding: 8px 12px; gap: 10px;
    border-right: none; border-bottom: 1px solid var(--border); order: 1;
  }
  .fvdl-fv-id-above { display: none; }
  .fvdl-icon { flex: 0 0 auto; padding: 0; }
  .fvdl-icon svg { width: 48px; }
  .fvdl-stage-below { display: none; }
  .fvdl-left > .fvdl-rapt-label { display: none; }
  .fvdl-left-mobile-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .fvdl-data { border-right: none; border-bottom: 1px solid var(--border); order: 2; }
  /* 2-column data rows on mobile */
  .fvdl-data-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
  /* Log Table link stays visible on mobile too */
  .fvdl-qe-input { width: 44px; }
  .fvdl-mob-task { display: flex; order: 3; }
  .fvdl-canvas-wrap { min-height: 180px; }
  .fvdl-graph { border-right: none; border-bottom: 1px solid var(--border); order: 4; }
  .fvdl-activity { border-left: none; border-top: 1px solid var(--border); max-height: 300px; order: 5; }
  .fvdl-bottom-task { display: none; }
  .fvdl-pipeline-area { order: 6; border-right: none; }
  .fvdl-pipeline-steps { flex-wrap: wrap; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════
   BATCH TAB  (bt-*)
═══════════════════════════════════════════════════════════════════ */

/* ── Selector strip ─────────────────────────────────────────────── */
.bt-selector-wrap {
  padding: 10px 16px 8px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.bt-selector-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bt-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.bt-pill:hover { background: var(--surface-3); border-color: var(--accent); }
.bt-pill-active { background: var(--surface-3); border-color: var(--accent); color: var(--text-primary); }
.bt-pill-dim { opacity: .55; }
.bt-pill-fv  { font-weight: 700; font-size: 11px; color: var(--accent); letter-spacing: .04em; }
.bt-pill-sep { color: var(--text-muted); }
.bt-pill-batch { font-weight: 600; font-size: 11px; color: var(--text-secondary); }
.bt-pill-name  { font-size: 11px; color: var(--text-dim); }

/* ── Batch history link ─────────────────────────────────────────── */
.bt-hist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12px;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
}
.bt-hist-link { color: var(--accent); text-decoration: none; }
.bt-hist-link:hover { text-decoration: underline; }
.bt-hist-note { color: var(--text-muted); font-size: 11px; }

/* ── Empty state ────────────────────────────────────────────────── */
.bt-empty { padding: 40px 16px; text-align: center; }
.bt-empty-msg { color: var(--text-dim); font-size: 14px; }

/* ── Fermenter info card ────────────────────────────────────────── */
.bt-info-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.bt-info-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.bt-fv-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .06em;
}
.bt-info-main { flex: 1 1 180px; min-width: 0; }
.bt-info-beer-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.bt-info-batch-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.bt-info-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  flex: 2 1 220px;
}
.bt-stat { display: flex; flex-direction: column; min-width: 44px; }
.bt-stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.bt-stat-val { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.bt-stat-sub { font-size: 10px; color: var(--text-muted); }
.bt-info-links { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

/* ── Action row: task + quick entry + status ────────────────────── */
.bt-action-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.bt-today-block,
.bt-quick-entry,
.bt-status-form {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
}
.bt-status-form { border-right: none; }
.bt-today-hdr {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bt-tasks-link { font-size: 11px; color: var(--accent); text-decoration: none; font-weight: 600; margin-left: auto; }
.bt-tasks-link:hover { text-decoration: underline; }
.bt-today-text { font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.bt-no-task { font-size: 12px; color: var(--text-muted); font-style: italic; }
.bt-quick-entry { }
.bt-qe-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 6px; }
.bt-qe-inputs { display: flex; flex-wrap: wrap; gap: 4px; }
.bt-qe-btns { margin-top: 6px; }
.bt-qe-status { font-size: 11px; margin-top: 4px; min-height: 14px; }
.bt-qe-status.is-ok    { color: var(--ok-text,  #4ade80); }
.bt-qe-status.is-error { color: var(--warn-text, #f87171); }
.bt-status-select { width: 140px; margin-top: 4px; }

/* ── Pipeline strip ─────────────────────────────────────────────── */
.bt-pipeline {
  padding: 10px 16px;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

/* ── Chart section ──────────────────────────────────────────────── */
.bt-chart-section {
  padding: 14px 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.bt-chart-hdr {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── Activity feed ──────────────────────────────────────────────── */
.bt-activity {
  padding: 14px 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  max-height: 420px;
  overflow-y: auto;
}

/* ── Log table ──────────────────────────────────────────────────── */
.bt-log-table-section {
  padding: 14px 16px 24px;
  background: var(--surface-1);
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .bt-action-row { grid-template-columns: 1fr; }
  .bt-today-block,
  .bt-quick-entry,
  .bt-status-form { border-right: none; border-bottom: 1px solid var(--border); }
  .bt-status-form { border-bottom: none; }
  .bt-info-card { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════════════
   BREW SESSIONS  (bsess-*)
═══════════════════════════════════════════════════════════════════ */

/* ── List page ─────────────────────────────────────────────────── */
.bsess-new-btn {
  display: inline-block;
  padding: .42rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  transition: opacity .15s;
}
.bsess-new-btn:hover { opacity: .85; }

.bsess-filter-bar {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.bsess-search {
  flex: 1;
  min-width: 180px;
  max-width: 300px;
  padding: .42rem .75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .88rem;
}
.bsess-filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.bsess-chip {
  padding: .28rem .7rem;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .8rem;
  transition: background .12s, color .12s;
}
.bsess-chip:hover { background: var(--bg-hover); color: var(--text); }
.bsess-chip-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.bsess-beer-select {
  padding: .38rem .65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .85rem;
}

/* ── Session list table ────────────────────────────────────────── */
.bsess-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.bsess-table th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  padding: .4rem .65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.bsess-table td {
  padding: .55rem .65rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  vertical-align: middle;
}
.bsess-row { cursor: pointer; transition: background .1s; }
.bsess-row:hover td { background: var(--bg-card-2); }
.bsess-row-selected td { background: var(--accent-dim2) !important; }
.bsess-row:last-child td { border-bottom: none; }

.bsess-batch-code { font-family: monospace; font-size: .85rem; color: var(--accent); font-weight: 600; }
.bsess-double-tag {
  display: inline-block;
  margin-left: .35rem;
  padding: .05rem .3rem;
  background: var(--accent-dim2);
  border-radius: 3px;
  font-size: .7rem;
  color: var(--accent);
  vertical-align: middle;
}
.bsess-beer-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: .4rem;
  vertical-align: middle;
  flex-shrink: 0;
}
.bsess-beer-dot-lg { width: 14px; height: 14px; }
.bsess-beer-name { vertical-align: middle; }
.bsess-date, .bsess-fv, .bsess-og { color: var(--text-dim); font-size: .83rem; }
.bsess-vol { font-weight: 600; }

.bsess-empty {
  color: var(--text-dim);
  padding: 2rem 0;
  text-align: center;
  font-size: .9rem;
}
.bsess-link { color: var(--accent); text-decoration: none; }
.bsess-link:hover { text-decoration: underline; }
.bsess-count { font-size: .78rem; color: var(--text-dim); margin-top: .75rem; text-align: right; }
.bsess-loading { color: var(--text-dim); padding: 1.5rem 0; text-align: center; font-size: .88rem; }

/* ── Status badges ─────────────────────────────────────────────── */
.bsess-status {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.bsess-status-planned    { background: var(--bg-card-2); color: var(--text-dim); }
.bsess-status-brewing    { background: color-mix(in srgb,#f5a623 15%,transparent); color: #f5a623; }
.bsess-status-fermenting { background: color-mix(in srgb,var(--accent) 15%,transparent); color: var(--accent); }
.bsess-status-kegged     { background: color-mix(in srgb,var(--green) 15%,transparent); color: var(--green); }
.bsess-status-archived   { background: transparent; color: var(--text-dim); opacity: .6; }

/* ── Right-panel detail ────────────────────────────────────────── */
.bsess-detail-wrap { padding: .25rem 0; }
.bsess-detail-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .85rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.bsess-detail-title { display: flex; align-items: center; gap: .65rem; }
.bsess-detail-batch { font-size: .95rem; font-weight: 700; font-family: monospace; color: var(--accent); }
.bsess-detail-beer  { font-size: .82rem; color: var(--text-dim); margin-top: .15rem; }
.bsess-detail-actions { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; }
.bsess-action-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .75rem;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: .8rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.bsess-action-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.bsess-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: .2rem;
}
.bsess-close-btn:hover { color: var(--text); }

.bsess-status-strip {
  display: flex;
  gap: .55rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.bsess-detail-fv {
  background: var(--bg-card-2);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .78rem;
  color: var(--accent);
  font-weight: 600;
  font-family: monospace;
}
.bsess-detail-meta { font-size: .78rem; color: var(--text-dim); }

.bsess-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
  margin-bottom: 1rem;
}
.bsess-stat {
  background: var(--bg-card-2);
  border-radius: 6px;
  padding: .45rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.bsess-stat-lbl { font-size: .7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.bsess-stat-val { font-size: .92rem; font-weight: 700; color: var(--text); }

.bsess-detail-section { margin-bottom: 1rem; }
.bsess-detail-section-hdr {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  margin-bottom: .45rem;
  padding-bottom: .25rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.04));
}
.bsess-detail-row { font-size: .85rem; color: var(--text); margin-bottom: .3rem; }
.bsess-detail-row-grid { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .83rem; color: var(--text-dim); }
.bsess-yeast-line { font-size: .85rem; color: var(--text); }
.bsess-notes-text { font-size: .82rem; color: var(--text-dim); line-height: 1.5; margin: .25rem 0; }

.bsess-mini-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.bsess-mini-table tr { border-bottom: 1px solid color-mix(in srgb, var(--border) 35%, transparent); }
.bsess-mini-table tr:last-child { border-bottom: none; }
.bsess-mini-table td { padding: .28rem .2rem; vertical-align: middle; }
.bsess-mini-ingredient { color: var(--text); }
.bsess-mini-qty { color: var(--accent); font-weight: 600; padding-left: .5rem; white-space: nowrap; }
.bsess-mini-meta { color: var(--text-dim); padding-left: .5rem; white-space: nowrap; }
.bsess-mini-sup { color: var(--text-dim); font-size: .75rem; }

.bsess-status-section { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.bsess-status-btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.bsess-status-btn {
  padding: .28rem .65rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: .78rem;
  transition: background .12s, color .12s;
}
.bsess-status-btn:hover { background: var(--bg-hover); color: var(--text); }
.bsess-status-btn-current { border-color: var(--accent); color: var(--accent); background: var(--accent-dim2); }
.bsess-status-btn-archived { color: var(--alert-dim, #f87171); border-color: var(--alert-dim, #f87171); }

/* ── Full form page ─────────────────────────────────────────────── */
.bsess-form-wrap { max-width: 1100px; }

.bsess-back-link {
  font-size: .82rem;
  color: var(--text-dim);
  text-decoration: none;
  margin-right: .75rem;
}
.bsess-back-link:hover { color: var(--text); }
.bsess-hdr-beer { font-size: .85rem; font-weight: 400; color: var(--text-dim); margin-left: .5rem; }

.bsess-save-banner {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 6px;
  padding: .55rem 1rem;
  font-size: .875rem;
  margin-bottom: 1rem;
}

/* Tab strip */
.bsess-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.bsess-tab {
  display: flex; flex: 0 0 auto; align-items: center; gap: 7px;
  padding: 8px 14px 9px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  font-family: var(--font);
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
  margin-bottom: -1px;
}
.bsess-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.bsess-tab:hover { color: var(--text); background: var(--bg-hover); }
.bsess-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bsess-tab-active { color: var(--accent); border-bottom-color: var(--accent); background: var(--accent-dim); }

/* Section visibility */
.bsess-section { padding-bottom: 1.5rem; }

.bsess-subsection-hdr {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  margin-bottom: .75rem;
  margin-top: .25rem;
}
.bsess-section-hint { font-size: .82rem; color: var(--text-dim); margin: -.4rem 0 .85rem; line-height: 1.5; }

/* Form grid */
.bsess-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.bsess-field { display: flex; flex-direction: column; gap: .3rem; }
.bsess-field label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
}
.bsess-req { color: var(--alert); }
.bsess-field-wide { grid-column: span 2; }
.bsess-field-full { grid-column: 1 / -1; }
.bsess-field-check { justify-content: flex-end; padding-bottom: .4rem; }

.bsess-input, .bsess-select {
  padding: .42rem .65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .88rem;
  width: 100%;
}
.bsess-input:focus, .bsess-select:focus {
  outline: none;
  border-color: var(--accent);
}
.bsess-textarea {
  padding: .55rem .75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .87rem;
  width: 100%;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.bsess-textarea:focus { outline: none; border-color: var(--accent); }
.bsess-textarea-urgent { border-color: var(--warning, #f59e0b); background: color-mix(in srgb, var(--warning, #f59e0b) 6%, var(--bg-card)); }
.bsess-textarea-urgent:focus { border-color: var(--warning, #f59e0b); }

.bsess-field-row { display: flex; gap: .4rem; align-items: center; }
.bsess-field-hint { font-size: .75rem; color: var(--accent); font-family: monospace; min-height: 1.2em; }
.bsess-suggest-btn {
  padding: .38rem .6rem;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .85rem;
  flex-shrink: 0;
}
.bsess-suggest-btn:hover { color: var(--accent); }

.bsess-check-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}
.bsess-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Minerals table */
.bsess-minerals-wrap { overflow-x: auto; }
.bsess-minerals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  min-width: 400px;
}
.bsess-minerals-table th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  padding: .4rem .65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.bsess-minerals-table td {
  padding: .4rem .5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  vertical-align: middle;
}
.bsess-minerals-table tr:last-child td { border-bottom: none; }
.bsess-mineral-name { font-size: .83rem; color: var(--text); min-width: 220px; }
.bsess-mineral-input {
  width: 80px;
  padding: .32rem .5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: .85rem;
  text-align: right;
}
.bsess-mineral-input:focus { outline: none; border-color: var(--accent); }

/* Dynamic ingredient tables */
.bsess-dynamic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .855rem;
  margin-bottom: .75rem;
}
.bsess-dynamic-table th {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  padding: .35rem .5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.bsess-dynamic-table td {
  padding: .3rem .4rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 35%, transparent);
  vertical-align: middle;
}
.bsess-dyn-row:last-child td { border-bottom: none; }

.bsess-dyn-input {
  width: 100%;
  min-width: 120px;
  padding: .3rem .45rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: .83rem;
}
.bsess-dyn-input:focus { outline: none; border-color: var(--accent); }
.bsess-dyn-input.bsess-dyn-sm  { min-width: 80px; }
.bsess-dyn-input.bsess-dyn-xs  { min-width: 55px; width: 65px; }
.bsess-dyn-select {
  padding: .3rem .4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: .8rem;
  width: 100%;
  min-width: 110px;
}

.bsess-add-row-btn {
  padding: .35rem .85rem;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .82rem;
  transition: border-color .12s, color .12s;
}
.bsess-add-row-btn:hover { border-color: var(--accent); color: var(--accent); }

.bsess-remove-row {
  padding: .2rem .45rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .78rem;
  transition: background .1s, color .1s;
}
.bsess-remove-row:hover { background: var(--alert); border-color: var(--alert); color: #fff; }

.bsess-mash-toolbar { display: flex; gap: .65rem; align-items: center; margin-bottom: .75rem; }
.bsess-tpl-btn {
  padding: .35rem .85rem;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .82rem;
  transition: background .12s, color .12s;
}
.bsess-tpl-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.bsess-mash-table-wrap { overflow-x: auto; }
.bsess-hops-table, .bsess-mash-table { min-width: 600px; }

/* Save bar */
.bsess-save-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding: .85rem 0;
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-top: 2rem;
}
.bsess-save-btn {
  padding: .5rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: opacity .15s;
}
.bsess-save-btn:hover { opacity: .87; }
.bsess-cancel-btn {
  padding: .5rem 1rem;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .88rem;
  cursor: pointer;
}
.bsess-cancel-btn:hover { color: var(--text); }
.bsess-form-error {
  background: color-mix(in srgb, var(--alert, #ef4444) 10%, transparent);
  border: 1px solid var(--alert, #ef4444);
  border-radius: 6px;
  color: var(--alert, #ef4444);
  font-size: .875rem;
  padding: .6rem 1rem;
  margin-bottom: .75rem;
}
.bsess-save-msg { min-height: 0; }
.rc-alpha-cell { white-space: nowrap; }
.rc-alpha-sep { color: var(--text-muted); font-size: .78rem; padding: 0 2px; user-select: none; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .bsess-filter-bar { flex-direction: column; align-items: stretch; }
  .bsess-search { max-width: 100%; }
  .bsess-form-grid { grid-template-columns: 1fr 1fr; }
  .bsess-field-wide { grid-column: span 2; }
  .bsess-table th:nth-child(5),
  .bsess-table td:nth-child(5),
  .bsess-table th:nth-child(6),
  .bsess-table td:nth-child(6) { display: none; }
}
@media (max-width: 600px) {
  .bsess-form-grid { grid-template-columns: 1fr; }
  .bsess-field-wide { grid-column: span 1; }
  .bsess-stats-grid { grid-template-columns: 1fr 1fr; }
  .bsess-table th:nth-child(4),
  .bsess-table td:nth-child(4) { display: none; }
}

/* ── Ingredient autocomplete (brew session form) ────────────────── */
.ing-wrap { position: relative; display: inline-block; width: 100%; }
.ing-wrap .ing-input { width: 100%; }
.ing-dd {
  position: absolute; top: 100%; left: 0; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--accent);
  border-radius: 0 0 6px 6px; min-width: 220px; max-width: 340px;
  max-height: 240px; overflow-y: auto; box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.ing-dd.hidden { display: none; }
.ing-opt {
  padding: .38rem .65rem; font-size: .855rem; cursor: pointer;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ing-opt:hover { background: var(--accent); color: #fff; }

/* ── Stock inventory — price column ─────────────────────────────── */
.inv-price      { font-weight: 600; font-size: .88rem; color: var(--text); }
.inv-price-unit { font-size: .78rem; color: var(--text-dim); }
.inv-price-cell { white-space: nowrap; }

/* ── Admin Settings — GitHub repo info panel ─────────────────────── */
.gh-info-section { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.2rem; }
.gh-info-section-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gh-info-refresh-btn { padding: 2px 10px; font-size: .78rem; margin-left: auto; }
.gh-info-cards { display: flex; gap: 12px; flex-wrap: wrap; margin: .8rem 0 1.2rem; }
.gh-info-card { flex: 1; min-width: 200px; background: var(--bg-card-alt, var(--bg-card)); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.gh-info-card-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.gh-repo-link { color: var(--accent); text-decoration: none; font-size: .9rem; font-weight: 600; word-break: break-all; }
.gh-repo-link:hover { text-decoration: underline; }
.gh-info-meta { font-size: .82rem; color: var(--text-dim); margin-top: 4px; }
.gh-info-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.gh-badge { font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: rgba(255,255,255,.07); color: var(--text-muted); }
.gh-badge-vis { background: rgba(139,92,246,.15); color: #a78bfa; }
.gh-deploy-ok { font-size: .85rem; color: #34d399; font-weight: 600; }
.gh-deploy-behind { font-size: .85rem; color: #f59e0b; }
.gh-branch-pill { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; vertical-align: middle; }
.gh-branch-main { background: rgba(99,102,241,.2); color: #818cf8; }
.gh-branch-stable { background: rgba(52,211,153,.15); color: #34d399; }
.gh-sha { font-family: monospace; font-size: .78rem; color: var(--accent); text-decoration: none; }
.gh-sha:hover { text-decoration: underline; }
.gh-sha-inline { font-family: monospace; font-size: .7rem; color: var(--text-dim); }
.gh-commit-msg { font-size: .82rem; color: var(--text); margin: 0 4px; }
.gh-age { font-size: .75rem; color: var(--text-dim); }
.gh-section { margin-bottom: 1.2rem; }
.gh-section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.gh-commits-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.gh-commits-table th { text-align: left; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); padding: 4px 8px; border-bottom: 1px solid var(--border); }
.gh-commits-table td { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: top; }
.gh-commit-msg-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.gh-author { color: var(--text-dim); white-space: nowrap; }
.gh-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.gh-tag-pill { font-size: .78rem; padding: 2px 10px; border-radius: 12px; background: rgba(245,158,11,.12); color: #fbbf24; font-weight: 600; }

/* ── Temp set confirmation modal (BREWDASH-234) ── */
.temp-confirm-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.temp-confirm-overlay[hidden] { display: none; }
.temp-confirm-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; width: min(94vw, 360px);
  padding: 20px 22px 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.temp-confirm-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 10px;
}
.temp-confirm-body {
  font-size: 13px; color: var(--text-dim); margin-bottom: 18px;
}
.temp-confirm-status {
  font-size: 12px; color: var(--text-dim); margin: -8px 0 14px;
}
.temp-confirm-status.is-error { color: #f87171; }
.temp-confirm-btns {
  display: flex; gap: 8px; justify-content: flex-end;
}
.fv-temp-denied {
  padding: 8px 12px; background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3); border-radius: 6px;
  color: #f87171; font-size: 12px;
}
.rapt-pending-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  background: rgba(245,166,35,.12); border: 1px solid rgba(245,166,35,.3);
  border-radius: 10px; color: var(--accent); font-size: 10px; font-weight: 700;
  vertical-align: middle;
}

/* ── Brew Stages Admin Table ──────────────────────────────────────────────── */
.bs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bs-table thead th {
  padding: 6px 10px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  text-align: left;
}
.bs-th-drag { width: 28px; }
.bs-th-code { width: 72px; }
.bs-th-pip  { width: 76px; }
.bs-th-slug { width: 130px; }
.bs-th-actions { width: 110px; }
.bs-row { border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.06)); }
.bs-row:hover { background: rgba(255,255,255,.025); }
.bs-row td { padding: 7px 10px; vertical-align: middle; }
.bs-drag-handle {
  cursor: grab; color: var(--text-muted); font-size: 16px;
  user-select: none; padding-left: 4px !important;
}
.bs-drag-handle:active { cursor: grabbing; }
.bs-td-actions { white-space: nowrap; }
.bs-btn-edit, .bs-btn-save, .bs-btn-cancel, .bs-btn-del {
  padding: 3px 8px; border-radius: 5px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim);
  cursor: pointer; font-size: 12px; margin-left: 3px;
  transition: background .12s;
}
.bs-btn-edit:hover { background: rgba(255,255,255,.08); }
.bs-btn-del { color: #f87171; }
.bs-btn-del:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
.bs-add-wrap { margin-top: 12px; }
.bs-add-wrap summary { list-style: none; }
.bs-add-wrap summary::-webkit-details-marker { display: none; }
.admin-error { color: #f87171; font-size: 12px; padding: 6px 0; }

/* ── item-action-btn (shared: locations, suppliers, brew stages, etc.) ──────── */
.item-action-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .6rem; font-size: .78rem; border-radius: 5px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); cursor: pointer; white-space: nowrap;
}
.item-action-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════════
   BREWSHEET — Single-page scrolling document (ioi105)
   ═══════════════════════════════════════════════════════════════════════════════ */

.bs-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0 6px;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.bs-jump {
  font-size: 0.63rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 3px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.bs-jump:hover { color: var(--text); background: var(--bg-card); border-color: var(--text-muted); }

.bs-doc {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6rem;
}

.bs-doc-section, .bs-tab-panel {
  --bs-c: #374151;
}
.bs-doc-section { border-bottom: 1px solid var(--border); }
.bs-doc-section:last-child { border-bottom: none; }

/* Section colour palette — applies to both .bs-doc-section and .bs-tab-panel */
[data-c="overview"] { --bs-c: #7c5500; }
[data-c="notes"]    { --bs-c: #b45309; }
[data-c="water"]    { --bs-c: #1558b0; }
[data-c="grain"]    { --bs-c: #86198f; }
[data-c="mash"]     { --bs-c: #166534; }
[data-c="lauter"]   { --bs-c: #0f4c41; }
[data-c="hops"]     { --bs-c: #9a3412; }
[data-c="yeast"]    { --bs-c: #7c2d12; }
[data-c="postboil"] { --bs-c: #4c1d95; }
[data-c="ferment"]  { --bs-c: #1e3a5f; }
[data-c="dryhop"]   { --bs-c: #14532d; }
[data-c="report"]   { --bs-c: #1f2937; }

.bs-shead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: var(--bs-c);
  color: #fff;
  user-select: none;
}
.bs-shead-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.bs-shead-code  { font-size: 0.7rem; opacity: 0.75; font-weight: 600; }

.bs-body { padding: 12px 16px; background: var(--bg-card); }
.bs-body-sub { margin-top: 14px; }

/* KV grid — spreadsheet-style paired fields */
.bs-kv {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.bs-kv:last-child { margin-bottom: 0; }
.bs-kv-1 { grid-template-columns: 1fr; }
.bs-kv-2 { grid-template-columns: 1fr 1fr; }
.bs-kv-3 { grid-template-columns: 1fr 1fr 1fr; }
.bs-kv-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.bs-kv-p {
  display: grid;
  grid-template-columns: auto 1fr;
  background: var(--bg-card);
  min-height: 32px;
}
.bs-kv-p-full { grid-column: 1 / -1; }

.bs-kv-l {
  background: color-mix(in srgb, var(--bs-c) 14%, var(--bg-card));
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  border-right: 1px solid color-mix(in srgb, var(--bs-c) 22%, var(--border));
  min-width: 115px;
}
.bs-kv-v {
  display: flex;
  align-items: center;
  min-width: 0;
}
.bs-kv-v input,
.bs-kv-v select,
.bs-kv-v textarea {
  border: none !important;
  background: transparent !important;
  padding: 5px 8px;
  color: var(--text);
  font-size: 0.83rem;
  width: 100%;
  min-width: 0;
  outline: none;
  font-family: inherit;
}
.bs-kv-v select { padding-right: 22px; }
.bs-kv-v input:focus,
.bs-kv-v select:focus,
.bs-kv-v textarea:focus {
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--bs-c) 65%, transparent);
}

/* Brew water table */
.bs-water-tbl { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 8px; }
.bs-water-tbl th {
  background: color-mix(in srgb, var(--bs-c) 20%, var(--bg-card));
  color: var(--text-muted);
  font-size: 0.63rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 8px; text-align: left; border: 1px solid var(--border); white-space: nowrap;
}
.bs-water-tbl td { border: 1px solid var(--border); padding: 1px 3px; vertical-align: middle; }
.bs-water-src {
  background: color-mix(in srgb, var(--bs-c) 12%, var(--bg-card));
  color: var(--text-muted);
  font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 9px !important; white-space: nowrap;
}
.bs-water-tbl input {
  background: transparent; border: none; color: var(--text);
  font-size: 0.82rem; padding: 4px 6px; width: 100%; outline: none; font-family: inherit;
}
.bs-water-tbl input:focus { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--bs-c) 65%, transparent); }

/* Dynamic tables within sections */
.bs-dyn-table { width: 100%; border-collapse: collapse; font-size: 0.79rem; margin-bottom: 8px; }
.bs-dyn-table th {
  background: color-mix(in srgb, var(--bs-c) 20%, var(--bg-card));
  color: var(--text-muted);
  font-size: 0.63rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 7px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.bs-dyn-table td {
  padding: 2px 3px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  vertical-align: middle;
}
.bs-dyn-table tr:last-child td { border-bottom: none; }
.bs-dyn-table .bsess-dyn-row:nth-child(even) > td {
  background: color-mix(in srgb, var(--bs-c) 4%, var(--bg-card));
}
.bs-dyn-table input,
.bs-dyn-table select:not(.bsess-dyn-select) {
  background: transparent; border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--text); font-size: 0.79rem; padding: 3px 4px; width: 100%; min-width: 0;
  font-family: inherit; outline: none;
}
.bs-dyn-table input:focus,
.bs-dyn-table select:not(.bsess-dyn-select):focus { border-bottom-color: color-mix(in srgb, var(--bs-c) 80%, transparent); }
.bs-dyn-table .ing-dd { z-index: 30; }

/* Sub-header inside bs-body */
.bs-sub-hdr {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: color-mix(in srgb, var(--bs-c) 90%, var(--text-muted));
  margin: 12px 0 6px; padding-bottom: 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--bs-c) 20%, var(--border));
}

@media (max-width: 700px) {
  .bs-kv-4 { grid-template-columns: 1fr 1fr; }
  .bs-kv-3 { grid-template-columns: 1fr 1fr; }
  .bs-kv-2 { grid-template-columns: 1fr; }
  .bs-kv-l { min-width: 90px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RECIPE SYSTEM + brew-session grain/mash redesign (ioi106)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Grain bill planned/actual columns */
.bs-grain-table .bs-col-plan   { color: var(--text-muted); }
.bs-grain-table .bs-col-actual { color: var(--bs-c, var(--accent)); }
.bs-grain-table .bs-actual {
  background: color-mix(in srgb, var(--bs-c, var(--accent)) 8%, transparent);
  border-radius: 3px;
}

/* Mash log — step cards (plan on top, actuals below) */
.bs-mash-steps { display: flex; flex-direction: column; gap: 10px; }
.bs-mash-step {
  border: 1px solid var(--border);
  border-left: 3px solid var(--bs-c, var(--accent));
  border-radius: 8px;
  background: var(--bg-card, rgba(255,255,255,0.02));
  overflow: hidden;
}
.bs-mash-plan {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--bs-c, var(--accent)) 10%, transparent);
  border-bottom: 1px solid var(--border);
}
.bs-mash-name {
  font-weight: 700; font-size: 0.9rem; flex: 1 1 200px; min-width: 140px;
  background: transparent; border: none; border-bottom: 1px dashed var(--border);
  color: var(--text); padding: 3px 2px; outline: none;
}
.bs-mash-name:focus { border-bottom-color: var(--accent); }
.bs-mash-target { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }
.bs-mash-target-txt { color: var(--text); font-weight: 600; }
.bs-mash-plan .bsess-remove-row { margin-left: auto; }

.bs-mash-actual {
  display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 10px 12px;
}
.bs-mash-actual label {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: 600;
}
.bs-mash-actual input {
  background: var(--bg-input, rgba(0,0,0,0.15));
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); padding: 4px 6px; font-size: 0.82rem; width: 88px;
  outline: none;
}
.bs-mash-actual input:focus { border-color: var(--accent); }
.bs-mash-actual .bs-m-notes-l { flex: 1 1 200px; }
.bs-mash-actual .bs-m-notes-l input { width: 100%; }

@media (max-width: 700px) {
  .bs-mash-actual input { width: 72px; }
}

/* Recipe list page */
.rc-page-intro {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 16px;
  max-width: 72ch;
}
.rc-group { margin-bottom: 14px; }
.rc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rc-beer-chip {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; margin-right: 8px;
}
.rc-current-badge {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  background: color-mix(in srgb, var(--success, #22c55e) 20%, transparent);
  color: var(--success, #22c55e);
}
.rc-list-table td { vertical-align: middle; }
.rc-mobile-list {
  display: none;
  flex-direction: column;
  gap: 8px;
}
.rc-mobile-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bs-c) 5%, var(--bg-card));
  padding: 10px 12px;
}
.rc-mobile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.rc-mobile-version {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.rc-mobile-name {
  color: var(--text);
  font-size: 0.83rem;
  margin-top: 2px;
}
.rc-mobile-current {
  flex: 0 0 auto;
}
.rc-mobile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.rc-mobile-stat {
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 6px;
  padding: 6px 7px;
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
}
.rc-mobile-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.rc-mobile-value {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.rc-mobile-actions {
  display: flex;
  justify-content: flex-end;
}
.rc-edit-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.rc-edit-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .rc-page-intro { font-size: 0.8rem; margin-bottom: 12px; }
  .rc-table-wrap { display: none; }
  .rc-mobile-list { display: flex; }
  .rc-group .bs-body { padding: 10px 12px; }
  .rc-group .bs-shead {
    align-items: flex-start;
    gap: 6px;
    flex-direction: column;
  }
  .rc-group .bs-shead-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    line-height: 1.35;
  }
  .rc-beer-chip { margin-right: 0; }
  .rc-mobile-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Dark-mode select fix inside bs-kv-v ──────────────────────────────────── */
[data-theme="dark"] .bs-kv-v select,
[data-theme="dark"] .bs-kv-v select option {
  color-scheme: dark;
  background-color: var(--bg-card-2, #1e2535);
  color: var(--text);
}

/* ── Admin Variables page ─────────────────────────────────────────────────── */
.admin-var-grid {
  column-width: 300px;
  column-gap: 18px;
}
.admin-var-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  break-inside: avoid;
  margin: 0 0 18px;
}
.admin-var-list-hdr { display: flex; flex-direction: column; gap: 3px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.admin-var-list-hdr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-var-list-label { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.admin-var-list-hint  { font-size: 0.73rem; color: var(--text-muted); line-height: 1.4; }
.admin-var-sort-select {
  font-size: 0.7rem; background: var(--bg-card-2, rgba(0,0,0,.2)); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 5px; padding: 2px 5px; cursor: pointer; flex-shrink: 0;
}
.admin-var-items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-var-item  { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; background: var(--bg-card-2, rgba(0,0,0,.15)); border-radius: 5px; }
.admin-var-item-text { font-size: 0.82rem; color: var(--text); flex: 1; white-space: pre-line; }
.admin-var-drag-handle { cursor: grab; color: var(--text-dim); font-size: 0.82rem; flex-shrink: 0; }
.admin-var-drag-handle:active { cursor: grabbing; }
.admin-var-empty { color: var(--text-muted); font-size: 0.8rem; font-style: italic; }
.admin-var-remove-btn {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  font-size: 0.72rem; padding: 2px 5px; border-radius: 3px; flex-shrink: 0;
}
.admin-var-remove-btn:hover { color: var(--alert); background: color-mix(in srgb, var(--alert) 12%, transparent); }
.admin-var-add-form { display: flex; gap: 6px; }
.admin-var-input {
  flex: 1; background: var(--bg-card-2, rgba(0,0,0,.2)); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 0.82rem; padding: 5px 9px; outline: none;
}
.admin-var-input:focus { border-color: var(--accent); }
.admin-var-add-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  font-size: 0.8rem; padding: 5px 14px; cursor: pointer; font-weight: 600;
}
.admin-var-add-btn:hover { opacity: .85; }
/* Shared overflow affordance for every data-tablist (BREWDASH-248). */
.bd-tablist-shell {
  position: relative;
  min-width: 0;
}
.bd-tablist-shell--sticky {
  position: sticky;
}
.bd-tablist-was-sticky {
  position: static !important;
}
.bd-tablist-margin-owned {
  margin-bottom: 0 !important;
}
.bd-tab-scroll {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 24px;
  height: 32px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text-muted) 18%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  box-shadow: none;
  color: var(--text-muted);
  cursor: pointer;
  font: 600 21px/1 var(--font);
  transform: translateY(-50%);
}
.bd-tab-scroll--left {
  left: 0;
  border-left: 0;
  border-radius: 0 3px 3px 0;
}
.bd-tab-scroll--right {
  right: 0;
  border-right: 0;
  border-radius: 3px 0 0 3px;
}
.bd-tab-scroll:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--bg-card) 96%, transparent);
  color: var(--text);
}
.bd-tab-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bd-tab-scroll[hidden] { display: none; }
