/* Ray · ProductShot Agent — "The Vault" design system (from the approved Stitch direction).
   Hand-written, self-contained (no Tailwind CDN). Dark luxury / horology register. */
:root {
  --bg: #0B0B0D;            /* Level 0 floor */
  --surface: #121214;       /* Level 1 cards */
  --surface-hover: #161618;
  --line: #1A1A1C;          /* hairlines */
  --line-2: #26262B;
  --text: #E5E1E4;          /* on-surface */
  --on-variant: #D1C5B4;    /* warm light grey for labels */
  --muted: #9A8F80;         /* outline */
  --muted-2: #4E4639;       /* dim warm */
  --gold: #C8A15A;          /* primary-container — the spark */
  --gold-bright: #EAC076;
  --gold-bloom: rgba(200, 161, 90, 0.05);
  --ink: #0B0B0D;
  --danger: #E0938B;
  --ok: #8FB89A;
  --r: 2px;                 /* DEFAULT radius */
  --r-lg: 4px;
  --r-xl: 8px;
  --gutter: 24px;
  --margin: 80px;
  --maxw: 1280px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, -apple-system, "SF Pro Text", system-ui, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.muted { color: var(--muted); }

/* type helpers */
.label-caps { font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--on-variant); }
.h-sm { font-size: 18px; font-weight: 500; letter-spacing: 0.02em; }

/* icons */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round;
  stroke-linejoin: round; }

/* ---------- buttons ---------- */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; border: 0; border-radius: var(--r);
  background: var(--gold); color: var(--ink); font-family: inherit;
  font-size: 16px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer;
  transition: opacity .2s, transform .05s;
}
.btn-gold:hover { opacity: .9; }
.btn-gold:active { transform: translateY(1px); }
.btn-gold:disabled { opacity: .4; cursor: default; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--on-variant);
  padding: 7px 12px; border-radius: var(--r); font: inherit; font-size: 13px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: color .25s, border-color .25s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

/* ---------- badges ---------- */
.badge-conf {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  padding: 3px 9px; border-radius: var(--r); color: var(--gold);
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  white-space: nowrap;
}
.badge-conf::before { content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: #C2554D; box-shadow: 0 0 6px #C2554D; }

/* ---------- inputs ---------- */
input, select, textarea {
  width: 100%; background: transparent; border: 1px solid var(--line);
  border-radius: var(--r); color: var(--text); font: inherit; padding: 12px 14px;
  outline: none; transition: border-color .25s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 110px; }
select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239A8F80' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }

/* ============================================================ AUTH (login) */
.vault-glow { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 900px; height: 900px; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(200,161,90,0.04) 0%, rgba(11,11,13,0) 70%); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; }
.auth-inner { width: 100%; max-width: 400px; z-index: 1; }
.auth-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 44px; }
.auth-head .badge-conf { margin-bottom: 30px; letter-spacing: 0.2em; }
.wordmark { font-size: 34px; font-weight: 600; letter-spacing: 0.22em; color: var(--gold);
  padding-left: 0.22em; line-height: 1; }
.wordmark-sub { margin-top: 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--on-variant); padding-left: 0.28em; }
.vault-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 40px; position: relative; }
.vault-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: rgba(200,161,90,0.25); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.field input { height: 48px; }
.auth-foot { margin-top: 36px; text-align: center; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: rgba(154,143,128,0.5); }
.error { background: rgba(208,106,96,0.1); border: 1px solid rgba(208,106,96,0.35);
  color: var(--danger); font-size: 13px; padding: 10px 12px; border-radius: var(--r);
  margin-bottom: 20px; }

/* ============================================================ TOPBAR */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--margin); border-bottom: 1px solid var(--line);
  background: rgba(19,19,21,0.8); backdrop-filter: blur(20px); }
.tb-left { display: flex; align-items: center; gap: 16px; }
.tb-brand { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tb-brand .agent { color: var(--on-variant); font-weight: 400; font-size: 16px; letter-spacing: 0; }
.tb-sep { color: var(--muted-2); }
.tb-eng { color: var(--on-variant); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.tb-right { display: flex; align-items: center; gap: 22px; }
.tb-user { display: flex; align-items: center; gap: 10px; }
.tb-user .uname { color: var(--text); font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--gold);
  background: var(--surface); }
.logout { color: var(--on-variant); display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; transition: color .25s; }
.logout:hover { color: var(--text); }
.logout form { margin: 0; }
.logout button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; }

