:root{
  --bg:#07101f;
  --panel:#0e1a32;
  --panel-soft:rgba(14,26,50,.76);
  --panel-strong:#0b1430;
  --stroke:rgba(159,184,255,.16);
  --text:#ecf2ff;
  --muted:#9cb0dc;
  --accent:#f3a53a;
  --accent-soft:rgba(243,165,58,.18);
  --ok:#79e2ab;
  --bad:#ff7373;
  --shadow:0 24px 60px rgba(0,0,0,.42);
  --radius-xl:28px;
  --radius-lg:20px;
  --radius-md:16px;
}

*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  color:var(--text);
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  background:
    radial-gradient(1200px 720px at 50% -120px, rgba(59,95,196,.42), transparent 62%),
    radial-gradient(900px 600px at 100% 0, rgba(243,165,58,.14), transparent 55%),
    linear-gradient(180deg, #091224, #050a15 72%);
}

.appShell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  padding:20px;
  gap:18px;
}

.topBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.brandBlock{
  display:flex;
  align-items:center;
  gap:14px;
}

.brandLogo{
  width:54px;
  height:54px;
  object-fit:cover;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 10px 28px rgba(0,0,0,.32);
}

.eyebrow{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--accent);
  font-weight:800;
  margin-bottom:6px;
}

h1,h2,h3{margin:0}
h1{font-size:24px}
h2{font-size:30px; line-height:1.05}
h3{font-size:20px}

.topStatus{
  padding:12px 16px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.05);
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
}

.screens{
  flex:1;
  position:relative;
  min-height:calc(100vh - 120px);
}

.screen{
  position:absolute;
  inset:0;
  width:100%;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.screen.isActive{
  position:relative;
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

#unlockScreen,
#setupScreen{
  display:flex;
  align-items:center;
  justify-content:center;
}

#flightScreen{
  display:block;
}

.card{
  width:min(840px,100%);
  margin:auto;
  background:linear-gradient(180deg, rgba(18,31,60,.96), rgba(10,18,38,.96));
  border:1px solid var(--stroke);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow);
}

.heroCard,
.setupCard{
  padding:30px;
}

.heroCopy p,
.sectionText{
  margin:14px 0 0;
  color:var(--muted);
  line-height:1.6;
  max-width:720px;
}

.fieldBlock{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:22px;
}

label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.45px;
  color:var(--muted);
  font-weight:700;
}

input{
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:14px 15px;
  background:rgba(4,9,20,.58);
  color:var(--text);
  font-size:15px;
  outline:none;
}

input::placeholder{color:rgba(236,242,255,.32)}
input:focus{
  border-color:rgba(243,165,58,.7);
  box-shadow:0 0 0 4px rgba(243,165,58,.12);
}

.actionRow{
  display:flex;
  gap:12px;
  margin-top:22px;
}

.actionRow.split{
  justify-content:space-between;
}

button{
  border:0;
  cursor:pointer;
  border-radius:16px;
  padding:14px 18px;
  font-size:14px;
  font-weight:800;
  letter-spacing:.3px;
}

