:root {
  --bg: #f7faf9;
  --ink: #14213d;
  --muted: #536471;
  --line: #d9e2df;
  --accent: #0f766e;
  --accent-dark: #0b5c56;
  --warn: #b42318;
  --surface: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--accent-dark); }
.safety-banner {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.65rem 1rem;
  background: #fff1f0;
  color: var(--warn);
  font-weight: 800;
  text-align: center;
  border-bottom: 1px solid #ffd0cc;
}
.topbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; text-decoration: none; color: var(--ink); }
nav { display: flex; gap: 0.65rem; overflow-x: auto; }
nav a { white-space: nowrap; text-decoration: none; font-weight: 650; }
.shell { width: min(980px, 100%); margin: 0 auto; padding: 1rem; }
.page-head { margin: 0.4rem 0 1rem; }
h1 { margin: 0 0 0.35rem; font-size: clamp(1.55rem, 4vw, 2.25rem); }
h2 { margin: 0 0 0.75rem; font-size: 1.2rem; }
p { color: var(--muted); }
.panel, .auth-panel, .action-card, .metrics div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}
.auth-panel { max-width: 420px; margin: 8vh auto; }
.stack { display: grid; gap: 0.85rem; }
label { display: grid; gap: 0.3rem; font-weight: 650; }
input, textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #bcc9c6;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}
textarea { min-height: 5rem; resize: vertical; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 0.95rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.link-button { background: transparent; color: var(--accent-dark); padding: 0; min-height: auto; }
.alert, .result-box.stop { color: var(--warn); font-weight: 800; }
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}
.action-card { display: grid; gap: 0.35rem; text-decoration: none; }
.action-card span, .metrics span { color: var(--muted); }
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.metrics b { display: block; font-size: 1.8rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 0.65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.85rem; }
video, #qr-reader video {
  width: 100%;
  max-height: 420px;
  background: #0b1720;
  border-radius: 8px;
}
#qr-reader {
  min-height: 10rem;
  display: grid;
  place-items: center;
  border: 1px dashed #9fb0ac;
  border-radius: 8px;
  padding: 0.6rem;
  color: var(--muted);
}
.result-box {
  border-left: 4px solid var(--accent);
  padding: 0.75rem;
  background: #edf7f5;
}
.check { grid-template-columns: 1.2rem 1fr; align-items: center; }
.check input { min-height: auto; }
.status-list { display: grid; grid-template-columns: minmax(110px, 180px) 1fr; gap: 0.7rem; }
dt { font-weight: 800; }
dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  nav { width: 100%; }
  .shell { padding: 0.8rem; }
  .status-list { grid-template-columns: 1fr; }
}
