:root {
  --bg: #131211;
  --panel: #1A1917;
  --panel-sel: #221F1B;
  --line: #2A2824;
  --line-strong: #3A3732;
  --line-hover: #6B655C;
  --hover: #26231F;
  --text: #EDE9E3;
  --muted: #A8A29A;
  --faint: #6B655C;
  --accent: #E8A33D;
  --on-accent: #1A1206;
  --run: #8EC1FF;
  --copy: #7FD4E8;
  --ok: #74D3AE;
  --warn: #F2B544;
  --bv21: #C7A6FF;
  --error: #FF8A7A;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Schibsted Grotesk', 'Helvetica Neue', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent); }
a:hover { color: #F5C46E; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--run); outline-offset: 2px; }
button:disabled { cursor: default; opacity: .5; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }
@keyframes stripes { from { background-position: 0 0 } to { background-position: 28px 0 } }
@keyframes spin { to { transform: rotate(360deg) } }
.pulse { animation: pulse 1.1s ease-in-out infinite; }
.spin { animation: spin .9s linear infinite; flex: 0 0 auto; }
.bar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background-color: var(--run); border-radius: inherit; transition: width .4s ease; }
.bar-live { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.16) 0 7px, transparent 7px 14px); background-size: 28px 28px; animation: stripes .9s linear infinite; }
.bar.big { height: 8px; border-radius: 4px; }
.bar > .bar-copy { background-color: var(--copy); opacity: .55; }
@media (prefers-reduced-motion: reduce) {
  .pulse, .bar-live { animation: none; }
  .spin { animation-duration: 3s; }
}

.wrap { max-width: 1360px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px) 40px; }

/* Header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 22px 0; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { display: flex; align-items: baseline; gap: 10px; }
.brand-name b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.brand-name span { font-size: 13px; color: var(--muted); }
.top-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13px; color: var(--muted); max-width: 100%; }
.pill .mono { color: var(--text); word-break: break-all; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; cursor: pointer; font-weight: 500; text-decoration: none; }
.btn-sec { background: transparent; color: var(--text); border: 1px solid var(--line-strong); transition: background .15s, border-color .15s; }
.btn-sec:hover:not(:disabled) { background: var(--hover); border-color: var(--line-hover); color: var(--text); }
.btn-pri { padding: 0 20px; background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; }
.btn-pri:hover:not(:disabled) { filter: brightness(1.08); }
.btn-link { min-height: 40px; padding: 0 12px; font-size: 14px; }

main { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; }

/* Folder list */
.list { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 0 4px; }
.section-title { display: flex; align-items: baseline; gap: 12px; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort-by { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sort select { min-height: 40px; padding: 0 30px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; appearance: none; -webkit-appearance: none; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%23A8A29A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center; }
.sort select:hover { border-color: var(--line-hover); }
.sort select:focus-visible { outline: 2px solid var(--run); outline-offset: 2px; }
.btn-sort { min-height: 40px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row.selected { background: var(--panel-sel); border-color: var(--accent); }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: transparent; border: 0; color: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.row-main:hover { background: rgba(255,255,255,.035); }
.row-name { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--text); word-break: break-all; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.row-side { display: flex; align-items: center; padding: 0 14px 0 4px; }
.row-side .btn { min-width: 92px; padding: 0 14px; font-size: 14px; }
.copying { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 92px; min-height: 44px; color: var(--copy); font-size: 13px; white-space: nowrap; }
.row-status, .verif-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 5px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.flag.bv21 { color: var(--bv21); background: rgba(199, 166, 255, 0.13); }
.flag.warn { color: var(--warn); background: rgba(242, 181, 68, 0.13); }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.empty-list { padding: 28px 20px; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 14px; }
.empty-list b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* Detail */
.detail { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.card-pad { padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.sel-name { margin: 0; font-family: var(--mono); font-size: 18px; font-weight: 500; line-height: 1.45; word-break: break-all; }
.sel-title { font-size: 14px; color: var(--muted); }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: 14px 20px; }
.facts div { display: flex; flex-direction: column; gap: 3px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; font-weight: 500; }

.verif { overflow: hidden; }
.verif-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 26px; border-bottom: 1px solid var(--line); }
.verif-head h3 { margin: 0; font-size: 19px; font-weight: 600; }
.verif-head .status { font-size: 14px; gap: 8px; }
.verif-head .dot { width: 9px; height: 9px; }
.verif-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.running { padding: 22px 26px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.running-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.running-line .mono { color: var(--run); font-size: 15px; }
.running-stage { font-size: 15px; word-break: break-word; min-width: 0; }
.hint { font-size: 13px; color: var(--muted); }

.never { padding: 48px 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.never b { font-size: 17px; font-weight: 600; }
.never span { max-width: 440px; font-size: 14px; color: var(--muted); }

.result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 18px 26px 0; }
.result-head .when { font-size: 13px; color: var(--muted); }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(90px, 100%), 1fr)); gap: 12px; padding: 16px 26px 20px; }
.count { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.count b { font-size: 30px; font-weight: 700; line-height: 1.1; }
.count span { font-size: 13px; color: var(--muted); }

.banner { display: flex; align-items: center; gap: 14px; margin: 0 26px 20px; padding: 18px 20px; border-radius: 10px; }
.banner div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.banner b { font-size: 15px; font-weight: 600; }
.banner span { font-size: 14px; color: var(--muted); word-break: break-word; }
.banner svg { flex: 0 0 auto; }
.banner.ok { background: rgba(116, 211, 174, 0.08); border: 1px solid rgba(116, 211, 174, 0.3); }
.banner.bad { background: rgba(255, 138, 122, 0.08); border: 1px solid rgba(255, 138, 122, 0.3); }

.links { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 26px 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 26px 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--line-hover); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip small { font-family: var(--mono); font-size: 12px; opacity: 0.8; }

.notes { list-style: none; margin: 0; padding: 0; }
.notes li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; padding: 16px 26px; border-top: 1px solid var(--line); }
.sev { flex: 0 0 auto; min-width: 118px; display: inline-flex; justify-content: center; padding: 4px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.sev.error { color: var(--error); background: rgba(255, 138, 122, 0.13); }
.sev.bv21 { color: var(--bv21); background: rgba(199, 166, 255, 0.13); }
.sev.warn { color: var(--warn); background: rgba(242, 181, 68, 0.13); }
.note-body { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.note-msg { font-size: 15px; line-height: 1.5; word-break: break-word; }
.note-ref { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }
.more { padding: 14px 26px 20px; border-top: 1px solid var(--line); }

.c-ok { color: var(--ok); }
.c-warn { color: var(--warn); }
.c-bv21 { color: var(--bv21); }
.c-error, .c-failed { color: var(--error); }
.c-never { color: var(--muted); }
.c-running, .c-queued { color: var(--run); }
.c-copying { color: var(--copy); }

/* Credits */
.credits { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.credits p { margin: 0; max-width: 760px; }
