@font-face { font-family: "Schola"; src: url("/assets/fonts/schola-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schola"; src: url("/assets/fonts/schola-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-bold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/plex-mono-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/plex-mono-bold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }

:root {
  --bg: #0b0b0c; --bg2: #111113; --card: #151517; --card2: #1b1b1e; --line: #26262a; --line2: #33333a;
  --ink: #ebe6da; --ink2: #c9c4b8; --muted: #8a867d; --faint: #5f5c56;
  --red: #c4473a; --red-wash: rgba(196, 71, 58, .12); --ok: #7fa36b; --warn: #d4a24c; --warn-wash: rgba(212, 162, 76, .12);
  --serif: "Schola", Georgia, serif; --sans: "Instrument Sans", system-ui, sans-serif; --mono: "Plex Mono", ui-monospace, monospace;
  --r: 10px; --dc: #9a9a9a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(235, 230, 218, .2); }
:focus-visible { outline: 2px solid var(--ink2); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hide { display: none !important; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 0 28px; height: 58px;
  background: rgba(11, 11, 12, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap; }
.brand b { font: 700 1.05rem/1 var(--serif); letter-spacing: .01em; }
.stamp { font: 600 .62rem/1 var(--mono); letter-spacing: .2em; color: var(--red); border: 1px solid currentColor; padding: 4px 6px 3px; border-radius: 3px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 7px; font-weight: 600; font-size: .9rem; }
.nav a:hover { color: var(--ink); background: var(--bg2); }
.nav a.on { color: var(--ink); background: var(--card2); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.who button { background: none; border: 1px solid var(--line2); border-radius: 7px; padding: 5px 10px; cursor: pointer; color: var(--ink2); }
.who button:hover { border-color: var(--muted); color: var(--ink); }

main { max-width: 1180px; margin: 0 auto; padding: 36px 28px 90px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: -.005em; }
h1 { font-size: 1.9rem; line-height: 1.15; }
h2 { font-size: 1.2rem; }
.eyebrow { font: 600 .68rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-h .eyebrow { margin-bottom: 10px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: var(--card2); color: var(--ink);
  padding: 9px 15px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); color: #121212; border-color: var(--ink); }
.btn.primary:hover { background: #fff; }
.btn.danger { color: #f0a59b; border-color: rgba(196, 71, 58, .5); background: var(--red-wash); }
.btn.ghost { background: none; }
.btn.small { padding: 5px 10px; font-size: .8rem; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: default; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .78rem; font-weight: 600; color: var(--ink2); letter-spacing: .01em; }
.input, select.input, textarea.input { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; outline: none; }
.input:focus { border-color: var(--ink2); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.err-line { color: #f0a59b; font-size: .85rem; min-height: 1.3em; margin: 4px 0 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; }
.check input { accent-color: var(--ink); width: 16px; height: 16px; }

/* ---------- sign-in ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 50% -10%, #17171a 0%, var(--bg) 60%); }
.gate-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 34px 32px 28px; position: relative; }
.gate-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 14px 14px 0 0;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, transparent 14px 22px); opacity: .8; }
.gate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.gate h1 { font-size: 1.5rem; margin-bottom: 6px; }
.gate p.lead { color: var(--muted); margin: 0 0 22px; font-size: .92rem; }
.gate .btn.primary { width: 100%; padding: 11px; margin-top: 4px; }
.gate-foot { margin-top: 18px; font: .7rem/1.5 var(--mono); color: var(--faint); letter-spacing: .04em; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 12px; width: 200px; margin: 4px auto 14px; }
.secret { font: 600 .82rem/1.6 var(--mono); letter-spacing: .08em; text-align: center; color: var(--ink2); word-break: break-all; margin-bottom: 16px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; background: var(--bg2); border: 1px dashed var(--line2); border-radius: 10px; padding: 16px; margin: 6px 0 18px;
  font: 600 .95rem/1 var(--mono); letter-spacing: .06em; }
.code-in { font: 600 1.4rem/1 var(--mono); letter-spacing: .35em; text-align: center; padding: 14px; }

/* ---------- search ---------- */
.find { max-width: 760px; margin: 6vh auto 0; }
.find h1 { font-size: 2.3rem; margin-bottom: 8px; }
.find .sub { color: var(--muted); margin-bottom: 26px; }
.sbox { position: relative; }
.sbox input { width: 100%; font-size: 1.15rem; padding: 18px 20px 18px 52px; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; outline: none; }
.sbox input:focus { border-color: var(--ink2); background: var(--card2); }
.sbox svg { position: absolute; left: 19px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.sbox kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: .7rem var(--mono); color: var(--faint); border: 1px solid var(--line2); border-radius: 5px; padding: 3px 6px; }
.results { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.results:empty { display: none; }
.res { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; text-decoration: none; border-top: 1px solid var(--line); }
.res:first-child { border-top: 0; }
.res:hover, .res.sel { background: var(--card2); }
.res-name b { font-weight: 600; }
.res-name .mono { font-size: .8rem; color: var(--muted); margin-left: 8px; }
.res-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.res-note { font-size: .78rem; color: var(--warn); margin-top: 2px; }
.empty { padding: 22px; text-align: center; color: var(--muted); }
.ava { width: 44px; height: 44px; border-radius: 50%; background: var(--card2) center/cover no-repeat; border: 1px solid var(--line2);
  display: grid; place-items: center; font: 700 1rem var(--serif); color: var(--muted); overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.big { width: 92px; height: 92px; font-size: 2rem; }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 34px; justify-content: center; font-size: .78rem; color: var(--faint); }
.status-strip span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; padding: 3px 9px 3px 8px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--dc) 45%, transparent); background: color-mix(in srgb, var(--dc) 12%, transparent); color: var(--ink); white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--dc); flex: none; }
.chip.off { opacity: .55; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); display: inline-block; flex: none; }
.dot.bad { background: var(--red); } .dot.ok { background: var(--ok); }
.flag { font: 600 .68rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 4px 7px; border-radius: 4px; border: 1px solid; white-space: nowrap; }
.flag.red { color: #f0a59b; border-color: rgba(196, 71, 58, .55); background: var(--red-wash); }
.flag.warn { color: #e9c584; border-color: rgba(212, 162, 76, .5); background: var(--warn-wash); }
.flag.plain { color: var(--muted); border-color: var(--line2); }

/* ---------- person file ---------- */
.file-h { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: 26px 28px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden; }
.file-h::after { content: "FILE"; position: absolute; right: -6px; bottom: -28px; font: 700 7rem/1 var(--serif); color: rgba(255, 255, 255, .025); letter-spacing: -.02em; pointer-events: none; }
.file-h h1 { font-size: 2.1rem; word-break: break-word; }
.file-h .ids { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; color: var(--ink2); font: .85rem var(--mono); }
.file-h .aka { margin-top: 8px; font-size: .8rem; color: var(--muted); }
.file-h .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.file-h .side { display: grid; gap: 6px; justify-items: end; align-self: start; font: .72rem/1.5 var(--mono); color: var(--faint); text-align: right; }
.tabs { display: flex; gap: 2px; margin: 26px 0 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; padding: 11px 16px 12px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 8px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--dc, var(--ink)); }
.tab .n { font: .7rem var(--mono); color: var(--faint); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card > header h3 { font-size: 1rem; }
.card > header .n { font: .72rem var(--mono); color: var(--faint); }
.cols { display: grid; grid-template-columns: 5fr 7fr; gap: 16px; align-items: start; }
.col { display: grid; gap: 16px; min-width: 0; }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c7 { grid-column: span 7; } .c6 { grid-column: span 6; } .c5 { grid-column: span 5; } .c4 { grid-column: span 4; }
.none { color: var(--faint); font-size: .85rem; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 7px 14px; font-size: .88rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.entry + .entry { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line2); }
.entry-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.entry-h .rank { font: 700 1.05rem var(--serif); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.stat b { display: block; font: 700 1.2rem/1.1 var(--serif); }
.stat span { font-size: .7rem; color: var(--muted); }
.list { display: grid; gap: 0; }
.item { padding: 11px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: .88rem; }
.item:first-child { border-top: 0; padding-top: 2px; }
.item-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-h b { font-weight: 600; }
.item .meta { font: .74rem var(--mono); color: var(--muted); }
.item .body { color: var(--ink2); overflow-wrap: anywhere; white-space: pre-wrap; }
.item.dim { opacity: .62; }
.conf { margin-top: 4px; padding: 8px 10px; border-left: 2px solid var(--red); background: var(--red-wash); border-radius: 0 6px 6px 0; color: var(--ink); font-size: .85rem; }
.conf::before { content: "Confidential reason"; display: block; font: 600 .62rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #f0a59b; margin-bottom: 5px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a { font: .74rem var(--mono); color: var(--ink2); }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line2); }
.tl { position: relative; padding: 0 0 16px; }
.tl::before { content: ""; position: absolute; left: -20px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 0 3px var(--bg); }
.tl .when { font: .74rem var(--mono); color: var(--muted); }
.tl .what { font-size: .9rem; }
.tl .what b { font-weight: 600; }
.tl .why { font-size: .84rem; color: var(--ink2); overflow-wrap: anywhere; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sum { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--dc); text-align: left; cursor: pointer; }
.sum:hover { border-color: var(--line2); border-top-color: var(--dc); }
.sum .t { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-weight: 600; }
.sum .r { font: 700 1rem var(--serif); }
.sum .m { font-size: .78rem; color: var(--muted); }
.hidden-note { margin-top: 14px; font-size: .8rem; color: var(--muted); }

/* the viewer's name across a file (screenshots carry it) */
.wm { position: fixed; inset: 58px 0 0; pointer-events: none; z-index: 5; overflow: hidden; opacity: .028;
  display: grid; grid-template-columns: repeat(4, 1fr); align-content: start; gap: 90px 40px; padding: 40px; transform: rotate(-18deg) scale(1.3); }
.wm span { font: 600 .9rem var(--mono); white-space: nowrap; letter-spacing: .1em; }

/* ---------- tables (owners) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th { text-align: left; font: 600 .66rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line2); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.mono { font-size: .78rem; color: var(--ink2); }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.dept-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--dc); border-radius: var(--r); margin-bottom: 12px; }
.dept-row h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.dept-row .meta { font: .76rem/1.7 var(--mono); color: var(--muted); margin-top: 6px; }
.dept-row .bad { color: #f0a59b; }
.counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font: .74rem var(--mono); color: var(--faint); margin-top: 8px; }
.counts b { color: var(--ink2); font-weight: 600; }

/* ---------- dialogs ---------- */
dialog { background: var(--card); color: var(--ink); border: 1px solid var(--line2); border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(2px); }
.dlg { padding: 24px 26px 22px; }
.dlg h2 { margin-bottom: 14px; }
.dlg .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.reveal { font: 600 1rem/1.5 var(--mono); background: var(--bg2); border: 1px dashed var(--line2); border-radius: 8px; padding: 12px 14px; word-break: break-all; user-select: all; }
.steps { margin: 12px 0 0; padding-left: 20px; color: var(--ink2); font-size: .88rem; }
.steps li { margin-bottom: 6px; }
.depts-pick { display: grid; gap: 8px; padding: 12px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #111; padding: 10px 16px; border-radius: 9px; font-weight: 600; font-size: .88rem; z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast.bad { background: #f0a59b; }
.load { padding: 60px 0; text-align: center; color: var(--faint); font: .8rem var(--mono); letter-spacing: .14em; }

@media (max-width: 860px) {
  .top { flex-wrap: wrap; height: auto; gap: 0 12px; padding: 10px 14px 0; } .brand { flex: 1; }
  .nav { order: 3; flex: 0 0 100%; overflow-x: auto; padding: 8px 0; scrollbar-width: none; } .nav a { padding: 6px 10px; }
  .stamp { display: none; } .wm { inset: 100px 0 0; }
  .cols { grid-template-columns: 1fr; }
  .file-h h1 { font-size: 1.6rem; } .ava.big { width: 64px; height: 64px; font-size: 1.5rem; }
  .find h1 { font-size: 1.9rem; } .find { margin-top: 2vh; }
  main { padding: 24px 14px 70px; }
  .c8, .c7, .c6, .c5, .c4 { grid-column: span 12; }
  .file-h { grid-template-columns: auto 1fr; padding: 20px; } .file-h .side { grid-column: span 2; justify-items: start; text-align: left; }
  .res { grid-template-columns: 40px 1fr; } .res-tags { grid-column: span 2; justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dept-row { grid-template-columns: 1fr; }
}
@media print { .top, .wm, .tabs { display: none; } body { background: #fff; color: #000; } }
