:root {
  color-scheme: light;
  --page: #f3f5f0;
  --paper: #fff;
  --ink: #172e25;
  --muted: #52665b;
  --line: #dbe5dc;
  --green: #185340;
  --green-dark: #133a2d;
  --green-light: #e9f1e6;
  --nav: #122d25;
  --nav-hover: #28493b;
  --lime: #d9efaa;
  --amber: #cd8c24;
  --grid-charge: #6b9e78;
  --discharge: #20634b;
  --battery-export: #69568e;
  --idle: #c8d4c9;
  --alert: #913b2c;
  --radius: 18px;
  --shadow: 0 1px 2px #172e250b, 0 5px 18px #172e2505;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body { margin: 0; }

a { color: inherit; text-decoration: none; }

button, input, select { font: inherit; }

button { cursor: pointer; }

button:disabled { opacity: .57; cursor: default; }

:focus-visible { outline: 3px solid #3d8867; outline-offset: 3px; }

h1, h2, h3, p, dl, dd { margin: 0; }

::selection { color: var(--green-dark); background: #d8edcf; }

.skip-link {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 5;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--paper);
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.topbar {
  color: #f6faf5;
  background: var(--nav);
}

.topbar-inner, .dashboard {
  width: min(1184px, calc(100% - 64px));
  margin-inline: auto;
}

.topbar-inner {
  min-height: 66px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--lime);
}

.brand-mark::after {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--nav);
  clip-path: polygon(54% 0, 12% 57%, 45% 57%, 34% 100%, 89% 40%, 55% 40%, 65% 0);
}

.main-nav { display: flex; gap: 4px; align-items: center; }

.main-nav a, .nav-logout {
  display: flex;
  align-items: center;
  min-height: 39px;
  padding-inline: 14px;
  border: 0;
  border-radius: 9px;
  color: #becdc4;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.main-nav a:hover, .main-nav a[aria-current], .nav-logout:hover {
  color: #f7fbf6;
  background: var(--nav-hover);
}

.main-nav a[aria-current] { color: var(--lime); }
.topbar :focus-visible { outline-color: var(--lime); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid #486454;
  border-radius: 9px;
  background: var(--nav-hover);
  color: #f7fbf6;
  font-size: 13px;
  font-weight: 690;
}

.menu-icon {
  display: block;
  width: 13px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 -4px currentColor, 0 4px currentColor;
}

.simulation-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding-inline: 9px;
  border-radius: 100px;
  color: #385127;
  background: #e5edda;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.feed-status::before, .control-indicator {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 100%;
  background: #488157;
}

.dashboard { padding-block: 38px 22px; }

.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px 16px;
  margin-bottom: 22px;
}

.intro-date, .feed-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.intro-date { margin-bottom: 6px; font-variant-numeric: tabular-nums; }

.feed-summary {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
}

.feed-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 24px;
  justify-content: flex-end;
}

.feed-receipt { color: var(--muted); font-size: 11px; line-height: 1.45; }

.feed-status::before { content: ""; }

