:root {
  --bg: #0e131c; --panel: #151c28; --raised: #1c2532; --line: #263041;
  --text: #e8ecf3; --soft: #93a0b4; --red: #e03c4b; --amber: #e0a33c;
  --green: #3cb371; --blue: #4a90d9;
  --head: Georgia, "Times New Roman", serif;
  --ui: Montserrat, system-ui, sans-serif;
  --body: "Open Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.5; }
a { color: var(--amber); }
h1, h2, h3 { font-family: var(--head); font-weight: normal; line-height: 1.2; }
h1 { font-size: 2rem; margin: .2em 0 .4em; }
h2 { font-size: 1.4rem; margin: 1.6em 0 .6em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.num { color: var(--red); font-family: var(--ui); font-weight: 700; font-variant-numeric: tabular-nums; }
.soft { color: var(--soft); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85em; word-break: break-all; }

/* demo band */
.band { background: var(--amber); color: #1a1205; font-family: var(--ui); font-size: .85rem; font-weight: 600; text-align: center; padding: 6px 16px; }
.band a { color: #1a1205; }

/* header */
header.top { border-bottom: 1px solid var(--line); background: var(--panel); }
header.top .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
header.top .brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--ui); font-weight: 700; }
header.top .brand img { height: 30px; }
header.top .brand small { display: block; font-weight: 400; color: var(--soft); font-size: .75rem; }
header.top nav { display: flex; gap: 16px; flex-wrap: wrap; margin-left: auto; font-family: var(--ui); font-size: .9rem; }
header.top nav a { color: var(--soft); text-decoration: none; }
header.top nav a:hover, header.top nav a.on { color: var(--text); }
header.top nav a.cta { color: #1a1205; background: var(--amber); padding: 4px 12px; border-radius: 6px; font-weight: 600; }
main { padding: 24px 0 60px; }
footer { border-top: 1px solid var(--line); color: var(--soft); font-size: .8rem; padding: 20px 0 40px; }

/* panels, tables */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.k { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.kpi .label { font-family: var(--ui); font-size: .78rem; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
.kpi .num { font-size: 1.9rem; display: block; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--ui); font-size: .75rem; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
td.r, th.r { text-align: right; }
tr:hover td { background: var(--raised); }

/* forms and buttons */
.btn { display: inline-block; font-family: var(--ui); font-weight: 600; font-size: 1rem; border: 0; border-radius: 8px; padding: 12px 22px; cursor: pointer; text-decoration: none; background: var(--amber); color: #1a1205; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.red { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #06180c; }
.btn.big { font-size: 1.25rem; padding: 16px 30px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=search], select, textarea { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.error { color: #ff8a94; font-weight: 600; }
.ok { color: #7fe0a8; font-weight: 600; }
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; font-size: .92rem; }
.notes .info { background: #18263a; }
.notes .warn { background: #33280f; color: #ffd27a; }
.notes .bad { background: #3a161b; color: #ff9aa3; font-weight: 600; }

/* sign-in */
.signin { max-width: 620px; margin: 10px auto; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--amber); }
.steps + .stepname { font-family: var(--ui); color: var(--soft); font-size: .85rem; margin-bottom: 4px; }
.signin .panel { padding: 28px; }
.counties { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.counties button { font-family: var(--ui); font-size: 1.1rem; padding: 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); color: var(--text); cursor: pointer; }
.counties button:hover { border-color: var(--amber); }
.puzzle { display: flex; flex-wrap: wrap; gap: 3px; font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; margin: 18px 0; }
.puzzle span, .puzzle input { width: 1.25em; height: 1.7em; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.puzzle input { padding: 0; font: inherit; border: 2px solid var(--amber); background: var(--raised); color: var(--text); border-radius: 6px; text-transform: lowercase; }
.codebox { font-family: ui-monospace, Consolas, monospace; font-size: 2.2rem; letter-spacing: .4em; text-align: center; width: 100%; max-width: 320px; padding: 12px; }
.waiting { display: flex; align-items: center; gap: 14px; font-size: 1.1rem; }
.spinner { width: 28px; height: 28px; border: 4px solid var(--line); border-top-color: var(--amber); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.cal .dow { font-family: var(--ui); color: var(--soft); font-size: .75rem; text-transform: uppercase; text-align: center; }
.tile { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 12px; min-height: 108px; cursor: pointer; text-align: left; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 4px; }
.tile:hover { border-color: var(--amber); }
.tile .d { font-family: var(--ui); font-weight: 700; font-size: 1.05rem; }
.tile .s { font-family: var(--ui); font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; align-self: flex-start; }
.tile.none .s { background: var(--raised); color: var(--soft); }
.tile.parsed .s, .tile.returned .s { background: #33280f; color: #ffd27a; }
.tile.pending .s { background: #18263a; color: #9cc6ff; }
.tile.published { border-color: #23593a; }
.tile.published .s { background: #143524; color: #7fe0a8; }
.tile.future { opacity: .55; }
.tile.wide { grid-column: span 2; }
.empty { visibility: hidden; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(5, 8, 12, .75); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.open { display: flex; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: 100%; max-width: 620px; padding: 24px; }
.drop { border: 3px dashed var(--line); border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--amber); background: #221c10; }
.drop .big { font-family: var(--ui); font-size: 1.3rem; font-weight: 600; }
.bar { height: 10px; background: var(--raised); border-radius: 5px; overflow: hidden; margin-top: 14px; display: none; }
.bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s; }

/* certification */
.certify { border: 2px solid var(--amber); border-radius: 10px; padding: 16px; margin-top: 16px; background: #1d1910; }
.certify label { display: flex; gap: 10px; align-items: flex-start; font-size: 1.05rem; cursor: pointer; }
.certify input[type=checkbox] { width: 24px; height: 24px; margin-top: 2px; flex: none; }
.signedby { font-family: var(--ui); font-size: .85rem; }

/* demo devices */
#demo-toasts { position: fixed; top: 46px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.toast { background: #f4f6fa; color: #121821; border-radius: 12px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45); cursor: pointer; animation: slidein .3s ease-out; font-size: .9rem; border-left: 5px solid var(--amber); }
.toast b { display: block; font-family: var(--ui); }
@keyframes slidein { from { transform: translateX(120%); } to { transform: none; } }
#demo-tab { position: fixed; right: 0; top: 40%; z-index: 55; writing-mode: vertical-rl; background: var(--amber); color: #1a1205; font-family: var(--ui); font-weight: 700; padding: 14px 8px; border-radius: 8px 0 0 8px; cursor: pointer; border: 0; }
#demo-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 100%; background: #0a0e15; border-left: 2px solid var(--amber); z-index: 70; transform: translateX(100%); transition: transform .25s; overflow-y: auto; padding: 16px; }
#demo-drawer.open { transform: none; }
#demo-drawer .tag { font-family: var(--ui); font-weight: 700; color: var(--amber); letter-spacing: .1em; font-size: .75rem; }
.device { background: #f4f6fa; color: #121821; border-radius: 18px; padding: 14px; margin: 12px 0; }
.device h4 { margin: 0 0 8px; font-family: var(--ui); font-size: .85rem; display: flex; justify-content: space-between; }
.device .msg { background: #fff; border-radius: 10px; padding: 10px; margin-top: 8px; font-size: .88rem; border: 1px solid #dfe3ea; }
.device .msg.sms { background: #e2f0ff; border: 0; border-radius: 14px; }
.device .code { font-family: ui-monospace, Consolas, monospace; font-size: 1.9rem; font-weight: 700; letter-spacing: .25em; color: #0d1a2b; margin: 6px 0 2px; }
.device .totp-bar { height: 5px; background: #dfe3ea; border-radius: 3px; overflow: hidden; }
.device .totp-bar i { display: block; height: 100%; background: #2b7de9; }
.device .none { color: #7a8597; font-size: .85rem; }
.device button { margin-top: 8px; font-size: .9rem; padding: 8px 14px; }

/* chart */
.chartbox { position: relative; height: 300px; }

@media (max-width: 760px) {
  .cal { grid-template-columns: repeat(2, 1fr); }
  .cal .dow, .empty { display: none; }
  h1 { font-size: 1.6rem; }
}

/* Landing page: the three videos, then the way into the demo. */
.hero { max-width: 820px; }
.hero p { font-size: 1.05rem; }
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; }
.video h2 { margin-top: 0; font-size: 1.3rem; }
.video .frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.video .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .frame.soon { display: flex; align-items: center; justify-content: center; background: var(--raised); color: var(--soft); font-family: var(--ui); font-weight: 600; }
