/* =========================================================
   EGO/ARCHIVE — pixel-minimal techno UI
   Fonts: Silkscreen (labels), Micro 5 (big numbers), IBM Plex Mono (text)
   ========================================================= */

:root {
  --bg: #0b0b0c;
  --bg-2: #101012;
  --panel: #141416;
  --panel-2: #1a1a1d;
  --line: #242427;
  --line-2: #34343a;
  --text: #ecebe6;
  --dim: #b5b3ab;
  --mute: #8a8882;
  --acc: #ff5a1f;          /* signal / REC */
  --acc-2: #ff7a47;
  --acc-ink: #0b0b0c;
  --ok: #b8f53c;
  --warn: #ffd23f;
  --err: #ff3b4f;

  --px: 2px;               /* one "pixel" of the UI grid */
  --side-w: 252px;
  --top-h: 56px;
  --card-min: 260px;

  --f-pixel: 'Silkscreen', 'IBM Plex Mono', monospace;
  --f-num: 'Micro 5', 'Silkscreen', monospace;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --notch: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px), 100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px)));
  --notch-4: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1.2px);
  background-size: 8px 8px;
  color: var(--text);
  font: 400 13px/1.55 var(--f-mono);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--acc); color: var(--acc-ink); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* pixel icons */
.ico { width: 16px; height: 16px; fill: currentColor; flex: none; display: inline-block; vertical-align: middle; }
.ico.lg { width: 24px; height: 24px; }
.ico.sm { width: 12px; height: 12px; }

.px-label, .lbl {
  font-family: var(--f-pixel);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border: 0; cursor: pointer;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--f-pixel); font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  clip-path: var(--notch);
  box-shadow: inset 0 0 0 var(--px) var(--line-2);
  white-space: nowrap;
  transition: background .12s, color .12s, box-shadow .12s;
}
.btn:hover { background: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 var(--px) var(--acc); }
.btn.acc { background: var(--acc); color: var(--acc-ink); box-shadow: none; }
.btn.acc:hover { background: var(--acc-2); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--dim); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.on { background: var(--text); color: var(--bg); box-shadow: none; }
.btn.danger:hover { background: var(--err); color: var(--bg); box-shadow: none; }
.btn.icon-only { padding: 0; width: 34px; justify-content: center; }
.btn.big { height: 52px; padding: 0 18px; font-size: 13px; width: 100%; justify-content: space-between; }
.btn.big small { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0; text-transform: none; opacity: .75; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.seg { display: inline-flex; }
.seg .btn { box-shadow: none; background: var(--panel); clip-path: none; height: 30px; padding: 0 10px; }
.seg .btn + .btn { margin-left: 2px; }
.seg .btn.on { background: var(--text); color: var(--bg); }
.seg { clip-path: var(--notch); }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.inp, select.inp, textarea.inp {
  width: 100%;
  background: var(--bg);
  border: 0;
  box-shadow: inset 0 0 0 var(--px) var(--line-2);
  padding: 9px 11px;
  outline: none;
  border-radius: 0;
}
textarea.inp { resize: vertical; min-height: 90px; line-height: 1.5; }
.inp:focus { box-shadow: inset 0 0 0 var(--px) var(--acc); }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.hint { color: var(--mute); font-size: 11px; }

/* =========================================================
   LOGIN
   ========================================================= */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}
