:root {
  --bg: #eef7ff;
  --bg-strong: linear-gradient(135deg, #f7fbff 0%, #e8f4ff 38%, #edfff7 68%, #fff8d8 100%);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: rgba(255, 255, 255, 0.96);
  --panel-border: rgba(11, 124, 255, 0.2);
  --text: #061827;
  --muted: #526c80;
  --accent: #0a7cff;
  --accent-strong: #034fb9;
  --accent-soft: rgba(10, 124, 255, 0.13);
  --sport-yellow: #d7ff2f;
  --sport-yellow-strong: #f3ff92;
  --sport-yellow-soft: rgba(215, 255, 47, 0.24);
  --success: #00bfa6;
  --success-soft: rgba(0, 191, 166, 0.14);
  --warm: #d7ff2f;
  --warm-soft: rgba(215, 255, 47, 0.22);
  --danger: #ff4d3d;
  --danger-soft: rgba(255, 77, 61, 0.13);
  --track-navy: #061b36;
  --ghost-text: #173300;
  --panel-gradient: linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(241, 248, 255, 0.72));
  --card-gradient: linear-gradient(155deg, rgba(255, 255, 255, 0.92), rgba(241, 248, 255, 0.66));
  --chip-bg: rgba(255, 255, 255, 0.72);
  --chip-border: rgba(10, 124, 255, 0.15);
  --input-bg: rgba(255, 255, 255, 0.86);
  --overlay-bg: rgba(7, 24, 39, 0.36);
  --drawer-bg: rgba(248, 252, 255, 0.98);
  --warning-text: #b12a18;
  --yellow-text: #4a5a00;
  --surface-highlight: rgba(255, 255, 255, 0.72);
  --slot-hover: rgba(10, 124, 255, 0.08);
  --canvas-glow-a: rgba(10, 124, 255, 0.18);
  --canvas-glow-b: rgba(0, 194, 168, 0.14);
  --canvas-glow-c: rgba(215, 255, 47, 0.16);
  --shadow: 0 24px 58px rgba(3, 86, 201, 0.13);
  --shadow-card: 0 16px 36px rgba(3, 86, 201, 0.1);
  --shadow-soft: 0 10px 24px rgba(3, 86, 201, 0.08);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}


:root[data-theme="outdoor-green"] {
  --bg: #effcf7;
  --bg-strong: linear-gradient(135deg, #fbfffd 0%, #e3fff4 40%, #fff4e4 74%, #edf8ff 100%);
  --panel: rgba(255, 255, 255, 0.8);
  --panel-solid: rgba(255, 255, 255, 0.96);
  --panel-border: rgba(0, 169, 129, 0.22);
  --text: #06231e;
  --muted: #5b716b;
  --accent: #00a981;
  --accent-strong: #007660;
  --accent-soft: rgba(0, 169, 129, 0.14);
  --sport-yellow: #ff9a26;
  --sport-yellow-strong: #ffc65f;
  --sport-yellow-soft: rgba(255, 154, 38, 0.2);
  --success: #00bfa6;
  --success-soft: rgba(0, 191, 166, 0.14);
  --warm: #ff9a26;
  --warm-soft: rgba(255, 154, 38, 0.17);
  --danger: #ff4d3d;
  --danger-soft: rgba(255, 77, 61, 0.13);
  --track-navy: #06382f;
  --ghost-text: #3a2100;
  --panel-gradient: linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(236, 255, 247, 0.72));
  --card-gradient: linear-gradient(155deg, rgba(255, 255, 255, 0.92), rgba(239, 255, 247, 0.66));
  --chip-bg: rgba(255, 255, 255, 0.74);
  --chip-border: rgba(0, 169, 129, 0.16);
  --input-bg: rgba(255, 255, 255, 0.87);
  --overlay-bg: rgba(8, 34, 30, 0.36);
  --drawer-bg: rgba(248, 255, 252, 0.98);
  --warning-text: #b73319;
  --yellow-text: #6a3400;
  --surface-highlight: rgba(255, 255, 255, 0.7);
  --slot-hover: rgba(0, 169, 129, 0.08);
  --canvas-glow-a: rgba(0, 169, 129, 0.18);
  --canvas-glow-b: rgba(255, 154, 38, 0.12);
  --canvas-glow-c: rgba(0, 194, 168, 0.14);
  --shadow: 0 24px 58px rgba(0, 122, 99, 0.13);
  --shadow-card: 0 16px 36px rgba(0, 122, 99, 0.1);
  --shadow-soft: 0 10px 24px rgba(0, 122, 99, 0.08);
}


:root[data-theme="night-neon"] {
  --bg: #07111f;
  --bg-strong: linear-gradient(135deg, #050b14 0%, #07192f 42%, #082a34 72%, #162300 100%);
  --panel: rgba(9, 22, 38, 0.82);
  --panel-solid: rgba(12, 28, 47, 0.96);
  --panel-border: rgba(0, 209, 255, 0.28);
  --text: #eff8ff;
  --muted: #9bb2c8;
  --accent: #00d1ff;
  --accent-strong: #8beeff;
  --accent-soft: rgba(0, 209, 255, 0.16);
  --sport-yellow: #d7ff2f;
  --sport-yellow-strong: #efff7a;
  --sport-yellow-soft: rgba(215, 255, 47, 0.18);
  --success: #00e4b5;
  --success-soft: rgba(0, 228, 181, 0.15);
  --warm: #d7ff2f;
  --warm-soft: rgba(215, 255, 47, 0.17);
  --danger: #ff6658;
  --danger-soft: rgba(255, 102, 88, 0.15);
  --track-navy: #020816;
  --ghost-text: #152500;
  --panel-gradient: linear-gradient(150deg, rgba(13, 31, 53, 0.94), rgba(7, 20, 36, 0.76));
  --card-gradient: linear-gradient(155deg, rgba(15, 35, 58, 0.92), rgba(8, 24, 43, 0.72));
  --chip-bg: rgba(12, 30, 50, 0.78);
  --chip-border: rgba(0, 209, 255, 0.22);
  --input-bg: rgba(10, 27, 46, 0.9);
  --overlay-bg: rgba(2, 8, 22, 0.58);
  --drawer-bg: rgba(7, 18, 32, 0.98);
  --warning-text: #ff9b93;
  --yellow-text: #eaff7b;
  --surface-highlight: rgba(255, 255, 255, 0.08);
  --slot-hover: rgba(0, 209, 255, 0.1);
  --canvas-glow-a: rgba(0, 209, 255, 0.18);
  --canvas-glow-b: rgba(215, 255, 47, 0.1);
  --canvas-glow-c: rgba(0, 228, 181, 0.12);
  --shadow: 0 24px 56px rgba(0, 209, 255, 0.11);
  --shadow-card: 0 16px 36px rgba(0, 209, 255, 0.09);
  --shadow-soft: 0 10px 24px rgba(0, 209, 255, 0.07);
}


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg-strong);
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, var(--canvas-glow-a), transparent 28%),
    radial-gradient(circle at 86% 14%, var(--canvas-glow-c), transparent 24%),
    radial-gradient(circle at 70% 92%, var(--canvas-glow-b), transparent 30%);
  opacity: 0.9;
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px;
  display: grid;
  gap: 14px;
  grid-template-rows: auto 1fr;
}

