@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(fonts/Inter-Regular.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(fonts/Inter-Medium.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(fonts/Inter-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(fonts/JetBrainsMono-Regular.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(fonts/JetBrainsMono-Medium.woff2) format("woff2"); }
:root {
  --bg: #0c0d0f; --side: #111215; --surface: #16181b; --raised: #1d1f23; --field: #131417; --line: #222428; --border: #2c2e33; --tile: #15171a;
  --text: #ececee; --text2: #a1a3a9; --muted: #8a8d94; --accent: #a3e635; --onaccent: #0c0d0f;
  --ok: #3ecf8e; --warn: #f5a524; --bad: #e5484d; --badtext: #f2555a;
  --accenttint: #1a2010; --accentline: #4f6a24; --oktint: #0f1f17; --okline: #2a5a3f; --badtint: #2a1315; --badline: #7d2b2f;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
  --rh: 40px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button, input, textarea, select { font: inherit; color: inherit; }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.s { width: 15px; height: 15px; } svg.ic.l { width: 22px; height: 22px; }
.mono { font-family: var(--mono); } .grow { flex: 1 1 0; min-width: 0; } .t2 { color: var(--text2); } .mu { color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; } .col { display: flex; flex-direction: column; gap: 10px; }
.el { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }

.btn { font: 500 14px/1 var(--font); height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; flex: none; cursor: pointer; user-select: none; }
.btn:hover { background: var(--raised); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--onaccent); font-weight: 600; } .btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; color: var(--text2); } .btn.icon { width: 36px; padding: 0; } .btn.on { background: var(--raised); color: var(--text); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; } .btn.small.icon { width: 30px; padding: 0; }
.btn.danger { background: var(--badtint); border-color: var(--badline); color: var(--badtext); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { height: 36px; background: var(--field); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.field:focus-within { border-color: var(--accent); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); height: 100%; padding: 0; }
input.field, select.field { color: var(--text); outline: 0; width: 100%; } input.field:focus, select.field:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); }
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); color: var(--text2); white-space: nowrap; flex: none; }
.chip.ok { background: var(--oktint); border-color: var(--okline); color: var(--ok); } .chip.acc { background: var(--accenttint); border-color: var(--accentline); color: var(--accent); }
.chip.warn { border-color: #6b4a12; background: #221a0b; color: var(--warn); } .chip.bad { background: var(--badtint); border-color: var(--badline); color: var(--badtext); }
.av { --s: 32px; width: var(--s); height: var(--s); border-radius: calc(var(--s) * 0.27); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: calc(var(--s) * 0.42); flex: none; line-height: 1; text-transform: uppercase; }
.bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .2s; }
.bar.bad i { background: var(--bad); }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--onaccent); display: flex; align-items: center; justify-content: center; flex: none; }
.kbd { font: 11px var(--mono); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--muted); }
.err { color: var(--badtext); font-size: 13px; min-height: 20px; }