.login::before {             /* slow scanning line */
  content: ''; position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 90, 31, .5), transparent);
  animation: scan 6s linear infinite; pointer-events: none;
}
@keyframes scan { from { top: -2px; } to { top: 100%; } }
.login-box { width: min(440px, 100%); position: relative; }
.login-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-mark .ico { width: 28px; height: 28px; color: var(--acc); animation: blink 1.6s steps(1) infinite; }
.login-mark span { font-family: var(--f-pixel); font-size: 22px; font-weight: 700; letter-spacing: .04em; }
@keyframes blink { 50% { opacity: .25; } }
.boot { font-size: 12px; color: var(--dim); min-height: 76px; margin-bottom: 22px; white-space: pre-line; }
.boot b { color: var(--text); font-weight: 500; }
.boot i { font-style: normal; color: var(--acc); }
.cursor { display: inline-block; width: 8px; height: 14px; background: var(--acc); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.code-in { display: flex; gap: 2px; margin-top: 8px; }
.code-in input {
  flex: 1; min-width: 0; height: 56px;
  background: var(--bg-2); border: 0; outline: 0;
  box-shadow: inset 0 0 0 var(--px) var(--line-2);
  font-family: var(--f-pixel); font-size: 22px; letter-spacing: .3em; padding: 0 16px;
  text-transform: uppercase;
}
.code-in input:focus { box-shadow: inset 0 0 0 var(--px) var(--acc); }
.code-in .btn { height: 56px; width: 56px; justify-content: center; padding: 0; }
.login .err { color: var(--err); font-family: var(--f-pixel); font-size: 10px; min-height: 18px; margin-top: 10px; letter-spacing: .05em; }
.shake { animation: shake .3s steps(4); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.teaser { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 34px; border-top: var(--px) solid var(--line); }
.teaser div { padding: 14px 0 0; }
.teaser b { display: block; font-family: var(--f-num); font-weight: 400; font-size: 34px; line-height: .9; }
.teaser span { font-family: var(--f-pixel); font-size: 9px; color: var(--mute); letter-spacing: .08em; }

/* =========================================================
   SHELL
   ========================================================= */
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: rgba(11, 11, 12, .92);
  backdrop-filter: blur(6px);
  border-bottom: var(--px) solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-pixel); font-weight: 700; font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.brand .ico { color: var(--acc); width: 18px; height: 18px; animation: blink 1.6s steps(1) infinite; }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; background: var(--bg-2); box-shadow: inset 0 0 0 var(--px) var(--line); }
