/* ==========================================================================
   macOS Sequoia Glassmorphism Design System (Fully Responsive Kiosk & Mobile)
   ========================================================================== */

:root {
  /* macOS Dark Palette */
  --bg-desktop: radial-gradient(circle at 50% -20%, #1e293b 0%, #0f172a 50%, #020617 100%);
  --macos-card-bg: rgba(28, 34, 52, 0.68);
  --macos-card-bg-hover: rgba(35, 43, 66, 0.82);
  --macos-dock-bg: rgba(22, 28, 44, 0.88);
  
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glass-top: rgba(255, 255, 255, 0.24);
  --border-focus: rgba(96, 165, 250, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --apple-blue: #0a84ff;
  --apple-green: #30d158;
  --apple-orange: #ff9f0a;
  --apple-red: #ff453a;
  --apple-purple: #bf5af2;
  --apple-teal: #64d2ff;
  
  --font-sf: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --font-sf-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  
  --radius-card: 18px;
  --radius-sub: 12px;
  --radius-pill: 9999px;
  
  --shadow-card: 0 12px 32px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --shadow-dock: 0 16px 48px 0 rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --shadow-sheet: 0 24px 60px 0 rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0; /* Prevents CSS Grid blowout */
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--bg-desktop) no-repeat fixed;
  background-size: cover;
  color: var(--text-primary);
  font-family: var(--font-sf);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Base Container */
.kiosk-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px 16px calc(76px + env(safe-area-inset-bottom, 16px)) 16px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ==========================================================================
   macOS 4-Quadrant Symmetrical Dashboard Grid
   ========================================================================== */
.macos-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  align-items: stretch;
}

/* Glassmorphic Card System */
.macos-card {
  background: var(--macos-card-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-top: 1px solid var(--border-glass-top);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.macos-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.header-left h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-badges-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Traffic Light Dots */
.traffic-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.dot-red, .dot-close {
  background: #ff5f56;
  border: 1px solid #e0443e;
}
.dot-yellow, .dot-minimize {
  background: #ffbd2e;
  border: 1px solid #dea123;
}
.dot-green, .dot-expand {
  background: #27c93f;
  border: 1px solid #1aab29;
}
.dot-blue {
  background: #0a84ff;
  border: 1px solid #006ee6;
}

.card-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges */
.macos-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(10px);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-green {
  background: rgba(48, 209, 88, 0.16);
  color: #4ade80;
  border: 1px solid rgba(48, 209, 88, 0.32);
}

.badge-blue {
  background: rgba(10, 132, 255, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(10, 132, 255, 0.32);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge-red {
  background: rgba(255, 69, 58, 0.16);
  color: #f87171;
  border: 1px solid rgba(255, 69, 58, 0.32);
}

/* Card Body */
.card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.section-micro-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 4px 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ==========================================================================
   1. TOP-LEFT: Interactive Weather Widget
   ========================================================================== */
.card-weather {
  background: linear-gradient(175deg, rgba(30, 41, 68, 0.72) 0%, rgba(20, 26, 44, 0.72) 100%);
}

.weather-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 52px;
  gap: 12px;
}

.weather-hero-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.weather-hero-icon {
  font-size: 40px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.weather-hero-temp {
  display: flex;
  align-items: flex-start;
}

.hero-temp-val {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.hero-temp-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
  margin-top: 2px;
}

.weather-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 2px;
}

.hero-cond-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-range-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* Forecast Chips Grid */
.forecast-chips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.forecast-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sub);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.16s ease;
  min-width: 0;
}

.forecast-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.chip-today {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.3);
}

.chip-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.chip-today .chip-day {
  color: #60a5fa;
}

.chip-icon {
  font-size: 20px;
  line-height: 1;
}

.chip-temp {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.chip-rain {
  font-size: 10px;
  font-weight: 500;
  color: #38bdf8;
}

/* Shared Triad Metrics Strip */
.metrics-triad-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.triad-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  min-width: 0;
}

.triad-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.triad-val {
  font-family: var(--font-sf-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   2. TOP-RIGHT: 5G Modem Gateway Widget
   ========================================================================== */
.card-modem {
  background: linear-gradient(175deg, rgba(26, 36, 58, 0.72) 0%, rgba(18, 25, 42, 0.72) 100%);
}

.modem-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 52px;
  gap: 12px;
}

.modem-hero-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  padding: 2px;
  flex-shrink: 0;
}

.signal-bars .bar {
  width: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  transition: background 0.2s ease;
}

.bar-1 { height: 20%; }
.bar-2 { height: 40%; }
.bar-3 { height: 60%; }
.bar-4 { height: 80%; }
.bar-5 { height: 100%; }

.signal-bars .bar.active {
  background: #30d158;
  box-shadow: 0 0 6px rgba(48, 209, 88, 0.5);
}

.signal-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.hero-signal-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-signal-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modem-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 2px;
  flex-shrink: 0;
}