.panel {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.08);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--surface-highlight), transparent 42%);
  opacity: 0.42;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.title-block h1,
.section-heading h2,
.settings-header h2 {
  margin: 6px 0 0;
}

.action-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-row.compact {
  flex-wrap: nowrap;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.ghost-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 11px 18px;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: linear-gradient(135deg, var(--sport-yellow) 0%, var(--sport-yellow-strong) 100%);
  color: var(--ghost-text);
  box-shadow: 0 8px 18px var(--sport-yellow-soft);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 18px var(--accent-soft);
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.ghost-button:disabled,
.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.alert-strip {
  display: none !important;
  gap: 10px;
}

.alert-strip.hidden,
.settings-overlay.hidden {
  display: none;
}

.alert-card {
  border-radius: 22px;
  padding: 14px 18px;
  background: var(--danger-soft);
  border: 1px solid var(--danger);
}

.alert-card strong,
.alert-card p,
.alert-card small {
  display: block;
}

.alert-card p {
  margin: 6px 0;
}

.main-grid {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.top-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

body.camera-disabled.reminder-disabled .top-panels {
  grid-template-columns: minmax(0, 1fr);
}

body.camera-disabled:not(.reminder-disabled) .top-panels,
body.reminder-disabled:not(.camera-disabled) .top-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.camera-disabled #camera-monitor-card,
body.reminder-disabled #vitamin-reminder-card {
  display: none;
}

.board-panel,
.system-panel {
  border-radius: var(--radius-xl);
  padding: 18px;
  min-height: 0;
}

.board-panel {
  position: relative;
}

.section-heading {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 2px 2px 4px;
}

.board-title-area {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 44px;
}

.board-title-area h2 {
  min-width: 0;
  color: var(--text);
  letter-spacing: -0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.title-info-row {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(240px, 28vw);
  min-width: 0;
}

.title-info-row.has-wash-car {
  grid-template-columns: auto auto minmax(0, 1fr);
  width: min(320px, 34vw);
}

.title-info-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 999px;
  color: var(--text);
  border: 1px solid var(--success);
  background: linear-gradient(135deg, rgba(215, 255, 47, 0.24), rgba(0, 194, 168, 0.14));
  white-space: nowrap;
}

.title-info-chip span {
  flex: 0 0 auto;
  font-size: 1.18rem;
  line-height: 1;
}

.title-info-chip strong {
  min-width: 0;
  font-size: 0.86rem;
}

.traffic-restriction-chip {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.1));
}

.play-window-inline,
.wash-car-chip {
  width: 38px;
  padding-inline: 0;
}

.wash-car-chip {
  border-color: rgba(255, 77, 61, 0.78);
  background: linear-gradient(135deg, rgba(255, 77, 61, 0.2), rgba(255, 255, 255, 0.1));
}

.legacy-current-panel-title {
  display: none;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.board-meta {
  flex: 1 1 100%;
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--accent-strong);
  font-size: 0.84rem;
  line-height: 1;
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  box-shadow: var(--shadow-soft);
}

.inline-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 0 4px;
}

.inline-clock strong {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.forecast-days {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
  align-items: start;
}

.feature-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--panel-gradient);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-card);
  min-height: 0;
  min-width: 0;
}

.feature-card::after,
.day-column::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 1px 1px auto 1px;
  height: 42%;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--surface-highlight), transparent);
  opacity: 0.28;
}

.feature-card > *,
.day-column > * {
  position: relative;
  z-index: 1;
}

.feature-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.feature-card-header h3 {
  margin: 6px 0 0;
  font-size: 1.05rem;
}

.feature-card-text {
  margin: 0;
  line-height: 1.45;
}

.reminder-panel.alerting {
  border-color: var(--danger);
  box-shadow: 0 14px 32px var(--danger-soft);
}

.reminder-panel.done {
  border-color: var(--success);
}

.reminder-panel .primary-button[disabled] {
  cursor: default;
}

.reminder-task-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.reminder-task-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--chip-border);
  border-radius: 50%;
  background: var(--chip-bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 var(--surface-highlight), var(--shadow-soft);
}

.reminder-task-button.alerting {
  border-width: 2px;
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--sport-yellow) 0%, var(--sport-yellow-strong) 100%);
  color: var(--ghost-text);
  box-shadow: 0 0 0 2px rgba(255, 77, 61, 0.28), 0 12px 28px var(--danger-soft);
  animation: reminder-pulse 1.4s ease-in-out infinite;
}

.reminder-task-button.done {
  border-color: var(--success);
  background: linear-gradient(180deg, var(--success-soft), var(--chip-bg));
}

.reminder-task-button:disabled {
  cursor: default;
}

.reminder-person-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}

