/* Safe Shift — workplace safety console
   Single committed light theme (deep teal on pale mint). No gradients, no glass. */

:root{
  color-scheme: light;

  /* Ground and paper. Warm, so the room feels lit rather than lab-lit. */
  --bg:        #f2ede4;
  --surface:   #fcfaf6;
  --surface-2: #f7f2ea;
  --sunken:    #e8e0d3;

  /* Ink stays cool — warm paper, cool writing. */
  --text:      #20515b;
  --text-2:    #5f7f85;
  --text-3:    #7d7a6e;
  --navy:      #234270;

  --line:      #e2d9ca;
  --line-2:    #cfc3af;

  --primary:   #72979f;
  --accent:    #8d99c0;

  /* Status colours, muted into the same family. Nothing shouts. */
  --ok:        #4c7a5e;
  --ok-fill:   #e9f0e7;
  --warn:      #b0762f;
  --warn-fill: #f7eede;
  --crit:      #a65046;
  --crit-fill: #f6e7e2;
  --info:      #5a68a0;
  --info-fill: #eceef4;

  --r:         10px;
  --shadow:    0 1px 2px rgba(74, 58, 38, 0.05), 0 2px 6px rgba(74, 58, 38, 0.035);
  --rail:      216px;
  --sim:       304px;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Public Sans", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --serif:"Newsreader", ui-serif, Georgia, "Times New Roman", serif;
}