.primaryBtn{
  background:linear-gradient(180deg, #f6b14e, var(--accent));
  color:#172341;
  box-shadow:0 14px 30px rgba(243,165,58,.24);
}

.secondaryBtn{
  background:rgba(255,255,255,.07);
  color:var(--text);
  border:1px solid rgba(255,255,255,.12);
}

button:disabled{
  opacity:.45;
  cursor:not-allowed;
  box-shadow:none;
}

.statusCard{
  margin-top:22px;
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:16px;
  border-radius:18px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
}

.statusDot{
  width:12px;
  height:12px;
  border-radius:50%;
  background:rgba(255,255,255,.24);
  box-shadow:0 0 0 6px rgba(255,255,255,.04);
  margin-top:3px;
  flex:0 0 auto;
}

.statusDot.ok{background:var(--ok); box-shadow:0 0 0 6px rgba(121,226,171,.12)}
.statusDot.bad{background:var(--bad); box-shadow:0 0 0 6px rgba(255,115,115,.12)}

.statusTitle{
  font-size:15px;
  font-weight:800;
}

.statusText{
  margin-top:5px;
  color:var(--muted);
  line-height:1.5;
  font-size:13px;
}

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

.pill{
  padding:10px 14px;
  border-radius:999px;
  background:var(--accent-soft);
  color:#ffd8a5;
  border:1px solid rgba(243,165,58,.28);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.setupGrid{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(260px,.8fr);
  gap:18px;
  align-items:end;
  margin-top:22px;
}

.actionTile{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.helperText{
  color:var(--muted);
  line-height:1.45;
  font-size:12px;
}

.summaryGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:22px;
}

.summaryCard{
  padding:16px;
  border-radius:18px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
}

.summaryCardWide{
  grid-column:1 / -1;
}

.summaryLabel{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.45px;
  color:var(--muted);
  font-weight:800;
}

.summaryValue{
  margin-top:8px;
  font-size:22px;
  font-weight:900;
  line-height:1.15;
}

.summaryMeta{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.flightScreen.isActive{
  display:block;
}

.flightShell{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.flightHeader{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
}

.headerMeta{
  max-width:420px;
  text-align:right;
  color:var(--muted);
  line-height:1.45;
  font-size:13px;
}

.flightCanvas{
  position:relative;
  min-height:calc(100vh - 150px);
}

.commsStage{
  width:100%;
  min-height:calc(100vh - 150px);
  border-radius:var(--radius-xl);
  overflow:visible;
  border:1px solid var(--stroke);
  background:#050910;
  box-shadow:var(--shadow);
}

.commsStage iframe{
  width:100%;
  min-height:calc(100vh - 150px);
  height:calc(100vh - 150px);
  border:0;
  display:block;
  background:#050910;
  transition:height .18s ease;
}

.cabinDock{
  position:absolute;
  top:18px;
  right:18px;
  width:min(360px,calc(100% - 36px));
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:16px;
  border-radius:24px;
  background:rgba(7,13,25,.86);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 22px 46px rgba(0,0,0,.4);
  backdrop-filter:blur(12px);
}

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

.dockEyebrow{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.45px;
  color:var(--accent);
  font-weight:800;
  margin-bottom:4px;
}

.dockPill{
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

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

.dockMetaCard,
.statusPanel,
.announcementPanel,
.signsPanel,
.manualPanel,
.audioPanel{
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
}

.dockMetaLabel,
.panelLabel,
.statusPanelLabel{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.45px;
  color:var(--muted);
  font-weight:800;
}

.dockMetaValue,
.statusPanelValue{
  margin-top:7px;
  font-size:15px;
  font-weight:900;
  line-height:1.3;
}

.statusPanelText,
.announcementText{
  margin-top:8px;
  color:var(--muted);
  line-height:1.52;
  font-size:13px;
}

.buttonGrid{
  display:grid;
  gap:10px;
  margin-top:12px;
}

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

.toggleBtn,
.ghostBtn{
  border-radius:14px;
  padding:12px 10px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:var(--text);
}

.toggleBtn.isActive{
  background:var(--accent-soft);
  border-color:rgba(243,165,58,.42);
  color:#ffe1b7;
}

.manualPanel summary{
  cursor:pointer;
  font-weight:800;
  list-style:none;
}

.manualPanel summary::-webkit-details-marker{
  display:none;
}

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

.cabinPlayer{
  width:100%;
  margin-top:12px;
  border-radius:14px;
  background:rgba(0,0,0,.22);
}

@media (max-width: 980px){
  .topBar,
  .sectionHeader,
  .flightHeader{
    flex-direction:column;
    align-items:flex-start;
  }

  .topStatus,
  .pill{
    white-space:normal;
  }

  .setupGrid,
  .summaryGrid{
    grid-template-columns:1fr;
  }

  .summaryCardWide{
    grid-column:auto;
  }

  .flightCanvas{
    display:flex;
    flex-direction:column;
    gap:14px;
    min-height:auto;
  }

  .commsStage iframe{
    min-height:0;
    height:auto;
  }

  .cabinDock{
    position:static;
    width:100%;
  }
}

@media (max-width: 640px){
  body{
    font-size:14px;
  }

  .appShell{
    padding:14px;
  }

  h1{font-size:20px}
  h2{font-size:25px}

  .heroCard,
  .setupCard{
    padding:22px;
  }

  .actionRow,
  .actionRow.split{
    flex-direction:column;
  }

  .buttonGrid.twoCol,
  .manualButtons,
  .dockMetaGrid{
    grid-template-columns:1fr;
  }
}