.reminder-person-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--chip-bg), rgba(255, 255, 255, 0.34));
  border: 1px solid var(--chip-border);
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.reminder-avatar,
.settings-avatar-preview {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), var(--sport-yellow-soft));
  border: 1px solid var(--panel-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  font-weight: 700;
  flex: 0 0 auto;
}

.reminder-avatar img,
.settings-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reminder-person-card.alerting {
  border-color: var(--danger);
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(255, 77, 61, 0.28), 0 14px 34px var(--danger-soft);
  animation: reminder-pulse 1.4s ease-in-out infinite;
}

.reminder-person-card.done {
  border-color: var(--success);
  background: linear-gradient(180deg, var(--success-soft), var(--chip-bg));
}

.reminder-person-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.reminder-person-copy strong {
  font-size: 1rem;
  flex: 0 0 auto;
}

.reminder-person-copy .feature-card-text {
  display: none;
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-upload-row input[type="file"] {
  min-width: 0;
  width: 100%;
}

.reminder-task-settings {
  display: grid;
  gap: 10px;
}

.reminder-person-setting {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
}

.reminder-task-setting {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) repeat(3, minmax(72px, 0.75fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--chip-border);
  border-radius: 16px;
  background: var(--chip-bg);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
}

.reminder-task-setting label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.reminder-task-enabled {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
}

.reminder-task-enabled input {
  width: auto;
}

.reminder-task-setting-icon {
  font-size: 1.1rem;
}

.reminder-task-setting span {
  color: var(--muted);
  font-size: 0.72rem;
}

.camera-placeholder {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.camera-stream-frame,
.camera-placeholder-screen {
  border-radius: 18px;
  min-height: 0;
  height: 100%;
}

.camera-stream-frame {
  display: block;
  width: 100%;
  border: 0;
  background: var(--track-navy);
}

.camera-stream-frame.hidden,
.camera-placeholder-screen.hidden {
  display: none;
}

.camera-placeholder-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background:
    radial-gradient(circle at 22% 18%, var(--accent-soft), transparent 28%),
    linear-gradient(135deg, var(--track-navy), var(--accent-strong)),
    repeating-linear-gradient(90deg, var(--sport-yellow-soft) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 18px);
  box-shadow: inset 0 0 0 1px var(--sport-yellow-soft), inset 0 18px 48px var(--accent-soft);
  user-select: none;
}

.camera-placeholder-screen::before {
  content: "LIVE";
  position: absolute;
  left: 14px;
  top: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--ghost-text);
  background: linear-gradient(135deg, var(--sport-yellow), var(--sport-yellow-strong));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.camera-placeholder-screen::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.camera-lock-hint {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  max-width: min(78%, 340px);
  padding: 18px 20px;
  border-radius: 18px;
  text-align: center;
  color: var(--text);
  background: rgba(4, 10, 28, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.camera-lock-hint strong {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.camera-lock-hint span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.camera-pin-form {
  width: min(82%, 360px);
}

.camera-pin-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.camera-pin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.camera-pin-input,
.camera-pin-button {
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font: inherit;
}

.camera-pin-input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.camera-pin-input:focus {
  border-color: var(--sport-yellow);
  box-shadow: 0 0 0 3px var(--sport-yellow-soft);
}

.camera-pin-button {
  padding: 0 14px;
  color: var(--ghost-text);
  background: linear-gradient(135deg, var(--sport-yellow), var(--sport-yellow-strong));
  cursor: pointer;
  font-weight: 900;
}

.camera-pin-button:disabled,
.camera-pin-input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.weather-alert-card,
.weather-alert-content {
  height: 100%;
  min-height: 0;
}

.weather-alert-card {
  display: grid;
}

.weather-alert-card.empty {
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background:
    radial-gradient(circle at 22% 18%, var(--success-soft), transparent 28%),
    linear-gradient(135deg, var(--track-navy), var(--accent-strong)),
    repeating-linear-gradient(90deg, var(--sport-yellow-soft) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 18px);
  box-shadow: inset 0 0 0 1px var(--sport-yellow-soft), inset 0 18px 48px var(--accent-soft);
}

.weather-alert-empty {
  height: 100%;
}

.middle-info-stack {
  display: grid;
  grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.middle-info-stack:has(.weather-alert-summary) {
  grid-template-rows: minmax(54px, 0.72fr) minmax(0, 1.28fr);
}

.middle-info-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 77, 61, 0.26), transparent 34%),
    linear-gradient(135deg, rgba(255, 77, 61, 0.16), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 32px var(--danger-soft);
  text-align: left;
}

.weather-alert-summary {
  cursor: pointer;
}

.play-window-summary {
  border-color: var(--success);
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 194, 168, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(215, 255, 47, 0.2), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 32px rgba(0, 194, 168, 0.18);
}

.current-weather-summary {
  grid-template-columns: minmax(0, 1fr);
  border-color: var(--accent);
  background:
    radial-gradient(circle at 15% 20%, var(--sport-yellow-soft), transparent 36%),
    linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 32px var(--accent-soft);
}

.top-current-card {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(96px, 0.78fr) minmax(0, 1.35fr);
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--text);
  background:
    radial-gradient(circle at 16% 18%, var(--sport-yellow-soft), transparent 38%),
    linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 32px var(--accent-soft);
}

.aquarium-temperature-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: clamp(52px, 5vw, 68px);
  height: clamp(52px, 5vw, 68px);
  border-radius: 999px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  overflow: hidden;
  color: var(--text);
  border: 2px solid var(--accent);
  background:
    radial-gradient(circle at 32% 26%, var(--sport-yellow-soft), transparent 42%),
    var(--chip-bg);
  box-shadow: inset 0 1px 0 var(--surface-highlight), 0 10px 24px var(--accent-soft);
  font-variant-numeric: tabular-nums;
  font: inherit;
  padding: 0;
  appearance: none;
  cursor: pointer;
}

.aquarium-temperature-badge::before,
.aquarium-temperature-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -38%;
  width: 145%;
  height: 92%;
  border-radius: 43%;
  transform: translateX(-50%);
  pointer-events: none;
}

