:root {
  --bg: #060a12;
  --panel: #0e1521;
  --panel-2: #111a29;
  --card: #151f31;
  --line: #223149;
  --text: #eef3ff;
  --muted: #96a7c6;
  --orange: #ff9f1a;
  --cyan: #29c7ff;
  --green: #1ee58a;
  --yellow: #ffd84d;
  --red: #ff5f70;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
  --radius: 14px;
  --topbar-h: 70px;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0) 220px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 32px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  overflow: hidden;
}

/* TOPBAR */

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 18, .92);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo,
.brand-mark {
  color: var(--orange);
  letter-spacing: .22em;
  font-weight: 900;
  font-size: 14px;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-meta strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.brand-sub {
  color: var(--muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 10px;
}

#syncState { color: var(--red); }
#syncState.online { color: var(--green); }

.topbar-center {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.topbar-center select {
  max-width: 100%;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.userLabel,
#userLabel {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clock {
  min-width: 84px;
  text-align: center;
  font-weight: 800;
  color: var(--orange);
}

/* FORM ELEMENTS */

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d1521;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 86px;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(41, 199, 255, .12);
}

/* BUTTONS */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #121b2a;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
}

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

.btn.sm {
  padding: 7px 10px;
  font-size: 12px;
}

.btn.wide {
  width: 100%;
}

.btn.orange { border-color: rgba(255,159,26,.5); color: var(--orange); }
.btn.cyan { border-color: rgba(41,199,255,.5); color: var(--cyan); }
.btn.green { border-color: rgba(30,229,138,.45); color: var(--green); }
.btn.yellow { border-color: rgba(255,216,77,.45); color: var(--yellow); }
.btn.red { border-color: rgba(255,95,112,.45); color: var(--red); }

/* MAIN LAYOUT */

.dashboard-grid {
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(360px, .95fr);
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 0;
}

.left-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.right-panel {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  align-content: start;
}

.current-panel,
.emergency-panel,
.overview-panel,
.mini-panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  flex: 0 0 auto;
}

.sticky-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(14, 21, 33, .96);
  backdrop-filter: blur(10px);
}

.panel-title {
  font-size: 15px;
  font-weight: 900;
}

.panel-subtitle {
  color: var(--muted);
  margin-top: 2px;
  font-size: 11px;
}

.panel-tools {
  display: flex;
  gap: 8px;
  min-width: min(100%, 420px);
}

.panel-tools.wrap {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-input {
  min-width: 180px;
}

.compact-head {
  padding-bottom: 8px;
}

/* LEFT CUE LIST */

.cue-list {
  overflow: auto;
  padding: 10px;
  min-height: 0;
}

.cue-card {
  --cue-accent: #1c2432;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cue-accent) 78%, #0f1623), #0d131f 46%);
  border: 1px solid color-mix(in srgb, var(--cue-accent) 55%, var(--line));
  cursor: pointer;
}

.cue-card:hover {
  border-color: var(--cyan);
}

.cue-card.cue-active {
  outline: 2px solid rgba(30,229,138,.55);
  box-shadow: 0 0 0 5px rgba(30,229,138,.09);
}

.cue-index-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.cue-index {
  min-width: 58px;
  padding: 10px 8px;
  border-radius: 11px;
  background: rgba(0,0,0,.22);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
}

button.cue-index:hover,
.jump-btn:hover {
  border-color: var(--cyan);
}

.cue-category {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: #d8e2ff;
  font-weight: 700;
  font-size: 11px;
}

.cue-main {
  min-width: 0;
}

.cue-headline-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.cue-headline-row h3 {
  margin: 0;
  font-size: 18px;
}

.cue-side-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cue-big-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 12px;
  color: #d6def0;
}

.cue-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cue-card-actions .btn {
  padding: 6px 8px;
}

/* INFO BOXES */

.cue-info-grid,
.current-details,
.next-cue-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.cue-info-grid > div,
.detail-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(4, 8, 14, .26);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  width: 100%;
  min-width: 0;
  align-self: start;
}

.cue-info-grid strong,
.detail-box strong {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.detail-box.full {
  grid-column: 1 / -1;
}

.detail-box.danger {
  background: rgba(255,95,112,.12);
  border-color: rgba(255,95,112,.32);
}

.tag-row,
.big-tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-row.big {
  margin-top: 10px;
}

.relevance-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.08);
}

.safety-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #fff0f3;
  background: rgba(255,95,112,.15);
  border: 1px solid rgba(255,95,112,.38);
  font-size: 12px;
  font-weight: 700;
}

.status-pill,
.priority-pill,
.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
  background: rgba(255,255,255,.08);
}

