:root {
  --ink: #181714;
  --muted: #77736b;
  --line: #d9d5cd;
  --paper: #efede7;
  --card: rgba(253, 252, 249, .93);
  --accent: #292722;
  --gold: #9a7b4f;
  --green: #28664b;
  --orange: #9d5c25;
  --shadow: 0 24px 70px rgba(35, 31, 25, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 12% 4%, #faf9f5 0, var(--paper) 38%, #e9e6df 100%); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.topbar { height: 70px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(70, 63, 52, .12); position: sticky; top: 0; z-index: 20; background: rgba(244, 242, 236, .84); backdrop-filter: blur(22px); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 650; letter-spacing: .04em; }
.mark { width: 17px; height: 17px; border: 1.5px solid var(--ink); border-radius: 50%; position: relative; }
.mark::after { content: ""; position: absolute; inset: 4px; background: var(--gold); border-radius: 50%; }
.status { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.status i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px rgba(40, 102, 75, .11); }
main { width: min(1480px, 92vw); margin: auto; }
.hero { padding: 58px 0 36px; }
.hero h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 5.6vw, 84px); font-weight: 400; line-height: .98; letter-spacing: -.055em; }
.hero h1 em { color: var(--gold); font-weight: 400; }
.kicker { font-size: 9px; font-weight: 750; letter-spacing: .2em; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: rgba(255,255,255,.48); border-radius: 999px; padding: 5px; margin-bottom: 18px; }
.step { border: 0; background: transparent; padding: 11px 18px; display: flex; justify-content: center; gap: 10px; align-items: center; color: #aaa59c; border-radius: 999px; }
.step b { font-size: 9px; letter-spacing: .1em; }.step span { font-size: 12px; font-weight: 620; }
.step.active { color: var(--ink); background: rgba(255,255,255,.86); box-shadow: 0 8px 22px rgba(40,35,27,.07); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .72fr); gap: 18px; align-items: start; }
.canvas-card, .panel, .report { background: var(--card); border: 1px solid rgba(88, 78, 64, .15); border-radius: 20px; box-shadow: var(--shadow); }
.canvas-card { padding: 23px; }.panel { padding: 21px; }
.card-head, .panel-head, .report-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card-head h2, .panel-head h2 { margin: 5px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 400; }
.pill, .count { font-size: 10px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.6); }
.mode-toolbar { display: flex; justify-content: flex-end; margin: -5px 0 8px; }
.mode-control { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 5px; background: #eeece6; border-radius: 14px; margin-bottom: 14px; }
.mode-button { border: 0; background: transparent; border-radius: 10px; padding: 12px 14px; text-align: left; color: var(--muted); cursor: pointer; }
.mode-button b, .mode-button span { display: block; }.mode-button b { color: inherit; font-family: Georgia, serif; font-size: 15px; font-weight: 400; }.mode-button span { font-size: 10px; margin-top: 3px; }
.mode-button.active { background: #fff; color: var(--ink); box-shadow: 0 8px 24px rgba(42, 37, 29, .08); }
.new-session-button { -webkit-appearance: none; appearance: none; border: 0; background: #ece9e2; color: var(--ink); border-radius: 999px; padding: 9px 18px; font: 650 12px/1.2 ui-sans-serif, system-ui, sans-serif; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(88,78,64,.06); transition: .18s; }
.new-session-button:hover { background: #fff; box-shadow: 0 7px 20px rgba(42,37,29,.08), inset 0 0 0 1px rgba(88,78,64,.12); }
.dropzone { height: 500px; border: 1px dashed #bcb5aa; border-radius: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(235,232,224,.76)); cursor: pointer; transition: .2s; }
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: #f8f5ed; }.dropzone input { display: none; }.dropzone span { font-size: 11px; color: var(--muted); }.dropzone strong { font-family: Georgia, serif; font-weight: 400; font-size: 18px; }.upload-icon { font-size: 26px; color: var(--gold); margin-bottom: 7px; }
.source-strip { display: flex; gap: 9px; padding: 11px 0 3px; overflow-x: auto; }
.source-thumb { flex: 0 0 76px; height: 92px; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: #fff; position: relative; cursor: pointer; transition: .18s; }
.source-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }.source-thumb.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(154,123,79,.14); }.source-thumb.selected::after { content: "SELECTED"; position: absolute; left: 7px; bottom: 7px; background: rgba(24,23,20,.88); color: #fff; padding: 3px 5px; border-radius: 4px; font-size: 7px; letter-spacing: .08em; }
.visual-stage { height: 590px; position: relative; background: #e6e2da; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; }.visual-stage img { max-height: 100%; max-width: 100%; object-fit: contain; display: block; }.visual-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: auto; }
.mask-layer { position: absolute; pointer-events: none; }
.region-mask { position: absolute; inset: 0; background: rgba(198, 156, 91, .62); opacity: 0; transition: opacity .16s; -webkit-mask-image: var(--mask-url); mask-image: var(--mask-url); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-mode: luminance; mask-mode: luminance; }
.region-mask.hot { opacity: 1; }
.region-rect { fill: rgba(154,123,79,.06); stroke: rgba(154,123,79,0); stroke-width: 3; vector-effect: non-scaling-stroke; transition: .18s; pointer-events: all; }.region-rect:hover, .region-rect.hot { fill: rgba(154,123,79,.16); stroke: var(--gold); }
.hover-label { position: absolute; left: 16px; top: 16px; background: rgba(24,23,20,.92); color: #fff; border-radius: 7px; padding: 8px 10px; font-size: 11px; }
.canvas-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }.primary, .ghost { border: 0; border-radius: 999px; padding: 13px 21px; font-weight: 650; cursor: pointer; }.primary { background: var(--ink); color: #fff; }.primary:disabled { opacity: .28; cursor: not-allowed; }.ghost { background: #ece9e2; color: var(--ink); }
.inspector { display: grid; gap: 18px; }.progress { height: 3px; background: #e8e4dc; border-radius: 10px; overflow: hidden; }.progress span { height: 100%; display: block; background: var(--gold); width: 0; transition: .3s; }
.timeline { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 2px; max-height: 276px; overflow: auto; }.timeline li { position: relative; padding: 10px 9px 10px 34px; border-radius: 9px; }.timeline li::before { content: ""; position: absolute; left: 13px; top: 15px; width: 7px; height: 7px; border: 1.5px solid #b7b0a5; border-radius: 50%; }.timeline li.running { background: #f4f0e8; }.timeline li.running::before { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(154,123,79,.12); }.timeline li.complete::before { background: var(--green); border-color: var(--green); }.timeline strong { display: block; font-size: 12px; }.timeline small { display: block; color: var(--muted); line-height: 1.45; margin-top: 3px; }.muted { color: var(--muted); }
.selection-note { padding: 11px 12px; border-left: 2px solid var(--gold); background: #f5f1e8; color: #696258; font-size: 11px; line-height: 1.55; margin-bottom: 12px; }
.region-list { display: grid; gap: 7px; max-height: 370px; overflow: auto; }.region-card { padding: 11px; border: 1px solid var(--line); border-radius: 10px; cursor: default; transition: .15s; }.region-card:hover { border-color: var(--gold); transform: translateY(-1px); }.region-top { display: flex; justify-content: space-between; gap: 10px; }.region-card b { font-size: 12px; }.region-card span { font-size: 9px; text-transform: uppercase; color: var(--muted); }.region-card p, .empty { font-size: 10px; color: var(--muted); margin: 7px 0 0; line-height: 1.5; }
.result-stage { height: 590px; border-radius: 14px; background: linear-gradient(145deg,#d9d3c8,#ece8e0); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 4% 5%; overflow: hidden; }.tv { width: 100%; aspect-ratio: 16/9; padding: 5px; background: #151515; border-radius: 4px; box-shadow: 0 34px 76px rgba(0,0,0,.24); }.tv img { width: 100%; height: 100%; object-fit: cover; }
.candidate-tabs { display: flex; justify-content: center; gap: 8px; margin: 0 0 14px; }
.candidate-tab { border: 1px solid rgba(23,23,23,.18); border-radius: 999px; padding: 8px 18px; color: rgba(23,23,23,.64); background: rgba(255,255,255,.34); cursor: pointer; }
.candidate-tab.active { color: #f5f0e7; background: #171717; border-color: #171717; }
.candidate-tab.pending { cursor: wait; opacity: .46; border-style: dashed; }
.analysis-data { margin-top: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.66); box-shadow: var(--shadow); }
.analysis-data-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.analysis-data-head h2 { margin: 5px 0 0; font: 500 22px/1.2 var(--serif); }
.analysis-data-actions { display: flex; align-items: center; gap: 9px; }
.export-button { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 10px 16px; background: #171717; color: #f7f3ec; text-decoration: none; font-size: 13px; }
.download-result { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 999px; padding: 0 18px; background: #171717; color: #f7f3ec; text-decoration: none; font-size: 13px; }
.analysis-json { margin: 20px 0 0; max-height: 520px; overflow: auto; padding: 20px; border-radius: 14px; background: #111210; color: #d9d5cc; font: 12px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.report { margin: 18px 0 70px; padding: 24px; }.report-title-compact { justify-content: flex-end; }.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; border-top: 1px solid var(--line); padding-top: 20px; }.report h3 { font-family: Georgia, serif; font-weight: 400; font-size: 17px; }.report li { color: var(--muted); padding: 5px; line-height: 1.5; font-size: 12px; }.rules { display: grid; gap: 8px; }.rule { border: 1px solid var(--line); border-radius: 10px; padding: 11px; }.rule b { font-size: 11px; }.rule p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }.pass { color: var(--green); }.warn { color: var(--orange); }
.toast { position: fixed; right: 22px; bottom: 22px; background: #191816; color: #fff; padding: 13px 16px; border-radius: 9px; z-index: 30; }.hidden { display: none !important; }
@media(max-width: 960px) { .workspace { grid-template-columns: 1fr; }.dropzone, .visual-stage, .result-stage { height: 470px; }.report-grid { grid-template-columns: 1fr; }.hero { padding-top: 38px; } }
