:root {
  --ink: #172230;
  --muted: #697586;
  --subtle: #98a2b3;
  --line: #e6e9ee;
  --panel: #ffffff;
  --canvas: #f4f5f7;
  --nav: #13221f;
  --nav-soft: #1b302c;
  --accent: #ed7b53;
  --accent-dark: #d85e36;
  --accent-soft: #fff0e9;
  --teal: #2b8171;
  --teal-soft: #e6f4f0;
  --amber: #c7842a;
  --amber-soft: #fff6e6;
  --red: #c94c4c;
  --red-soft: #fff0f0;
  --blue: #416d9d;
  --blue-soft: #edf4fb;
  --shadow: 0 1px 2px rgba(18, 30, 28, .04), 0 10px 30px rgba(18, 30, 28, .06);
  --radius: 14px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 228px; z-index: 20; display: flex; flex-direction: column; padding: 24px 14px 16px; color: #d7e1de; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 11px; height: 50px; padding: 0 10px; color: white; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #f2936e, #d85e36); box-shadow: 0 8px 20px rgba(227, 105, 65, .22); }
.brand-mark svg { width: 23px; stroke-width: 1.4; }
.brand strong { display: block; font-size: 18px; letter-spacing: .08em; }
.brand small { display: block; margin-top: 1px; color: #7f9a94; font-size: 9px; letter-spacing: .11em; text-transform: uppercase; }

.main-nav { display: grid; gap: 6px; margin-top: 34px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px; border: 0; border-radius: 11px; color: #9db0ac; background: transparent; cursor: pointer; text-align: left; transition: .18s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.045); }
.nav-item.is-active { color: white; background: var(--nav-soft); box-shadow: inset 3px 0 var(--accent); }
.nav-icon { display: grid; place-items: center; width: 22px; }
.nav-icon svg { width: 20px; height: 20px; }
.nav-item > span:nth-child(2) { flex: 1; font-size: 13px; font-weight: 600; }
.nav-item b { min-width: 22px; height: 21px; padding: 0 6px; border-radius: 10px; color: #b9cac6; background: rgba(255,255,255,.07); font-size: 10px; line-height: 21px; text-align: center; }
.nav-item .warning-count { color: #ffd5c7; background: rgba(237, 123, 83, .18); }

.sidebar-bottom { margin-top: auto; }
.pipeline-status { display: flex; align-items: center; gap: 10px; margin: 0 7px 12px; padding: 12px 10px; border: 1px solid rgba(255,255,255,.06); border-radius: 10px; background: rgba(255,255,255,.025); }
.status-orb { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #62c5a5; box-shadow: 0 0 0 4px rgba(98,197,165,.1); }
.pipeline-status strong, .pipeline-status small { display: block; }
.pipeline-status strong { color: #cad7d4; font-size: 10px; }
.pipeline-status small { margin-top: 3px; color: #6f8b85; font-size: 9px; }
.user-card { display: flex; align-items: center; gap: 9px; width: 100%; padding: 12px 9px; border: 0; border-top: 1px solid rgba(255,255,255,.07); color: #d7e1de; background: transparent; text-align: left; cursor: pointer; }
.avatar { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; color: #15322d; background: #bad8d0; font-weight: 800; }
.user-card > span:nth-child(2) { min-width: 0; flex: 1; }
.user-card strong, .user-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card strong { font-size: 11px; }
.user-card small { margin-top: 3px; color: #728b85; font-size: 9px; }
.more { color: #68817b; font-size: 14px; }

.main-area { min-width: 0; grid-column: 2; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(250, 250, 250, .92); backdrop-filter: blur(12px); }
.project-switcher .eyebrow { display: block; margin-bottom: 2px; color: var(--subtle); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.project-switcher button { display: flex; align-items: center; gap: 7px; max-width: 390px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.project-switcher strong { overflow: hidden; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.project-switcher svg { width: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.global-search { display: flex; align-items: center; gap: 8px; width: 260px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.global-search svg { flex: 0 0 17px; width: 17px; color: var(--subtle); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.global-search kbd { padding: 2px 5px; border: 1px solid #e3e6eb; border-radius: 4px; color: var(--subtle); background: #f7f8f9; font-size: 8px; }
.icon-button { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; }
.icon-button svg { width: 17px; }
.icon-button i { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border: 1px solid white; border-radius: 50%; background: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; font-size: 11px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.button svg { width: 16px; }
.button.primary { color: white; background: var(--accent); box-shadow: 0 6px 14px rgba(237,123,83,.16); }
.button.primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.button.primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.secondary { border-color: var(--line); background: white; }
.button.secondary:hover { border-color: #cad0d8; background: #fafbfc; }
.button.ghost { color: var(--muted); background: transparent; }
.button.ghost:hover { background: #f4f5f7; }

.workspace { width: min(1500px, 100%); margin: 0 auto; padding: 30px 34px 50px; }
.view { display: none; animation: view-in .24s ease; }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.loading-state { display: grid; place-items: center; align-content: center; min-height: calc(100vh - 76px); color: var(--muted); }
.loader { width: 32px; height: 32px; border: 2px solid #e2e6e9; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; color: #1a2724; font-family: Georgia, "Songti SC", serif; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.page-heading p { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.section-kicker { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.section-kicker::before { content: ""; width: 18px; height: 1px; background: currentColor; }

.overview-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.5fr .8fr; min-height: 205px; margin-bottom: 18px; border-radius: 18px; color: white; background: linear-gradient(118deg, #162b27 0%, #1d3832 64%, #29483f 100%); box-shadow: 0 12px 30px rgba(19,34,31,.12); }
.overview-hero::after { content: ""; position: absolute; right: -45px; top: -85px; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 50px rgba(255,255,255,.025), 0 0 0 100px rgba(255,255,255,.018); }
.hero-copy { position: relative; z-index: 1; padding: 30px 34px; }
.hero-copy .label { color: #93aea7; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.hero-copy h2 { max-width: 610px; margin: 13px 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 500; line-height: 1.35; }
.hero-copy p { max-width: 620px; margin: 0; color: #9fb4af; font-size: 11px; line-height: 1.7; }
.hero-status { display: flex; align-items: center; gap: 8px; margin-top: 21px; font-size: 10px; }
.hero-status span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 20px; background: rgba(255,255,255,.08); }
.hero-status i { width: 6px; height: 6px; border-radius: 50%; background: #6bd2ad; }
.hero-progress { position: relative; z-index: 1; display: grid; place-items: center; padding: 24px; }
.progress-ring { position: relative; display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress), rgba(255,255,255,.09) 0); }
.progress-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #213c36; }
.progress-ring div { position: relative; text-align: center; }
.progress-ring strong { display: block; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.progress-ring small { color: #94aaa5; font-size: 9px; }

.demo-path { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.demo-path-intro h3 { margin: 0 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 18px; font-weight: 500; }
.demo-path-intro p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.demo-step-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.demo-step { display: grid; align-content: start; gap: 7px; min-height: 126px; padding: 13px; border: 1px solid #e9ecef; border-radius: 12px; background: #fbfcfc; cursor: pointer; text-align: left; transition: .18s ease; }
.demo-step:hover { border-color: #bad3ce; background: #f5fbf8; transform: translateY(-1px); }
.demo-step > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--teal); background: var(--teal-soft); font-family: Georgia, serif; font-size: 11px; }
.demo-step strong { font-size: 10px; }
.demo-step small { color: var(--subtle); font-size: 8px; line-height: 1.5; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.metric-card .metric-icon { position: absolute; right: 15px; top: 15px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--teal); background: var(--teal-soft); }
.metric-card:nth-child(4) .metric-icon { color: var(--amber); background: var(--amber-soft); }
.metric-card:nth-child(5) .metric-icon { color: var(--accent); background: var(--accent-soft); }
.metric-icon svg { width: 16px; }
.metric-card > span { color: var(--muted); font-size: 10px; }
.metric-card strong { display: block; margin: 9px 0 5px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.metric-card small { color: var(--subtle); font-size: 9px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .7fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 59px; padding: 0 20px; border-bottom: 1px solid #eef0f3; }
.panel-header h3 { margin: 0; font-size: 12px; }
.panel-header p { margin: 3px 0 0; color: var(--subtle); font-size: 9px; }
.text-link { border: 0; color: var(--teal); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.compact-table { width: 100%; border-collapse: collapse; }
.compact-table th { padding: 11px 18px; color: var(--subtle); background: #fafbfc; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.compact-table td { padding: 13px 18px; border-top: 1px solid #f0f2f4; font-size: 10px; }
.compact-table tbody tr { cursor: pointer; transition: .15s; }
.compact-table tbody tr:hover { background: #fbfbfa; }
.scene-heading { font-weight: 700; }
.table-sub { display: block; margin-top: 4px; color: var(--subtle); font-size: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 20px; color: var(--teal); background: var(--teal-soft); font-size: 8px; font-weight: 700; white-space: nowrap; }
.pill.warn { color: var(--amber); background: var(--amber-soft); }
.pill.danger { color: var(--red); background: var(--red-soft); }
.pill.neutral { color: var(--muted); background: #f1f3f5; }
.review-summary { padding: 8px 20px 18px; }
.review-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0f2f4; }
.review-row:last-child { border-bottom: 0; }
.review-type-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--amber); background: var(--amber-soft); font-size: 11px; font-weight: 800; }
.review-row strong, .review-row small { display: block; }
.review-row strong { font-size: 10px; }
.review-row small { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.review-row > b { font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.source-comparison { grid-column: 1 / -1; }
.document-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px; }
.document-card { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e9ecef; border-radius: 11px; background: #fafbfb; }
.file-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.file-icon.fdx { color: var(--teal); background: var(--teal-soft); }
.document-card strong, .document-card small { display: block; }
.document-card strong { overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.document-card small { margin-top: 5px; color: var(--subtle); font-size: 8px; }
.document-stats { display: flex; gap: 17px; }
.document-stats div { text-align: center; }
.document-stats b, .document-stats span { display: block; }
.document-stats b { font-family: Georgia, serif; font-size: 16px; font-weight: 500; }
.document-stats span { margin-top: 2px; color: var(--subtle); font-size: 7px; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.segmented { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.segmented button { min-height: 30px; padding: 0 11px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 9px; cursor: pointer; }
.segmented button.is-active { color: var(--ink); background: #f0f2f3; box-shadow: 0 1px 2px rgba(0,0,0,.05); font-weight: 700; }
.select-control, .filter-input { height: 37px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: white; font-size: 10px; }
.select-control { padding: 0 30px 0 11px; }
.filter-input { min-width: 220px; padding: 0 12px; }
.toolbar-spacer { flex: 1; }
.info-strip { margin: -2px 0 16px; padding: 12px 14px; border: 1px solid #f1dfc0; border-radius: 11px; color: #7c5b25; background: #fffaf0; font-size: 9px; line-height: 1.6; }
.info-strip strong { color: #5c4015; }

.structure-layout { display: grid; grid-template-columns: 180px minmax(320px, .8fr) minmax(350px, 1.2fr); min-height: 640px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.episode-column, .scene-column, .detail-column { min-width: 0; }
.episode-column, .scene-column { border-right: 1px solid var(--line); }
.column-title { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; height: 49px; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.column-title strong { font-size: 10px; }
.column-title span { color: var(--subtle); font-size: 8px; }
.episode-list, .scene-list { max-height: 650px; overflow: auto; padding: 7px; }
.episode-button, .scene-button { width: 100%; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; }
.episode-button { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; min-height: 48px; padding: 6px 8px; }
.episode-button:hover, .scene-button:hover { background: #f6f7f8; }
.episode-button.is-active, .scene-button.is-active { background: var(--accent-soft); }
.episode-num { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: var(--muted); background: #f1f3f4; font-family: Georgia, serif; font-size: 12px; }
.episode-button.is-active .episode-num { color: white; background: var(--accent); }
.episode-button strong, .episode-button small { display: block; }
.episode-button strong { font-size: 9px; }
.episode-button small { margin-top: 3px; color: var(--subtle); font-size: 7px; }
.episode-button > b { color: var(--subtle); font-size: 8px; font-weight: 600; }
.scene-button { display: block; min-height: 72px; margin-bottom: 5px; padding: 11px; }
.scene-button .scene-index { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--subtle); font-size: 7px; }
.scene-button strong { display: block; font-size: 10px; line-height: 1.45; }
.scene-meta { display: flex; gap: 7px; margin-top: 7px; color: var(--subtle); font-size: 7px; }
.detail-scroll { max-height: 650px; overflow: auto; }
.detail-section { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.detail-title h3 { margin: 0; font-size: 11px; }
.confidence { display: flex; align-items: center; gap: 5px; color: var(--teal); font-size: 8px; font-weight: 700; }
.confidence i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.form-field.full { grid-column: 1/-1; }
.form-field label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; }
.form-field input, .form-field select { width: 100%; height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fbfbfc; font-size: 9px; }
.form-field input:focus, .form-field select:focus { border-color: #90aaa4; box-shadow: 0 0 0 3px rgba(43,129,113,.08); }
.evidence-card { position: relative; padding: 13px 14px 13px 29px; border: 1px solid #e9ecee; border-radius: 10px; background: #fafbfa; }
.evidence-card::before { content: "“"; position: absolute; left: 11px; top: 6px; color: var(--accent); font-family: Georgia, serif; font-size: 25px; }
.evidence-card p { margin: 0; color: #44514e; font-family: Georgia, "Songti SC", serif; font-size: 10px; line-height: 1.7; }
.evidence-card small { display: block; margin-top: 8px; color: var(--subtle); font-size: 7px; }
.inline-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; }
.mini-button { min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 8px; font-weight: 700; cursor: pointer; }
.mini-button.primary { border-color: var(--teal); color: white; background: var(--teal); }
.mini-button.danger { border-color: #e6b5b5; color: var(--red); background: var(--red-soft); }
.mini-button:disabled, .decision-button:disabled, .segmented button:disabled, .select-control:disabled { opacity: .48; cursor: not-allowed; }

.asset-tabs { margin-bottom: 16px; }
.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.entity-card { position: relative; min-height: 145px; padding: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); cursor: pointer; transition: .18s ease; }
.entity-card:hover { border-color: #cfd6d8; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(18,30,28,.08); }
.entity-avatar { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 14px; border-radius: 12px; color: var(--teal); background: var(--teal-soft); font-family: Georgia, serif; font-size: 15px; }
.entity-card.asset .entity-avatar { color: var(--amber); background: var(--amber-soft); font-family: inherit; font-size: 10px; font-weight: 800; }
.entity-card.location .entity-avatar { color: var(--blue); background: var(--blue-soft); }
.entity-card h3 { margin: 0 0 5px; font-size: 12px; }
.entity-card p { margin: 0; color: var(--subtle); font-size: 8px; line-height: 1.5; }
.entity-stats { display: flex; gap: 16px; margin-top: 14px; padding-top: 11px; border-top: 1px solid #eff1f3; }
.entity-stats strong, .entity-stats span { display: block; }
.entity-stats strong { font-family: Georgia, serif; font-size: 14px; font-weight: 500; }
.entity-stats span { margin-top: 2px; color: var(--subtle); font-size: 7px; }
.entity-confidence { position: absolute; right: 13px; top: 13px; }

.review-toolbar { align-items: stretch; }
.review-bulk { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 16px; margin-bottom: 14px; padding: 15px 16px; }
.bulk-copy strong { display: block; margin-bottom: 5px; font-size: 11px; }
.bulk-copy p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.bulk-stats { display: grid; grid-template-columns: repeat(4, 62px); gap: 7px; }
.bulk-stats span { padding: 9px 8px; border: 1px solid #edf0f2; border-radius: 10px; background: #fbfcfc; text-align: center; }
.bulk-stats b, .bulk-stats small { display: block; }
.bulk-stats b { font-family: Georgia, serif; font-size: 16px; font-weight: 500; }
.bulk-stats small { margin-top: 3px; color: var(--subtle); font-size: 7px; }
.bulk-actions { display: flex; justify-content: flex-end; gap: 7px; }
.bulk-progress { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid #eff1f3; color: var(--muted); font-size: 8px; }
.bulk-progress > span { height: 7px; overflow: hidden; border-radius: 20px; background: #edf1f0; }
.bulk-progress > span::before { content: ""; display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--teal); transition: width .18s ease; }
.bulk-progress strong { color: var(--ink); font-size: 8px; }
.bulk-progress small { color: var(--subtle); }

.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.review-list { overflow: hidden; }
.review-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #eef0f2; }
.review-card:last-child { border-bottom: 0; }
.review-priority { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: var(--amber); background: var(--amber-soft); font-size: 10px; font-weight: 800; }
.review-card h3 { margin: 1px 0 5px; font-size: 10px; }
.review-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.review-card small { display: block; margin-top: 7px; color: var(--subtle); font-size: 7px; }
.decision-actions { display: flex; align-items: center; gap: 5px; }
.decision-button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; cursor: pointer; }
.decision-button:hover { color: var(--teal); border-color: #a7c2bc; background: var(--teal-soft); }
.decision-button.reject:hover { color: var(--red); border-color: #e6b5b5; background: var(--red-soft); }
.review-card.is-resolved { opacity: .52; background: #fafbfb; }
.review-card.is-resolved h3 { text-decoration: line-through; }
.review-guide { padding: 20px; }
.review-guide h3 { margin: 0 0 6px; font-family: Georgia, "Songti SC", serif; font-size: 17px; font-weight: 500; }
.review-guide > p { margin: 0 0 18px; color: var(--muted); font-size: 9px; line-height: 1.65; }
.guide-step { display: flex; gap: 11px; margin: 15px 0; }
.guide-step > span { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; color: white; background: var(--nav); font-family: Georgia, serif; font-size: 10px; }
.guide-step strong, .guide-step small { display: block; }
.guide-step strong { font-size: 9px; }
.guide-step small { margin-top: 4px; color: var(--subtle); font-size: 8px; line-height: 1.45; }

.export-hero { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: center; min-height: 200px; padding: 29px 33px; border-radius: 17px; color: white; background: linear-gradient(120deg, #172a26, #26483f); box-shadow: var(--shadow); }
.export-hero h2 { margin: 8px 0; font-family: Georgia, "Songti SC", serif; font-size: 24px; font-weight: 500; }
.export-hero p { max-width: 600px; color: #a1b4af; font-size: 10px; line-height: 1.7; }
.export-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 18px; }
.export-checks span { display: flex; align-items: center; gap: 6px; color: #bfd0cc; font-size: 8px; }
.export-checks span::before { content: "✓"; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; color: #17332d; background: #76c8ae; font-size: 8px; font-weight: 900; }
.export-actions { display: grid; gap: 10px; }
.export-download { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; color: white; background: rgba(255,255,255,.06); text-decoration: none; transition: .18s ease; }
.export-download:hover { background: rgba(255,255,255,.1); transform: translateX(2px); }
.export-download .format { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #17342e; background: #97d4c0; font-size: 9px; font-weight: 900; }
.export-download:last-child .format { color: #55301f; background: #f3aa85; }
.export-download strong, .export-download small { display: block; }
.export-download strong { font-size: 10px; }
.export-download small { margin-top: 4px; color: #91aaa4; font-size: 8px; }
.export-download > span:last-child { font-size: 18px; }
.original-export-links { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 2px 4px 0; color: #8ea8a2; font-size: 8px; }
.original-export-links a { color: #c3d4d0; text-underline-offset: 3px; }
.export-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.export-detail-card { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.export-detail-card h3 { margin: 0 0 8px; font-size: 11px; }
.export-detail-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.export-detail-card .detail-meta { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 8px; }
.sheet-guide { margin-top: 16px; overflow: hidden; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.sheet-card { min-height: 96px; padding: 14px; border: 1px solid #edf0f2; border-radius: 11px; background: #fbfcfc; }
.sheet-card strong { display: block; margin-bottom: 7px; font-size: 10px; }
.sheet-card p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.6; }

.empty-state { padding: 60px 20px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); }
.empty-actions { display: grid; grid-template-columns: repeat(2, max-content); justify-content: center; gap: 8px; margin-top: 16px; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(10, 20, 18, .54); backdrop-filter: blur(5px); }
.modal { position: relative; width: min(520px, 100%); padding: 29px; border-radius: 18px; background: white; box-shadow: 0 30px 80px rgba(10,20,18,.28); animation: modal-in .2s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; right: 17px; top: 14px; border: 0; color: var(--muted); background: transparent; font-size: 24px; cursor: pointer; }
.modal-kicker { color: var(--teal); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.modal h2 { margin: 7px 0; font-family: Georgia, "Songti SC", serif; font-size: 23px; font-weight: 500; }
.modal > p { margin: 0 0 18px; color: var(--muted); font-size: 9px; line-height: 1.65; }
.import-hints { display: grid; gap: 8px; margin: -6px 0 17px; }
.import-hints div { display: grid; grid-template-columns: 82px 1fr; gap: 9px; padding: 10px 11px; border: 1px solid #edf0f2; border-radius: 10px; background: #fbfcfc; }
.import-hints strong { color: var(--teal); font-size: 8px; }
.import-hints span { color: var(--muted); font-size: 8px; line-height: 1.45; }
.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; }
.text-input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; }
.text-input:focus { border-color: #88aaa2; box-shadow: 0 0 0 3px rgba(43,129,113,.08); }
.drop-zone { display: grid; place-items: center; min-height: 150px; margin-top: 13px; padding: 18px; border: 1px dashed #cdd5d3; border-radius: 12px; background: #fafcfb; cursor: pointer; text-align: center; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--teal); background: #f3faf7; }
.upload-icon { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 10px; border-radius: 11px; color: var(--teal); background: var(--teal-soft); }
.upload-icon svg { width: 19px; }
.drop-zone strong { font-size: 10px; }
.drop-zone small { margin-top: 6px; color: var(--subtle); font-size: 8px; }
.selected-files { display: grid; gap: 6px; margin-top: 9px; }
.selected-file { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: #f5f6f7; font-size: 8px; }
.selected-file.invalid { color: var(--red); background: var(--red-soft); }
.analysis-stage { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 10px; border-radius: 9px; color: var(--teal); background: var(--teal-soft); font-size: 8px; font-weight: 700; }
.analysis-stage span { width: 8px; height: 8px; border: 2px solid rgba(43,129,113,.22); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
.modal-note { margin: 12px 0; color: var(--subtle); font-size: 8px; }
.modal-note span { margin-right: 6px; padding: 3px 6px; border-radius: 10px; color: var(--teal); background: var(--teal-soft); font-weight: 800; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-actions .button { width: 100%; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 28px; min-width: 240px; padding: 11px 15px; border-radius: 10px; color: white; background: #172824; box-shadow: 0 12px 32px rgba(0,0,0,.22); font-size: 10px; text-align: center; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1160px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { width: 76px; padding-inline: 9px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:last-child, .nav-item > span:nth-child(2), .nav-item b, .pipeline-status div, .user-card > span:nth-child(2), .user-card .more { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .pipeline-status { justify-content: center; margin-inline: 4px; padding: 12px 0; }
  .user-card { justify-content: center; padding-inline: 0; }
  .main-area { grid-column: 2; }
  .global-search { width: 205px; }
  .demo-path { grid-template-columns: 1fr; }
  .demo-step-list { grid-template-columns: repeat(3, 1fr); }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .asset-grid { grid-template-columns: repeat(3, 1fr); }
  .review-bulk { grid-template-columns: 1fr; }
  .bulk-stats { grid-template-columns: repeat(4, 1fr); }
  .bulk-actions { justify-content: flex-start; }
  .structure-layout { grid-template-columns: 150px 280px minmax(330px, 1fr); }
}

@media (max-width: 860px) {
  .topbar { padding: 0 20px; }
  .global-search, .icon-button, .topbar .secondary { display: none; }
  .workspace { padding: 24px 20px 40px; }
  .overview-hero { grid-template-columns: 1fr; }
  .hero-progress { position: absolute; right: 20px; bottom: 13px; opacity: .2; }
  .overview-grid, .review-layout { grid-template-columns: 1fr; }
  .bulk-progress { grid-template-columns: 1fr; }
  .sheet-grid { grid-template-columns: repeat(2, 1fr); }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
  .structure-layout { grid-template-columns: 130px minmax(270px, .8fr) minmax(330px, 1fr); overflow-x: auto; }
  .export-hero { grid-template-columns: 1fr; }
  .export-details { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .app-shell { display: block; padding-bottom: 67px; }
  .sidebar { inset: auto 0 0; width: auto; height: 67px; padding: 6px 8px; border-top: 1px solid rgba(255,255,255,.08); }
  .brand, .sidebar-bottom { display: none; }
  .main-nav { grid-template-columns: repeat(5, 1fr); gap: 2px; margin: 0; }
  .nav-item { min-height: 54px; }
  .nav-icon svg { width: 18px; }
  .nav-item.is-active { box-shadow: inset 0 -2px var(--accent); }
  .main-area { width: 100%; }
  .topbar { height: 64px; padding: 0 14px; }
  .project-switcher strong { max-width: 175px; font-size: 13px; }
  .topbar .primary { width: 38px; padding: 0; }
  .topbar .primary svg { margin: 0; }
  .topbar .primary { font-size: 0; }
  .workspace { padding: 20px 13px 34px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 24px; }
  .overview-hero { min-height: 238px; }
  .hero-copy { padding: 25px 22px; }
  .hero-copy h2 { font-size: 21px; }
  .hero-progress { display: none; }
  .demo-step-list { grid-template-columns: 1fr; }
  .demo-step { min-height: auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card { min-height: 104px; }
  .document-cards { grid-template-columns: 1fr; }
  .document-card { grid-template-columns: 40px minmax(0,1fr); }
  .document-stats { grid-column: 1/-1; justify-content: space-around; padding-top: 10px; border-top: 1px solid var(--line); }
  .source-comparison { overflow: hidden; }
  .compact-table { min-width: 640px; }
  .panel:has(.compact-table) { overflow-x: auto; }
  .toolbar { flex-wrap: wrap; }
  .toolbar-spacer { display: none; }
  .filter-input { flex: 1; min-width: 160px; }
  .bulk-stats { grid-template-columns: repeat(2, 1fr); }
  .bulk-actions { flex-wrap: wrap; }
  .structure-layout { grid-template-columns: 105px 240px 330px; min-height: 570px; }
  .episode-list, .scene-list, .detail-scroll { max-height: 580px; }
  .asset-grid { grid-template-columns: 1fr; }
  .sheet-grid { grid-template-columns: 1fr; }
  .review-card { grid-template-columns: 31px 1fr; }
  .decision-actions { grid-column: 2; }
  .export-hero { padding: 24px 20px; }
  .export-checks { grid-template-columns: 1fr; }
  .empty-actions, .modal-actions { grid-template-columns: 1fr; }
  .modal { padding: 24px 18px 19px; }
}
