:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --panel: #ffffff;
  --panel-soft: #f0f4ef;
  --ink: #17201d;
  --muted: #68716d;
  --line: #d9ded7;
  --green: #257044;
  --green-dark: #17492d;
  --blue: #245a78;
  --amber: #b26a00;
  --red: #a73737;
  --cyan: #0ea5e9;
  --pink: #f59bb6;
  --lime: #8bdc65;
  --brand-image: url("/static/poultry-banner.png");
  --shadow: 0 10px 30px rgba(20, 30, 25, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07100d;
  --panel: #0d1915;
  --panel-soft: #14231e;
  --ink: #eef7f1;
  --muted: #a7b8af;
  --line: #24352f;
  --green: #5bc27d;
  --green-dark: #9ae6af;
  --blue: #4cb7e5;
  --amber: #f0b55a;
  --red: #f07575;
  --cyan: #22d3ee;
  --pink: #ff9fbd;
  --lime: #b9f273;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #07100d;
    --panel: #0d1915;
    --panel-soft: #14231e;
    --ink: #eef7f1;
    --muted: #a7b8af;
    --line: #24352f;
    --green: #5bc27d;
    --green-dark: #9ae6af;
    --blue: #4cb7e5;
    --amber: #f0b55a;
    --red: #f07575;
    --cyan: #22d3ee;
    --pink: #ff9fbd;
    --lime: #b9f273;
    --shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  }
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(37, 112, 68, 0.12), transparent 32rem),
    linear-gradient(180deg, rgba(255,255,255,0.30), transparent 18rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

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

button, .button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, color 150ms ease;
}

button:hover, .button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

button.primary, .button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

button.ghost {
  background: transparent;
  color: var(--muted);
}

.theme-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
}

.theme-link:hover {
  color: var(--ink);
  background: var(--panel-soft);
  text-decoration: none;
}

button.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

input:focus, select:focus, textarea:focus, button:focus-visible, .button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cyan) 42%, transparent);
  outline-offset: 2px;
}

textarea { resize: vertical; }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

label input, label select, label textarea { color: var(--ink); font-size: 15px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 0 24px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  min-width: 0;
}

.brand:hover { text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--green), var(--blue));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22), 0 8px 20px rgba(18, 80, 52, 0.18);
}

.brand-mark.large {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  font-size: 20px;
}

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
}

.nav a {
  color: var(--muted);
  padding: 9px 11px;
  border-radius: 7px;
  white-space: nowrap;
}

