:root {
  color-scheme: light;
  --ink: #171819;
  --muted: #5f6368;
  --line: #d9dcdf;
  --paper: #ffffff;
  --soft: #f5f6f6;
  --dark: #162127;
  --green: #347350;
  --red: #9b4745;
  font-family: "Instrument Sans","Helvetica Neue","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction:column; color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.65; }
[hidden] { display:none!important; }
button,input,select,textarea { font:inherit; color:inherit; }
button,[type=submit],a.button { appearance:none; border:0; background:none; cursor:pointer; text-align:inherit; }
a { color:inherit; text-underline-offset:.22em; }
:focus-visible { outline:2px solid #326d8c; outline-offset:4px; }
h1,h2,h3,p,figure { margin:0; }
h1,h2,h3 { line-height:1.28; }
h1 { font-size:clamp(2rem,4vw,3.7rem); letter-spacing:-.06em; font-weight:640; }
h2 { font-size:clamp(1.45rem,2.3vw,2rem); letter-spacing:-.04em; }
h3 { font-size:1.12rem; }
small,.small { font-size:.88rem; }
img { display:block; max-width:100%; }
.skip { position:fixed; left:-1000px; padding:8px; z-index:10; background:white; }
.skip:focus {left:10px;top:10px;}
.mast { display:flex; justify-content:space-between; align-items:center; gap:1rem; min-height:76px; padding:15px clamp(16px,4vw,72px); border-bottom:1px solid var(--line); }
.brand { display:inline-flex; align-items:center; gap:9px; font:900 29px/1 Arial,sans-serif; letter-spacing:-1.9px; text-decoration:none; }
.brand-mark { display:block; position:relative; width:30px; height:30px; flex:none; }
.brand-mark i { position:absolute; inset:0; background:currentColor; clip-path:polygon(50% 3%,90.7% 26.5%,65.8% 57.3%,65.8% 40%); transform:rotate(var(--angle,0deg)); }
.brand-mark i:nth-child(2){--angle:60deg}.brand-mark i:nth-child(3){--angle:120deg}.brand-mark i:nth-child(4){--angle:180deg}.brand-mark i:nth-child(5){--angle:240deg}.brand-mark i:nth-child(6){--angle:300deg}
nav { display:flex; align-items:center; gap:clamp(.4rem,1.8vw,2rem); flex-wrap:wrap; }
nav a,.text-button { text-decoration:none; padding:6px 0; font-size:.94rem; }
nav a[aria-current=page] { box-shadow:inset 0 -2px var(--ink); font-weight:650; }
nav a:hover,.text-button:hover { text-decoration:underline; }
.account { color:var(--muted); font-size:.9rem; }
main { align-self:center; flex:1; width:min(100%,1600px); padding:clamp(25px,4vw,64px) clamp(16px,4vw,72px) 64px; }
footer { margin-top:auto; display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:18px clamp(16px,4vw,72px); border-top:1px solid var(--line); color:var(--muted); font-size:.88rem; }
.wordmark { letter-spacing:-.06em; color:var(--ink); font-weight:800; }
.landing { display:grid; grid-template-columns:minmax(0,.94fr) minmax(0,1.2fr); min-height: min(68svh,660px); }
.landing-copy { align-self:center; padding:clamp(12px,4vw,60px) clamp(20px,4vw,75px) clamp(22px,4vw,60px) 0; }
.landing h1 { font-size:clamp(2.7rem,5.7vw,5.8rem); line-height:1.16; letter-spacing:-.065em; margin:1rem 0 1.1rem; }
.landing-copy>p { color:var(--muted); max-width:30em; }
.landing-copy .button { margin-top:2rem; }
.login-mark { display:block; width:min(100%,42vw); max-width:480px; height:100%; min-height:240px; opacity:.83; position:relative; }
.stage { overflow:hidden; isolation:isolate; position:relative; min-height:360px; background:
    radial-gradient(ellipse at 75% -18%,#bddce6 1%,transparent 35%),
    radial-gradient(ellipse at 18% 29%,#527e97 0%,transparent 36%),
    radial-gradient(ellipse at 83% 81%,#884e53 0%,transparent 43%),
    linear-gradient(135deg,#142329 5%,#283d48 44%,#211d23 78%); }
.stage::before,.stage::after { content:""; position:absolute; inset:-5%; pointer-events:none; }
.stage::before { opacity:.62; background: conic-gradient(from 139deg at 88% 0%,transparent 0 9deg,#d3edf7aa 11deg,transparent 16deg),conic-gradient(from 10deg at 21% 110%,transparent 0deg,#a1c6d17a 6deg,transparent 11deg),conic-gradient(from 162deg at 28% -4%,transparent 0deg,#cfebff77 6deg,transparent 14deg); filter:blur(7px); }
.stage::after { background:linear-gradient(0deg,#101317cc,transparent 48%),repeating-linear-gradient(-62deg,transparent 0 25px,#ddefff10 26px,transparent 28px); }
.stage-label { position:absolute; z-index:1; left:clamp(18px,3vw,42px); bottom:clamp(18px,3vw,42px); right:18px; color:white; font-family:"Baskervville",Georgia,serif; letter-spacing:-.06em; line-height:.91; font-size:clamp(2.3rem,5.5vw,5.8rem); }
.eyebrow { display:block; color:#515c63; font-family:"IBM Plex Mono",ui-monospace,monospace; font-size:.8rem; letter-spacing:.1em; line-height:1.5; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1.6rem; }
.page-head .eyebrow { margin-bottom:.45rem; }
.page-head p { margin-top:.5rem; color:var(--muted); }
.panel { border:1px solid var(--line); background:white; padding:clamp(16px,2.2vw,32px); min-width:0; }
.panel h2,.panel h3 { margin-bottom:.5rem; }
.panel+.panel,.section+.section,.section+.panel,.panel+.section { margin-top:1.5rem; }
.stack { display:grid; align-content:start; gap:1rem; }
.stack-tight { display:grid; align-content:start; gap:.55rem; }
.inline { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; }
.inline.baseline { align-items:flex-end; }
.split { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(230px,.7fr); gap:1.4rem; align-items:start; }
.two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.2rem; align-items:start; }
.fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr)); gap:.8rem; }
.field { display:grid; gap:.28rem; font-size:.89rem; color:var(--muted); min-width:0; }
.field:has([type=checkbox]),.check-line { display:flex; align-items:center; gap:.55rem; }
.check-line input,.field [type=checkbox] { width:1.1rem;height:1.1rem; accent-color:var(--ink); }
input:not([type=checkbox]):not([type=radio]),select,textarea { width:100%; min-width:0; padding:8px 11px; border:1px solid #bdc2c5; border-radius:3px; background:#fff; color:var(--ink); min-height:42px; }
input[type=file] { font-size:.91rem; }
textarea { resize:vertical; min-height:70px; }
select { appearance:none; background-image:linear-gradient(45deg,transparent 50%,#30373a 50%),linear-gradient(135deg,#30373a 50%,transparent 50%); background-position:calc(100% - 16px) 51%,calc(100% - 11px) 51%;background-size:5px 5px;background-repeat:no-repeat;padding-right:30px; }
.button,button.button,a.button { border:1px solid #a4aaad; padding:9px 15px; min-height:42px; border-radius:4px; background:white; color:var(--ink); text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:.4rem; font-size:.94rem; line-height:1.5; font-weight:550; }
.button:hover { border-color:var(--ink); background:#f4f6f6; }
.button.primary { background:var(--dark); border-color:var(--dark); color:white; }
.button.primary:hover { background:#293b43; }
.button.danger { color:#8d3936; border-color:#d29f9e; }
button:disabled,.button:disabled { cursor:default; opacity:.5; }
fieldset { margin:0; border:1px solid var(--line); padding:.8rem 1rem; min-width:0; }
legend { padding:0 .3rem; font-weight:600; }
strong { font-weight:650; }
.hint,.muted { color:var(--muted); }
.summary { padding:.8rem 1rem; background:var(--soft); border-left:3px solid #72858a; font-size:.96rem; }
.notice.error { background:#fbf1f0; border-color:#b45b56; color:#782c2a; }
.notice.success { background:#edf6f0; border-color:#688b74; color:#245136; }
.notice,.empty { padding:.85rem 1rem; border:1px solid var(--line); background:var(--soft); }
.empty>p { color:var(--muted); }
.empty a,.empty .button { margin-top:.7rem; }
.loading { color:var(--muted); padding:1rem 0; }
.filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr)); align-items:end; gap:.75rem; padding:1rem 0 1.15rem;border-top:1px solid var(--line);border-bottom:1px solid var(--line); margin-bottom:1.4rem; }
.gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,185px),1fr)); gap:clamp(.8rem,1.5vw,1.5rem); }
.tile { appearance:none; display:block; min-width:0; width:100%; border:0; padding:0; background:none; text-align:left; color:inherit; }
.tile .frame { position:relative; display:block; background:#ecefef; border:2px solid var(--line); aspect-ratio:4/3; overflow:hidden; border-radius:4px; }
.tile .frame img {width:100%;height:100%;object-fit:cover;}
.tile[data-state=available] .frame { border-color:#718f78; }
.tile[data-state=delivered] .frame,.tile[data-state=reserved] .frame,.tile[data-state=unavailable] .frame {border-color:#ae7775;}
.tile-name { display:block; font-weight:630; margin-top:.3rem; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.tile-meta { display:block; color:var(--muted); font-size:.85rem; }
.person .frame { aspect-ratio:1; border-radius:50%; max-width:150px; }
.person .frame img { object-fit:cover; }
.person { text-align:center; max-width:170px; }
.person .frame { margin:auto; }
.person-placeholder { display:grid!important; place-items:center; font-size:2rem; color:#73828a; }
.tabs { display:flex; align-items:stretch; overflow-x:auto; gap:.5rem; border-bottom:1px solid var(--line); margin-bottom:1.4rem; }
.tabs button { padding:.6rem .25rem; white-space:nowrap; font-size:.97rem; }
.tabs button[aria-current=page] { box-shadow:inset 0 -2px var(--ink);font-weight:660; }
.table-wrap { overflow-x:auto; max-width:100%; }
table { border-collapse:collapse; width:100%; font-size:.93rem; }
th,td { border-bottom:1px solid var(--line); text-align:left; padding:.6rem .45rem; vertical-align:top; }
th { color:var(--muted); font-weight:590; }
td.code,.mono,output.code { overflow-wrap:anywhere; font-family:"IBM Plex Mono",ui-monospace,monospace; }
tr:last-child td { border-bottom:0; }
.line-item { border-bottom:1px solid var(--line); padding:.55rem 0; display:flex; gap:.7rem; align-items:center; flex-wrap:wrap; }
.line-item>:first-child { flex:1; min-width:10em; }
dialog { border:1px solid var(--line); border-radius:7px; box-shadow:0 24px 100px #101a2240; padding:0; max-height:92svh; width:min(95vw,680px); color:var(--ink); }
dialog.wide { width:min(96vw,1030px); }
dialog::backdrop { background:#101418ad; }
dialog .dialog-head { position:sticky; top:0; z-index:3; display:flex; justify-content:space-between; gap:.6rem; align-items:center; border-bottom:1px solid var(--line); padding:.75rem clamp(12px,2vw,24px); background:white; }
dialog .dialog-head h2 { font-size:1.22rem; overflow-wrap:anywhere; }
dialog .dialog-body { padding:clamp(13px,2vw,24px); }
.photo-view { display:flex; align-items:center; justify-content:center; background:#14181b; margin:0; min-height:110px; border-radius:3px; overflow:hidden; }
.photo-view img { max-width:100%; max-height:70svh; object-fit:contain; }
.media-nav { display:flex; flex-wrap:wrap; gap:.45rem; align-items:center; }
.media-nav label { min-width:min(150px,100%); }
.asset-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:.58rem; max-height:44svh; overflow-y:auto; padding:.35rem; }
.asset-choice { padding:.42rem; border:1px solid var(--line); border-radius:4px; min-width:0; }
.asset-choice:has(input:checked) { border-color:#447284; box-shadow:inset 0 0 0 1px #447284; }
.asset-choice img { width:100%; height:86px;object-fit:cover; background:var(--soft); }
.asset-choice label { display:flex; align-items:center; gap:.35rem; font-size:.87rem; overflow-wrap:anywhere; }
.asset-choice label input { accent-color:var(--ink); }
.media-names { margin:.35rem 0; padding-left:1.35rem; max-height:24svh; overflow:auto; }
.code-block { display:flex; align-items:center; justify-content:space-between; gap:.7rem; background:var(--soft); padding:1rem; border-radius:4px; }
.note-list { margin:.2rem 0; padding-left:1.25rem; }
.frame-editor { position:relative; display:inline-block; line-height:0; max-width:100%; overflow:hidden; touch-action:none; cursor:crosshair; user-select:none; }
.frame-editor>img { display:block; max-height:62svh; width:auto; max-width:100%; }
.box { position:absolute; outline:2px solid #58d1ff; background:#1481bc22; pointer-events:none; }
.box.selected { outline:3px solid #ffd463; background:#f1c33822; }
.box.excluded { outline:2px dashed #ee8a85; background:transparent; }
.box.draft { outline:3px dashed #fff; background:#e0e5ea33; }
.box span { position:absolute; top:0; left:0; background:#152b35; color:white; font:12px/1.4 system-ui; padding:0 3px; }
.face-stage { display:flex; justify-content:center; background:#192025; padding:0; }
.face-row { border:1px solid var(--line); padding:.5rem; border-radius:3px; }
.face-row:has(input:checked) { border-color:#487282; background:#eff5f6; }
#message:not(:empty) { position:fixed; right:1rem; bottom:1rem; z-index:12; padding:.6rem 1rem; background:var(--dark); color:white; border-radius:4px; max-width:95vw; overflow-wrap:break-word; }
@media(max-width:770px) {
  .mast { min-height:65px; flex-wrap:wrap; }
  .mast nav { gap:.6rem 1rem; }
  .account { display:none; }
  .landing,.two,.split { grid-template-columns:1fr; }
  .landing { gap:1.2rem; }
  .stage { min-height:215px; }
  .gallery { grid-template-columns:repeat(auto-fill,minmax(min(100%,135px),1fr)); }
}
@media(max-width:520px) {
  .mast { align-items:flex-start; gap:.6rem; }
  .mast nav { width:100%; }
  .mast nav:empty { display:none; }
  .brand { font-size:25px; }
  .brand-mark { width:25px; height:25px; }
  .page-head { align-items:flex-start; flex-direction:column; }
  .filters { grid-template-columns:1fr 1fr; }
  main { padding-left:14px; padding-right:14px; }
  footer { font-size:.8rem; }
}
.face-thumb { display:block; position:relative; width:100%; aspect-ratio:1; overflow:hidden; background:var(--soft); }
.asset-choice .face-thumb img,.face-thumb img { display:block; height:100%; width:100%; object-fit:cover; }
.source-face { width:85px; }
.manual-compare { display:grid; grid-template-columns:repeat(2,minmax(0,13rem)); gap:1rem; }
.duplicate-images img { width:100%; max-height:38vh; object-fit:contain; background:var(--soft); }
.candidate-row { display:grid; grid-template-columns:minmax(65px,95px) 1fr; gap:1rem; padding:.7rem 0; border-bottom:1px solid var(--line); align-items:center; }
.event-index { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr)); gap:.8rem; }
.event-card { display:grid; align-content:start; gap:.45rem; padding:1.1rem 1.2rem; border:1px solid var(--line); border-top:2px solid var(--dark); text-decoration:none; }
.event-card:hover { background:var(--soft); }
.event-date { font-family:"IBM Plex Mono",ui-monospace,monospace; font-size:.88rem; color:var(--muted); }
.crumbs { margin-bottom:1.15rem; gap:.48rem; color:var(--muted); font-size:.9rem; }
.crumbs a { text-decoration:underline; padding:0; }
.crumbs>*+*::before { content:"／"; margin-right:.48rem; color:#838a8d; }
.album-links { margin:0 0 1.15rem; }
.photographer-group { display:grid; gap:.65rem; padding:1rem 0; border-top:1px solid var(--line); }
.photographer-group h2 { font-size:1.3rem; }
.album-index { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,190px),1fr)); gap:.85rem; }
.album-card { display:grid; align-content:start; gap:.38rem; padding:.77rem; border:1px solid var(--line); text-decoration:none; }
.album-card:hover { background:var(--soft); border-color:#899a9e; }
.album-cover { display:block; background:var(--soft); }
.album-cover img { width:100%; aspect-ratio:3 / 2; object-fit:cover; }
.pagination { justify-content:center; gap:1rem; margin:1rem 0; }
.mast .own-studio { border:1px solid var(--ink); border-radius:4px; padding:.3rem .7rem; }
.event-governance .table-wrap { max-height:34rem; overflow:auto; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.job-list { display:grid; gap:.75rem; }
.job-card { display:grid; gap:.5rem; padding:1rem; border:1px solid var(--line); min-width:0; }
.job-head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.55rem 1rem; }
.job-head h2,.job-head h3 { margin:0; }
.job-card[data-state=done] .job-head>strong,.job-card[data-state=complete] .job-head>strong,.complete-state { color:#2b6343; }
.job-card[data-state=failed] .job-head>strong,.job-card[data-state=stale] .job-head>strong { color:#873b36; }
.job-card[data-state=waiting_config] .job-head>strong { color:#81580d; }
.stage-meter { display:grid; grid-template-columns:minmax(8rem,auto) minmax(4rem,1fr) auto; align-items:center; gap:.55rem .8rem; }
.stage-label-text { font-weight:600; }
.stage-meter progress { display:block; width:100%; max-width:32rem; height:.9rem; accent-color:#396761; }
.status-delay { color:#81580d; font-size:.88rem; }
.live-toolbar { align-items:center; }
.training-panel .summary h3,.training-panel .summary p { margin:0; }
.training-message:empty { display:none; }
.training-counts { display:grid; gap:.6rem; grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr)); }
.training-counts>div { display:flex; flex-direction:column; padding:.65rem .8rem; background:var(--soft); }
.training-counts strong { font-size:1.3rem; font-variant-numeric:tabular-nums; }
.training-counts span { color:var(--muted); font-size:.88rem; }
.model-evidence { min-width:0; }
.model-evidence h4 { margin:.5rem 0 0; }
@media(max-width:600px) {
  .stage-meter { grid-template-columns:minmax(0,1fr) auto; }
  .stage-label-text { grid-column:1/-1; }
  .live-toolbar { width:100%; }
  .training-panel .button.primary { width:100%; }
}
