:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --ink: #1d2521;
  --muted: #66736c;
  --line: #d7ddd6;
  --green: #20785d;
  --green-soft: #dff2ea;
  --amber: #9b6a13;
  --amber-soft: #fbefd6;
  --red: #aa3f3f;
  --red-soft: #f8dddd;
  --cyan: #1f6f7a;
  --cyan-soft: #dceff2;
  --blue: #285f9f;
  --blue-soft: #dfe9fb;
  --shadow: 0 8px 22px rgba(29, 37, 33, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #202722;
  color: #f5f8f5;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d7f0e5;
  color: #123f32;
  font-size: 14px;
  font-weight: 800;
}

.brand-title {
  font-size: 15px;
  font-weight: 760;
}

.brand-subtitle,
.sidebar-footer {
  color: #b6c2bb;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 7px;
  color: #dce5df;
  font-size: 14px;
  font-weight: 620;
}

.nav-link:hover,
.nav-link.active {
  background: #2f3a33;
  color: #ffffff;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #6f8176;
}

.nav-link.active .nav-dot {
  background: #6fd4a8;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 10px;
}

.session-card {
  display: grid;
  gap: 2px;
}

.session-card span {
  color: #f5f8f5;
  font-size: 13px;
  font-weight: 800;
}

.session-card strong {
  color: #b6c2bb;
  font-size: 12px;
  font-weight: 650;
}

.logout-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: #2f3a33;
  color: #f5f8f5;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 22px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

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

.refresh-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.refresh-link.secondary {
  background: var(--surface-2);
}

.message-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.message {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 750;
}

.message.success {
  border-color: #b9dfce;
  background: var(--green-soft);
  color: var(--green);
}

.message.error {
  border-color: #ecc5c5;
  background: var(--red-soft);
  color: var(--red);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.panel,
.line-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 116px;
  padding: 16px;
  display: grid;
  gap: 6px;
}

.metric-label,
.metric-detail,
.panel-note,
.compact-row span,
.line-panel p,
.line-top span,
.gpio-tile span,
.muted {
  color: var(--muted);
}

.metric-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.metric-detail {
  font-size: 13px;
}

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