.aquarium-temperature-badge::before {
  background: rgba(0, 194, 168, 0.28);
  animation: aquarium-wave 4.6s linear infinite;
}

.aquarium-temperature-badge::after {
  bottom: -42%;
  background: rgba(11, 124, 255, 0.2);
  animation: aquarium-wave 6.2s linear infinite reverse;
}

.aquarium-temperature-badge strong {
  position: relative;
  z-index: 1;
  font-size: clamp(0.9rem, 1.35vw, 1.12rem);
  line-height: 1;
}

.aquarium-temperature-badge.is-warning {
  color: #fff;
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--danger), #ff8a7e);
  box-shadow: 0 0 0 3px rgba(255, 77, 61, 0.28), 0 12px 28px var(--danger-soft);
  animation: aquarium-warning-pulse 1s ease-in-out infinite;
}

.top-current-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--chip-bg), rgba(255, 255, 255, 0.18));
  border: 1px solid var(--chip-border);
}

.top-current-temperature {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--text);
  font-size: clamp(1.02rem, 2.4vw, 1.76rem);
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.top-current-icon {
  display: grid;
  place-items: center;
  width: clamp(48px, 5vw, 68px);
  height: clamp(48px, 5vw, 68px);
  border-radius: 20px;
  color: var(--sport-yellow);
  background: linear-gradient(135deg, var(--track-navy), var(--accent-strong));
  border: 0;
  box-shadow: inset 0 0 0 1px var(--sport-yellow-soft), 0 12px 24px var(--accent-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.top-current-icon:active {
  transform: scale(0.96);
}

.top-current-icon .weather-icon {
  width: clamp(32px, 3.8vw, 48px);
  height: clamp(32px, 3.8vw, 48px);
  color: currentColor;
}

.top-current-label {
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 2;
  transform: translate(-50%, -50%) scale(0.94);
  max-width: calc(100% - 12px);
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ghost-text);
  background: linear-gradient(135deg, var(--sport-yellow), var(--sport-yellow-strong));
  box-shadow: 0 10px 22px var(--accent-soft);
  font-size: clamp(0.72rem, 1.1vw, 0.92rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.top-current-label.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.top-current-copy {
  display: grid;
  align-content: center;
  min-width: 0;
}

.top-current-copy span,
.top-current-copy em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-current-copy strong {
  display: block;
  margin: 1px 0;
  font-size: clamp(1.28rem, 3vw, 2.05rem);
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.top-current-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.top-current-metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 6px;
  align-content: center;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 14px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
}

.top-current-metric > span {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 1rem;
  line-height: 1;
}

.top-current-metric small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-current-metric strong {
  min-width: 0;
  font-size: clamp(0.78rem, 1.25vw, 1rem);
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-weather-grid {
  display: grid;
  grid-template-columns: minmax(52px, 0.7fr) repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
  align-items: stretch;
}

.weather-alert-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 86px;
}

.weather-alert-icons span,
.weather-alert-detail-icon,
.play-window-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--danger);
  box-shadow: 0 8px 18px var(--danger-soft);
  font-size: 1.2rem;
  font-weight: 900;
}

.play-window-icon {
  background: var(--success);
  box-shadow: 0 8px 18px rgba(0, 194, 168, 0.2);
}

.weather-alert-copy {
  min-width: 0;
}

.weather-alert-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
}

.weather-alert-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.weather-alert-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 8, 23, 0.62);
  backdrop-filter: blur(10px);
}

.weather-alert-modal.hidden {
  display: none;
}

.weather-alert-modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(680px, calc(100dvh - 48px));
  overflow: auto;
  border-radius: 24px;
  padding: 22px;
  border: 1px solid var(--danger);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.weather-alert-modal-card h2 {
  margin: 0 48px 16px 0;
}

.weather-alert-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--danger);
  color: #fff;
}

.weather-alert-modal-body {
  display: grid;
  gap: 12px;
}

.weather-alert-detail {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: var(--danger-soft);
}

.weather-alert-detail strong,
.weather-alert-detail small {
  display: block;
}

.weather-alert-detail p {
  margin: 6px 0;
  line-height: 1.45;
}

.hourly-forecast-table {
  display: grid;
  gap: 6px;
  min-width: 560px;
}

.hourly-forecast-head,
.hourly-forecast-row {
  display: grid;
  grid-template-columns: 54px minmax(112px, 1.25fr) repeat(5, minmax(48px, 0.72fr));
  gap: 8px;
  align-items: center;
}

.hourly-forecast-head {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.hourly-forecast-row {
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--chip-bg);
  font-size: 0.84rem;
}

.hourly-forecast-row.missing {
  color: var(--muted);
  opacity: 0.72;
}

.hourly-forecast-weather {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hourly-forecast-weather svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.hourly-forecast-weather strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes reminder-pulse {
  0%,
  100% {
    transform: scale(1);
    background: linear-gradient(180deg, var(--danger-soft), var(--chip-bg));
  }
  50% {
    transform: scale(1.018);
    background: linear-gradient(135deg, var(--sport-yellow) 0%, var(--sport-yellow-strong) 100%);
    color: var(--ghost-text);
    box-shadow: inset 0 0 0 2px rgba(255, 77, 61, 0.68);
  }
}

@keyframes aquarium-warning-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.08);
    filter: brightness(1.18);
  }
}

@keyframes aquarium-wave {
  from {
    transform: translateX(-50%) rotate(0deg);
  }
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

body.camera-disabled.reminder-disabled .top-panels {
  grid-template-columns: minmax(0, 1fr);
}

body.camera-disabled:not(.reminder-disabled) .top-panels,
body.reminder-disabled:not(.camera-disabled) .top-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.board-meta,
.status-text,
.day-type-pill {
  display: none;
}

.day-column {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--card-gradient);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-card);
}

.day-column.today {
  border-color: var(--accent);
}

.day-column.tomorrow {
  border-color: var(--success);
}

.day-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 2px 2px 0;
}