.search:focus-within { box-shadow: inset 0 0 0 var(--px) var(--acc); }
.search .ico { color: var(--mute); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 12px; }
.search input::placeholder { color: var(--mute); font-family: var(--f-pixel); font-size: 10px; letter-spacing: .06em; }
.search kbd { font-family: var(--f-pixel); font-size: 9px; color: var(--mute); box-shadow: inset 0 0 0 1px var(--line-2); padding: 1px 5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.role { font-family: var(--f-pixel); font-size: 9px; color: var(--mute); letter-spacing: .08em; padding: 0 6px; }
.role.admin { color: var(--acc); }
.only-mobile { display: none; }

/* ---------- global counters ---------- */
.stats {
  display: grid; grid-template-columns: repeat(6, 1fr);
  border-bottom: var(--px) solid var(--line);
  background: var(--bg);
}
.stat { padding: 14px 16px 12px; border-right: var(--px) solid var(--line); min-width: 0; position: relative; }
.stat:last-child { border-right: 0; }
.stat .lbl { display: flex; align-items: center; gap: 6px; }
.stat .lbl::before { content: ''; width: 4px; height: 4px; background: var(--mute); }
.stat:first-child .lbl::before { background: var(--acc); }
.stat .v { font-family: var(--f-num); font-size: clamp(34px, 3.6vw, 52px); line-height: .85; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v small { font-size: .5em; color: var(--dim); margin-left: 4px; }
.stat .sub { font-size: 10px; color: var(--mute); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.body { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: var(--top-h);
  height: calc(100vh - var(--top-h)); overflow-y: auto;
  border-right: var(--px) solid var(--line);
  padding: 18px 0 40px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.side-sec { padding: 0 12px; }
.side-sec + .side-sec { margin-top: 26px; }
.side-sec h4 { margin: 0 0 8px; padding: 0 8px; display: flex; justify-content: space-between; align-items: center; }
.side-sec h4 .lbl { color: var(--mute); }
.side-sec h4 button { background: none; border: 0; color: var(--mute); cursor: pointer; padding: 2px; display: flex; }
.side-sec h4 button:hover { color: var(--acc); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree a, .catlist button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 6px 8px;
  border: 0; background: none; cursor: pointer; text-align: left;
  font-size: 12px; color: var(--dim);
}
.tree a:hover, .catlist button:hover { color: var(--text); background: var(--panel); }
.tree a.on, .catlist button.on { color: var(--text); background: var(--panel-2); box-shadow: inset var(--px) 0 0 var(--acc); }
.tree a .ico { color: var(--mute); width: 12px; height: 12px; }
.tree a.on .ico { color: var(--acc); }
.tree .nm, .catlist .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n { font-family: var(--f-pixel); font-size: 9px; color: var(--mute); }
.tagcloud { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; font-size: 11px; line-height: 1.3;
  background: var(--panel); color: var(--dim);
  border: 0; cursor: pointer;
  clip-path: var(--notch);
}
.tag::before { content: '#'; color: var(--mute); }
.tag:hover { color: var(--text); background: var(--panel-2); }
.tag.on { background: var(--acc); color: var(--acc-ink); }
.tag.on::before { color: var(--acc-ink); }
.tag .n { margin-left: 2px; }
.tag.on .n { color: var(--acc-ink); }

/* ---------- main ---------- */
.main { padding: 20px 24px 120px; min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--f-pixel); font-size: 10px; letter-spacing: .06em; color: var(--mute); margin-bottom: 14px; text-transform: uppercase; }
.crumbs a:hover { color: var(--acc); }
.crumbs .sep { color: var(--line-2); }
.crumbs .cur { color: var(--dim); }

.head { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { margin: 0; font-family: var(--f-pixel); font-weight: 700; font-size: clamp(24px, 3vw, 38px); line-height: 1.05; letter-spacing: .01em; text-transform: uppercase; }
.head p { margin: 8px 0 0; color: var(--dim); max-width: 62ch; }
.head-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.head-stats div { text-align: right; }
.head-stats b { display: block; font-family: var(--f-num); font-weight: 400; font-size: 30px; line-height: .9; }
.head-stats span { font-family: var(--f-pixel); font-size: 9px; color: var(--mute); letter-spacing: .06em; }
.head-actions { display: flex; gap: 6px; margin-top: 12px; }

/* sub-folder tiles */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 28px; }
.ftile { display: block; background: var(--panel); clip-path: var(--notch-4); transition: transform .15s; }
.ftile:hover { transform: translateY(-2px); }
.ftile:hover .fmos::after { opacity: 1; }
.fmos { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 16/8; background: var(--bg); position: relative; }
.fmos::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 var(--px) var(--acc); opacity: 0; transition: opacity .15s; }
.fmos > * { background: var(--panel-2) center/cover no-repeat; min-height: 0; }
.fmos > :first-child { grid-row: span 2; }
.fmos.n1 > :first-child { grid-column: span 2; }
.fmos .ph { display: grid; place-items: center; color: var(--line-2); }
.fmeta { padding: 10px 12px 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fmeta .nm { font-family: var(--f-pixel); font-size: 12px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.fmeta .nm .ico { color: var(--acc); width: 12px; height: 12px; }
.fmeta .n { white-space: nowrap; }

/* toolbar */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; margin-bottom: 16px;
  border-top: var(--px) solid var(--line); border-bottom: var(--px) solid var(--line);
  position: sticky; top: var(--top-h); z-index: 10; background: var(--bg);
}
.toolbar .count { font-family: var(--f-pixel); font-size: 10px; color: var(--dim); letter-spacing: .05em; }
.toolbar .count b { color: var(--text); font-weight: 400; }
.toolbar .spacer { flex: 1; }
.toolbar select.inp { width: auto; height: 30px; padding: 0 30px 0 10px; font-family: var(--f-pixel); font-size: 10px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip-x { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 8px; background: var(--panel-2); font-size: 11px; border: 0; cursor: pointer; clip-path: var(--notch); }
.chip-x .ico { width: 10px; height: 10px; color: var(--mute); }
.chip-x:hover .ico { color: var(--acc); }

/* ---------- clip cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr)); gap: 16px 14px; }
.grid.d-s { --card-min: 180px; gap: 10px; }
.grid.d-l { --card-min: 380px; gap: 22px 18px; }
.grid.d-s .desc, .grid.d-s .tags { display: none; }
.grid.d-s .card h3 { font-size: 12px; }

.card { position: relative; min-width: 0; animation: rise .4s both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.media {
  display: block; position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: var(--panel);
  clip-path: var(--notch-4);
}
.media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.media .sprite { position: absolute; inset: 0; background-repeat: no-repeat; background-color: var(--bg); opacity: 0; }
.media.scrub .sprite { opacity: 1; }
.media::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 var(--px) transparent; transition: box-shadow .12s; pointer-events: none; clip-path: var(--notch-4); }
.card:hover .media::after { box-shadow: inset 0 0 0 var(--px) var(--acc); }
.scrub-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .5); opacity: 0; display: grid; grid-auto-flow: column; gap: 1px; }
.media.scrub .scrub-bar { opacity: 1; }
.scrub-bar i { background: rgba(255, 255, 255, .25); }
.scrub-bar i.on { background: var(--acc); }
.pchip {
  position: absolute; padding: 3px 6px 2px;
  background: rgba(11, 11, 12, .82); color: var(--text);
  font-family: var(--f-pixel); font-size: 9px; letter-spacing: .06em; line-height: 1.2;
}
.pchip.tl { top: 6px; left: 6px; }
.pchip.tr { top: 6px; right: 6px; }
.pchip.br { bottom: 8px; right: 6px; }
.pchip.acc { background: var(--acc); color: var(--acc-ink); }
.processing { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; background: var(--panel); font-family: var(--f-pixel); font-size: 9px; color: var(--dim); letter-spacing: .08em; }
.pbar { width: 60%; height: 6px; background: var(--bg); position: relative; overflow: hidden; }
.pbar::after { content: ''; position: absolute; top: 0; bottom: 0; width: 30%; background: repeating-linear-gradient(90deg, var(--acc) 0 4px, transparent 4px 6px); animation: load 1.2s steps(12) infinite; }
@keyframes load { from { left: -30%; } to { left: 100%; } }
.processing.err { color: var(--err); }

.card-body { padding: 10px 2px 0; }
.card-meta { display: flex; gap: 8px; align-items: center; font-family: var(--f-pixel); font-size: 9px; letter-spacing: .06em; color: var(--mute); text-transform: uppercase; }
.card-meta .cat { color: var(--acc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta .fr { margin-left: auto; white-space: nowrap; }
.card h3 { margin: 4px 0 0; font-size: 13px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card h3 a:hover { color: var(--acc); }
.card .desc { margin: 4px 0 0; color: var(--dim); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card .tags { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; margin-top: 8px; }
.card .tags .tag { font-size: 10px; padding: 2px 6px; flex: none; }

.selbox { position: absolute; top: 8px; left: 8px; z-index: 3; width: 22px; height: 22px; display: grid; place-items: center; background: rgba(11, 11, 12, .85); box-shadow: inset 0 0 0 var(--px) var(--line-2); cursor: pointer; border: 0; padding: 0; color: var(--acc-ink); }
.card.sel .selbox { background: var(--acc); box-shadow: none; }
.card.sel .media::after { box-shadow: inset 0 0 0 3px var(--acc); }
.card .selbox .ico { width: 12px; height: 12px; visibility: hidden; }
.card.sel .selbox .ico { visibility: visible; }

/* ---------- table view ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 900px; }
.tbl th { text-align: left; font-family: var(--f-pixel); font-weight: 400; font-size: 9px; color: var(--mute); letter-spacing: .06em; padding: 8px 10px; border-bottom: var(--px) solid var(--line); white-space: nowrap; }
.tbl td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--dim); }
.tbl tr:hover td { background: var(--panel); color: var(--text); }
.tbl td.t { color: var(--text); max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.tbl td.code { font-family: var(--f-pixel); font-size: 10px; color: var(--acc); }
.tbl .th { width: 72px; aspect-ratio: 16/9; background: var(--panel) center/cover; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr { cursor: pointer; }
.tbl tr.sel td { background: rgba(255, 90, 31, .1); }

.empty { padding: 80px 20px; text-align: center; color: var(--mute); }
.empty .ico { width: 48px; height: 48px; color: var(--line-2); margin-bottom: 16px; }
.empty b { display: block; font-family: var(--f-pixel); font-size: 14px; color: var(--dim); font-weight: 400; margin-bottom: 8px; }

/* =========================================================
   CLIP VIEW
   ========================================================= */
.clip { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.player { background: #000; aspect-ratio: 16/9; position: relative; clip-path: var(--notch-4); }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.story { display: grid; gap: 2px; margin-top: 8px; }
.story button { aspect-ratio: 16/9; border: 0; padding: 0; cursor: pointer; background-repeat: no-repeat; background-color: var(--panel); opacity: .55; transition: opacity .12s; position: relative; }
.story button:hover, .story button.on { opacity: 1; }
.story button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--acc); }
.story-lbl { display: flex; justify-content: space-between; margin-top: 18px; }
.clip-side { position: sticky; top: calc(var(--top-h) + 20px); }
.clip-side .code { font-family: var(--f-pixel); font-size: 10px; color: var(--acc); letter-spacing: .06em; display: flex; gap: 10px; text-transform: uppercase; }
.clip-side .code span { color: var(--mute); }
.clip-side h1 { margin: 8px 0 12px; font-size: 20px; line-height: 1.25; font-weight: 600; }
.clip-side .full-desc { color: var(--dim); white-space: pre-line; margin: 0 0 18px; }
.specs { display: grid; grid-template-columns: auto 1fr; margin: 18px 0; border-top: var(--px) solid var(--line); }
.specs dt, .specs dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.specs dt { font-family: var(--f-pixel); font-size: 9px; color: var(--mute); letter-spacing: .06em; padding-right: 16px; text-transform: uppercase; display: flex; align-items: center; }
.specs dd { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.specs .custom { color: var(--text); }
.clip-side .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.clip-nav { display: flex; gap: 6px; margin-top: 18px; }
.clip-nav .btn { flex: 1; justify-content: center; }
.admin-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; margin: 44px 0 14px; padding-top: 14px; border-top: var(--px) solid var(--line); }
.section-h h2 { margin: 0; font-family: var(--f-pixel); font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; }
.note { font-size: 11px; color: var(--mute); margin-top: 8px; }

/* =========================================================
   ACCESS & VIEWS (admin analytics)
   ========================================================= */
.views-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; padding: 10px 12px; background: var(--panel); font-size: 11px; color: var(--dim); clip-path: var(--notch); }
.views-line:empty { display: none; }
.views-line b { color: var(--text); font-weight: 500; }
.views-line .ico { color: var(--acc); }
.views-line:hover { background: var(--panel-2); }
.newcode { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 16px; background: var(--panel); clip-path: var(--notch-4); }
.newcode .field { margin: 0; min-width: 140px; }
.newcode .field.grow { flex: 1; min-width: 200px; }
.newcode .field + .field { margin-top: 0; }
.newcode .btn { height: 38px; }
.atbl { min-width: 760px; }
.atbl td.t a:hover, .atbl a:hover { color: var(--acc); }
.atbl .sub { font-size: 10px; color: var(--mute); margin-top: 2px; }
.atbl tr { cursor: default; }
.atbl td.acts { text-align: right; }
.atbl td.acts .btn { height: 26px; font-size: 9px; }
.codebtn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--acc); font-family: var(--f-pixel); font-size: 11px; letter-spacing: .08em; }
.codebtn .ico { color: var(--mute); }
.codebtn:hover .ico { color: var(--acc); }
.st-ok, .st-off { font-family: var(--f-pixel); font-size: 9px; letter-spacing: .06em; }
.st-ok { color: var(--ok); }
.st-off { color: var(--mute); }
.head p .st-ok, .head p .st-off { font-size: 10px; }
.code-card { padding: 16px; background: var(--panel); clip-path: var(--notch-4); display: grid; gap: 12px; }
.code-card b { display: block; font-family: var(--f-pixel); font-size: clamp(22px, 3vw, 32px); letter-spacing: .12em; color: var(--acc); margin-top: 4px; font-weight: 700; }
.code-card .admin-row { margin: 0; }
.code-card .hint { margin: 0; }
.meter { display: inline-flex; align-items: center; gap: 1px; }
.meter i { width: 5px; height: 10px; background: var(--line-2); }
.meter i.on { background: var(--acc); }
.meter em { font-style: normal; margin-left: 8px; font-size: 11px; color: var(--text); min-width: 32px; }
.evt-tag { font-family: var(--f-pixel); font-size: 9px; letter-spacing: .06em; padding: 2px 6px; background: var(--panel-2); color: var(--dim); }
.ev-download .evt-tag { background: var(--acc); color: var(--acc-ink); }
.ev-play .evt-tag { color: var(--ok); }
.ev-login .evt-tag { color: var(--text); }
.ev-fail .evt-tag { color: var(--err); }
.acc-page .section-h:first-of-type { margin-top: 32px; }
.head p a { color: var(--acc); }
.head p b { color: var(--text); font-weight: 500; }
.code-card b.url { font-size: clamp(16px, 2.2vw, 24px); letter-spacing: .04em; overflow-wrap: anywhere; text-transform: none; }
.code-card.match { box-shadow: inset 0 0 0 var(--px) var(--warn); margin-bottom: 18px; }
.code-card.match .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.flag { font-family: var(--f-pixel); font-size: 8px; letter-spacing: .05em; color: var(--warn); margin-left: 8px; white-space: nowrap; }
.ident { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.mini td:first-child { color: var(--text); }
.mini a:hover { color: var(--acc); }
.specs.dev { margin: 6px 0 0; }
.specs.dev + .specs.dev { margin-top: 14px; }
.ua { font-size: 10px; color: var(--mute); overflow-wrap: anywhere; text-align: left; }
.specs dd.ua { text-align: right; }
.ev-link .evt-tag { color: var(--acc); }
.ev-preview .evt-tag { color: var(--mute); }
.ev-visit .evt-tag { color: var(--text); }

/* =========================================================
   MODALS / DRAWERS / BULK / TOASTS
   ========================================================= */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 5, 6, .72); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; overflow-y: auto; animation: fade .15s; }
