@font-face { font-family: 'Onest'; src: url('/assets/onest.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/assets/plex-mono.woff2') format('woff2'); font-weight: 400; font-display: swap; }
:root {
  color-scheme: dark;
  --surface: #0c0a09; --panel: #151210; --panel-raised: #1e1a17; --ink: #f4efe9; --muted: #aaa39b;
  --line: rgba(255, 238, 222, .11); --orange: #ff5a1f; --orange-soft: #ff9a6b;
  --red-text: #ffb3a4; --amber-text: #f2c98a; --green-text: #8fd6a4;
  --edge: inset 0 1px 0 rgba(255, 255, 255, .055);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: 'Plex Mono', ui-monospace, Consolas, monospace;
  font-family: 'Onest', Arial, Helvetica, sans-serif;
  background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: var(--surface); font-size: 15.5px; line-height: 1.55; }
::selection { background: var(--orange); color: #170a00; }
a { color: var(--orange-soft); text-decoration: none; transition: color 160ms var(--ease); }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--orange-soft); outline-offset: 3px; }
h1, h2, p, ul, ol, dl, dd { margin: 0; }
h1 { font-size: 30px; font-weight: 500; letter-spacing: -.025em; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13.5px; }
@keyframes settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-name { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.brand-tag { padding: 3px 10px; border-radius: 12px; background: rgba(255, 90, 31, .16); color: var(--orange-soft); font-size: 12.5px; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; font: inherit; font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: transform 160ms var(--ease), filter 160ms var(--ease), background-color 160ms var(--ease); }
.btn-primary { background: linear-gradient(180deg, #ff6b30 0%, #f24e12 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(0, 0, 0, .6); color: #170a00; }
.btn-quiet { background: var(--panel-raised); box-shadow: var(--edge), 0 0 0 1px var(--line); color: var(--ink); }
a.btn:hover { color: inherit; }
a.btn-primary, a.btn-primary:hover { color: #170a00; }
a.btn-quiet, a.btn-quiet:hover { color: var(--ink); }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); filter: brightness(1.08); } }
.btn:active { transform: scale(.975); transition-duration: 90ms; }

.card { background: var(--panel); border-radius: 14px; box-shadow: var(--edge), 0 0 0 1px var(--line); }
.pad { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; }
.pad > .form { width: min(100%, 440px); }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px; border-radius: 13px; background: rgba(242, 201, 138, .12); color: var(--amber-text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip[data-tone='good'] { background: rgba(143, 214, 164, .14); color: var(--green-text); }
.chip[data-tone='bad'] { background: rgba(255, 179, 164, .12); color: var(--red-text); }
.note { padding: 14px 16px; border-radius: 10px; background: rgba(242, 201, 138, .09); color: var(--amber-text); }
.note[data-tone='bad'] { background: rgba(255, 179, 164, .1); color: var(--red-text); }
.note[data-tone='good'] { background: rgba(143, 214, 164, .1); color: var(--green-text); }

.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 8px; font-size: 14px; font-weight: 500; }
.form small { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
.form input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-raised); color: var(--ink); font: inherit; font-size: 16px; transition: border-color 200ms var(--ease); }
.form input:focus-visible { border-color: var(--orange-soft); }
.form input[name='code'], .form input[name='setup'] { font-family: var(--mono); letter-spacing: .08em; }
.form .btn { justify-self: start; }
.reveal { position: relative; display: block; }
.reveal input { padding-right: 76px; }
.reveal-toggle { position: absolute; top: 6px; right: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: color 160ms var(--ease), background-color 160ms var(--ease); }
.reveal-toggle:hover { background: rgba(255, 238, 222, .06); color: var(--ink); }