.day-header h3 {
  margin: 2px 0 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.day-tag {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.day-tag:hover,
.day-tag:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.16);
}

.day-column.today .day-tag {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.day-column.tomorrow .day-tag {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--success), var(--accent));
}

.day-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  margin-top: 6px;
}

.day-type-pill.weekend,
.day-type-pill.non-workday {
  background: var(--sport-yellow-soft);
  color: var(--yellow-text);
}

.day-type-pill.holiday {
  background: var(--danger-soft);
  color: var(--warning-text);
}

.slot-head {
  display: grid;
  grid-template-columns: 46px minmax(72px, 1.15fr) repeat(5, minmax(38px, 0.68fr));
  gap: 3px;
  padding: 0 5px 2px 5px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.slot-head span {
  white-space: nowrap;
}

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

.slot-card {
  display: grid;
  grid-template-columns: 46px minmax(72px, 1.15fr) repeat(5, minmax(38px, 0.68fr));
  align-items: center;
  gap: 3px;
  padding: 8px 5px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--panel-solid), rgba(255, 255, 255, 0.58));
  border: 1px solid var(--chip-border);
  border-left: 6px solid var(--success);
  box-shadow: inset 0 1px 0 var(--surface-highlight), 0 8px 18px rgba(7, 24, 39, 0.04);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.slot-card:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--panel-solid), var(--slot-hover));
  box-shadow: inset 0 1px 0 var(--surface-highlight), var(--shadow-soft);
}

.slot-card.missing {
  opacity: 0.68;
  background: rgba(255, 255, 255, 0.32);
  border-left-color: rgba(85, 106, 124, 0.32);
  box-shadow: none;
}

.slot-card.medium {
  border-left-color: var(--sport-yellow);
}

.slot-card.high {
  border-left-color: var(--danger);
}

.slot-time {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.slot-weather {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.weather-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: 0 0 auto;
}

.weather-label {
  display: grid;
  min-width: 0;
}

.weather-label strong {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-metric {
  display: block;
  min-width: 0;
}

.slot-metric strong {
  display: block;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.slot-metric.is-warning strong,
.slot-metric.is-warning span {
  color: var(--warning-text);
}

.slot-metric.is-warning strong {
  font-weight: 900;
  text-shadow: 0 0 12px var(--danger-soft);
}

.slot-metric span {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.current-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, auto));
  gap: 8px;
}

.inline-current-summary {
  flex: 1 1 420px;
  align-items: center;
}

.play-window-inline {
  flex: 0 1 auto;
}

.play-window-inline span {
  font-size: 1.08rem;
  line-height: 1;
}

.play-window-inline strong {
  font-size: 0.94rem;
}

.current-card,
.system-item {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  box-shadow: inset 0 1px 0 var(--surface-highlight), var(--shadow-soft);
}

.current-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.current-metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
}

.current-metric-icon .weather-icon {
  width: 20px;
  height: 20px;
}

.current-weather-summary .current-card {
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-color: var(--chip-border);
  background: rgba(255, 255, 255, 0.1);
}

.current-weather-summary .current-metric-icon {
  color: var(--sport-yellow);
  filter: drop-shadow(0 0 10px var(--accent));
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
}

.current-weather-summary .current-metric-icon .weather-icon {
  width: clamp(24px, 3.6vw, 34px);
  height: clamp(24px, 3.6vw, 34px);
}

.current-weather-summary .current-card strong {
  font-size: clamp(0.78rem, 1.45vw, 1.08rem);
  display: block;
  min-width: max-content;
}

.current-weather-summary .current-weather-card {
  padding: 8px;
}

.current-weather-summary .current-weather-card .current-metric-icon {
  color: var(--sport-yellow);
  filter: drop-shadow(0 0 12px var(--sport-yellow-soft));
}

.current-weather-summary .current-weather-card .current-metric-icon .weather-icon {
  width: clamp(42px, 5.8vw, 64px);
  height: clamp(42px, 5.8vw, 64px);
}

.current-card strong,
.system-item strong {
  display: block;
  margin-top: 0;
  font-size: 0.96rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-status {
  display: grid;
  gap: 10px;
}

.status-text {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 0%, var(--canvas-glow-a), transparent 32%),
    var(--drawer-bg);
  box-shadow: -24px 0 54px rgba(3, 86, 201, 0.2);
  border-left: 1px solid var(--panel-border);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  overflow: hidden;
}

.settings-drawer.open {
  transform: translateX(0);
}

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

.settings-header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
}

.settings-header-actions .primary-button,
.settings-header-actions .ghost-button {
  white-space: nowrap;
}

.settings-form {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px calc(24px + env(safe-area-inset-bottom)) 0;
}

.field,
.field-grid {
  display: grid;
  gap: 8px;
}

.settings-form > .field,
.settings-form > .field-grid,
.threshold-section {
  padding: 12px;
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
}

.field span {
  font-weight: 600;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.theme-option {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.theme-option:hover {
  transform: translateY(-1px);
}

.theme-option.selected,
.theme-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent-soft), 0 8px 18px var(--accent-soft);
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.theme-swatch {
  height: 26px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(7, 24, 39, 0.08);
}

.theme-race-blue .theme-swatch {
  background: linear-gradient(135deg, #0b7cff 0 42%, #d7ff2f 42% 74%, #00c2a8 74% 100%);
}

.theme-outdoor-green .theme-swatch {
  background: linear-gradient(135deg, #00a981 0 42%, #ff8f1f 42% 74%, #00c2a8 74% 100%);
}

.theme-night-neon .theme-swatch {
  background: linear-gradient(135deg, #07111f 0 34%, #00d1ff 34% 68%, #d7ff2f 68% 100%);
}

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

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

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--chip-border);
  background: var(--input-bg);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--sport-yellow-soft);
  border-color: var(--accent);
}

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

.hour-chip {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--muted);
  border-radius: 14px;
  padding: 10px 0;
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: transform 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.hour-chip:hover {
  transform: translateY(-1px);
  color: var(--accent-strong);
  border-color: var(--accent);
}

.hour-chip.active {
  background: linear-gradient(135deg, var(--sport-yellow-soft), var(--accent-soft));
  color: var(--accent-strong);
  border-color: var(--accent);
  font-weight: 700;
}

.selected-hours-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.9rem;
}