/* shell */
.shell { display: flex; height: 100dvh; }
.rail { width: 56px; flex: none; background: #0e0f11; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; }
.rail .mark { margin-bottom: 12px; }
.rail a { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.rail a:hover { color: var(--text); } .rail a.on { background: var(--raised); color: var(--accent); } .rail a svg { width: 20px; height: 20px; }
.rail .sp { flex: 1; }
.side { width: 232px; flex: none; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; padding: 14px 10px; min-height: 0; }
.side h3 { font-size: 16px; font-weight: 600; padding: 3px 8px; }
.side .items { display: flex; flex-direction: column; gap: 2px; }
.side .items a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text2); font-weight: 500; min-width: 0; }
.side .items a:hover { color: var(--text); }
.side .items a.on { background: var(--raised); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.side .foot { margin-top: auto; padding: 0 8px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text2); }
.main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; position: relative; }
.top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.top .field { width: 440px; max-width: 100%; }
.view { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.tb { display: flex; align-items: center; gap: 6px; padding: 12px 16px 8px; flex: none; min-height: 56px; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 600; color: var(--text2); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a:hover { color: var(--text); } .crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; } .crumbs svg { width: 14px; height: 14px; color: var(--muted); }
.crumbs a.over { color: var(--accent); }
.body { flex: 1 1 0; min-height: 0; display: flex; }
.list { flex: 1 1 0; min-width: 0; overflow-y: auto; outline: 0; position: relative; }
.lh, .lr { display: grid; align-items: center; padding: 0 16px; gap: 12px; }
.lh { height: 30px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.lh span { cursor: pointer; user-select: none; } .lh span.on { color: var(--text); }
.lr { height: var(--rh); border-bottom: 1px solid var(--line); min-width: 0; cursor: default; user-select: none; }
.lr:hover { background: var(--surface); } .lr.cur { background: var(--accenttint); } .lr.over { box-shadow: inset 0 0 0 1px var(--accent); }
.lr .nm { display: flex; align-items: center; gap: 10px; min-width: 0; } .lr .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr .nm small { display: none; }
.lr .m { font: 400 12px var(--mono); color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr .st { color: var(--accent); width: 13px; height: 13px; fill: currentColor; }
.lr .more { display: none; }
.k-folder { color: var(--accent); } .k-file { color: var(--muted); }
.thumb { width: 22px; height: 22px; border-radius: 5px; flex: none; object-fit: cover; background: var(--tile); }
.cols-files { grid-template-columns: minmax(0, 1fr) 90px 150px; }
.cols-where { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 90px 150px; }
.vs { position: relative; } .vw { position: absolute; left: 0; right: 0; top: 0; }
.grow-row { display: grid; gap: 12px; padding: 0 16px; height: 162px; }
.tile { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; height: 150px; cursor: default; user-select: none; min-width: 0; }
.tile .pic { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--tile); color: var(--muted); }
.tile .pic svg { width: 34px; height: 34px; stroke-width: 1.25; } .tile .pic img { width: 100%; height: 100%; object-fit: cover; }
.tile .capn { padding: 6px 10px; font-size: 13px; flex: none; }
.tile.cur { border-color: var(--accent); } .tile.over { border-color: var(--accent); }
.pane { width: 300px; flex: none; border-left: 1px solid var(--line); background: var(--side); padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.pane .pv { height: 150px; flex: none; border-radius: 10px; border: 1px solid var(--border); background: var(--tile); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); }
.pane .pv img { width: 100%; height: 100%; object-fit: contain; } .pane .pv svg { width: 44px; height: 44px; stroke-width: 1.25; }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 4px 10px; font-size: 13px; } .kv span:nth-child(odd) { color: var(--muted); } .kv span { min-width: 0; overflow-wrap: anywhere; }
.vrow { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 30px; }

/* pages */
.page { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.page-h { font-size: 18px; font-weight: 600; }
.page .card { max-width: 760px; }
.tbl .lr { height: 48px; } .cols-people { grid-template-columns: minmax(0, 1fr) 170px 110px 110px 36px; }
.cols-dev { grid-template-columns: minmax(0, 1fr) 130px 110px 90px; }

/* overlays */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 20; }
.modal { width: 520px; max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; font-size: 16px; font-weight: 600; }
.modal .sec { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }
.modal footer { padding: 12px 18px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.pick { height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.pick a:hover { background: var(--raised); } .pick a.off { opacity: .4; pointer-events: none; }
.menu { position: fixed; z-index: 30; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.5); padding: 4px; display: flex; flex-direction: column; }
.menu a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 7px; white-space: nowrap; }
.menu a:hover { background: var(--raised); } .menu a.bad { color: var(--badtext); } .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.menu svg { color: var(--muted); } .menu a.bad svg { color: inherit; }
.queue { position: absolute; right: 16px; bottom: 16px; width: 380px; max-width: calc(100% - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.5); z-index: 4; overflow: hidden; }
.queue header { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.queue .qs { max-height: 260px; overflow-y: auto; }
.q { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; } .q:last-child { border: 0; }
.q .t { display: flex; gap: 8px; font-size: 13px; align-items: center; } .q .t span.r { font: 400 11px var(--mono); color: var(--text2); white-space: nowrap; }
.q .t a { color: var(--muted); display: flex; } .q.bad .t span.r { color: var(--badtext); } .q.ok .t span.r { color: var(--ok); }
.drop { position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 12px; background: rgba(163,230,53,.06); display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; color: var(--accent); z-index: 3; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; z-index: 40; box-shadow: 0 12px 32px rgba(0,0,0,.5); max-width: calc(100% - 32px); display: flex; gap: 12px; align-items: center; }
.toast.bad { border-color: var(--badline); color: var(--badtext); } .toast a { color: var(--accent); font-weight: 600; }
.viewer { position: fixed; inset: 0; background: rgba(7,8,9,.96); z-index: 25; display: flex; flex-direction: column; }
.viewer header { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; flex: none; }
.viewer header b { font-weight: 600; }
.viewer .stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 8px 12px; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.viewer iframe { width: min(1000px, 100%); height: 100%; border: 0; border-radius: 8px; background: #fff; }
.viewer textarea { width: min(900px, 100%); height: 100%; resize: none; background: var(--field); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font: 13px/1.6 var(--mono); outline: 0; color: var(--text); tab-size: 4; }
.viewer textarea:focus { border-color: var(--accentline); }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 22px; background: rgba(29,31,35,.85); display: flex; align-items: center; justify-content: center; color: var(--text); z-index: 1; }
.viewer .nav.l { left: 14px; } .viewer .nav.r { right: 14px; }

/* sign in */
.gate { height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate form { width: 340px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; }
.gate h1 { font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }

.p-tabs, .fab { display: none; }
.fab { position: absolute; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--onaccent); align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 2; border: 0; cursor: pointer; }
.fab svg { width: 24px; height: 24px; stroke-width: 2.25; }

@media (max-width: 760px) {
  :root { --rh: 58px; }
  .rail, .side, .pane, .lh, .kbd, .tb .mode { display: none; }
  .shell { flex-direction: column; }
  .p-tabs { flex: none; display: flex; border-top: 1px solid var(--line); background: var(--side); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
  .p-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--muted); }
  .p-tabs a.on { color: var(--accent); } .p-tabs a svg { width: 22px; height: 22px; }
  .fab { display: flex; }
  .top .field { width: 100%; height: 44px; font-size: 16px; }
  .btn { height: 44px; } .btn.icon { width: 44px; } .btn.small { height: 34px; } .btn.small.icon { width: 34px; }
  input.field, select.field { height: 44px; font-size: 16px; }
  .tb { flex-wrap: wrap; }
  .lr { grid-template-columns: minmax(0, 1fr) 44px !important; padding: 0 4px 0 16px; }
  .lr .m { display: none; }
  .lr .nm { gap: 12px; } .lr .nm > div { min-width: 0; display: flex; flex-direction: column; }
  .lr .nm span { font-weight: 500; } .lr .nm small { display: block; font: 400 11.5px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lr .ico, .lr .thumb { width: 36px; height: 36px; border-radius: 9px; }
  .lr .ico { background: var(--surface); display: flex; align-items: center; justify-content: center; flex: none; }
  .lr .more { display: inline-flex; }
  .tbl .lr { height: 58px; }
  .scrim { align-items: flex-end; }
  .modal { width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .menu { left: 0 !important; right: 0; top: auto !important; bottom: 0; border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding: 10px 8px calc(14px + env(safe-area-inset-bottom)); }
  .menu a { height: 46px; gap: 14px; padding: 0 12px; }
  .queue { right: 8px; left: 8px; bottom: 84px; width: auto; max-width: none; }
  .viewer .nav { display: none; }
}
@media (min-width: 761px) { .lr .ico { display: contents; } .lr .nm > div { display: contents; } }