*{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button{ font: inherit; color: inherit; }

/* ---------- shell ---------- */

.shell{
  display: grid;
  grid-template-columns: var(--rail) minmax(0,1fr) var(--sim);
  grid-template-rows: auto minmax(0,1fr);
  grid-template-areas: "head head head" "rail main sim";
  height: 100%;
}

/* ---------- header ---------- */

.head{
  grid-area: head;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0px);
  min-height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.wordmark{
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-right: auto;
}
.wordmark b{
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.wordmark span{
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--text-3);
}

.clock{
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.clock small{
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

.speeds{ display: flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.speeds button{
  border: 0; background: var(--surface); padding: 5px 10px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--text-2);
  border-left: 1px solid var(--line);
}
.speeds button:first-child{ border-left: 0; }
.speeds button[aria-pressed="true"]{ background: var(--navy); color: #fff; }

.posture{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px; border-radius: 999px;
  font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
}
.posture .dot{ width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.posture[data-p="incident"]{ background: var(--warn-fill); border-color: #dcc79a; color: #7d5518; }
.posture[data-p="incident"] .dot{ background: var(--warn); }
.posture[data-p="muster"]{ background: var(--crit-fill); border-color: #dfb2ad; color: #7d332f; }
.posture[data-p="muster"] .dot{ background: var(--crit); }

/* ---------- nav rail ---------- */

.rail{
  grid-area: rail;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.rail .eyebrow{ margin: 6px 8px 8px; }

.navbtn{
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer;
  padding: 8px 10px; border-radius: var(--r);
  color: var(--text-2);
  border-left: 2px solid transparent;
}
.navbtn:hover{ background: var(--surface-2); color: var(--text); }
.navbtn[aria-current="true"]{ background: var(--sunken); color: var(--navy); border-left-color: var(--navy); font-weight: 600; }
.navbtn .count{
  margin-left: auto;
  font-family: var(--mono); font-size: 11px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--sunken); color: var(--text-2);
}
.navbtn[data-alert="true"] .count{ background: var(--crit); color: #fff; }

.rail-foot{ margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11.5px; }

/* ---------- main ---------- */

.main{ grid-area: main; overflow-y: auto; padding: 22px 24px 40px; }
.main > * + *{ margin-top: 20px; }

.page-head{ display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1{
  font-family: var(--serif); font-weight: 500; font-size: 27px; line-height: 1.15;
  margin: 0; color: var(--navy); text-wrap: balance;
}
.page-head p{ margin: 0; color: var(--text-2); max-width: 60ch; }

.eyebrow{
  font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}

/* ---------- panels ---------- */

.panel{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.panel > header{
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.panel > header h2{ font-family: var(--serif); font-weight: 500; font-size: 17px; margin: 0; }
.panel > header .eyebrow{ margin-left: auto; }
.panel .body{ padding: 16px; }
.panel .body > * + *{ margin-top: 14px; }

.grid{ display: grid; gap: 14px; }
.cols-2{ grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.cols-3{ grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- zone tiles ---------- */

.zone{
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--r);
  padding: 13px 15px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
}
.zone[data-tier="1"]{ border-left-color: var(--primary); }
.zone[data-tier="2"]{ border-left-color: var(--accent); }
.zone[data-tier="3"]{ border-left-color: var(--navy); }
.zone[data-live="watch"]{ border-color: #dcc79a; background: var(--warn-fill); }
.zone[data-live="alarm"]{ border-color: #dfb2ad; background: var(--crit-fill); }

.zone .top{ display: flex; align-items: baseline; gap: 8px; }
.zone .name{ font-weight: 600; color: var(--navy); }
.zone .code{ font-family: var(--mono); font-size: 10.5px; color: var(--text-3); margin-left: auto; }
.zone .who{ font-size: 12.5px; color: var(--text-2); min-height: 19px; }
.zone .blind{ font-family: var(--mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.04em; }

/* ---------- watch cards ---------- */

.watch{
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow);
}
.watch[data-level="1"], .watch[data-level="2"]{ border-color: #dcc79a; }
.watch[data-level="3"], .watch[data-level="4"]{ border-color: #dfb2ad; }
.watch .row{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.watch .subject{ font-weight: 600; color: var(--navy); }
.watch .meta{ font-size: 12.5px; color: var(--text-2); }
.watch .timer{ margin-left: auto; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 15px; }
.watch .timer[data-over="true"]{ color: var(--crit); }

.bar{ height: 4px; background: var(--sunken); border-radius: 2px; overflow: hidden; }
.bar i{ display: block; height: 100%; background: var(--ok); }
.bar i[data-state="warn"]{ background: var(--warn); }
.bar i[data-state="crit"]{ background: var(--crit); }

/* ---------- ladder ---------- */

.ladder{ display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ladder div{
  flex: 1; padding: 7px 8px; text-align: center;
  font-family: var(--sans); font-weight: 600; font-size: 10px; letter-spacing: 0.04em;
  color: var(--text-3); background: var(--surface-2);
  border-left: 1px solid var(--line);
}
.ladder div:first-child{ border-left: 0; }
.ladder div[data-on="true"]{ background: var(--navy); color: #fff; }
.ladder div[data-on="passed"]{ background: var(--sunken); color: var(--text-2); }

/* ---------- pills & tags ---------- */

.pill{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-family: var(--sans); font-weight: 600; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
  white-space: nowrap;
}
.pill[data-t="ok"]{   background: var(--ok-fill);   border-color: #b6d2c8; color: #2d5b4d; }
.pill[data-t="warn"]{ background: var(--warn-fill); border-color: #dcc79a; color: #7d5518; }
.pill[data-t="crit"]{ background: var(--crit-fill); border-color: #dfb2ad; color: #7d332f; }
.pill[data-t="info"]{ background: var(--info-fill); border-color: #bcc2dd; color: #414d80; }

/* ---------- buttons ---------- */

.btn{
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  padding: 7px 13px; border-radius: var(--r); cursor: pointer;
  font-size: 13px; font-weight: 500;
}
.btn:hover{ background: var(--surface-2); border-color: var(--primary); }
.btn:focus-visible{ outline: 2px solid var(--navy); outline-offset: 2px; }
.btn[data-v="primary"]{ background: var(--navy); border-color: var(--navy); color: #fff; }
.btn[data-v="primary"]:hover{ background: #1a3459; }
.btn[data-v="glass"]{ background: var(--info-fill); border-color: #bcc2dd; color: #3c4878; }
.btn[data-v="glass"]:hover{ background: #e0e4f0; }
.btn[data-v="danger"]{ background: var(--crit-fill); border-color: #dfb2ad; color: #7d332f; }
.btn[data-v="danger"]:hover{ background: #f0d9d6; }
.btn[disabled]{ opacity: 0.45; cursor: not-allowed; }
.btn.sm{ padding: 4px 9px; font-size: 12px; }

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

/* ---------- simulator rail ---------- */

.sim{
  grid-area: sim;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 16px 14px 32px;
  overflow-y: auto;
}
.sim > * + *{ margin-top: 12px; }

.scn{
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.scn:hover{ border-color: var(--primary); background: #f2ebe0; }
.scn:disabled{ opacity: 0.45; cursor: not-allowed; }
.scn b{ color: var(--navy); font-size: 13px; }
.scn span{ font-size: 12px; color: var(--text-2); line-height: 1.4; }
.scn .tag{ font-family: var(--sans); font-weight: 600; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }

/* ---------- feed / timeline ---------- */

.feed{ display: flex; flex-direction: column; gap: 0; }
.feed li{
  display: grid; grid-template-columns: 62px 1fr; gap: 10px;
  padding: 7px 0; border-top: 1px solid var(--line);
  font-size: 12.5px; list-style: none;
}
.feed li:first-child{ border-top: 0; }
.feed time{ font-family: var(--mono); font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.feed .what strong{ color: var(--navy); font-weight: 600; }
.feed li[data-kind="privacy"] .what{ color: #414d80; }
.feed li[data-kind="crit"] .what strong{ color: var(--crit); }
ul.feed{ margin: 0; padding: 0; }

/* ---------- tables ---------- */

.tablewrap{ overflow-x: auto; }
table{ width: 100%; border-collapse: collapse; font-size: 12.5px; }
th{
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2);
  font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; white-space: nowrap;
}
td{ padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.mono{ font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
tr:last-child td{ border-bottom: 0; }

/* ---------- roster ---------- */

.roster{ display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.person{
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; background: var(--surface);
}
.person[data-s="unaccounted"]{ border-color: #dfb2ad; background: var(--crit-fill); }
.person[data-s="safe"]{ border-color: #b6d2c8; background: var(--ok-fill); }
.person .nm{ font-weight: 600; color: var(--navy); font-size: 13px; }
.person .rl{ font-size: 11.5px; color: var(--text-2); }
.person .st{ margin-left: auto; }

/* ---------- notes / callouts ---------- */

.note{
  border-left: 2px solid var(--accent);
  background: var(--info-fill);
  padding: 11px 14px; border-radius: 0 var(--r) var(--r) 0;
  font-size: 12.5px; color: #3c4878;
}
.note b{ color: #2e3866; }

.blindnote{
  border-left: 2px solid var(--primary);
  background: var(--surface-2);
  padding: 11px 14px; border-radius: 0 var(--r) var(--r) 0;
  font-size: 12.5px; color: var(--text-2);
}

.empty{ color: var(--text-3); font-size: 13px; padding: 18px 0; text-align: center; }

/* ---------- prose (policy / why pages) ---------- */

.prose{ max-width: 68ch; }
.prose h3{ font-family: var(--serif); font-weight: 500; font-size: 18px; color: var(--navy); margin: 22px 0 6px; }
.prose p{ margin: 0 0 10px; color: var(--text-2); }
.prose strong{ color: var(--text); }
.prose ul{ margin: 0 0 10px; padding-left: 18px; color: var(--text-2); }
.prose li{ margin-bottom: 5px; }

.kv{ display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 12.5px; }
.kv dt{ font-family: var(--sans); font-weight: 600; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding-top: 2px; }
.kv dd{ margin: 0; color: var(--text); }

/* ---------- modal ---------- */

.veil{
  position: fixed; inset: 0; background: rgba(60, 48, 34, 0.30);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 40;
}
.modal{
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  width: min(520px, 100%); max-height: 86vh; overflow-y: auto;
}
.modal header{ padding: 16px 20px 0; }
.modal header h2{ font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0 0 4px; color: var(--navy); }
.modal .body{ padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal label{ display: block; font-family: var(--sans); font-weight: 600; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.modal select, .modal textarea{
  width: 100%; font: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 10px; background: var(--surface);
}
.modal textarea{ min-height: 66px; resize: vertical; }

/* ---------- camera stand-in ---------- */

.cam{
  border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--sunken);
}
.cam .frame{
  aspect-ratio: 16/9; max-width: 100%;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  background: var(--sunken);
  color: var(--text-2); font-size: 12.5px; text-align: center; padding: 16px;
}
.cam .strip{
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 13px; border-top: 1px solid var(--line-2); background: var(--info-fill);
  font-size: 11.5px; color: #414d80;
}

/* ---------- toast ---------- */

.toast{
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--r);
  font-size: 13px; z-index: 60; max-width: min(520px, calc(100% - 32px));
}

/* ---------- responsive ---------- */

@media (max-width: 1080px){
  .shell{
    grid-template-columns: var(--rail) minmax(0,1fr);
    grid-template-areas: "head head" "rail main" "sim sim";
    grid-template-rows: auto minmax(0,1fr) auto;
    height: auto; min-height: 100%;
  }
  .sim{ border-left: 0; border-top: 1px solid var(--line); }
  .main{ overflow: visible; }
}

@media (max-width: 720px){
  body{ font-size: 13.5px; }
  .shell{
    grid-template-columns: minmax(0,1fr);
    grid-template-areas: "head" "rail" "main" "sim";
    grid-template-rows: auto auto auto auto;
  }
  .rail{
    flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 16px; gap: 6px;
  }
  .rail .eyebrow, .rail-foot{ display: none; }
  .navbtn{ width: auto; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .navbtn[aria-current="true"]{ border-left: 0; border-bottom-color: var(--navy); }
  .main{ padding: 18px 16px 32px; }
  .sim{ padding: 16px; }
  .kv{ grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd{ margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

/* ---------- the brief, stated up front ---------- */

.turn{
  border-left: 2px solid var(--primary);
  padding: 2px 0 2px 16px;
  display: flex; flex-direction: column; gap: 12px;
}

.turn-grid{
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.turn-cell{ display: flex; flex-direction: column; gap: 5px; }
.turn-cell .q{
  font-family: var(--serif); font-size: 15.5px; color: var(--navy);
  padding-bottom: 5px; border-bottom: 1px solid var(--line);
}
.turn-cell .a, .turn-cell .b{ font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.turn-cell .b{ color: var(--text); }
.turn-cell span{
  display: block;
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 1px;
}
.turn-cell .b span{ color: var(--primary); }

.turn-out{
  margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.4;
  color: var(--navy); max-width: 64ch; text-wrap: balance;
}

.statline{
  font-size: 12.5px; color: var(--text-2);
  padding-bottom: 2px;
}

/* the one button a presenter needs */
.scn[data-lead="true"]{
  background: var(--navy); border-color: var(--navy);
}
.scn[data-lead="true"]:hover{ background: #1a3459; }
.scn[data-lead="true"] b{ color: #fff; font-size: 14px; }
.scn[data-lead="true"] span{ color: #cdd8e6; }
.scn[data-lead="true"] .tag{ color: #8fa6c4; }
.scn[data-lead="true"]:disabled{ opacity: 0.5; }

/* ---------- the "why not cameras" argument ---------- */

.why{ display: flex; flex-direction: column; gap: 5px; }
.why-h{
  font-family: var(--serif); font-size: 16px; line-height: 1.3;
  color: var(--navy); text-wrap: balance;
}
.why p{ margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }

/* ---------- the privacy promises ---------- */

.promises{
  display: grid; gap: 14px 22px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}
.promise{ display: flex; flex-direction: column; gap: 3px; }
.promise .p{
  font-family: var(--serif); font-size: 16px; line-height: 1.3;
  color: var(--navy); text-wrap: balance;
}
.promise .m{ font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