/* Before sign-in */
.gate { display: grid; place-items: start center; padding: 56px 16px; }
.gate-card { display: flex; flex-direction: column; gap: 20px; width: min(100%, 460px); padding: 32px; border-radius: 16px; background: var(--panel); box-shadow: var(--edge), 0 0 0 1px var(--line); animation: settle 320ms var(--ease) both; }
.gate-card .brand { margin-bottom: 4px; }
.lead { color: var(--muted); font-size: 16px; }
.gate-foot { padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }
.gate-foot a { font-weight: 600; }
.steps { display: grid; gap: 22px; padding: 0; list-style: none; counter-reset: step; }
.steps > li { display: grid; gap: 12px; padding-left: 44px; position: relative; counter-increment: step; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 15px; background: rgba(255, 90, 31, .16); color: var(--orange-soft); font-size: 14px; font-weight: 600; }
.steps strong { font-weight: 600; }
.qr-box { justify-self: start; padding: 10px; border-radius: 12px; background: #fff; line-height: 0; }
.qr { display: block; width: 200px; height: 200px; }
details summary { color: var(--orange-soft); font-size: 14.5px; font-weight: 600; cursor: pointer; }
details p { margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.mono-block { padding: 12px 14px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--ink); font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
details .mono-block { color: var(--ink); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; list-style: none; }
.codes li { padding: 11px 12px; border-radius: 9px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-family: var(--mono); font-size: 14.5px; text-align: center; letter-spacing: .04em; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }

/* After sign-in */
.app { display: flex; }
.side { position: sticky; top: 0; align-self: flex-start; display: flex; flex: 0 0 256px; flex-direction: column; gap: 22px; height: 100svh; padding: 26px 14px 18px; background: #110e0c; border-right: 1px solid var(--line); overflow-y: auto; }
.side .brand { padding: 0 12px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 9px; color: var(--ink); font-size: 14.5px; font-weight: 500; transition: background-color 160ms var(--ease); }
.side nav a svg { flex-shrink: 0; color: var(--muted); transition: color 160ms var(--ease); }
.side nav a:hover { background: rgba(255, 238, 222, .045); }
.side nav a[aria-current='page'] { background: var(--panel-raised); box-shadow: var(--edge); }
.side nav a[aria-current='page'] svg { color: var(--orange); }
.side-foot { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding: 16px 4px 0; border-top: 1px solid var(--line); }
.side-who { padding: 0 8px; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.side-foot .btn { width: 100%; }
.main { flex: 1; min-width: 0; padding: 44px 40px 72px; }
.screen { display: flex; flex-direction: column; gap: 28px; max-width: 1000px; animation: settle 320ms var(--ease) both; }
.screen-head { display: flex; flex-direction: column; gap: 10px; }
.screen-head p { max-width: 64ch; color: var(--muted); font-size: 16.5px; }
.part { display: flex; flex-direction: column; gap: 14px; }
.part-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.facts { display: grid; gap: 0; width: 100%; }
.facts > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); }
.table-card { overflow-x: auto; }
.log { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.log th { padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; }
.log td { padding: 13px 18px; border-top: 1px solid var(--line); vertical-align: top; }
.log tbody tr:first-child td { border-top: 0; }
.log td:first-child { white-space: nowrap; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pager .muted { margin-right: auto; font-size: 14px; }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { position: static; flex: none; width: 100%; height: auto; gap: 14px; padding: 16px 12px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { flex-direction: row; align-items: center; justify-content: space-between; margin-top: 0; padding-top: 12px; }
  .side-foot .btn { width: auto; }
  .main { padding: 28px 16px 56px; }
  h1 { font-size: 26px; }
  .gate { padding: 24px 12px; }
  .gate-card { padding: 24px 20px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .log thead { display: none; }
  .log, .log tbody, .log tr, .log td { display: block; }
  .log tr { padding: 12px 16px; border-top: 1px solid var(--line); }
  .log tbody tr:first-child { border-top: 0; }
  .log td, .log tbody tr:first-child td { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 4px 0; border: 0; white-space: normal; }
  .log td::before { content: attr(data-label); color: var(--muted); font-family: 'Onest', Arial, sans-serif; font-size: 13px; }
  .log td .chip { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