.status-pill.pending { color: var(--yellow); }
.status-pill.ready { color: var(--cyan); }
.status-pill.running { color: var(--green); }
.status-pill.hold { color: var(--orange); }
.status-pill.done { color: #bec8db; }

.priority-pill.low { color: #9fb2d7; }
.priority-pill.medium { color: var(--cyan); }
.priority-pill.high { color: var(--orange); }
.priority-pill.critical { color: var(--red); }

.mini-badge.hold { color: var(--yellow); }

.live-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* LIVE CUE CARDS */

.current-cue-card,
.next-cue-preview {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.current-cue-card,
.next-cue-card {
  --cue-accent: #1c2432;
  border: 1px solid color-mix(in srgb, var(--cue-accent) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--cue-accent) 80%, #121929), #101722 72%);
  border-radius: 12px;
  width: 100%;
  min-width: 0;
}

.current-cue-card {
  margin: 10px 12px 0;
  padding: 10px;
}

.next-cue-preview {
  padding: 0 12px 12px;
}

.next-cue-card {
  margin: 10px 0 0;
  padding: 10px;
}

.next-cue-card.empty {
  color: var(--muted);
  text-align: center;
  padding: 20px 16px;
}

.current-cue-card > *,
.next-cue-card > * {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.current-cue-top {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: start;
}

.current-index {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 12px;
  font-size: 24px;
  font-weight: 900;
  background: rgba(0,0,0,.2);
}

.current-index.jump-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,.08);
  color: inherit;
  cursor: pointer;
}

.current-cue-card h2,
.next-cue-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
}

.current-meta,
.next-cue-meta {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: #d4ddf0;
  font-size: 12px;
}

#currentCueTags,
.next-cue-card .tag-row {
  margin-top: 6px;
}

/* ACTIONS */

.main-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 8px 12px 12px;
  flex: 0 0 auto;
}

.main-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 13px;
}

/* OVERVIEW / EMERGENCY */

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

.emergency-grid {
  padding: 0 14px 14px;
}

.overview-emergency-grid {
  padding: 0 12px 12px;
}

.emg-btn {
  border: 0;
  border-radius: 12px;
  min-height: 72px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  width: 100%;
}

.emg-btn.readonly {
  cursor: not-allowed;
  opacity: .8;
}

.emergency-active,
#emergencyActive {
  margin: 0 12px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
}