.feed-status[data-state="loading"]::before { background: #8e9a91; }

.feed-status[data-state="error"] { color: var(--alert); }

.feed-status[data-state="error"]::before { background: var(--alert); }

h1 {
  font-size: clamp(31px, 4.2vw, 50px);
  line-height: 1.05;
  letter-spacing: -.055em;
}

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

.metric, .panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metric {
  display: flex;
  flex-direction: column;
  min-height: 155px;
  padding: 16px 18px;
}

.battery-metric {
  color: #fff;
  border-color: #184838;
  background: linear-gradient(143deg, #174334, #24684d);
}

.metric-header { display: flex; align-items: center; gap: 9px; }

.metric-header h2 { font-size: 13px; font-weight: 690; }

.metric-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-block: 12px 5px;
  font-size: clamp(28px, 3.1vw, 43px);
  font-weight: 740;
  line-height: 1;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}

.unit { color: var(--muted); font-size: .44em; font-weight: 630; letter-spacing: -.02em; }

.battery-metric .unit { color: #d4ead5; }

.metric-caption { margin-top: auto; color: var(--muted); font-size: 12px; line-height: 1.4; }

.battery-metric .metric-caption { color: #e0eee4; }

.battery-track {
  height: 6px;
  margin-block: 4px 7px;
  overflow: hidden;
  border-radius: 100px;
  background: #fdfffa2d;
}

.battery-track div { height: 100%; width: var(--soc, 0%); border-radius: inherit; background: var(--lime); }

.metric-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  color: var(--green-dark);
  background: #eef4ed;
}

.icon-battery { color: #ecf7e0; background: #fdfffa23; }

.icon-battery::before {
  content: "";
  width: 13px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.icon-battery::after {
  position: absolute;
  left: 24px;
  content: "";
  width: 2px;
  height: 3px;
  border-radius: 0 1px 1px 0;
  background: currentColor;
}

.icon-sun { color: #85561c; background: #fcf0d7; font-size: 21px; line-height: 1; }

.icon-grid { color: #365d76; background: #edf3f8; }

.icon-home::before {
  position: absolute;
  top: 10px;
  content: "";
  width: 9px;
  height: 9px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.icon-home::after {
  position: absolute;
  bottom: 8px;
  content: "";
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}

.icon-grid::before {
  content: "";
  width: 16px;
  height: 17px;
  background: currentColor;
  clip-path: polygon(50% 0, 83% 45%, 70% 45%, 100% 100%, 84% 100%, 51% 40%, 16% 100%, 0 100%, 30% 45%, 17% 45%);
}

.icon-grid::after { position: absolute; top: 18px; content: ""; width: 12px; height: 1.5px; background: currentColor; }

.panel { padding: 22px; scroll-margin-top: 16px; }
.view-empty { color: var(--muted); font-size: 14px; }
.logout-feedback { margin-bottom: 9px; }

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 19px;
}

.panel h2 { font-size: 23px; line-height: 1.2; letter-spacing: -.038em; }

.panel-header p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.date-tabs {
  display: inline-flex;
  gap: 2px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f4f6f2;
}

.date-tabs button {
  min-height: 35px;
  padding: 4px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 690;
}

.date-tabs button[aria-pressed="true"] { background: var(--paper); color: var(--green-dark); box-shadow: 0 1px 4px #17332120; }

.chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.chart-area, .history-chart-frame {
  padding: 13px 14px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafcf9;
}

.plot { --slot-gap: clamp(2px, .45vw, 8px); display: grid; grid-template-columns: 33px minmax(0, 1fr); }
.plot[data-density="high"] { --slot-gap: 0px; }

.chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-block: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.chart-plot {
  display: grid;
  grid-template-columns: repeat(var(--slot-count, 1), minmax(0, 1fr));
  gap: var(--slot-gap);
  height: 174px;
  padding-inline: 3px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(100% / 3));
  border-bottom: 1px solid var(--line);
}

.chart-slot {
  isolation: isolate;
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 5px 5px 0 0;
  background: transparent;
}

.chart-slot:hover, .chart-slot[aria-pressed="true"] { background: #e5ede594; }

.chart-slot:focus-visible { outline-offset: 0; border-radius: 3px; }

.chart-bar {
  position: absolute;
  left: 50%;
  bottom: var(--bar-bottom, 0%);
  width: 87%;
  max-width: 35px;
  height: var(--bar-height, 0%);
  min-height: 2px;
  transform: translateX(-50%);
  border-radius: 4px 4px 1px 1px;
  background: var(--slot-color, var(--idle));
}

.chart-slot[aria-pressed="true"] .chart-bar { box-shadow: 0 0 0 1px #1b4937ad; }
.plot[data-density="high"] .chart-bar { width: 91%; border-radius: 1px 1px 0 0; }

.chart-times {
  display: grid;
  grid-template-columns: repeat(var(--slot-count, 1), minmax(0, 1fr));
  grid-column: 2;
  gap: var(--slot-gap);
  padding: 7px 3px 0;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-times span { position: relative; justify-self: center; }

.chart-times span:first-child { justify-self: start; }
.chart-times span:last-child { justify-self: end; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-block: 14px 2px;
  color: var(--muted);
  font-size: 11px;
}

.legend-item { display: inline-flex; align-items: center; gap: 6px; }

.legend-swatch { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 2px; background: var(--slot-color, var(--idle)); }

[data-kind="solar"] { --slot-color: var(--amber); }
[data-kind="grid"] { --slot-color: var(--grid-charge); }
[data-kind="discharge"] { --slot-color: var(--discharge); }
[data-kind="export"] { --slot-color: var(--battery-export); }
[data-kind="idle"] { --slot-color: var(--idle); }

.chart-empty { padding: 30px 10px; color: var(--muted); font-size: 13px; text-align: center; }
.period-picker { max-width: 260px; margin-block: 13px 10px; }

.plan-preview {
  display: grid;
  grid-template-columns: fit-content(38%) minmax(0, 1fr);
  gap: 7px 13px;
  min-height: 86px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid #e0e9dc;
  border-radius: 12px;
  background: #f0f4ee;
}

.preview-time, .preview-action { font-size: 13px; font-weight: 720; }

.preview-time { color: var(--green-dark); font-variant-numeric: tabular-nums; }

.preview-reason, .preview-data { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.preview-data { font-variant-numeric: tabular-nums; }

.preview-export { grid-column: 1 / -1; padding-top: 4px; border-top: 1px solid var(--line); }
.preview-export summary { min-height: 42px; font-size: 12px; }
.preview-export summary strong { font-weight: 730; }
.preview-export summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.preview-rates {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 3px 0 7px;
  font-size: 12px;
}
.preview-rates dt { color: var(--muted); }
.preview-rates dd { margin-top: 3px; font-weight: 700; font-variant-numeric: tabular-nums; }

.schedule-details { margin-top: 10px; }

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin: 0 4px 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

details[open] > summary::after { margin-block: 4px 0; transform: rotate(225deg); }

.schedule-details summary { padding-inline: 2px; color: var(--green-dark); font-size: 13px; font-weight: 690; }

.schedule-list { margin: 1px 0 0; padding: 0; list-style: none; }

.schedule-list li {
  display: grid;
  grid-template-columns: minmax(82px, .33fr) minmax(0, 1fr);
  gap: 6px 12px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
}

.schedule-list time { color: var(--muted); font-variant-numeric: tabular-nums; }

.schedule-list p + p { margin-top: 2px; color: var(--muted); }

.schedule-list strong { font-weight: 700; }

.history-tabs button { min-height: 40px; }
.history-values { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 17px; }

.history-value {
  flex: 1 1 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5f7f3;
}

.history-value h3 { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.history-value p { margin-top: 4px; font-size: 20px; font-weight: 720; font-variant-numeric: tabular-nums; }
.history-value time { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.history-value[data-series="export"], .history-plot-line[data-series="export"] { --history-color: #a26b19; }
.history-value .legend-swatch { background: var(--history-color, var(--green)); }

.history-chart-plot { display: grid; grid-template-columns: 44px minmax(0, 1fr); }

.history-chart-plot svg {
  display: block;
  width: 100%;
  height: 154px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 50%);
}

.history-plot-line {
  fill: none;
  stroke: var(--history-color, var(--green));
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.history-chart-times {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.history-chart-times time + time { text-align: right; }

.invrida-status { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; font-weight: 690; }
.invrida-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8e9a91; }
.invrida-status[data-state="connected"]::before { background: #488157; }
.invrida-status[data-state="error"] { color: var(--alert); }
.invrida-status[data-state="error"]::before { background: var(--alert); }
.invrida-values { margin-bottom: 11px; }
.invrida-reading-note { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.invrida-times { display: flex; flex-wrap: wrap; gap: 8px 27px; font-size: 12px; }
.invrida-times div { display: grid; gap: 4px; }
.invrida-times dt { color: var(--muted); }
.invrida-times dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 680; }
.invrida-stale { padding: 2px 6px; border-radius: 5px; color: #754913; background: #fbf1dc; font-size: 11px; }
.invrida-form > p { margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.invrida-form .field input { padding-right: 9px; }
.invrida-fields { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.invrida-fields label { flex: 1 1 160px; min-width: 0; max-width: 285px; }
.invrida-disconnect { margin-top: 12px; }
#invrida-readings:not([hidden]) + .invrida-form { margin-top: 12px; }
.invrida-feedback:not(:empty) { margin-top: 8px; }

.control-mode {
  display: flex;
  gap: 9px;
  min-height: 65px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e0e9dc;
  border-radius: 12px;
  background: #f0f5ed;
}

.control-indicator { margin-top: 5px; }
.control-mode[data-state="loading"] .control-indicator { background: #8e9a91; }
.control-mode[data-state="error"] { border-color: #ead8d1; background: #fcf3f0; }
.control-mode[data-state="error"] .control-indicator { background: var(--alert); }

.control-mode h3 { font-size: 14px; }
.control-mode p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }

.action-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.button-primary { color: #fff; background: var(--green); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-secondary { color: var(--ink); background: var(--paper); border-color: var(--line); }
.button-secondary:hover:not(:disabled) { background: var(--green-light); }

.action-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; font-size: 18px; line-height: 1; }

.icon-pause::before, .icon-pause::after { content: ""; width: 2px; height: 10px; margin-inline: 1px; border-radius: 1px; background: currentColor; }

.action-feedback, .form-feedback { color: var(--green-dark); font-size: 12px; line-height: 1.4; }
.action-feedback:not(:empty) { margin-top: 10px; }
.action-feedback[data-error="true"], .form-feedback[data-error="true"] { color: var(--alert); }

.control-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.control-meta div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.control-meta dt { color: var(--muted); }
.control-meta dd { font-weight: 740; text-align: right; }

.settings-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.settings-fields { margin: 0; min-inline-size: 0; padding: 0; border: 0; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px 15px; }
.export-settings { margin: 23px 0 0; min-inline-size: 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); }
.export-settings legend { padding: 0 10px 0 0; font-size: 16px; font-weight: 720; }
.export-settings p { margin-bottom: 11px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.export-settings .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; align-content: start; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 680; }
.input-with-unit { position: relative; display: block; }
.input-with-unit > span { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); pointer-events: none; }

.field input, .field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}

.field input { padding-right: 38px; appearance: textfield; }
.field input::-webkit-inner-spin-button, .field input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 13px; }
.settings-help { margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.footer { margin-top: 18px; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.footer span { margin-inline: 4px; }

@media (max-width: 950px) {
  .topbar-inner, .dashboard { width: calc(100% - 38px); }
  .panel-header { flex-wrap: wrap; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 725px) {
  .topbar-inner, .dashboard { width: calc(100% - 32px); }
  .topbar-inner { gap: 0 10px; min-height: 63px; padding-block: 9px; }
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; grid-column: 1 / -1; flex-direction: column; align-items: stretch; gap: 2px; padding-top: 8px; }
  .main-nav[data-open="true"] { display: flex; }
  .main-nav a, .nav-logout { min-height: 44px; padding-inline: 9px; }
  .dashboard { padding-top: 23px; }
  .page-intro { flex-wrap: wrap; align-items: start; margin-bottom: 15px; }
  .feed-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .feed-status { justify-content: flex-start; min-height: 22px; font-size: 12px; }
  .feed-receipt { flex-basis: 100%; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
  .metric { min-height: 118px; padding: 12px; border-radius: 15px; }
  .metric-value { font-size: clamp(26px, 7vw, 36px); }
  .panel { padding: 15px; border-radius: 15px; }
  .panel-header { margin-bottom: 13px; }
  .invrida-fields { display: grid; }
  .invrida-fields label { max-width: none; }
  .history-value { flex-basis: 125px; }
  .action-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-buttons .button-primary { grid-column: 1 / -1; }
  .action-buttons .button { min-height: 47px; }
  .chart-area, .history-chart-frame { padding-inline: 8px; }
  .chart-plot { height: 134px; }
  .chart-times .end-adjacent { visibility: hidden; }
  .date-tabs button { min-height: 38px; }
  .preview-rates, .export-settings .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 370px) {
  .topbar-inner, .dashboard { width: calc(100% - 24px); }
  .metric-header { gap: 5px; }
  .metric-header h2 { font-size: 11.5px; }
  .metric-icon { margin-right: -4px; transform: scale(.9); transform-origin: left center; }
  .chart-times .start-adjacent { visibility: hidden; }
  .plan-preview { grid-template-columns: 1fr; }
  .control-meta div { display: grid; gap: 4px; }
  .control-meta dd { text-align: left; }
  .fields, .export-settings .fields { grid-template-columns: 1fr; }
}
