/* Studio — a dark room for looking at pictures. One accent (amber) for actions; green keep, red reject, gold winner. */
:root {
  --bg: #0d0d0f; --panel: #151518; --panel2: #1c1c20; --line: #2a2a30; --text: #ecebe6; --muted: #8d8c88;
  --accent: #ffb547; --accent-ink: #1a1203; --ok: #4fd18b; --bad: #ff6b5e; --gold: #f5d061; --info: #7cc4ff;
  --r: 10px; --font: 'Space Grotesk', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .85em; background: var(--panel2); padding: .1em .35em; border-radius: 4px; word-break: break-all; }
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: .95rem; display: flex; align-items: center; gap: .5rem; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .sr { position: absolute; left: -9999px; }
.warn-t { color: var(--accent); }
.i { width: 18px; height: 18px; flex: none; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1.25rem; padding: .7rem 1.25rem; background: rgba(13,13,15,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.brand.big { font-size: 1.5rem; margin-bottom: 1rem; }
.mark { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--accent); position: relative; }
.mark::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.places { display: flex; gap: .25rem; flex: 1; }
.places a { display: flex; align-items: center; gap: .4rem; padding: .4rem .7rem; border-radius: 8px; text-decoration: none; color: var(--muted); }
.places a.on, .places a:hover { color: var(--text); background: var(--panel2); }
.numby { display: flex; align-items: center; gap: .45rem; font-size: .82rem; text-decoration: none; color: var(--muted); }
.numby i { width: 9px; height: 9px; border-radius: 50%; background: #555; }
.numby.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(79,209,139,.18); }
.numby.paused i { background: var(--accent); }
#page { padding: 1.25rem; max-width: 1400px; margin: 0 auto; }

/* parts */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; }
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .95rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; text-decoration: none; font-weight: 500; }
.btn:hover { border-color: #3a3a42; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.small { padding: .35rem .65rem; font-size: .85rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; color: var(--text); font-size: .95rem; }
textarea { resize: vertical; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255,181,71,.5); outline-offset: 0; border-color: var(--accent); }
.row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-top: .75rem; }
.row.end { justify-content: flex-end; align-items: center; }
.row .grow, .grow { flex: 1; min-width: 160px; }
.notice { background: rgba(255,181,71,.08); border: 1px solid rgba(255,181,71,.25); border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; font-size: .9rem; }
.notice.bad { background: rgba(255,107,94,.08); border-color: rgba(255,107,94,.3); }
.empty { padding: 3rem; text-align: center; color: var(--muted); }
.chip { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 99px; border: 1px solid var(--line); margin-left: .35rem; font-weight: 600; letter-spacing: .02em; }
.v-keep.chip { color: var(--ok); border-color: rgba(79,209,139,.4); } .v-reject.chip { color: var(--bad); border-color: rgba(255,107,94,.4); } .v-winner.chip { color: var(--gold); border-color: rgba(245,208,97,.5); }
.p-available { color: var(--ok); } .p-unqualified { color: var(--muted); } .p-off { color: var(--bad); }
.st { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.st-running { color: var(--accent); } .st-done { color: var(--ok); } .st-failed { color: var(--bad); }
.prog { display: block; height: 3px; background: var(--line); border-radius: 2px; position: relative; overflow: hidden; margin-top: .4rem; }
.prog::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--accent); transition: width .4s; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); opacity: 0; background: var(--panel2); border: 1px solid var(--line); padding: .6rem 1rem; border-radius: 8px; transition: .2s; pointer-events: none; z-index: 20; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.bad { border-color: var(--bad); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login form { width: min(360px, 100%); display: flex; flex-direction: column; gap: .8rem; }

/* make */
.make { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; }
.compose .tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tab { padding: .45rem .85rem; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.tab.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab.off { color: var(--muted); } .tab small { font-size: .65rem; opacity: .8; }
.compose textarea { font-size: 1.05rem; min-height: 110px; }
.opts label { min-width: 120px; }
.refs { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.ref { position: relative; } .ref img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; display: block; }
.ref button { position: absolute; top: -6px; right: -6px; border-radius: 50%; border: 0; background: var(--panel2); width: 20px; height: 20px; padding: 2px; cursor: pointer; }
.ref button .i { width: 14px; height: 14px; }
.side { display: flex; flex-direction: column; gap: 1rem; }
.count { font-size: .75rem; color: var(--muted); font-weight: 500; }
.state { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-left: auto; }
.state.on { color: var(--ok); } .state.off { color: var(--muted); }
.meter { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; font-size: .82rem; margin: .5rem 0; }
.meter span { color: var(--muted); } .meter b { font-weight: 500; font-family: var(--mono); font-size: .78rem; }
.meter i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--panel2); position: relative; overflow: hidden; }
.meter i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--info); border-radius: 3px; }
.meter.warn i::after { background: var(--accent); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .75rem; font-size: .82rem; color: var(--muted); margin: .5rem 0; }
.facts b { color: var(--text); font-family: var(--mono); font-weight: 500; font-size: .8rem; }
.line-item { display: block; padding: .55rem 0; border-top: 1px solid var(--line); text-decoration: none; }
.line-item:first-child { border-top: 0; }
.line-item .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-item .why { display: block; color: var(--muted); }
.recent { grid-column: 1 / -1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.tile { position: relative; display: block; border-radius: var(--r); overflow: hidden; background: var(--panel); border: 1px solid var(--line); text-decoration: none; aspect-ratio: 1; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .cap { position: absolute; inset: auto 0 0 0; padding: 1.5rem .6rem .5rem; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-size: .78rem; display: flex; gap: .35rem; align-items: center; }
.tile .cap .t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #ccc; flex: 1; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: .85rem; background: var(--panel2); min-height: 120px; }

/* request */
.back { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); text-decoration: none; font-size: .88rem; margin-bottom: .75rem; }
.req-h { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.req-h h1 { margin-top: .2rem; max-width: 60ch; }
.acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.running { margin: .75rem 0; }
.prompt { background: var(--panel); border-left: 3px solid var(--line); padding: .6rem .9rem; border-radius: 0 8px 8px 0; white-space: pre-wrap; }
#revise { margin: .75rem 0; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin: 1rem 0; }
.result { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.result .frame { display: block; background: #000; }
.result img, .result video { width: 100%; display: block; max-height: 70vh; object-fit: contain; }
.result figcaption { display: flex; align-items: center; gap: .4rem; padding: .5rem .6rem; }
.verdicts { margin-left: auto; display: flex; gap: .3rem; }
.vb { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: .35rem; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); }
.verdicts.big .vb { padding: .55rem .8rem; flex: 1; justify-content: center; color: var(--text); }
.vb.v-keep.on { background: rgba(79,209,139,.15); color: var(--ok); border-color: var(--ok); }
.vb.v-reject.on { background: rgba(255,107,94,.15); color: var(--bad); border-color: var(--bad); }
.vb.v-winner.on { background: rgba(245,208,97,.15); color: var(--gold); border-color: var(--gold); }
.timeline summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.timeline ol, .activity { list-style: none; padding: 0; margin: .5rem 0; font-size: .85rem; }
.timeline li, .activity li { padding: .25rem 0; border-top: 1px solid var(--line); }
.timeline time, .activity time { color: var(--muted); font-family: var(--mono); font-size: .75rem; margin-right: .5rem; }

/* library + one result */
.filters { display: flex; gap: .35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters a { padding: .35rem .75rem; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-size: .88rem; }
.filters a.on { color: var(--bg); background: var(--text); border-color: var(--text); }
.mview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; }
.stage { background: #000; border-radius: var(--r); display: grid; place-items: center; min-height: 50vh; overflow: hidden; }
.stage img, .stage video { max-width: 100%; max-height: 80vh; display: block; }
.facts-list { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; font-size: .85rem; margin: 1rem 0; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; }
.notes { list-style: none; padding: 0; margin: 0 0 .75rem; }
.notes li { border-top: 1px solid var(--line); padding: .5rem 0; font-size: .9rem; }
.notes p { margin: 0 0 .15rem; white-space: pre-wrap; }
#note { display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; }

/* compare */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pair figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pair .frame { background: #000; display: grid; place-items: center; min-height: 40vh; }
.pair img, .pair video { width: 100%; max-height: 72vh; object-fit: contain; display: block; }
.pair figcaption { display: flex; align-items: center; gap: .5rem; padding: .6rem; flex-wrap: wrap; }
.pair figcaption .btn { margin-left: auto; }
#why { margin-top: 1rem; }

/* system */
.sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.sys .wide { grid-column: 1 / -1; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.rules small { color: #6d6c68; font-size: .72rem; }
.rules .row { grid-column: 1 / -1; }
.presets { width: 100%; border-collapse: collapse; font-size: .88rem; }
.presets th { text-align: left; color: var(--muted); font-weight: 500; font-size: .78rem; padding: .3rem .5rem; }
.presets td { border-top: 1px solid var(--line); padding: .5rem; vertical-align: top; }
.chart { width: 100%; height: 120px; background: var(--bg); border-radius: 6px; }
.chart polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.l-ram { stroke: var(--info); background: var(--info); } .l-vram { stroke: var(--accent); background: var(--accent); } .l-temp { stroke: var(--bad); background: var(--bad); }
.legend .k { display: inline-block; width: 10px; height: 3px; margin: 0 .3rem 0 .8rem; vertical-align: middle; }
.legend .k:first-child { margin-left: 0; }

@media (max-width: 860px) {
  .make, .mview-grid { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .top { gap: .6rem; padding: .6rem 1rem; }
  .places a span { display: none; }
  .numby { font-size: 0; } .numby i { width: 11px; height: 11px; }
  #page { padding: 1rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
.ref-k { width: 56px; height: 56px; border-radius: 6px; background: var(--panel2); display: grid; place-items: center; font-size: 1.3rem; color: var(--accent); }
