:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --grouped: #ffffff;
  --label: #1c1c1e;
  --secondary: rgba(60, 60, 67, 0.64);
  --tertiary: rgba(60, 60, 67, 0.36);
  --separator: rgba(60, 60, 67, 0.12);
  --fill: rgba(120, 120, 128, 0.12);
  --blue: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
  --safe: env(safe-area-inset-bottom, 16px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--label);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #e8e8ed; }
button, input, textarea, select { font: inherit; }
button { border: 0; background: none; cursor: pointer; color: inherit; }
a { color: var(--blue); text-decoration: none; }

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.demo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 20;
}
.wordmark {
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 12px;
  text-transform: uppercase;
}
.wordmark span { color: var(--blue); }
.segment {
  display: flex;
  background: var(--fill);
  padding: 3px;
  border-radius: 9px;
}
.segment button {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 590;
  color: var(--label);
}
.segment button.on {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

.stage { padding: 28px 24px 48px; }
.stage.narrow { max-width: 1120px; margin: 0 auto; width: 100%; }

.page { display: none; }
.page.on { display: block; }

.kicker { color: var(--secondary); font-size: 13px; margin: 0 0 6px; }
h1.title { font-size: 34px; letter-spacing: -0.03em; margin: 0 0 8px; font-weight: 700; }
.lede { color: var(--secondary); margin: 0 0 28px; max-width: 52ch; line-height: 1.45; }

/* Recorder */
.phone-stage { display: flex; justify-content: center; padding: 8px 0 24px; }
.phone {
  width: 390px;
  min-height: 760px;
  background: #000;
  border-radius: 44px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.phone-inner {
  background: var(--bg);
  border-radius: 34px;
  min-height: 736px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.notch {
  height: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--tertiary);
  font-size: 12px;
  font-weight: 600;
}
.tech-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 22px 14px;
}
.tech-head .name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.tech-head .meta { color: var(--secondary); font-size: 13px; margin-top: 2px; }
.logo-card {
  margin: 0 22px 8px;
  background: var(--surface);
  border-radius: 16px;
  padding: 22px 18px;
  display: grid;
  place-items: center;
  min-height: 104px;
}
.logo-card img { width: min(260px, 100%); height: auto; }

.record-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 22px 12px;
}
.rec-btn {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 4px #fff, 0 0 0 3px #d1d1d6;
  display: grid;
  place-items: center;
}
.rec-btn .dot {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--red);
  transition: border-radius .18s, transform .18s;
}
.rec-btn.live {
  box-shadow: inset 0 0 0 4px #fff, 0 0 0 3px var(--red);
}
.rec-btn.live .dot {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.hint { margin: 16px 0 4px; font-weight: 600; font-size: 16px; }
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--label);
}
.wave {
  height: 36px;
  display: flex;
  gap: 3px;
  align-items: center;
  margin-top: 10px;
  visibility: hidden;
}
.wave.on { visibility: visible; }
.wave i {
  width: 3px;
  height: 8px;
  background: var(--red);
  border-radius: 2px;
  animation: bar 0.9s ease-in-out infinite;
}
.wave i:nth-child(2n) { animation-delay: .1s; height: 16px; }
.wave i:nth-child(3n) { animation-delay: .2s; height: 24px; }
.wave i:nth-child(4n) { animation-delay: .05s; height: 12px; }
@keyframes bar {
  0%, 100% { transform: scaleY(0.45); opacity: .55; }
  50% { transform: scaleY(1); opacity: 1; }
}

.queue {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.clip {
  background: var(--surface);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
}
.play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--fill);
  font-size: 14px;
}
.clip .when { font-size: 12px; color: var(--secondary); }
.clip .dur { font-weight: 650; font-size: 15px; }
.x {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--secondary);
  font-size: 18px;
}

.send {
  margin: 14px 0 8px;
  width: 100%;
  height: 52px;
  border-radius: 14px;
  background: var(--label);
  color: #fff;
  font-weight: 650;
  font-size: 17px;
  opacity: 0.28;
  pointer-events: none;
}
.send.ready { opacity: 1; pointer-events: auto; }