@media (min-width: 901px) and (max-width: 1366px) {
  .app-shell {
    padding: 14px;
    gap: 12px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .icon-button svg {
    width: 18px;
    height: 18px;
  }

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

  .meta-chip {
    padding: 5px 9px;
    font-size: 0.76rem;
  }

  .board-panel,
  .system-panel {
    padding: 14px;
  }

  .section-heading {
    margin-bottom: 10px;
  }

  .section-heading h2 {
    font-size: 1.2rem;
  }

  .inline-clock {
    gap: 8px;
  }

  .inline-clock strong {
    font-size: 1rem;
  }

  .forecast-days {
    gap: 10px;
  }

  .top-panels {
    gap: 10px;
  }

  .feature-card {
    padding: 12px;
    border-radius: 20px;
  }

  .day-column {
    padding: 12px;
    gap: 8px;
    border-radius: 20px;
  }

  .day-header h3 {
    font-size: 1.08rem;
  }

  .day-type-pill {
    padding: 3px 8px;
    font-size: 0.72rem;
    margin-top: 4px;
  }

  .slot-list {
    gap: 6px;
  }

  .slot-head {
    grid-template-columns: 38px minmax(62px, 1.1fr) repeat(5, minmax(32px, 0.64fr));
    gap: 2px;
    padding: 0 4px 2px 4px;
    font-size: 0.58rem;
  }

  .slot-card {
    grid-template-columns: 38px minmax(62px, 1.1fr) repeat(5, minmax(32px, 0.64fr));
    gap: 2px;
    padding: 7px 4px;
    border-radius: 14px;
    border-left-width: 5px;
  }

  .slot-time {
    font-size: 0.72rem;
  }

  .slot-weather {
    gap: 6px;
  }

  .weather-icon {
    width: 18px;
    height: 18px;
  }

  .weather-label strong {
    font-size: 0.7rem;
  }

  .slot-metric strong {
    font-size: 0.68rem;
  }

  .current-summary {
    grid-template-columns: repeat(5, minmax(0, auto));
    gap: 8px;
  }

  .top-current-card {
    grid-template-columns: minmax(78px, 0.76fr) minmax(0, 1.32fr);
    gap: 8px;
    padding: 10px;
  }

  .aquarium-temperature-badge {
    right: 8px;
    bottom: 8px;
    width: 50px;
    height: 50px;
  }

  .top-current-hero {
    gap: 8px;
    padding: 8px;
  }

  .top-current-metrics {
    gap: 6px;
  }

  .top-current-metric {
    padding: 7px;
  }

  .current-card,
  .system-item {
    padding: 10px;
    border-radius: 14px;
  }

  .current-card strong,
  .system-item strong {
    font-size: 1rem;
  }

  .status-text {
    margin-top: 8px;
    font-size: 0.86rem;
  }

  .settings-drawer {
    width: min(450px, 94vw);
  }

  .hour-chip-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }

  .hour-chip {
    padding: 8px 0;
    border-radius: 12px;
    font-size: 0.86rem;
  }
}