/* ============================================================ STUDIO */
.studio { max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 96px var(--margin) 60px; display: grid; grid-template-columns: 4fr 8fr;
  gap: 32px; align-items: start; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.panel-head .icon { color: var(--gold); width: 20px; height: 20px; }
.panel-head h2 { font-size: 18px; font-weight: 500; }
.panel-head .bay-icon { color: var(--on-variant); }
.subhint { font-size: 12px; color: var(--muted); margin: -10px 0 18px; line-height: 1.6; }

/* create panel */
.create { display: flex; flex-direction: column; }
.create form { display: flex; flex-direction: column; gap: 22px; }
.dropzone { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  min-height: 230px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; cursor: pointer; text-align: center;
  transition: background .25s, border-color .25s; position: relative; padding: 24px; }
.dropzone[hidden] { display: none; }
.dropzone:hover { background: var(--surface-hover); }
.dropzone.drag { border-color: var(--gold); background: var(--gold-bloom); }
.dz-ring { width: 48px; height: 48px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--on-variant);
  transition: border-color .25s, color .25s; }
.dropzone:hover .dz-ring, .dropzone.drag .dz-ring { border-color: var(--gold); color: var(--gold); }
.dz-ring .icon { width: 22px; height: 22px; }
.dz-title { font-size: 14px; font-weight: 500; color: var(--text); }
.dz-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dz-name { font-size: 12px; color: var(--gold); margin-top: 6px; word-break: break-all; max-width: 100%; }
.has-file .dz-thumb { width: 100%; max-height: 150px; object-fit: contain; border-radius: var(--r); }

.ctl { display: flex; flex-direction: column; gap: 8px; }

/* segmented variants */
.seg { display: flex; gap: 12px; }
.seg label { flex: 1; cursor: pointer; display: block; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
  pointer-events: none; }
.seg .cell { display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px 0; text-align: center; color: var(--on-variant);
  font-size: 14px; transition: border-color .2s, color .2s; }
.seg input:checked + .cell { border-color: var(--gold); color: var(--gold); }

.form-msg { font-size: 13px; min-height: 18px; }
.form-msg.err { color: var(--danger); }

/* ============================================================ PRODUCTION BAY */
.bay-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.gallery { display: flex; flex-direction: column; gap: 26px; }
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 60px 24px; text-align: center; color: var(--muted); font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; transition: border-color .3s, box-shadow .3s; }
.card.is-active { border-top: 2px solid var(--gold); }
.card.is-done:hover { border-color: var(--gold); box-shadow: inset 0 0 15px var(--gold-bloom); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.job-id { font-size: 16px; font-weight: 500; color: var(--text); }
.job-target { font-size: 13px; color: var(--muted); margin-top: 4px; }
.proc { display: inline-flex; align-items: center; gap: 8px; }
.proc .dot { position: relative; width: 8px; height: 8px; }
.proc .dot::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--gold); opacity: .75; animation: ping 1.4s cubic-bezier(0,0,.2,1) infinite; }
.proc .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--gold); }
.proc .txt { color: var(--gold); }
.proc.done .dot::before { animation: none; opacity: 0; }
.proc.done .dot::after { background: var(--ok); }
.proc.done .txt { color: var(--ok); }
.proc.failed .dot::after { background: var(--danger); }
.proc.failed .dot::before { animation: none; opacity: 0; }
.proc.failed .txt { color: var(--danger); }

/* stepper */
.stepper { position: relative; display: flex; justify-content: space-between; margin: 8px 0 22px; }
.stepper .track { position: absolute; left: 12px; right: 12px; top: 12px; height: 1px; background: var(--line); }
.stepper .track-fill { position: absolute; left: 12px; top: 12px; height: 1px; background: var(--gold);
  transition: width .8s ease; }
.step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.step .bullet { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.step .bullet .icon { width: 13px; height: 13px; }
.step.done .bullet { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.step.active .bullet { background: var(--surface); border-color: var(--gold); color: var(--gold); }
.step .lbl { font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.step.done .lbl, .step.active .lbl { color: var(--text); }
.step.active .lbl { color: var(--gold); }

.prog-row { display: flex; align-items: center; gap: 14px; }
.prog-track { flex: 1; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--gold); border-radius: 99px; transition: width .8s ease; }
.prog-eta { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--on-variant);
  white-space: nowrap; font-variant-numeric: tabular-nums; }

.card-understood { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); font-style: italic; line-height: 1.6; }
.card-err { margin-top: 14px; font-size: 12px; color: var(--danger); line-height: 1.5; }
.card-foot { margin-top: 16px; display: flex; }

/* completed shots */
.shots-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.shots-head .ttl { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.shots { display: grid; gap: 14px; }
.shots.n1 { grid-template-columns: 1fr; }
.shots.n2 { grid-template-columns: 1fr 1fr; }
.shots.n3 { grid-template-columns: 1fr 1fr 1fr; }
.shot { position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; aspect-ratio: 1 / 1; display: block; }
.shot img { width: 100%; height: 100%; object-fit: cover; opacity: .85;
  transition: opacity .4s, transform .4s; }
.shot:hover img { opacity: 1; transform: scale(1.04); }
.shot-ov { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 12px; background: linear-gradient(to top, rgba(0,0,0,.8), transparent 55%);
  opacity: 0; transition: opacity .3s; }
.shot:hover .shot-ov { opacity: 1; }
.shot-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); }
.dl-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--ink);
  display: grid; place-items: center; transition: background .2s; flex-shrink: 0; }