.home-bar {
  height: 22px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.home-bar b {
  width: 128px;
  height: 5px;
  background: #1c1c1e;
  border-radius: 4px;
  opacity: 0.85;
}

/* Admin / exec */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
}
.nav-card, .panel, .block {
  background: var(--surface);
  border-radius: 16px;
}
.nav-card { padding: 8px; height: max-content; }
.nav-card button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 510;
  color: var(--label);
}
.nav-card button.on { background: var(--fill); font-weight: 600; }

.panel { padding: 22px 24px 26px; }
.panel h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.03em; }
.panel .help { color: var(--secondary); margin: 0 0 20px; font-size: 14px; }

.topic {
  border: 1px solid var(--separator);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.topic-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.topic-head strong { font-size: 17px; }
.pill {
  font-size: 12px;
  background: var(--fill);
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--secondary);
}
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
}
.field label, .label {
  display: block;
  font-size: 11px;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 4px;
}
.field input, .field textarea, .field select,
.form input, .form textarea, .form select {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  outline: none;
  color: var(--label);
}
.field textarea { min-height: 52px; resize: vertical; }
.risks { display: flex; gap: 8px; flex-wrap: wrap; }
.risk {
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--separator);
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}
.risk.on { border-color: var(--blue); color: var(--blue); background: #e8f1ff; }

.row-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn {
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.quiet { background: var(--fill); }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12px;
  color: var(--secondary);
  font-weight: 600;
  padding: 8px 6px;
  border-bottom: 1px solid var(--separator);
}
.table td {
  padding: 12px 6px;
  border-bottom: 1px solid var(--separator);
  font-size: 14px;
  vertical-align: top;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.ok { background: #e4f8ea; color: #0d7a32; }
.badge.wait { background: #fff4d6; color: #946200; }
.badge.low { background: #eef0f3; color: #3a3a3c; }
.badge.medium { background: #fff4d6; color: #946200; }
.badge.high { background: #ffe8d6; color: #c93400; }
.badge.critical { background: #ffe3e1; color: #d70015; }

.form { display: grid; gap: 10px; }
.form .line {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
}

/* Executive */
.exec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.plant {
  background: var(--surface);
  border-radius: 18px;
  padding: 22px;
  min-height: 320px;
}
.plant .where { font-size: 13px; color: var(--secondary); margin: 0 0 4px; }
.plant h3 { margin: 0 0 18px; font-size: 24px; letter-spacing: -0.03em; }
.crit { padding: 12px 0; border-top: 1px solid var(--separator); }
.crit:first-of-type { border-top: 0; padding-top: 0; }
.crit .sev { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.crit h4 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.02em; }
.crit p { margin: 0; color: var(--secondary); font-size: 13px; line-height: 1.4; }

.privacy {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: #1c1c1e;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 40;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(242, 242, 247, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate[hidden] { display: none; }
.gate-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gate-mark {
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.gate-mark span { color: var(--blue); }
.gate-card h1 {
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}
.gate-card .lede { margin-bottom: 12px; }
.gate-card .label { font-size: 12px; color: var(--secondary); margin-top: 8px; }
.gate-card input {
  border: 0;
  background: var(--fill);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 17px;
}
.gate-err { color: var(--red); font-size: 13px; margin: 4px 0 0; }
.gate-card .btn { margin-top: 12px; width: 100%; }
.sign-out {
  font-size: 13px;
  font-weight: 590;
  color: var(--blue);
  padding: 7px 8px;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .layout, .exec-grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .stage { padding: 18px 14px 40px; }
  .demo-bar { padding: 8px 12px; }
  .segment button { padding: 7px 10px; font-size: 12px; }
}
@media (max-width: 430px) {
  .phone { width: 100%; min-height: calc(100svh - 70px); border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
  .phone-inner { border-radius: 0; min-height: calc(100svh - 70px); }
  .notch, .home-bar { display: none; }
  body { background: var(--bg); }
}