.nav a.active, .nav a:hover {
  background: var(--panel-soft);
  color: var(--ink);
  text-decoration: none;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.shell {
  width: min(1440px, calc(100% - 40px));
  margin: 26px auto 60px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(260px, 0.92fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: center;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.auth-intro {
  align-self: stretch;
  display: grid;
  align-content: center;
}

.auth-visual {
  min-height: 280px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.58), rgba(0,0,0,0.08)),
    var(--brand-image) center / cover;
  box-shadow: var(--shadow);
}

.auth-panel h1 { margin: 0; font-size: 32px; }
.auth-panel p { margin: 8px 0 0; color: var(--muted); }

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.action-row form {
  margin: 0;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #23553a, #2f704d);
  box-shadow: var(--shadow);
}

.poultry-hero {
  min-height: 260px;
  background:
    linear-gradient(90deg, rgba(5, 18, 15, 0.96) 0%, rgba(8, 25, 20, 0.82) 38%, rgba(8, 25, 20, 0.34) 100%),
    var(--brand-image) center right / cover;
}

.dashboard-hero.poultry-hero.goed {
  background:
    linear-gradient(90deg, rgba(10, 55, 33, 0.97) 0%, rgba(21, 89, 55, 0.78) 40%, rgba(21, 89, 55, 0.22) 100%),
    var(--brand-image) center right / cover;
}

.dashboard-hero.poultry-hero.aandacht {
  background:
    linear-gradient(90deg, rgba(93, 57, 0, 0.97) 0%, rgba(157, 95, 0, 0.78) 40%, rgba(157, 95, 0, 0.22) 100%),
    var(--brand-image) center right / cover;
}

.dashboard-hero.poultry-hero.bijsturen {
  background:
    linear-gradient(90deg, rgba(90, 20, 20, 0.97) 0%, rgba(150, 42, 42, 0.78) 40%, rgba(150, 42, 42, 0.22) 100%),
    var(--brand-image) center right / cover;
}

.dashboard-hero.aandacht { background: linear-gradient(135deg, #7a4a00, #b26a00); }
.dashboard-hero.bijsturen { background: linear-gradient(135deg, #7b2525, #a73737); }

.dashboard-hero span, .dashboard-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-hero strong {
  display: block;
  margin: 6px 0;
  font-size: 62px;
  line-height: 0.95;
}

.breed-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.breed-strip span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 999px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--panel-soft) 80%, transparent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.hero-breeds span {
  background: rgba(255,255,255,0.13);
  color: #fff;
  border-color: rgba(255,255,255,0.28);
}

.hero-message {
  display: grid;
  align-content: center;
  border-left: 1px solid rgba(255,255,255,0.32);
  padding-left: 20px;
  font-size: 20px;
}

.hero-message p { margin: 0; }

.page-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.page-head p { margin: 7px 0 0; color: var(--muted); }

.panel {
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel + .panel { margin-top: 18px; }

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-head h2, .house-card h3, .finding h3 {
  margin: 0;
  line-height: 1.2;
}

.panel-head h2 { font-size: 18px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-grid.expanded {
  grid-template-columns: repeat(8, minmax(130px, 1fr));
}

.metric-card, .house-card {
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 116px;
  box-shadow: var(--shadow);
}

.metric-card span, .metric-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.metric-card strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 30px;
  line-height: 1;
}

.metric-card.goed { border-left: 5px solid var(--green); }
.metric-card.aandacht { border-left: 5px solid var(--amber); }
.metric-card.bijsturen { border-left: 5px solid var(--red); }

.metric-mini {
  min-height: 122px;
}

.metric-mini.good { border-left: 5px solid var(--green); }
.metric-mini.bad { border-left: 5px solid var(--amber); }
.metric-mini.unknown { border-left: 5px solid var(--line); }
.metric-mini strong { font-size: 25px; }

.mini-bar {
  height: 7px;
  margin-top: 12px;
  border-radius: 999px;
  background: #e8ece6;
  overflow: hidden;
}

.mini-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.metric-mini.bad .mini-bar i { background: var(--amber); }

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.chart-surface {
  --chart-text: var(--ink);
  --chart-muted: var(--muted);
  --chart-grid: rgba(23, 32, 29, 0.12);
  --chart-row-bg: var(--panel-soft);
  --chart-row-border: var(--line);
  background: var(--panel);
  color: var(--chart-text);
}

.chart-surface .muted,
.chart-surface .panel-head span,
.chart-surface a {
  color: var(--chart-muted);
}

.chart-surface .line-row,
.chart-surface .climate-grid article {
  background: var(--chart-row-bg);
  border-color: var(--chart-row-border);
}

.chart-surface .line-row span {
  color: var(--chart-muted);
}

.chart-surface .dual-meter {
  background: color-mix(in srgb, var(--chart-row-bg) 65%, var(--line));
}

:root[data-theme="dark"] .chart-surface {
  --chart-text: #eafff6;
  --chart-muted: #9ddfc8;
  --chart-grid: rgba(190, 255, 230, 0.13);
  --chart-row-bg: rgba(242, 255, 248, 0.06);
  --chart-row-border: rgba(157, 223, 200, 0.16);
  background: linear-gradient(180deg, rgba(12, 28, 24, 0.98), rgba(5, 13, 12, 0.98));
  border-color: rgba(121, 211, 173, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .chart-surface {
    --chart-text: #eafff6;
    --chart-muted: #9ddfc8;
    --chart-grid: rgba(190, 255, 230, 0.13);
    --chart-row-bg: rgba(242, 255, 248, 0.06);
    --chart-row-border: rgba(157, 223, 200, 0.16);
    background: linear-gradient(180deg, rgba(12, 28, 24, 0.98), rgba(5, 13, 12, 0.98));
    border-color: rgba(121, 211, 173, 0.18);
  }
}

.trend-chart {
  min-height: 295px;
  display: grid;
  align-items: center;
}

.trend-chart svg {
  width: 100%;
  min-height: 250px;
  overflow: visible;
}

.trend-chart .score-bar {
  fill: url(#scoreGradient);
  opacity: 0.88;
}

.trend-chart .grid-lines line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.trend-chart text {
  fill: var(--chart-muted);
  font-size: 11px;
}

.trend-chart .axis-title {
  font-size: 11px;
  font-weight: 700;
}

.trend-chart .line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.12));
}

.trend-chart .line.laying {
  stroke: #ff9fbd;
}

.trend-chart .line.feed-water {
  stroke: #b9f273;
}

.trend-chart .hit-area {
  fill: transparent;
  cursor: pointer;
}

.trend-chart .hover-guide {
  opacity: 0;
  stroke: var(--cyan);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  pointer-events: none;
}

.trend-chart .chart-hitpoint.active .hover-guide,
.trend-chart .chart-hitpoint:focus .hover-guide {
  opacity: 1;
}

.trend-chart .chart-hitpoint:focus {
  outline: none;
}

.chart-tooltip {
  min-height: 46px;
  margin: 3px 10px 0 52px;
  padding: 8px 12px;
  border: 1px solid var(--chart-row-border);
  border-radius: 7px;
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--chart-row-bg);
  color: var(--chart-muted);
  font-size: 13px;
}

.chart-tooltip strong {
  color: var(--chart-text);
}

.chart-tooltip b {
  color: var(--chart-text);
  font-weight: 700;
}

.chart-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.chart-legend i,
.chart-legend b,
.chart-legend em {
  width: 16px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.chart-legend i { background: var(--cyan); }
.chart-legend b { background: var(--pink); }
.chart-legend em { background: var(--lime); }

.chart-panel {
  min-height: 285px;
}

.bar-chart {
  height: 210px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 10px 4px 0;
  border-bottom: 1px solid var(--line);
}

.bar-item {
  flex: 1 1 18px;
  min-width: 12px;
  height: 100%;
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 4px;
}

.bar-item i {
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #3d8b5d, #245a78);
}

.bar-item span {
  color: var(--muted);
  font-size: 11px;
}

.line-board, .climate-grid, .grafana-links {
  display: grid;
  gap: 12px;
}

.line-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.line-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.dual-meter {
  height: 16px;
  position: relative;
  border-radius: 999px;
  background: #edf0ea;
  overflow: hidden;
}

.dual-meter i, .dual-meter b {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
}

.dual-meter i {
  background: #4b9565;
}

.dual-meter b {
  height: 6px;
  top: 5px;
  background: #245a78;
}

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

.climate-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.climate-grid h3 {
  margin: 0 0 12px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.account-grid .panel,
.split .panel {
  margin-top: 0;
}

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

.house-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 14px;
}

.house-title span {
  color: var(--green-dark);
  font-weight: 700;
}

.compact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.compact-list div {
  min-height: 42px;
}

.compact-list dt {
  color: var(--muted);
  font-size: 12px;
}

.compact-list dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.finding-list {
  display: grid;
  gap: 10px;
}

.finding-list.wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finding {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 13px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
}

.finding span {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.finding p {
  margin: 7px 0 0;
  color: var(--muted);
}

.finding.critical { border-left-color: var(--red); }
.finding.warning { border-left-color: var(--amber); }
.finding.info { border-left-color: var(--blue); }

.status, .score-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 7px;
  padding: 4px 9px;
  background: var(--panel-soft);
  color: var(--green-dark);
  font-weight: 700;
}

.status.bijsturen, .score-pill.bijsturen { background: #f7dddd; color: var(--red); }
.status.aandacht, .score-pill.aandacht { background: #f6ead8; color: #7a4a00; }
.status.goed, .score-pill.goed, .status.good { background: #dcefe4; color: var(--green-dark); }

.score-pill {
  min-height: 48px;
  padding: 8px 16px;
  font-size: 22px;
}

.form, .form-grid {
  display: grid;
  gap: 14px;
}

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

.settings-grid {
  display: grid;
  gap: 18px;
}

.settings-grid .panel {
  margin: 0;
}

.check {
  display: flex;
  flex-direction: row;
  gap: 9px;
  align-items: center;
  min-height: 40px;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.check.inline { min-height: 0; }

.sticky-actions {
  position: sticky;
  bottom: 14px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(8px);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.report-message pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.readonly { background: var(--panel-soft); }

.flash {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  margin-bottom: 14px;
  background: var(--panel);
}

.flash.good { border-color: #b9d8c5; background: #edf7f1; }
.flash.danger { border-color: #e2b8b8; background: #fbefef; }
.flash.info { border-color: #b7d0de; background: #eef6fa; }

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: start;
  align-content: center;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.qr svg { width: 210px; height: 210px; max-width: 100%; }
code { white-space: pre-wrap; overflow-wrap: anywhere; }

.vision-screen {
  min-height: calc(100vh - 118px);
  background: #000;
  color: #fff;
  border-radius: 8px;
  padding: 26px;
}

.vision-screen header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 5px solid #fff;
  padding-bottom: 18px;
}

.vision-screen h1 {
  margin: 0;
  font-size: 72px;
}

.vision-screen header p {
  margin: 4px 0 0;
  color: #f6e56d;
  font-size: 32px;
}

.vision-screen header strong {
  color: #f6e56d;
  font-size: 82px;
}

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

.vision-grid article {
  border: 5px solid #fff;
  border-radius: 8px;
  padding: 18px;
}

.vision-grid h2 {
  margin: 0 0 18px;
  font-size: 54px;
}

.vision-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.vision-metrics div {
  min-height: 150px;
  display: grid;
  align-content: center;
  padding: 14px;
  background: #fff;
  color: #000;
  border-radius: 8px;
}

.vision-metrics span {
  font-size: 28px;
  font-weight: 800;
}

.vision-metrics strong {
  font-size: 64px;
  line-height: 1;
}

.vision-empty {
  font-size: 64px;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stock-card {
  min-height: 130px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stock-card span, .stock-card em {
  color: var(--muted);
  font-style: normal;
}

.stock-card strong {
  font-size: 42px;
  line-height: 1;
}

.touch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.touch-panel input, .touch-panel select, .touch-panel button {
  min-height: 58px;
  font-size: 22px;
}

.touch-form {
  display: grid;
  gap: 14px;
}

.big-button {
  min-height: 72px;
  font-size: 24px;
  font-weight: 800;
}

.label-body {
  background: #fff;
}

.print-label {
  width: 95mm;
  min-height: 60mm;
  padding: 5mm;
  color: #000;
  border: 2px solid #000;
  font-family: Arial, sans-serif;
}

.label-code {
  font-size: 24px;
  font-weight: 900;
}

.label-type {
  margin-top: 4mm;
  font-size: 20px;
  font-weight: 700;
}

.label-qty {
  margin-top: 3mm;
  font-size: 32px;
  font-weight: 900;
}

.label-meta, .label-note {
  margin-top: 2mm;
  font-size: 14px;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.podcast-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  border-left: 6px solid var(--green);
}

.podcast-hero h2 {
  margin: 0 0 9px;
  font-size: 26px;
}

.podcast-hero p {
  color: var(--muted);
}

.episode-actions {
  display: grid;
  gap: 14px;
}

.episode-actions audio {
  width: 100%;
}

.news-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.news-card {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

.news-card span, .news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.news-card h3 {
  margin: 0;
  font-size: 15px;
}

.two-column-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.two-column-grid .panel + .panel {
  margin-top: 0;
}

.schedule-row {
  display: grid;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.schedule-row span {
  color: var(--muted);
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.readiness-card {
  min-height: 142px;
  border-top: 4px solid var(--green);
}

.readiness-card + .readiness-card {
  margin-top: 0;
}

.readiness-card.warning {
  border-top-color: var(--amber);
}

.readiness-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.readiness-card strong {
  display: block;
  margin: 9px 0 5px;
  font-size: 18px;
}

.readiness-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.field-note {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
}

.management-panel {
  margin-top: 18px;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(270px, 1fr));
  gap: 14px;
}

.editor-grid.compact {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.editor-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.editor-card h3 {
  margin: 0 0 3px;
}

.editor-card.new-card {
  border-style: dashed;
}

.source-status {
  min-height: 38px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.listen-screen {
  width: min(920px, 100%);
  margin: 0 auto;
}

.listen-screen header {
  margin-bottom: 22px;
}

.listen-screen h1 {
  margin: 10px 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.1;
}

.listen-screen header p {
  font-size: 20px;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  font-size: 18px;
  margin-bottom: 20px;
}

.listen-player {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 5vw, 40px);
  margin-bottom: 28px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--panel);
}

.giant-audio {
  width: 100%;
  min-height: 74px;
}

.listen-download {
  min-height: 70px;
  font-size: 24px;
  font-weight: 800;
}

.listen-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.listen-controls button {
  min-height: 72px;
  font-size: 21px;
  font-weight: 800;
}

.listen-sources {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.listen-sources h2 {
  font-size: 28px;
}

.listen-sources article {
  display: grid;
  gap: 7px;
  border: 2px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  font-size: 18px;
}

.listen-sources article span {
  color: var(--muted);
}

.listen-transcript {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 9px;
}

.listen-transcript summary {
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
}

.listen-transcript pre {
  white-space: pre-wrap;
  font: inherit;
  font-size: 19px;
  line-height: 1.65;
}

@media print {
  .no-print { display: none; }
  body { margin: 0; }
  .print-label { border: 0; }
}

@media (max-width: 1020px) {
  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .userbox {
    justify-content: space-between;
  }

  .kpi-grid, .kpi-grid.expanded, .split, .account-grid, .house-grid, .finding-list.wide, .form-grid, .analytics-grid, .climate-grid, .touch-grid, .vision-grid, .stock-grid, .podcast-hero, .two-column-grid, .readiness-grid, .editor-grid, .editor-grid.compact, .news-card-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .hero-message {
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,0.32);
    padding-left: 0;
    padding-top: 18px;
  }

  .shell {
    width: min(100% - 24px, 760px);
    margin-top: 18px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 220px;
  }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .auth-panel {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .compact-list { grid-template-columns: 1fr; }
  .metric-card strong { font-size: 26px; }
  .nav { padding-bottom: 4px; }
  .vision-screen h1, .vision-grid h2 { font-size: 42px; }
  .vision-screen header strong { font-size: 52px; }
  .vision-metrics { grid-template-columns: 1fr; }
  .vision-metrics strong { font-size: 48px; }
  .audio-focus .nav, .audio-focus .theme-link { display: none; }
  .audio-focus .topbar { gap: 8px; }
}