.color-red { background: linear-gradient(180deg, rgba(255,95,112,.35), rgba(255,95,112,.2)); }
.color-orange { background: linear-gradient(180deg, rgba(255,159,26,.35), rgba(255,159,26,.2)); }
.color-yellow { background: linear-gradient(180deg, rgba(255,216,77,.35), rgba(255,216,77,.17)); color: #201a00; }
.color-cyan { background: linear-gradient(180deg, rgba(41,199,255,.35), rgba(41,199,255,.18)); }
.color-green { background: linear-gradient(180deg, rgba(30,229,138,.35), rgba(30,229,138,.18)); }

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

.kpi {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi span {
  color: var(--muted);
  font-size: 11px;
}

.kpi strong {
  font-size: 20px;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

/* MODALS */

.modal-bg {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(3, 5, 9, .7);
  backdrop-filter: blur(7px);
  z-index: 20;
}

.modal {
  width: min(980px, 100%);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-modal {
  width: min(430px, 100%);
}

.cue-modal {
  width: min(1180px, 96vw);
  height: min(90vh, 760px);
  display: grid;
  grid-template-rows: auto 1fr;
}

.emergency-modal {
  width: min(560px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.modal-body {
  padding: 14px 16px 18px;
  max-height: calc(95vh - 60px);
  overflow: auto;
}

.cue-modal-body {
  padding: 14px 16px 16px;
  overflow: hidden;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
}

.modal-subtitle {
  color: var(--muted);
  margin-top: 4px;
}

/* FORM / CUE EDITOR */

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

.form-grid.compact {
  gap: 10px;
}

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

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-row.full,
.form-actions.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.form-actions .btn {
  flex: 1;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

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

.tag-option span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0b1320;
  font-weight: 800;
}

.tag-option.selected span {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(41,199,255,.12);
}

.notice {
  min-height: 20px;
  font-size: 14px;
  color: var(--muted);
}

.notice.err { color: var(--red); }
.notice.ok { color: var(--green); }

.cue-form-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.cue-tabbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cue-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: #101826;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.cue-tab.active {
  border-color: rgba(41,199,255,.55);
  color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(41,199,255,.1);
}

.cue-tab-panels {
  min-height: 0;
  overflow: hidden;
}

.cue-tab-panel {
  display: none;
  height: 100%;
}

.cue-tab-panel.active {
  display: block;
}

.compact-grid-form {
  gap: 10px;
}

.compact-grid-form textarea {
  min-height: 110px;
  max-height: 180px;
}

.color-row input[type="color"] {
  height: 42px;
  padding: 4px;
  border-radius: 10px;
}

.sticky-actions {
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.05);
  background: linear-gradient(180deg, rgba(17,26,41,0), rgba(17,26,41,1) 28%);
}

/* ADMIN */

body.admin-page {
  overflow: hidden;
}

.admin-shell,
.admin-card,
.admin-section,
.admin-panel-full {
  min-height: 0;
}

.admin-shell {
  height: calc(100vh - var(--topbar-h));
  overflow: auto;
  padding: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.admin-stretch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  border: 0;
  align-items: start;
}

.admin-panel-full {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-card {
  padding: 16px;
  min-height: 100%;
  overflow: hidden;
}

.admin-card .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-panel-full .panel-title {
  padding: 16px 16px 0;
}

.admin-bottom-grid {
  align-items: stretch;
}

.admin-bottom-grid .admin-card {
  display: flex;
  flex-direction: column;
}

.admin-bottom-grid .table-wrap {
  flex: 1 1 auto;
  max-height: 100%;
  overflow: auto;
}

.admin-emg-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.emg-editor-wrap {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.emg-editor {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.emg-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  max-height: 360px;
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align: left;
  font-size: 13px;
}

.table th {
  color: var(--muted);
  position: sticky;
  top: 0;
  background: #0f1725;
  z-index: 1;
}

/* EMERGENCY FLASH */

.emergency-flash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 14, .72);
  backdrop-filter: blur(4px);
}

.emergency-flash.hidden {
  display: none !important;
}

.emergency-flash-card {
  width: min(960px, 100%);
  border-radius: 18px;
  padding: 24px;
  border: 2px solid rgba(255,255,255,.16);
  box-shadow: 0 20px 70px rgba(0,0,0,.45);
  text-align: center;
}

.flash-kicker {
  font-size: 16px;
  letter-spacing: .24em;
  font-weight: 900;
  opacity: .9;
}

.flash-title {
  margin-top: 10px;
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 900;
}

.flash-message {
  margin-top: 10px;
  font-size: clamp(16px, 2vw, 26px);
  font-weight: 700;
}

/* RESPONSIVE */

@media (max-width: 1320px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .right-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr;
    overflow: auto;
  }

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

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

  .right-panel {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow: auto;
  }

  .admin-stretch {
    grid-template-columns: 1fr;
  }

  .cue-modal {
    width: min(96vw, 920px);
    height: min(92vh, 820px);
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .dashboard-grid {
    height: auto;
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 1fr;
    height: auto;
  }

  .cue-card,
  .current-cue-top,
  .form-grid.two-col,
  .cue-info-grid,
  .current-details,
  .next-cue-details,
  .emergency-grid,
  .kpi-grid,
  .overview-emergency-grid {
    grid-template-columns: 1fr;
  }

  .cue-headline-row,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .cue-index {
    width: 100%;
  }

  .main-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    height: auto;
  }

  .app-shell {
    grid-template-rows: auto 1fr;
  }

  .form-grid.two-col,
  .admin-stretch,
  .emg-row {
    grid-template-columns: 1fr;
  }

  .cue-card {
    grid-template-columns: 1fr;
  }

  .cue-index-wrap {
    flex-direction: row;
    align-items: center;
  }

  .cue-modal {
    height: min(94vh, 900px);
  }

  .overview-emergency-grid {
    grid-template-columns: 1fr;
  }
}

/* HEIGHT BREAKPOINTS - OHNE INNERE SCROLLBARS */

@media (max-height: 920px) {
  :root {
    --topbar-h: 64px;
  }

  .dashboard-grid {
    gap: 8px;
    padding: 8px;
  }

  .panel-head {
    padding: 8px 12px;
  }

  .panel-title {
    font-size: 14px;
  }

  .panel-subtitle {
    font-size: 10px;
  }

  .current-cue-card,
  .next-cue-card {
    margin-top: 8px;
    padding: 8px;
  }

  .current-cue-top {
    grid-template-columns: 50px 1fr;
    gap: 8px;
  }

  .current-index {
    min-height: 50px;
    font-size: 21px;
  }

  .current-cue-card h2,
  .next-cue-card h3 {
    font-size: 16px;
  }

  .current-meta,
  .next-cue-meta {
    font-size: 11px;
    gap: 6px;
  }

  .cue-info-grid,
  .current-details,
  .next-cue-details {
    gap: 6px;
    margin-top: 6px;
  }

  .detail-box,
  .cue-info-grid > div {
    padding: 7px 8px;
  }

  .detail-box strong,
  .cue-info-grid strong {
    font-size: 9px;
  }

  .relevance-tag {
    padding: 4px 7px;
    font-size: 10px;
  }

  .safety-box {
    padding: 7px 8px;
    font-size: 11px;
  }

  .main-actions {
    padding: 6px 12px 10px;
  }

  .main-actions .btn {
    padding: 7px 8px;
    font-size: 12px;
  }

  .kpi {
    padding: 8px;
  }

  .kpi span {
    font-size: 10px;
  }

  .kpi strong {
    font-size: 17px;
  }

  .emg-btn {
    min-height: 62px;
    font-size: 13px;
  }
}

@media (max-height: 780px) {
  .current-details,
  .next-cue-details {
    grid-template-columns: 1fr;
  }

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

  .panel-title {
    font-size: 13px;
  }

  .panel-subtitle {
    font-size: 9px;
  }

  .current-cue-card h2,
  .next-cue-card h3 {
    font-size: 15px;
  }

  .current-meta,
  .next-cue-meta {
    font-size: 10px;
  }

  .main-actions .btn {
    font-size: 11px;
  }
}

@media (max-height: 700px) {
  .detail-box.crew-info,
  .next-cue-card .detail-box.crew-info,
  .current-cue-card .detail-box.crew-info {
    display: none;
  }

  .emg-btn {
    min-height: 54px;
    font-size: 12px;
  }

  .kpi strong {
    font-size: 15px;
  }
}

/* ===== 1080p / normale Full-HD Laptops & Monitore ===== */
@media (max-width: 1920px) and (max-height: 1080px) {
  :root {
    --topbar-h: 60px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
    gap: 8px;
    padding: 8px;
    height: calc(100vh - var(--topbar-h));
  }

  .topbar {
    padding: 8px 12px;
    gap: 10px;
  }

  .logo,
  .brand-mark {
    font-size: 13px;
  }

  .brand-sub {
    font-size: 9px;
  }

  .clock {
    min-width: 74px;
    font-size: 13px;
  }

  .panel-head {
    padding: 8px 10px;
  }

  .panel-title {
    font-size: 14px;
  }

  .panel-subtitle {
    font-size: 10px;
  }

  .cue-list {
    padding: 8px;
  }

  .cue-card {
    grid-template-columns: 70px 1fr;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 10px;
  }

  .cue-index {
    min-width: 48px;
    padding: 8px 6px;
    font-size: 16px;
    border-radius: 9px;
  }

  .cue-category {
    font-size: 10px;
    padding: 5px 7px;
  }

  .cue-headline-row h3 {
    font-size: 15px;
  }

  .cue-big-meta {
    margin-top: 4px;
    gap: 8px;
    font-size: 11px;
  }

  .cue-info-grid,
  .current-details,
  .next-cue-details {
    gap: 6px;
    margin-top: 6px;
  }

  .cue-info-grid > div,
  .detail-box {
    padding: 7px 8px;
    border-radius: 9px;
  }

  .cue-info-grid strong,
  .detail-box strong {
    font-size: 9px;
  }

  .relevance-tag {
    font-size: 10px;
    padding: 4px 7px;
  }

  .safety-box {
    margin-top: 6px;
    padding: 7px 8px;
    font-size: 11px;
  }

  .right-panel {
    gap: 8px;
    grid-template-rows: auto auto auto;
  }

  .current-cue-card,
  .next-cue-card {
    padding: 8px;
    border-radius: 10px;
  }

  .current-cue-card {
    margin: 8px 10px 0;
  }

  .next-cue-preview {
    padding: 0 10px 10px;
  }

  .next-cue-card {
    margin-top: 8px;
  }

  .current-cue-top {
    grid-template-columns: 48px 1fr;
    gap: 8px;
  }

  .current-index {
    min-height: 48px;
    font-size: 20px;
    border-radius: 10px;
  }

  .current-cue-card h2,
  .next-cue-card h3 {
    font-size: 15px;
  }

  .current-meta,
  .next-cue-meta {
    margin-top: 3px;
    gap: 6px;
    font-size: 11px;
  }

  .main-actions {
    padding: 6px 10px 10px;
    gap: 6px;
  }

  .main-actions .btn {
    padding: 7px 8px;
    font-size: 12px;
  }

  .kpi-grid {
    gap: 6px;
    padding: 0 10px 8px;
  }

  .kpi {
    padding: 8px;
  }

  .kpi span {
    font-size: 10px;
  }

  .kpi strong {
    font-size: 16px;
  }

  .overview-emergency-grid {
    padding: 0 10px 10px;
    gap: 6px;
  }

  .emg-btn {
    min-height: 58px;
    font-size: 12px;
    border-radius: 10px;
  }
}