:root {
  color-scheme: dark;
  --black: #080b0c;
  --panel: #111718;
  --panel-raised: #172020;
  --line: #30403d;
  --text: #f1f5ef;
  --muted: #a8b8b1;
  --green: #76efad;
  --amber: #ffc45e;
  --red: #ff6767;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { background: var(--black); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 80% -10%, rgba(73, 158, 122, .12), transparent 42%),
    var(--black);
}
body.alerting { animation: alarm-flash .7s steps(2, end) infinite; }

.shell {
  width: min(100% - 48px, 1080px);
  margin: 0 auto;
  padding: 40px 0 64px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.eyebrow, .signal-label, .notes span {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1 {
  margin: 10px 0 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 720;
}
.connection {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--amber);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.connection::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
.checkline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 50px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid #294b3d;
  border-radius: 12px;
  background: #102219;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.checkline.warning { border-color: #87413d; background: #331516; color: var(--red); }
.checkline.stale { border-color: #77572c; background: #2a2013; color: var(--amber); }
.audio-warning { margin: 0 0 16px; padding: 12px 16px; border: 1px solid #77572c; border-radius: 12px; background: #2a2013; color: var(--amber); font-weight: 650; }
.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  animation: live-pulse 1.2s ease-out infinite;
}
.check-separator { color: var(--muted); }

.signal {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  min-height: 292px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid #385449;
  border-radius: var(--radius);
  background: linear-gradient(125deg, #182b20 0%, #101c1a 60%, #0e1617 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 22px 50px rgba(0,0,0,.16);
}
.signal-mark {
  align-self: stretch;
  width: 7px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 22px rgba(255,196,94,.25);
}
.signal.ready .signal-mark {
  background: var(--green);
  box-shadow: 0 0 22px rgba(118,239,173,.32);
}
.signal-label { color: var(--green); }
.signal-state {
  margin: 15px 0 12px;
  max-width: 800px;
  font-size: clamp(38px, 6vw, 74px);
  line-height: .98;
  letter-spacing: -.065em;
  font-weight: 760;
  text-wrap: balance;
}
.signal-detail {
  margin: 0;
  max-width: 680px;
  color: #c7d4cd;
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.5;
}
.signal.alert {
  border-color: #ff9a8f;
  background: linear-gradient(135deg, #a31921 0%, #721216 57%, #320c11 100%);
  color: #fff8f5;
  box-shadow: 0 0 0 5px rgba(255,103,103,.14), 0 24px 55px rgba(95,0,0,.28);
}
.signal.alert .signal-mark { background: #fff4ee; box-shadow: 0 0 28px rgba(255,255,255,.65); }
.signal.alert .signal-label, .signal.alert .signal-detail { color: #fff1ed; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 20px 0 24px; }
.conversation-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.conversation-links[hidden] { display: none; }
.conversation-links a { display: inline-flex; min-height: 44px; align-items: center; padding: 10px 14px; border: 1px solid var(--green); border-radius: 10px; color: var(--green); text-decoration: none; font-weight: 750; }
.conversation-links a:hover { background: #183629; }
.conversation-links a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 22px;
  border: 1px solid var(--green);
  border-radius: 10px;
  background: var(--green);
  color: #0a1a11;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}
button:hover { background: #b0ffd0; transform: translateY(-1px); }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
button[hidden] { display: none !important; }
button.secondary {
  border-color: #547a67;
  background: #16241d;
  color: var(--green);
}
button.secondary:hover { background: #213e2d; }
button.acknowledge {
  min-width: 220px;
  border-color: #ffd1c9;
  background: var(--red);
  color: #210a0c;
  box-shadow: 0 0 0 4px rgba(255,103,103,.15);
  font-size: 17px;
}
button.acknowledge:hover { background: #ffb4aa; }
body.alerting .controls { position: relative; z-index: 1; }

.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.notes div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 112px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.notes strong { overflow-wrap: anywhere; font-size: 20px; font-weight: 720; }
.working-hours { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.working-hours h2 { margin: 0 0 10px; font-size: 22px; }
.working-hours p, .working-hours small { color: var(--muted); line-height: 1.5; }
.working-hours form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.working-hours label { display: grid; gap: 8px; }
.working-hours input, .working-hours select { min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--text); background: var(--black); }
.working-hours input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.working-hours button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 640px) { .working-hours { padding: 18px; } .working-hours button { width: 100%; } .working-hours label { flex: 1; } .working-hours input { width: 100%; } }

@keyframes alarm-flash { 0%, 100% { background-color: var(--black); } 50% { background-color: #300e11; } }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; } 70% { box-shadow: 0 0 0 7px transparent; opacity: .7; } 100% { box-shadow: 0 0 0 0 transparent; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body.alerting { animation: none; background: #3a1015; }
  .live-dot { animation: none; }
  button { transition: none; }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 28px, 1080px); padding: 24px 0 38px; }
  .topbar { align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .topbar > div:first-child { min-width: 0; }
  h1 { font-size: clamp(30px, 8vw, 42px); }
  .connection { min-height: 32px; padding: 6px 10px; font-size: 10px; }
  .checkline { margin-bottom: 14px; padding: 12px; }
  .check-separator { display: none; }
  .signal { min-height: 260px; gap: 18px; padding: 24px 18px; }
  .signal-state { font-size: clamp(38px, 10vw, 54px); }
  .controls { padding: 16px 0 20px; }
  .controls button { width: 100%; }
  .notes { grid-template-columns: 1fr; gap: 8px; }
  .notes div { min-height: 68px; flex-direction: row; align-items: center; gap: 10px; padding: 15px; }
  .notes strong { text-align: right; font-size: 17px; }
}