@media (max-width: 1180px) {
  .current-summary {
    grid-template-columns: repeat(5, minmax(0, auto));
  }

  .slot-head {
    grid-template-columns: 38px minmax(62px, 1.1fr) repeat(5, minmax(32px, 0.64fr));
    gap: 2px;
    padding: 0 4px 2px 4px;
  }

  .slot-card {
    grid-template-columns: 38px minmax(62px, 1.1fr) repeat(5, minmax(32px, 0.64fr));
    gap: 2px;
  }
}

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

  .action-row {
    justify-content: flex-start;
  }

  .section-heading {
    display: grid;
    gap: 10px;
  }

  .section-tools {
    justify-content: flex-start;
  }

  .forecast-days {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

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

  .top-current-card {
    grid-template-columns: 1fr;
    align-content: stretch;
    gap: 7px;
    padding: 8px;
  }

  .aquarium-temperature-badge {
    width: 44px;
    height: 44px;
  }

  .top-current-hero {
    min-height: 0;
    grid-template-rows: auto auto;
    padding: 7px;
  }

  .top-current-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .top-current-icon .weather-icon {
    width: 28px;
    height: 28px;
  }

  .top-current-copy span,
  .top-current-copy em {
    font-size: 0.58rem;
  }

  .top-current-copy strong {
    font-size: 1.18rem;
  }

  .top-current-temperature {
    font-size: 1.12rem;
  }

  .top-current-metrics {
    gap: 5px;
  }

  .top-current-metric {
    padding: 6px;
  }

  .top-current-metric small {
    font-size: 0.54rem;
  }

  .top-current-metric strong {
    font-size: 0.66rem;
  }

  .feature-card {
    padding: 10px;
    border-radius: 18px;
  }

  .day-column {
    padding: 10px;
    gap: 8px;
  }

  .slot-head {
    grid-template-columns: 28px minmax(0, 1fr) repeat(5, minmax(0, 0.58fr));
    gap: 2px;
    padding: 0 3px 1px;
    font-size: 0.5rem;
  }

  .slot-card {
    grid-template-columns: 28px minmax(0, 1fr) repeat(5, minmax(0, 0.58fr));
    gap: 2px;
    padding: 6px 3px;
    border-radius: 12px;
    border-left-width: 4px;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 8px;
    gap: 8px;
  }

  .board-panel {
    padding: 8px;
    border-radius: 18px;
  }

  .section-heading {
    margin-bottom: 8px;
  }

  .section-heading h2 {
    font-size: 1rem;
  }

  .board-title-area {
    gap: 6px;
  }

  .title-info-row {
    position: static;
    transform: none;
    display: flex;
    width: auto;
    justify-content: flex-start;
    gap: 6px;
  }

  .board-meta {
    gap: 6px;
  }

  .meta-chip {
    font-size: 0.64rem;
    padding: 4px 6px;
  }

  .inline-clock {
    gap: 8px;
  }

  .inline-clock strong {
    font-size: 0.84rem;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .inline-current-summary {
    flex-basis: 100%;
    gap: 4px;
  }

  .current-card {
    padding: 5px 6px;
    gap: 4px;
  }

  .play-window-inline {
    gap: 4px;
  }

  .title-info-chip {
    padding: 5px 7px;
  }

  .title-info-chip span {
    font-size: 0.82rem;
  }

  .title-info-chip strong {
    font-size: 0.64rem;
  }

  .current-metric-icon {
    font-size: 0.82rem;
  }

  .current-metric-icon .weather-icon {
    width: 15px;
    height: 15px;
  }

  .current-card strong {
    font-size: 0.64rem;
  }

  .current-weather-grid {
    grid-template-columns: minmax(34px, 0.62fr) repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .top-current-card {
    gap: 5px;
    padding: 6px;
  }

  .aquarium-temperature-badge {
    right: 6px;
    bottom: 6px;
    width: 38px;
    height: 38px;
  }

  .aquarium-temperature-badge strong {
    font-size: 0.66rem;
  }

  .top-current-hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 5px;
    padding: 5px;
  }

  .top-current-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .top-current-icon .weather-icon {
    width: 22px;
    height: 22px;
  }

  .top-current-copy span,
  .top-current-copy em {
    font-size: 0.48rem;
  }

  .top-current-copy strong {
    font-size: 0.9rem;
  }

  .top-current-temperature {
    font-size: 0.86rem;
  }

  .top-current-metrics {
    gap: 4px;
  }

  .top-current-metric {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 1px;
    padding: 4px;
  }

  .top-current-metric > span {
    display: none;
  }

  .top-current-metric small {
    font-size: 0.46rem;
  }

  .top-current-metric strong {
    font-size: 0.54rem;
  }

  .current-weather-summary .current-card {
    padding: 6px 4px;
    gap: 3px;
  }

  .current-weather-summary .current-weather-card .current-metric-icon .weather-icon {
    width: 26px;
    height: 26px;
  }

  .status-text {
    font-size: 0.68rem;
  }

  .current-summary,
  .hour-chip-grid {
    grid-template-columns: repeat(5, minmax(0, auto));
  }

  .forecast-days {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .top-panels {
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feature-card {
    padding: 8px;
    gap: 8px;
    border-radius: 14px;
  }

  .feature-card-text {
    font-size: 0.62rem;
  }

  .reminder-person-card {
    padding: 8px;
    gap: 6px;
    border-radius: 12px;
    align-items: center;
  }

  .reminder-avatar,
  .settings-avatar-preview {
    width: 30px;
    height: 30px;
  }

  .reminder-person-copy {
    gap: 3px;
  }

  .reminder-person-copy strong {
    font-size: 0.72rem;
  }

  .reminder-person-copy .feature-card-text {
    font-size: 0.54rem;
    white-space: normal;
    line-height: 1.2;
  }

  .reminder-person-card .primary-button {
    padding: 7px 8px;
    font-size: 0.58rem;
  }

  .reminder-task-actions {
    gap: 3px;
  }

  .reminder-task-button {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }

  .reminder-task-setting {
    grid-template-columns: 1fr;
  }

  .camera-stream-frame,
  .camera-placeholder-screen {
    border-radius: 12px;
  }

  .day-column {
    padding: 6px;
    gap: 6px;
    border-radius: 14px;
  }

  .day-header h3 {
    font-size: 0.78rem;
  }

  .day-type-pill {
    padding: 2px 5px;
    font-size: 0.56rem;
    margin-top: 3px;
  }

  .slot-list {
    gap: 4px;
  }

  .slot-head {
    grid-template-columns: 22px minmax(0, 1fr) repeat(5, minmax(0, 0.54fr));
    gap: 1px;
    padding: 0 3px 1px;
    font-size: 0.48rem;
  }

  .slot-card {
    grid-template-columns: 22px minmax(0, 1fr) repeat(5, minmax(0, 0.54fr));
    gap: 1px;
    padding: 5px 2px;
  }

  .slot-time {
    font-size: 0.58rem;
  }

  .slot-weather {
    gap: 3px;
  }

  .weather-icon {
    width: 12px;
    height: 12px;
  }

  .weather-label strong,
  .slot-metric strong {
    font-size: 0.54rem;
  }

  .settings-drawer {
    width: min(420px, 96vw);
    padding: 14px;
  }
}

@media (orientation: portrait) and (min-width: 768px) {
  .app-shell {
    padding: 12px;
    gap: 10px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .board-panel,
  .system-panel {
    padding: 12px;
  }

  .section-heading h2 {
    font-size: 1.1rem;
  }

  .section-heading > .muted {
    font-size: 0.78rem;
  }

  .board-meta {
    gap: 6px;
  }

  .meta-chip {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .inline-clock strong {
    font-size: 0.96rem;
  }

  .forecast-days {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

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

  .feature-card {
    padding: 10px;
    border-radius: 18px;
  }

  .day-column {
    padding: 12px;
    gap: 8px;
  }

  .day-header h3 {
    font-size: 1rem;
  }

  .slot-head {
    grid-template-columns: 28px minmax(0, 1fr) repeat(5, minmax(0, 0.58fr));
    gap: 2px;
    padding: 0 3px 2px 3px;
    font-size: 0.56rem;
  }

  .slot-card {
    grid-template-columns: 28px minmax(0, 1fr) repeat(5, minmax(0, 0.58fr));
    gap: 2px;
    padding: 6px 3px;
  }

  .slot-time {
    font-size: 0.7rem;
  }

  .weather-icon {
    width: 18px;
    height: 18px;
  }

  .weather-label strong {
    font-size: 0.68rem;
  }

  .slot-metric strong {
    font-size: 0.64rem;
  }

  .current-summary {
    grid-template-columns: repeat(5, minmax(0, auto));
    gap: 8px;
  }
}

.compact-panel {
  padding-top: 12px;
}

.current-heading {
  margin-bottom: 10px;
  align-items: center;
}

/* Responsive stabilization layer for weatherpad1.
   Keep this block last so it overrides older fixed three-column tablet rules. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.app-shell,
.main-grid,
.top-panels,
.forecast-days,
.panel,
.feature-card,
.day-column,
.middle-info-card,
.reminder-person-card,
.slot-card,
.slot-head,
.weather-alert-copy,
.reminder-person-copy,
.top-current-card,
.top-current-metrics,
.top-current-metric {
  min-width: 0;
}

img,
svg,
iframe,
video {
  max-width: 100%;
}

.board-title-area h2,
.weather-alert-copy strong,
.reminder-person-copy strong,
.slot-time,
.slot-metric strong,
.slot-metric span,
.weather-label strong,
.top-current-metric strong,
.top-current-metric small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell {
  padding: clamp(8px, 1.4vw, 18px);
  gap: clamp(8px, 1.1vw, 14px);
}

.top-panels,
.forecast-days {
  gap: clamp(8px, 1.2vw, 14px);
}

.feature-card,
.day-column,
.board-panel {
  padding: clamp(10px, 1.2vw, 18px);
}

.slot-head,
.slot-card {
  grid-template-columns: minmax(38px, 0.72fr) minmax(66px, 1.18fr) repeat(5, minmax(34px, 0.7fr));
}

@media (max-width: 760px) {
  .app-shell {
    overflow-x: hidden;
  }

  .main-grid {
    gap: 10px;
  }

  .top-panels {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch;
  }

  body.camera-disabled:not(.reminder-disabled) .top-panels,
  body.reminder-disabled:not(.camera-disabled) .top-panels {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .feature-card {
    min-height: clamp(128px, 38vw, 220px);
  }

  .camera-card {
    min-height: clamp(220px, 58vw, 320px);
  }

  .middle-info-stack,
  .middle-info-stack:has(.weather-alert-summary) {
    grid-template-rows: none;
    grid-auto-rows: minmax(118px, auto);
  }

  .middle-info-card {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 118px;
  }

  .weather-alert-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.35;
  }

  .top-current-card {
    grid-template-columns: minmax(0, 1fr);
    min-height: 172px;
  }

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

  .reminder-person-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .reminder-person-card {
    min-height: 86px;
  }

  .forecast-days {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch;
  }

  .day-column {
    overflow: hidden;
  }

  .slot-list {
    gap: 7px;
  }

  .slot-head,
  .slot-card {
    grid-template-columns: 42px minmax(82px, 1.15fr) repeat(5, minmax(42px, 0.72fr)) !important;
    min-width: 430px;
  }

  .slot-head {
    font-size: 0.6rem;
  }

  .slot-card {
    padding: 8px 6px;
  }

  .day-column {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .day-header,
  .slot-list {
    min-width: 430px;
  }

  .board-heading {
    flex-wrap: wrap;
  }

  .title-info-row {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 8px;
  }

  .board-panel,
  .feature-card,
  .day-column {
    border-radius: 16px;
  }

  .board-heading {
    gap: 8px;
  }

  .board-title-area {
    flex: 1 1 100%;
    min-height: 34px;
  }

  .board-title-area h2 {
    font-size: clamp(1rem, 5vw, 1.25rem);
    white-space: nowrap;
  }

  .board-meta {
    display: flex;
    flex-wrap: wrap;
  }

  .section-tools,
  .action-row {
    width: 100%;
    justify-content: flex-start;
  }

  .inline-clock {
    flex-wrap: wrap;
  }

  .weather-alert-icons {
    max-width: none;
  }

  .weather-alert-icons span,
  .weather-alert-detail-icon,
  .play-window-icon {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .middle-info-card {
    gap: 10px;
    padding: 12px;
  }

  .top-current-hero {
    min-height: 92px;
  }

  .top-current-temperature {
    font-size: clamp(1.2rem, 7vw, 1.8rem);
  }

  .top-current-metric {
    min-height: 54px;
  }

  .reminder-person-card {
    gap: 10px;
  }

  .reminder-task-actions {
    gap: 5px;
  }

  .reminder-task-button {
    width: 34px;
    min-width: 34px;
  }

  .forecast-days {
    gap: 10px;
  }

  .day-header h3 {
    font-size: 1rem;
  }

  .slot-head,
  .slot-card,
  .day-header,
  .slot-list {
    min-width: 448px;
  }

  .slot-time {
    font-size: 0.72rem;
  }

  .weather-label strong,
  .slot-metric strong {
    font-size: 0.68rem;
  }

  .camera-lock-hint {
    max-width: 82%;
    padding: 14px 16px;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .forecast-days {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch;
  }

  .slot-head,
  .slot-card {
    grid-template-columns: 42px minmax(80px, 1.12fr) repeat(5, minmax(40px, 0.72fr)) !important;
    gap: 3px;
  }

  .slot-head {
    font-size: 0.6rem;
  }

  .slot-card {
    padding: 8px 5px;
  }
}

@media (max-width: 520px) {
  .day-column {
    overflow-x: hidden;
  }

  .day-header,
  .slot-list,
  .slot-head,
  .slot-card {
    min-width: 0 !important;
    width: 100%;
  }

  .slot-head,
  .slot-card {
    grid-template-columns: 38px minmax(54px, 1fr) 43px 31px 40px 34px 40px !important;
    gap: 2px;
  }

  .slot-head {
    padding: 0 3px 2px;
    font-size: 0.53rem;
    letter-spacing: 0;
  }

  .slot-card {
    padding: 8px 4px;
    border-left-width: 5px;
  }

  .slot-time {
    font-size: 0.68rem;
  }

  .weather-icon {
    width: 14px;
    height: 14px;
  }

  .slot-weather {
    gap: 3px;
  }

  .weather-label strong,
  .slot-metric strong {
    font-size: 0.62rem;
  }

  .slot-metric span {
    font-size: 0.56rem;
  }
}