.overlay.drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); background: var(--panel); clip-path: var(--notch-4); box-shadow: inset 0 0 0 var(--px) var(--line-2); animation: pop .18s steps(4); }
.drawer .modal { width: min(520px, 100%); clip-path: none; min-height: 100%; display: flex; flex-direction: column; animation: slide .2s steps(5); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: var(--px) solid var(--line); }
.modal-h h3 { margin: 0; font-family: var(--f-pixel); font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .05em; display: flex; gap: 10px; align-items: center; }
.modal-h h3 .ico { color: var(--acc); }
.modal-b { padding: 18px 16px; }
.drawer .modal-b { flex: 1; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: var(--px) solid var(--line); flex-wrap: wrap; }
.modal-f .left { margin-right: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .field + .field { margin-top: 0; }
.row2 + .field, .field + .row2 { margin-top: 14px; }

.drop {
  display: grid; place-items: center; text-align: center; gap: 8px;
  padding: 34px 16px; cursor: pointer;
  background: var(--bg) repeating-linear-gradient(45deg, transparent 0 6px, rgba(255, 255, 255, .02) 6px 8px);
  box-shadow: inset 0 0 0 var(--px) var(--line-2);
  color: var(--dim);
}
.drop .ico { width: 32px; height: 32px; color: var(--acc); }
.drop b { font-family: var(--f-pixel); font-weight: 400; font-size: 12px; color: var(--text); letter-spacing: .05em; }
.drop.over { box-shadow: inset 0 0 0 var(--px) var(--acc); background-color: rgba(255, 90, 31, .06); }
.uq { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.uq li { background: var(--bg); padding: 10px 12px; display: grid; gap: 6px; }
.uq .top-row { display: flex; gap: 10px; justify-content: space-between; font-size: 12px; }
.uq .top-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq .st { font-family: var(--f-pixel); font-size: 9px; color: var(--mute); white-space: nowrap; letter-spacing: .05em; }
.uq .st.ok { color: var(--ok); }
.uq .st.err { color: var(--err); }
.ubar { height: 4px; background: var(--panel-2); }
.ubar i { display: block; height: 100%; background: var(--acc); width: 0; transition: width .2s; }
.ubar.ok i { background: var(--ok); }

.cover-row { display: flex; gap: 12px; align-items: center; }
.cover-row .th { width: 140px; aspect-ratio: 16/9; background: var(--bg) center/cover; flex: none; }
.cover-row .btns { display: grid; gap: 6px; }

.bulk {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px;
  background: var(--text); color: var(--bg);
  clip-path: var(--notch-4);
  max-width: calc(100vw - 32px); flex-wrap: wrap;
  animation: pop .15s steps(3);
}
.bulk .lbl { color: var(--bg); font-size: 11px; margin-right: 8px; }
.bulk .btn { background: var(--bg); color: var(--text); box-shadow: none; height: 30px; }
.bulk .btn:hover { background: var(--acc); color: var(--acc-ink); }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 6px; justify-items: end; pointer-events: none; }
.toast { background: var(--panel-2); box-shadow: inset 0 0 0 var(--px) var(--line-2); padding: 10px 14px; font-family: var(--f-pixel); font-size: 10px; letter-spacing: .05em; clip-path: var(--notch); animation: pop .15s steps(3); max-width: 360px; }
.toast.err { box-shadow: inset 0 0 0 var(--px) var(--err); color: var(--err); }
.toast.ok::before { content: '■ '; color: var(--ok); }

/* heat badges, request button, greeting */
.lvl { display: inline-block; font: 600 11px/1 var(--f-mono); letter-spacing: .06em; padding: 4px 7px; white-space: nowrap; clip-path: var(--notch); background: var(--panel-2); color: var(--dim); }
.lvl.hot { background: var(--acc); color: var(--acc-ink); }
.lvl.warm { background: var(--warn); color: var(--acc-ink); }
.lvl.scan { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--mute); }
.code-card.heat { margin-bottom: 18px; max-width: 560px; }
.code-card.heat.hot { box-shadow: inset 0 0 0 var(--px) var(--acc); }
.heat-top { display: flex; align-items: center; gap: 12px; }
.heat .mini td:first-child { color: var(--acc); width: 44px; font-weight: 600; }
.heat .mini td { white-space: normal; }
.for { font-size: 12px; color: var(--dim); white-space: nowrap; }
.for b { color: var(--text); font-weight: 600; }
.btn.cta-2 { width: 100%; justify-content: center; height: 42px; margin-top: 8px; }
.hint.setup { padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line-2); margin: 0 0 14px; }
.scanners { margin-top: 14px; }
.scanners summary { cursor: pointer; padding: 8px 0; }
.scanners summary:hover { color: var(--text); }

