/* Punch Down tester portal. Same palette and type as novarafrontier.com. */
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("fonts/archivo-variable.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800; src: url("fonts/jetbrains-mono-variable.woff2") format("woff2"); }

:root {
  --graphite: #15171a;
  --panel: #1e2126;
  --panel2: #23272d;
  --line: #2a2e35;
  --line2: #363b44;
  --faint: #5e636b;
  --muted: #9a9ea5;
  --bone: #ece7dc;
  --gold: #c9a24a;
  --link: #57c26a;
  --act: #e7a33e;
  --orange: #e8792b;
  --green: #3e9b4f;
  --blue: #2f6fd6;
  --blue-text: #79a3f2;
  --brown: #8a5a36;
  --red: #d4503e;
  --red-text: #f08070;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--graphite); color: var(--bone); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--blue-text); }
button, input, textarea, select { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
[hidden] { display: none !important; }

/* The eight-conductor stripe from the site header. */
.conductors { display: flex; height: 4px; }
.conductors i { flex: 1; background: var(--c); }
.conductors i:nth-child(odd) { background: linear-gradient(90deg, var(--c) 0 50%, var(--bone) 50% 100%); background-size: 8px 4px; }
.conductors i:nth-child(1), .conductors i:nth-child(2) { --c: var(--orange); }
.conductors i:nth-child(3), .conductors i:nth-child(6) { --c: var(--green); }
.conductors i:nth-child(4), .conductors i:nth-child(5) { --c: var(--blue); }
.conductors i:nth-child(7), .conductors i:nth-child(8) { --c: var(--brown); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.02em; text-decoration: none; color: var(--bone); }
.brand__mark { width: 26px; height: 26px; border: 2px solid var(--bone); border-radius: 4px; display: grid; place-items: center; font: 700 11px var(--mono); }
.brand small { font-weight: 500; color: var(--muted); letter-spacing: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--gold);
  background: var(--gold); color: #17140c; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.btn--line { background: transparent; color: var(--bone); border-color: var(--line2); }
.btn--line:hover { border-color: var(--muted); }
.btn--danger { background: transparent; color: var(--red-text); border-color: #5a2a25; }
.btn--small { padding: 6px 12px; font-size: 13px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.input { width: 100%; padding: 11px 12px; background: #111316; border: 1px solid var(--line2); border-radius: 6px; outline: none; }
.input:focus { border-color: var(--gold); }
textarea.input { min-height: 70px; resize: vertical; }
.status { min-height: 1.5em; font-size: 14px; color: var(--muted); }
.status--bad { color: var(--red-text); }
.status--ok { color: var(--link); }

/* ------------------------------------------------------------ tester download page */
.dl { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.dl header, .dl footer { padding: 18px 24px; }
.dl footer { color: var(--faint); font-size: 13px; }
.dl main { display: grid; place-items: center; padding: 24px 16px 48px; }
.dl__card { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 32px; }
.dl__card h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.15; }
.dl__card p { color: var(--muted); margin: 0 0 18px; }
.dl__form { display: grid; gap: 14px; margin-top: 8px; }
.dl__row { display: flex; gap: 10px; }
.dl__row .input { font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.dl__ready { display: grid; gap: 14px; }
.dl__build { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #191c20; font-size: 14px; }
.dl__build b { font-family: var(--mono); font-weight: 600; }
.dl__platforms { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.steps code { font-family: var(--mono); font-size: 13px; color: var(--bone); background: #191c20; padding: 1px 5px; border-radius: 4px; }
.steps { margin: 4px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.steps b { color: var(--bone); font-weight: 600; }
.notice { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }
.notice b { color: var(--muted); }

@media (max-width: 520px) {
  .dl__card { padding: 22px 18px; }
  .dl__row { flex-direction: column; }
}

/* ------------------------------------------------------------ admin */
.adm { min-height: 100vh; display: grid; grid-template-rows: auto auto 1fr; }
.adm__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.adm__nav { display: flex; gap: 4px; flex-wrap: wrap; }
.adm__nav a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 6px; font-weight: 600; font-size: 14px; }
.adm__nav a.on, .adm__nav a:hover { color: var(--bone); background: var(--panel); }
.adm__main { padding: 22px 24px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }
.adm__login { display: grid; place-items: center; min-height: 70vh; }
.adm__login form { width: min(380px, 100%); display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.adm__login h1 { margin: 0; font-size: 22px; }

h2.h { font-size: 20px; margin: 0 0 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h2.h small { font-size: 13px; color: var(--muted); font-weight: 500; }
h3.h { font-size: 15px; margin: 26px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 10px; }
.back:hover { color: var(--bone); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stat b { display: block; font: 600 24px/1.2 var(--mono); }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bar .grow { flex: 1; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; background: #1b1e22; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel2); }
td.num, th.num { text-align: right; font-family: var(--mono); }
td.dim { color: var(--muted); }
.empty { padding: 24px; color: var(--muted); text-align: center; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.pill--ok { color: var(--link); border-color: #2c5a35; }
.pill--bad { color: var(--red-text); border-color: #5a2a25; }
.pill--act { color: var(--act); border-color: #5a4320; }
.pill--blue { color: var(--blue-text); border-color: #2a3f66; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; overflow-wrap: anywhere; }

/* event timeline */
.tl { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13.5px; }
.tl__row { display: grid; grid-template-columns: 78px 136px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.tl__row:last-child { border-bottom: 0; }
.tl__row:hover { background: var(--panel2); }
.tl__time { font-family: var(--mono); color: var(--faint); font-size: 12px; padding-top: 2px; }
.tl__type { font-family: var(--mono); font-size: 12px; padding-top: 2px; color: var(--muted); }
.tl__text { overflow-wrap: anywhere; }
.tl__text .mono { color: var(--bone); }
.tl__text .msg { color: var(--muted); display: block; font-size: 12.5px; white-space: pre-wrap; }
.tl__row--fail .tl__type, .tl__row--error .tl__type { color: var(--red-text); }
.tl__row--mark { background: #1d241d; }
.tl__row--mark .tl__type { color: var(--link); }
.tl__row--play .tl__type { color: var(--gold); }
.tl__save { opacity: 0; transition: opacity 0.1s; }
.tl__row:hover .tl__save { opacity: 1; }
@media (max-width: 720px) {
  .tl__row { grid-template-columns: 64px minmax(0, 1fr); }
  .tl__type { grid-column: 2; }
  .tl__text { grid-column: 1 / -1; }
  .tl__save { opacity: 1; grid-column: 1 / -1; }
}

/* dialog */
dialog { background: var(--panel); color: var(--bone); border: 1px solid var(--line2); border-radius: 10px; padding: 24px; width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 6, 8, 0.7); }
dialog form { display: grid; gap: 14px; }
dialog h2 { margin: 0; font-size: 19px; }
dialog .actions { display: flex; flex-direction: row-reverse; gap: 10px; margin-top: 4px; }
.code-box { font: 600 22px var(--mono); letter-spacing: 0.08em; padding: 14px; text-align: center; border: 1px dashed var(--gold); border-radius: 8px; color: var(--gold); user-select: all; }

.progress { height: 8px; background: #111316; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }

.toast { position: fixed; right: 18px; bottom: 18px; background: var(--panel2); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

@media (max-width: 640px) {
  .adm__top { padding: 10px 16px; flex-wrap: wrap; }
  .adm__main { padding: 16px 16px 48px; }
}

.dim { color: var(--muted); }
.m0 { margin: 0; }

/* ------------------------------------------------------------ site traffic */
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.seg a { padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; border-right: 1px solid var(--line2); }
.seg a:last-child { border-right: 0; }
.seg a:hover { color: var(--bone); }
.seg a.on { background: var(--panel2); color: var(--bone); }
.small { font-size: 13px; }

.chart { margin-bottom: 4px; }
.chart__legend { display: flex; gap: 16px; align-items: center; font-size: 13px; margin-bottom: 10px; flex-wrap: wrap; }
.chart__legend .dim { margin-left: auto; font-family: var(--mono); font-size: 12px; }
.chart__key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart__key--vis::before { background: var(--gold); }
.chart__key--views::before { background: var(--line2); }
.chart__plot { display: flex; align-items: stretch; gap: 2px; height: 180px; border-bottom: 1px solid var(--line2);
  background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 45px); }
.chart__col { flex: 1; position: relative; min-width: 0; border-radius: 2px 2px 0 0; }
.chart__col:hover { background: rgba(236, 231, 220, 0.05); }
.chart__col i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 2px 2px 0 0; }
.chart__views { background: var(--line2); }
.chart__vis { background: var(--gold); left: 18% !important; right: 18% !important; }
.chart__x { display: flex; gap: 2px; margin-top: 6px; }
.chart__x span { flex: 1; min-width: 0; font: 11px var(--mono); color: var(--faint); white-space: nowrap; overflow: visible; }

.toplist .h { margin-top: 22px; }
.toplist td.meter { position: relative; max-width: 0; width: 100%; }
.meter__fill { position: absolute; left: 0; top: 4px; bottom: 4px; background: rgba(201, 162, 74, 0.13); border-radius: 3px; }
.meter__name { position: relative; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pills { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* Applications (website form) */
.badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--gold); color: #15171a; font: 700 11px/18px var(--mono); text-align: center; vertical-align: 1px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #111316; border: 1px solid var(--line2); transition: background 0.15s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.switch input:checked + .switch__track { background: #2c5a35; border-color: var(--link); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: var(--bone); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--act); outline-offset: 2px; }
.switch__help { font-weight: 400; color: var(--muted); }
textarea.input.msg-box { width: 100%; min-height: 440px; font: 14px/1.55 var(--sans); resize: vertical; white-space: pre-wrap; }
.app-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .app-grid { grid-template-columns: 1fr; } }
.app-grid .card h3 { margin: 0 0 12px; font-size: 16px; }