.status-item {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.status-item strong {
  margin-left: auto;
  font-size: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.good {
  background: var(--green);
}

.status-dot.warn {
  background: var(--amber);
}

.status-dot.bad {
  background: var(--red);
}

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

.panel {
  padding: 16px;
  margin-bottom: 14px;
}

.panel-head,
.line-top,
.compact-row,
.gpio-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head h2,
.line-top h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.panel-head a {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-row {
  min-height: 38px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.compact-row:last-child {
  border-bottom: 0;
}

.compact-row div {
  display: grid;
  gap: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.good {
  background: var(--green-soft);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.bad {
  background: var(--red-soft);
  color: var(--red);
}

.badge.neutral {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.badge.plan-on,
.badge.plan-keep {
  background: var(--green-soft);
  color: var(--green);
}

.badge.plan-desired {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.badge.plan-off-candidate {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.plan-busy {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.plan-blocked {
  background: var(--red-soft);
  color: var(--red);
}

.badge.plan-neutral {
  background: #edf0ed;
  color: #46534c;
}

.temp {
  font-weight: 800;
  color: var(--cyan);
}

.ac-row {
  align-items: flex-start;
}

.ac-copy {
  min-width: 0;
}

.ac-temp-pair {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
  min-width: 254px;
  text-align: right;
}

.ac-temp-pair span {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.ac-temp-pair strong {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.ac-temp-pair em {
  display: block;
  color: var(--red);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #f9faf8;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 14px 0;
}

.compact-table {
  max-height: 640px;
}

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

.line-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.line-panel p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.node-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.node-pill,
.line-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 7px;
  background: #edf0ed;
  color: #344039;
  font-size: 12px;
  font-weight: 760;
}

.node-pill.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.node-pill.ipmi {
  border-color: #cce9d7;
  background: #f0faf4;
  color: #2f7650;
}

.node-pill.online {
  border-color: #2f8457;
  background: #3c9d67;
  color: #ffffff;
}

.line-chip {
  margin: 1px 3px 1px 0;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.line-chip.line-on {
  background: var(--green-soft);
  color: var(--green);
}

.line-chip.line-off {
  background: #edf0ed;
  color: #46534c;
}

.line-chip.line-unknown {
  background: var(--red-soft);
  color: var(--red);
}

.node-pill.plan-on {
  border-color: #9bcfb8;
  background: var(--green-soft);
  color: var(--green);
}

.node-pill.plan-desired {
  border-color: #badfe5;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.node-pill.plan-off-candidate {
  border-color: #ecd19a;
  background: var(--amber-soft);
  color: var(--amber);
}

.hpc-power-summary .metric {
  min-height: 108px;
}

.runtime-summary .metric {
  min-height: 108px;
}

.runtime-summary .metric strong .badge {
  min-height: 30px;
  font-size: 12px;
}

.runtime-history .notice-row {
  min-height: 34px;
  padding: 9px 12px;
}

.control-panel {
  display: grid;
  align-content: start;
}

.control-form {
  display: grid;
  gap: 10px;
}

.control-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.control-form input[type="number"] {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
}

.control-form textarea {
  min-height: 156px;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.dense-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.dense-form button {
  min-width: 0;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.button-row.wrap {
  flex-wrap: wrap;
}

.button-row form {
  margin: 0;
}

.small-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

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

.check-row {
  min-height: 40px;
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  padding: 8px 10px;
  color: var(--ink) !important;
  text-transform: none !important;
}

.check-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.primary-button,
.danger-button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
}

.primary-button {
  background: var(--green);
}

.danger-button {
  background: var(--red);
}

.danger-zone {
  border-color: #ecc5c5;
}

.power-plan-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

.power-plan-editor button {
  min-width: 150px;
}

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

.ac-control-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
}

.ac-control-item .panel-head h2 {
  font-size: 15px;
}

.control-mini-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.control-mini-facts span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.control-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--line);
}

.control-subhead {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.25;
}

.temporary-gpio-list {
  display: grid;
  gap: 8px;
}

.temporary-gpio-row,
.alarm-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 8px 10px;
}

.alarm-control {
  margin-top: 8px;
  border-color: #badfe5;
  background: #f4fbfc;
}

.temporary-gpio-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.temporary-gpio-meta strong {
  font-size: 13px;
}

.temporary-gpio-meta span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.compact-actions {
  margin-top: 0;
}

.control-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.control-status-item {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  font-size: 13px;
}

.control-status-item span {
  color: var(--muted);
  line-height: 1.4;
}

.audit-table td {
  vertical-align: top;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.plan-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.plan-facts div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.plan-facts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.plan-facts strong {
  font-size: 20px;
}

.plan-block {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.power-plan-table tbody tr.plan-on-row {
  background: #f3fbf7;
}

.power-plan-table tbody tr.plan-desired-row {
  background: #f4fbfc;
}

.power-plan-table tbody tr.plan-idle-row {
  background: #fffaf0;
}

.power-plan-table tbody tr.plan-busy-row {
  background: #f5f8ff;
}

.power-plan-table tbody tr.plan-blocked-row {
  background: #fff7f7;
}

.cell-note {
  display: block;
  max-width: 220px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.server-control-table td:last-child {
  min-width: 300px;
}

.server-action-row {
  margin-top: 0;
  gap: 6px;
}

.server-action-row .small-button {
  min-width: 76px;
}

.gpio-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

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

.temperature-tile {
  min-height: 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.temperature-tile div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.temperature-tile span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.temperature-tile .temperature-value {
  color: var(--cyan);
  font-size: 20px;
  font-weight: 850;
  white-space: nowrap;
}

.temperature-tile .temperature-value.bad {
  color: var(--red);
}

.gpio-tile {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.gpio-tile div {
  display: grid;
  gap: 3px;
}

.alert-panel {
  border-color: #ecc5c5;
}

.notice-row {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  font-size: 13px;
}

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

.history-toolbar {
  display: grid;
  gap: 12px;
}

.history-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) repeat(2, minmax(190px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
}

.history-controls label {
  display: grid;
  gap: 5px;
}

.history-controls label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-controls select,
.history-controls input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 9px;
  font: inherit;
  font-size: 13px;
}

.history-controls button {
  justify-content: center;
  cursor: pointer;
}

.history-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 9px;
  font-size: 13px;
  font-weight: 700;
}

.history-status.good {
  background: var(--green-soft);
  color: var(--green);
}

.history-status.bad {
  background: var(--red-soft);
  color: var(--red);
}

.series-controls {
  display: grid;
  gap: 8px;
  margin: 12px 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.series-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.series-control-actions {
  display: flex;
  gap: 6px;
}

.series-control-actions button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  min-height: 28px;
  padding: 0 10px;
}

.series-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.series-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 230px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.series-pill:has(input:not(:checked)) {
  color: var(--muted);
  opacity: 0.62;
}

.series-pill input {
  margin: 0;
}

.series-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.series-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-chart {
  width: 100%;
  min-height: 470px;
}

.history-chart.pin-chart {
  min-height: 520px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
}

.login-brand .brand-subtitle {
  color: var(--muted);
}

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

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

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  text-transform: none;
}

.login-form button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
}

.login-error {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid #ecc5c5;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 1180px) {
  .summary-grid,
  .power-grid,
  .status-strip,
  .plan-facts,
  .control-status-grid,
  .power-plan-editor,
  .ac-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

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

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .main {
    padding: 16px;
  }

  .topbar,
  .two-column,
  .summary-grid,
  .power-grid,
  .status-strip,
  .gpio-grid,
  .temperature-grid,
  .plan-facts,
  .control-status-grid,
  .dense-form,
  .check-grid,
  .power-plan-editor,
  .ac-control-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .ac-row {
    align-items: stretch;
    flex-direction: column;
  }

  .ac-temp-pair {
    min-width: 0;
    text-align: left;
  }

  .history-controls {
    grid-template-columns: 1fr;
  }

  .history-chart,
  .history-chart.pin-chart {
    min-height: 360px;
  }

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

  .series-control-actions {
    width: 100%;
  }

  .series-control-actions button {
    flex: 1;
  }

  .temporary-gpio-row,
  .alarm-control {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compact-actions {
    width: 100%;
  }

  .compact-actions form,
  .compact-actions button {
    flex: 1;
  }
}