/* =========================================================
   READABILITY
   Silkscreen is only crisp at 8/16/24px. Small UI text uses the mono face;
   the pixel face stays for the brand, page/section titles and big numbers.
   ========================================================= */
.lbl, .px-label,
.btn, .seg .btn,
.login .err, .teaser span,
.search input::placeholder, .search kbd, .role, .n,
.crumbs, .head-stats span, .toolbar .count, .toolbar select.inp,
.pchip, .processing, .card-meta,
.tbl th, .tbl td.code, .clip-side .code, .specs dt,
.codebtn, .st-ok, .st-off, .evt-tag, .flag, .uq .st, .toast, .fmeta .nm {
  font-family: var(--f-mono);
  font-weight: 600;
  letter-spacing: .06em;
}
.lbl, .px-label { font-size: 11px; color: var(--dim); }
.btn { font-size: 12px; letter-spacing: .04em; }
.btn.big { font-size: 13px; }
.seg .btn { font-size: 12px; }
.search input::placeholder { font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.search kbd { font-size: 11px; }
.role { font-size: 11px; }
.n { font-size: 11px; font-weight: 500; color: var(--mute); }
.crumbs { font-size: 12px; color: var(--dim); }
.crumbs .cur { color: var(--text); }
.head-stats span { font-size: 11px; color: var(--dim); }
.head p { color: var(--dim); font-size: 14px; }
.toolbar .count { font-size: 12px; }
.toolbar select.inp { font-size: 12px; }
.pchip { font-size: 11px; padding: 3px 6px; letter-spacing: .03em; background: rgba(8, 8, 9, .88); }
.processing { font-size: 11px; }
.card-meta { font-size: 11px; color: var(--mute); letter-spacing: .04em; }
.card h3 { font-size: 14px; }
.card .desc { font-size: 13px; color: var(--dim); }
.card .tags .tag { font-size: 11px; }
.tag { font-size: 12px; }
.fmeta .nm { font-size: 13px; letter-spacing: .03em; }
.stat .lbl { font-size: 11px; }
.stat .sub { font-size: 11px; color: var(--mute); }
.tree a, .catlist button { font-size: 13px; }
.tbl { font-size: 13px; }
.tbl th { font-size: 11px; color: var(--dim); }
.tbl td.code { font-size: 12px; }
.clip-side .code { font-size: 12px; }
.specs dt { font-size: 11px; color: var(--dim); }
.specs dd, .specs dt { padding: 8px 0; }
.specs dd { font-size: 13px; }
.codebtn { font-size: 13px; }
.st-ok, .st-off, .evt-tag, .uq .st { font-size: 11px; }
.flag { font-size: 10px; }
.toast { font-size: 12px; }
.login .err { font-size: 12px; }
.teaser span { font-size: 11px; }
.atbl .sub, .hint { font-size: 12px; }
/* pixel titles at their crisp size */
.section-h h2, .modal-h h3 { font-size: 16px; }
.empty b { font-size: 16px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(3) { border-right: 0; }
  .stat:nth-child(-n+3) { border-bottom: var(--px) solid var(--line); }
  .clip { grid-template-columns: 1fr; }
  .clip-side { position: static; }
}
@media (max-width: 860px) {
  .body { grid-template-columns: 1fr; }
  .side { position: fixed; top: var(--top-h); left: 0; bottom: 0; width: min(300px, 86vw); height: auto; z-index: 35; background: var(--bg); transform: translateX(-100%); transition: transform .2s steps(5); }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .6); }
  .only-mobile { display: inline-flex; }
  .main { padding: 16px 16px 120px; }
  .brand span { display: none; }
  .role { display: none; }
  .top { gap: 8px; }
  .top .btn.acc span { display: none; }
  .top .btn.acc { width: 34px; padding: 0; justify-content: center; }
  .search kbd { display: none; }
  .head-stats div { text-align: left; }
  .stat { padding: 10px 12px; }
  .grid { --card-min: 160px; gap: 14px 10px; }
  .grid.d-l { --card-min: 260px; }
  .grid.d-s { --card-min: 120px; }
  .row2 { grid-template-columns: 1fr; }
  .row2 .field + .field { margin-top: 14px; }
  .toolbar { top: var(--top-h); }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* long clip titles: two lines instead of a cut-off single line */
.card h3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