.hero-rf-metric {
  font-family: var(--font-sf-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.hero-rf-metric b {
  color: #38bdf8;
  font-weight: 600;
}

.hero-rf-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 4-Box Telemetry Grid */
.modem-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.modem-stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sub);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  min-width: 0;
}

.m-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.m-val {
  font-family: var(--font-sf-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.m-val.highlight {
  color: #38bdf8;
}

.m-sub {
  font-size: 9px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ==========================================================================
   3. BOTTOM-LEFT: Tailscale Mesh & Downloads
   ========================================================================== */
.card-network-transfers {
  background: linear-gradient(175deg, rgba(24, 32, 50, 0.7) 0%, rgba(18, 24, 40, 0.7) 100%);
}

.card-body-split {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
}

.split-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.qbit-section {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tailscale-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.tailscale-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.15s ease;
  min-width: 0;
}

.tailscale-chip:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tailscale-chip.chip-online {
  border-color: rgba(48, 209, 88, 0.22);
}

.chip-device-header {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-online {
  background: #30d158;
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.7);
}

.dot-offline {
  background: #64748b;
}

.chip-device-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.os-mini-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.chip-device-ip {
  font-family: var(--font-sf-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* qBittorrent Queue Item */
.queue-list-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-compact-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.queue-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.queue-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.queue-eta-badge {
  font-family: var(--font-sf-mono);
  font-size: 10px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.queue-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0a84ff 0%, #38bdf8 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.queue-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.queue-pct-val {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   4. BOTTOM-RIGHT: Core Fleet Services
   ========================================================================== */
.card-fleet {
  background: linear-gradient(175deg, rgba(24, 32, 52, 0.72) 0%, rgba(18, 24, 40, 0.72) 100%);
}

.services-macos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.service-macos-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: background 0.15s ease;
  min-width: 0;
}

.service-macos-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.service-summary-slot {
  background: rgba(48, 209, 88, 0.06);
  border-color: rgba(48, 209, 88, 0.16);
}

.svc-name-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.svc-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-meta-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.svc-unit-tag {
  font-family: var(--font-sf-mono);
  font-size: 9px;
  color: var(--text-subtle);
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
}

.macos-pill-sm {
  font-family: var(--font-sf-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-active {
  background: rgba(48, 209, 88, 0.16);
  color: #4ade80;
  border: 1px solid rgba(48, 209, 88, 0.32);
}

.pill-down {
  background: rgba(255, 69, 58, 0.16);
  color: #f87171;
  border: 1px solid rgba(255, 69, 58, 0.32);
}

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

/* ==========================================================================
   macOS Floating Bottom Dock / Navbar
   ========================================================================== */
.macos-dock-wrapper {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  padding: 0 12px;
}

.macos-dock {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--macos-dock-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border-glass);
  border-top: 1px solid var(--border-glass-top);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-dock);
  padding: 6px 14px;
  max-width: 95vw;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.macos-dock:hover {
  transform: translateY(-2px);
}

.dock-section {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.dock-clock-section {
  gap: 6px;
}

.dock-clock {
  font-family: var(--font-sf-mono);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dock-divider-dot {
  font-size: 10px;
  color: var(--text-subtle);
}

.dock-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.dock-separator {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.dock-brand-section {
  gap: 6px;
}

.dock-apple-logo {
  font-size: 14px;
  color: var(--text-secondary);
}

.dock-brand-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dock-actions {
  gap: 6px;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.dock-btn:active {
  transform: scale(0.96);
}

.dock-btn.active {
  background: rgba(10, 132, 255, 0.2);
  border-color: rgba(10, 132, 255, 0.4);
  color: #60a5fa;
}

.dock-btn-icon {
  font-size: 12px;
  line-height: 1;
}

.dock-btn-text b {
  font-weight: 700;
}

.btn-logout:hover {
  background: rgba(255, 69, 58, 0.2);
  border-color: rgba(255, 69, 58, 0.4);
  color: #f87171;
}

/* ==========================================================================
   macOS Interactive Weather Forecast Sheet Modal
   ========================================================================== */
.macos-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px;
}

.macos-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.macos-sheet {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(28, 34, 52, 0.94);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid var(--border-glass);
  border-top: 1px solid var(--border-glass-top);
  border-radius: 20px;
  box-shadow: var(--shadow-sheet);
  transform: scale(0.94);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.macos-modal-overlay.open .macos-sheet {
  transform: scale(1);
}

.macos-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-traffic-lights {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-traffic-lights button {
  border: none;
  cursor: pointer;
  padding: 0;
}

.sheet-title-group {
  text-align: center;
}

.sheet-title-group h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.sheet-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.sheet-close-btn:hover {
  color: #ffffff;
}

.macos-sheet-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-hero-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sub);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-hero-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-hero-icon {
  font-size: 36px;
  line-height: 1;
}

.sheet-hero-cond {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.sheet-hero-range {
  font-size: 12px;
  color: var(--text-secondary);
}

.sheet-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.sheet-stat-pill {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.s-label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.s-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.s-val.highlight {
  color: #38bdf8;
}

.sheet-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.hourly-scroll-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hourly-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.h-time {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
}

.h-icon {
  font-size: 18px;
  line-height: 1;
}

.h-temp {
  font-family: var(--font-sf-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.h-rain {
  font-size: 9px;
  color: #38bdf8;
}

/* Ambient Dimmer & Night Mode */
body.night-mode {
  filter: brightness(0.72) contrast(1.05);
}

.dimmer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9999;
  cursor: pointer;
}

body.night-mode-screen .dimmer-overlay {
  display: block;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Mobile & Small Tablets)
   ========================================================================== */

/* Medium Screens (Tablets Portrait <= 1024px) */
@media (max-width: 1024px) {
  .macos-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Mobile & Portrait Tablet Screens (<= 820px) */
@media (max-width: 820px) {
  .kiosk-container {
    padding: 10px 10px calc(72px + env(safe-area-inset-bottom, 12px)) 10px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .macos-dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }

  .macos-card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .card-header {
    padding: 10px 12px;
  }

  .card-body {
    padding: 12px;
    gap: 8px;
    width: 100%;
    overflow: hidden;
  }

  /* Weather Hero on mobile */
  .weather-hero-row {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .hero-temp-val {
    font-size: 32px;
  }

  .weather-hero-icon {
    font-size: 32px;
  }

  .weather-hero-right {
    align-items: flex-end;
    text-align: right;
  }

  .hero-cond-text {
    font-size: 13px;
  }

  /* 5G Modem Hero on mobile */
  .modem-hero-row {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .hero-signal-title {
    font-size: 12px;
  }

  .modem-hero-right {
    align-items: flex-end;
    text-align: right;
  }

  /* 4-Box Telemetry on mobile -> 2x2 grid for readability */
  .modem-telemetry-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px;
    width: 100%;
  }

  /* Forecast chips on mobile */
  .forecast-chips-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 5px;
    width: 100%;
  }

  .forecast-chip {
    padding: 6px 2px;
    min-width: 0;
  }

  .chip-day {
    font-size: 10px;
  }

  .chip-icon {
    font-size: 16px;
  }

  .chip-temp {
    font-size: 12px;
  }

  .chip-rain {
    font-size: 8.5px;
  }

  /* Triad Metrics on mobile */
  .metrics-triad-strip {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px;
    width: 100%;
  }

  .triad-item {
    padding: 5px 2px;
    min-width: 0;
    overflow: hidden;
  }

  .triad-label {
    font-size: 8px;
  }

  .triad-val {
    font-size: 11px;
  }

  /* Services Grid on mobile -> Single Column so no names get truncated */
  .services-macos-grid {
    grid-template-columns: 1fr !important;
    gap: 5px;
    width: 100%;
  }

  .service-macos-item {
    padding: 7px 10px;
    width: 100%;
  }

  .svc-title {
    font-size: 12px;
  }

  /* Tailscale Grid on mobile -> Single Column so IPs & names never truncate */
  .tailscale-compact-grid {
    grid-template-columns: 1fr !important;
    gap: 5px;
    width: 100%;
  }

  .tailscale-chip {
    padding: 7px 10px;
    width: 100%;
  }

  /* qBittorrent queue on mobile */
  .queue-compact-item {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .queue-row-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }

  .queue-name {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  /* Floating Dock on Mobile -> Compact iOS Dynamic Island Style */
  .macos-dock-wrapper {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 0 8px;
    width: 100%;
  }

  .macos-dock {
    width: calc(100% - 16px);
    max-width: 360px;
    justify-content: space-between;
    padding: 5px 12px;
    gap: 6px;
    margin: 0 auto;
  }

  /* Hide brand section and date on mobile to fit comfortably */
  .dock-brand-section,
  .dock-date,
  .dock-divider-dot,
  .dock-separator {
    display: none !important;
  }

  .dock-clock {
    font-size: 12px;
  }

  /* Dock action buttons on mobile become icon pills */
  .dock-btn {
    padding: 5px 8px;
  }

  .dock-btn-text {
    display: none !important;
  }

  /* Weather Modal Sheet on mobile */
  .macos-sheet {
    max-height: 85vh;
    width: 100%;
    max-width: calc(100vw - 20px);
  }

  .sheet-hero-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sheet-hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .hourly-scroll-strip {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 6px;
  }

  .hourly-tile {
    flex: 0 0 64px;
  }
}