.dl-btn:hover { background: #fff; }
.dl-btn .icon { width: 15px; height: 15px; }

.confid-foot { text-align: center; color: var(--muted-2); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 30px 0 44px; }

/* spinner / ping */
.spin { animation: spin .9s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

/* responsive */
@media (max-width: 1024px) { :root { --margin: 32px; } }
@media (max-width: 820px) {
  .studio { grid-template-columns: 1fr; gap: 28px; padding-top: 88px; }
  .topbar { padding: 0 20px; }
  .tb-eng, .tb-sep { display: none; }
  :root { --margin: 20px; }
  .admin-grid { grid-template-columns: 1fr; }
}

/* ---------- topbar nav (admin) ---------- */
.tb-nav { display: flex; gap: 16px; }
.tb-nav a { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); transition: color .2s; }
.tb-nav a:hover { color: var(--text); }
.tb-nav a.active { color: var(--gold); }

/* ---------- admin page ---------- */
.admin { max-width: 1080px; margin: 0 auto; width: 100%; padding: 96px var(--margin) 60px; }
.admin .panel-head { margin-bottom: 8px; }
.admin-msg { border-radius: var(--r); padding: 11px 14px; font-size: 13px; margin-bottom: 20px; border: 1px solid; }
.admin-msg.ok { background: var(--gold-bloom); border-color: rgba(200,161,90,.4); color: var(--gold); }
.admin-msg.err { background: rgba(208,106,96,.1); border-color: rgba(208,106,96,.35); color: var(--danger); }
.admin-grid { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
.acct-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.acct-card h3 { font-size: 16px; font-weight: 500; margin-bottom: 18px; }
.acct-form { display: flex; flex-direction: column; gap: 8px; }
.acct-form .label-caps { margin-top: 8px; }
.acct-form .btn-gold { margin-top: 18px; height: 46px; font-size: 15px; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; }
.pw-row .btn-ghost { white-space: nowrap; }

.acct-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.acct-list-head, .acct-row { display: grid; grid-template-columns: 1.5fr 0.8fr 0.9fr 2.2fr; gap: 12px; align-items: center; padding: 14px 20px; }
.acct-list-head { color: var(--muted); border-bottom: 1px solid var(--line); }
.acct-row { border-bottom: 1px solid var(--line); }
.acct-row:last-child { border-bottom: 0; }
.acct-row.off { opacity: 0.5; }
.acct-name { color: var(--text); font-size: 14px; }
.tag-admin { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: var(--gold);
  border: 1px solid rgba(200,161,90,.4); border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
.acct-stat, .acct-date { font-size: 13px; color: var(--muted); }
.acct-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acct-act form { margin: 0; display: flex; gap: 6px; }
.reset-form input { width: 110px; padding: 6px 9px; font-size: 12px; }
.btn-mini { background: var(--surface); border: 1px solid var(--line); color: var(--on-variant);
  border-radius: var(--r); padding: 6px 11px; font: inherit; font-size: 12px; cursor: pointer;
  white-space: nowrap; transition: border-color .2s, color .2s; }
.btn-mini:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- brand logo (studio) ---------- */
.logo-row { display: flex; gap: 14px; align-items: center; }
.logo-thumb { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: var(--r);
  background-color: #1c1b1d; background-image: repeating-conic-gradient(#26262b 0% 25%, #1c1b1d 0% 50%);
  background-size: 12px 12px; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-thumb .muted { font-size: 11px; }
.logo-actions { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.logo-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--on-variant); cursor: pointer; }
.logo-toggle input { width: auto; margin: 0; accent-color: var(--gold); }
#logo-corner { max-width: 160px; }
.logo-hint { font-size: 11px; line-height: 1.5; }

/* optional collapsible block (logo etc.) */
.opt-block { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.opt-block summary { list-style: none; cursor: pointer; padding: 13px 14px; font-size: 11px;
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-variant);
  display: flex; align-items: center; gap: 9px; user-select: none; }
.opt-block summary::-webkit-details-marker { display: none; }
.opt-block summary::before { content: "+"; color: var(--gold); font-weight: 400; font-size: 16px; line-height: 1; }
.opt-block[open] summary::before { content: "\2212"; }
.opt-block summary:hover { color: var(--text); }
.opt-block .opt-body { padding: 2px 14px 16px; display: flex; flex-direction: column; gap: 12px; }
