/* Compact desktop overview. Content remains in the document so existing capture,
   pairing and alert handlers keep their original nodes and state. */
.sidebar {
  position: sticky;
  inset: 0 0 auto;
  z-index: 40;
  width: auto;
  height: auto;
  min-height: 64px;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 8px clamp(14px, 2vw, 30px);
  border-right: 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-label, .sidebar-bottom { display: none; }
.sidebar .brand { flex: 0 0 auto; padding: 0; font-size: 17px; }
.sidebar .brand-mark { width: 36px; height: 40px; }
.sidebar .brand-mark svg { width: 30px; height: 34px; }
.sidebar nav { display: flex; align-items: center; gap: 4px; min-width: 0; margin: 0 0 0 auto; }
.nav-item { min-height: 44px; padding: 8px 10px; margin: 0; gap: 7px; white-space: nowrap; }
.nav-item svg { flex: 0 0 18px; }
.nav-dot { display: none; }
.app-shell { margin-left: 0; }
.topbar { height: 48px; min-height: 48px; padding: 0 clamp(14px, 2vw, 30px); }
.breadcrumb { font-size: 14px; }
.topbar-right { gap: 16px; }
.topbar time, .topbar-account, .connection-pill { font-size: 14px; }
.topbar-admin { display: none !important; }
.app-shell > main { max-width: 1900px; padding: 12px clamp(14px, 1.8vw, 28px) 20px; }
.page-heading { margin: 0 0 6px; min-height: 30px; }
.page-heading .eyebrow, .page-heading p { display: none; }
.page-heading h1 { margin: 0; font-size: 21px; line-height: 1.35; }
.heading-action { min-height: 40px; font-size: 15px; }
.guard-card { min-height: 0; margin: 0 0 10px; border-radius: 8px; }
.guard-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; width: 100%; max-width: none; padding: 8px 12px; }
.guard-kicker { grid-column: 1; margin: 0; font-size: 15px; }
.guard-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; }
.lie-status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 8px; border: 1px solid #506952; border-radius: 6px; background: #14231e88; color: #d3e5cf; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.guard-card h2, .guard-card p, .guard-footnote, .guard-art { display: none; }
.guard-actions { grid-column: 2; grid-row: 1; gap: 8px; margin: 0; }
.guard-actions .button { min-height: 40px; padding: 7px 12px; font-size: 15px; }
.stat-grid { gap: 10px; margin: 0 0 8px; }
.stat-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 12px; min-height: 0; padding: 7px 12px; border-radius: 7px; }
.stat-top { grid-column: 1; grid-row: 1; }
.stat-value, .time-value { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.stat-bottom { grid-column: 1; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; line-height: 1.3; }
.stat-top { font-size: 14px; }
.stat-icon { width: 25px; height: 25px; }
.stat-value, .time-value { margin: 2px 0 3px; font-size: 24px; line-height: 1.3; }
.stat-bottom { gap: 4px 8px; font-size: 14px; }
.stat-tag, .stat-bottom .text-button, #xp-rate, #coins-rate { font-size: 14px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .9fr); grid-template-areas: "capture game" "phone phone"; align-items: start; gap: 10px; }
.capture-panel { grid-area: capture; min-width: 0; padding: 14px; }
.game-panel { grid-area: game; min-width: 0; margin: 0; padding: 14px; }
.phone-panel { grid-area: phone; min-width: 0; padding: 14px; }
.dashboard-grid .panel-header { margin-bottom: 10px; }
.dashboard-grid .panel-header h2 { font-size: 17px; }
.dashboard-grid .preview-shell, .dashboard-grid .capture-panel .preview-shell { min-height: 190px; max-height: 330px; aspect-ratio: 16 / 9; }
.capture-toolbar { margin-bottom: 7px; }
.region-label { margin: 9px 0 7px; }
.region-buttons { gap: 6px; }
.region-button { min-height: 44px; padding: 7px; gap: 5px; font-size: 14px; }
.region-button > span:last-child { font-size: 14px; }
.recognition-readings { gap: 6px; padding: 7px; font-size: 14px; }
.capture-bottom { margin-top: 7px; gap: 8px; }
.capture-bottom p { font-size: 14px; line-height: 1.5; }
.secondary-settings { margin-top: 8px; border: 1px solid #344840; border-radius: 7px; background: #14201f; }
.secondary-settings > summary, .records-disclosure > summary { display: flex; align-items: center; min-height: 44px; padding: 8px 11px; color: #c3d5ca; font-size: 15px; cursor: pointer; }
.secondary-settings > summary::marker, .records-disclosure > summary::marker { color: #b7d7bb; }
.secondary-settings-content { padding: 0 11px 10px; }
.secondary-settings p { font-size: 14px; line-height: 1.55; }
.pair-step { margin: 8px 0; padding: 10px; }
.pair-step > h3, .pair-step > p { font-size: 14px; line-height: 1.5; margin: 0 0 6px; }
.pair-install-step > summary { min-height: 44px; font-size: 15px; cursor: pointer; }
.pair-step-content { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px 12px; padding-top: 8px; }
.pair-step-content .qr-placeholder { grid-row: span 2; width: 96px; height: 96px; }
.pair-step-content p { font-size: 14px; line-height: 1.5; }
.pair-guidance p { padding: 0 10px 9px; font-size: 14px; line-height: 1.5; }
.phone-pairing { margin: 9px 0; gap: 12px; }
.phone-pairing .qr-placeholder { width: 92px; height: 92px; }
.phone-panel .button-full { min-height: 44px; font-size: 15px; }
.phone-panel .setting-row { min-height: 48px; padding: 5px 0; }
.phone-panel .panel-divider { margin: 9px 0; }
.phone-panel .test-alert-button { min-height: 48px; margin-top: 8px; }
.phone-panel .paired-state, .phone-panel .sound-unlock-row { font-size: 14px; }
.game-summary { gap: 10px; margin: 8px 0; }
.game-summary span { margin-bottom: 3px; font-size: 14px; }
.game-summary strong { font-size: 19px; line-height: 1.35; }
.potion-grid { gap: 7px; }
.potion-tile { gap: 7px; padding: 8px; }
.potion-tile img { width: 30px; height: 30px; }
.potion-tile strong { font-size: 15px; }
.potion-tile span { font-size: 14px; }
.manual-guard-entry { margin: 9px 0; padding: 10px; gap: 8px; }
.manual-guard-entry h3 { margin-bottom: 4px; font-size: 16px; }
.manual-guard-entry p { font-size: 14px; }
.manual-guard-entry .button { min-height: 44px; font-size: 14px; padding: 8px 10px; white-space: normal; }
.watch-settings { margin-top: 10px; padding-top: 9px; }
.watch-settings > h3 { font-size: 16px; }
.watch-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; margin: 8px 0; font-size: 14px; }
.watch-switches label { gap: 6px; min-height: 44px; line-height: 1.35; }
.watch-switches input { width: 20px; height: 20px; flex: 0 0 auto; }
.watch-field { gap: 8px; font-size: 14px; }
.watch-field .form-input { width: 82px; min-height: 42px; }
.watch-guidance > summary { min-height: 40px; }
.threshold-editor { grid-template-columns: minmax(0, 1fr) 100px; gap: 7px; margin: 9px 0; }
.threshold-editor label { gap: 4px; font-size: 14px; }
.threshold-editor label:first-child { grid-column: 1 / -1; }
.threshold-editor .button { grid-column: 1 / -1; min-height: 44px; font-size: 14px; }
.watch-save-row { align-items: center; gap: 8px; margin-top: 9px; font-size: 14px; }
.watch-save-row .button { min-height: 44px; }
.records-disclosure { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.records-disclosure > summary { font-weight: 600; }
.records-disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.records-grid { gap: 10px; margin: 0; padding: 10px; }
.records-grid .panel { min-width: 0; padding: 13px; }
.page-footer { padding: 12px 0 0; }
.alert-overlay { z-index: 200; }

@media (min-width: 1500px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1.25fr) minmax(350px, .92fr) minmax(350px, .92fr); grid-template-areas: "capture game phone"; }
  .dashboard-grid .preview-shell, .dashboard-grid .capture-panel .preview-shell { min-height: 190px; max-height: 275px; }
  .phone-panel .pair-step-content { grid-template-columns: 78px minmax(0, 1fr); }
  .phone-panel .pair-step-content .qr-placeholder { width: 78px; height: 78px; }
}
@media (min-width: 1280px) and (max-width: 1499px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1.08fr) minmax(330px, .96fr) minmax(320px, .92fr); grid-template-areas: "capture game phone"; }
  .dashboard-grid .preview-shell, .dashboard-grid .capture-panel .preview-shell { min-height: 190px; max-height: 250px; }
  .phone-panel .pair-step-content { grid-template-columns: 72px minmax(0, 1fr); }
  .phone-panel .pair-step-content .qr-placeholder { width: 72px; height: 72px; }
}
@media (max-width: 1100px) {
  .sidebar { position: sticky; width: auto; height: auto; min-height: 58px; padding: 7px 14px; gap: 10px; }
  .sidebar .brand { justify-content: flex-start; }
  .sidebar .brand > span:last-child { display: block; font-size: 16px; }
  .sidebar .brand small { display: none; }
  .sidebar nav { width: auto; margin: 0 0 0 auto; }
  .nav-item { width: auto; min-height: 42px; justify-content: center; font-size: 14px; padding: 7px; }
  .nav-item svg { width: 17px; height: 17px; }
}
@media (max-width: 900px) {
  .sidebar { display: block; padding: 8px 14px 5px; }
  .sidebar nav { display: flex; justify-content: flex-start; gap: 4px; width: 100%; margin-top: 5px; overflow-x: auto; scrollbar-width: thin; }
  .nav-item { flex: 0 0 auto; flex-direction: row; min-height: 40px; gap: 5px; padding: 6px 9px; font-size: 14px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "capture" "game" "phone"; }
  .dashboard-grid .preview-shell, .dashboard-grid .capture-panel .preview-shell { min-height: 220px; max-height: 420px; }
  .guard-copy { grid-template-columns: 1fr; }
  .guard-actions { grid-column: 1; grid-row: 2; flex-wrap: wrap; }
}
@media (max-width: 540px) {
  .app-shell > main { padding: 10px 12px 18px; }
  .topbar { height: auto; min-height: 44px; padding: 6px 12px; }
  .breadcrumb { display: none; }
  .topbar-right { width: 100%; justify-content: space-between; gap: 8px; }
  .page-heading h1 { font-size: 19px; }
  .guard-copy { padding: 9px; }
  .guard-kicker { font-size: 14px; }
  .guard-actions .button { flex: 1 1 auto; font-size: 14px; padding: 7px 9px; }
  .stat-grid { grid-template-columns: 1fr; gap: 6px; }
  .stat-card, .stat-card:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 8px 10px; }
  .stat-top { grid-column: 1; }
  .stat-top .stat-icon { display: none; }
  .stat-value, .stat-card:last-child .stat-value { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0; font-size: 20px; text-align: right; }
  .stat-bottom { grid-column: 1; }
  .dashboard-grid .panel, .capture-panel, .game-panel, .phone-panel { padding: 11px; }
  .dashboard-grid .panel-header h2 { font-size: 16px; }
  .dashboard-grid .preview-shell, .dashboard-grid .capture-panel .preview-shell { min-height: 185px; }
  .region-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .region-button { min-width: 0; white-space: normal; }
  .phone-pairing { align-items: center; }
  .phone-pairing .qr-placeholder { width: 78px; height: 78px; }
  .watch-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .threshold-editor { grid-template-columns: minmax(0, 1fr) 86px; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-grid *, .sidebar * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
