:root {
  --blue: #256fdd;
  --blue-dark: #1558b8;
  --blue-soft: #eaf2ff;
  --navy: #101b2d;
  --ink: #172235;
  --muted: #6d7b91;
  --line: #dfe6f0;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --green: #19a560;
  --red: #e04c5b;
  --amber: #f2a324;
  --shadow: 0 16px 42px rgba(39, 61, 91, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  padding: 25px 18px 20px;
  background: #fff;
  border-right: 1px solid var(--line);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; padding: 0 8px 26px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #347fea, #1555b0); box-shadow: 0 8px 18px rgba(37,111,221,.26); }
.brand-mark svg { width: 24px; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.3px; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
.nav-label { margin: 8px 12px; color: #98a4b5; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
.side-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #637188; display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; text-align: left; font-size: 13px; font-weight: 600; cursor: pointer; }
.nav-item svg { width: 19px; }
.nav-item:hover { background: #f4f7fb; color: var(--ink); }
.nav-item.active { background: var(--blue-soft); color: var(--blue); }
.sidebar-spacer { flex: 1; }
.model-status { border: 1px solid #dce6f3; border-radius: 14px; padding: 13px; background: #f9fbfe; }
.status-top { display: flex; align-items: center; gap: 10px; }
.status-orb { width: 28px; height: 28px; border-radius: 50%; background: #e8f8f0; display: grid; place-items: center; }
.status-orb i { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(242,163,36,.13); }
.model-status.ready .status-orb i { background: var(--green); box-shadow: 0 0 0 4px rgba(25,165,96,.13); }
.status-top strong { display: block; font-size: 12px; }
.status-top small { color: var(--muted); font-size: 10px; }
.status-meter { height: 4px; background: #e6ebf2; border-radius: 10px; margin-top: 13px; overflow: hidden; }
.status-meter span { display: block; width: 35%; height: 100%; background: var(--amber); transition: .4s ease; }
.model-status.ready .status-meter span { width: 100%; background: var(--green); }
.model-status p { margin: 7px 0 0; color: #7c899b; font-size: 9px; }

.main-content { width: calc(100% - 248px); margin-left: 248px; min-width: 0; padding: 0 30px 24px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.eyebrow, .section-kicker { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.topbar h1 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.5px; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.secure-pill { display: flex; gap: 6px; align-items: center; color: #617086; font-size: 11px; }
.secure-pill svg { width: 15px; color: var(--green); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #dfeaff; color: #1c5ab1; font-size: 11px; font-weight: 800; }

.flow-card { margin: 28px auto 18px; max-width: 1400px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; display: grid; grid-template-columns: minmax(280px, .85fr) minmax(560px, 1.35fr); gap: 36px; align-items: center; box-shadow: 0 8px 30px rgba(37,55,84,.035); }
.flow-copy h2 { margin: 6px 0 7px; font-size: 23px; letter-spacing: -.7px; line-height: 1.2; }
.flow-copy p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.process-flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.process-flow::before { content: ""; position: absolute; left: 8%; right: 8%; top: 16px; height: 1px; background: #dce5f1; }
.process-flow li { text-align: center; position: relative; }
.process-flow li > span { position: relative; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center; margin: 0 auto 9px; border-radius: 50%; border: 1px solid #cbd6e5; background: #fff; color: #8795a7; font-size: 11px; font-weight: 800; }
.process-flow li.active > span { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 5px var(--blue-soft); }
.process-flow strong { display: block; font-size: 11px; }
.process-flow small { display: block; color: #8b97a9; font-size: 9px; margin-top: 3px; }

.workspace-grid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: minmax(580px, 1.35fr) minmax(330px, .65fr); gap: 18px; align-items: start; }
.inspection-card, .analysis-card, .processing-card, .result-banner, .metric-grid article, .evidence-card, .severity-card, .findings-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.inspection-card { padding: 22px; }
.card-heading, .result-card-header { display: flex; align-items: center; gap: 11px; }
.heading-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.heading-icon svg { width: 21px; }
.heading-icon.blue { background: var(--blue-soft); color: var(--blue); }
.card-heading span:first-child, .result-card-header span { display: block; color: #8a96a7; font-size: 9px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.card-heading h3, .result-card-header h3 { margin: 2px 0 0; font-size: 15px; letter-spacing: -.2px; }
.required-note { margin-left: auto; color: #9aa5b4 !important; font-size: 9px !important; text-transform: none !important; letter-spacing: 0 !important; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-top: 20px; }
.field > span, .field-title { display: block; margin: 0 0 6px 2px; color: #55647a; font-size: 10px; font-weight: 700; }
.field-title b { color: var(--red); }
.field input, .field select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #dce3ed; border-radius: 9px; outline: none; background: #fff; color: var(--ink); font-size: 11px; transition: border .15s, box-shadow .15s; }
.field input::placeholder { color: #aab3c0; }
.field input:focus, .field select:focus { border-color: #6ea1e9; box-shadow: 0 0 0 3px rgba(37,111,221,.09); }
.upload-label-row { display: flex; justify-content: space-between; align-items: end; margin: 20px 0 8px; }
.upload-label-row small { color: #909baa; font-size: 9px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 10px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.text-button svg { width: 14px; }
.drop-zone { min-height: 142px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 22px; border: 1.5px dashed #9fbce4; border-radius: 13px; background: #f8fbff; cursor: pointer; outline: none; transition: .2s ease; }
.drop-zone:hover, .drop-zone:focus, .drop-zone.dragover { background: #f0f6ff; border-color: var(--blue); transform: translateY(-1px); }
.upload-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: var(--blue); background: #e5f0ff; }
.upload-icon svg { width: 25px; }
.drop-zone strong { display: block; font-size: 12px; }
.drop-zone p { margin: 6px 0 4px; color: #7c899b; font-size: 10px; }
.drop-zone p button { border: 0; background: transparent; padding: 0; color: var(--blue); font-weight: 700; cursor: pointer; }
.drop-zone small { color: #9ba6b5; font-size: 8.5px; }
.file-queue { display: grid; gap: 7px; margin-top: 10px; }
.file-row { min-height: 51px; display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; border: 1px solid #e0e6ee; padding: 6px 9px 6px 6px; border-radius: 10px; background: #fff; }
.file-thumb { width: 42px; height: 38px; border-radius: 7px; object-fit: cover; background: #e9eef5; }
.video-thumb { width: 42px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: #152a47; color: #fff; }
.video-thumb svg { width: 19px; }
.file-meta strong { display: block; font-size: 10px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { color: #8d98a8; font-size: 8.5px; }
.remove-file { width: 28px; height: 28px; border: 0; border-radius: 7px; background: #f5f7fa; color: #8190a3; display: grid; place-items: center; cursor: pointer; }
.remove-file:hover { color: var(--red); background: #fff0f2; }
.remove-file svg { width: 14px; }
.advanced-options { margin-top: 12px; border: 1px solid #e0e6ee; border-radius: 10px; }
.advanced-options summary { height: 42px; padding: 0 12px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.advanced-options summary::-webkit-details-marker { display: none; }
.advanced-options summary span { display: flex; gap: 7px; align-items: center; font-size: 10px; font-weight: 700; }
.advanced-options summary svg { width: 15px; color: var(--blue); }
.advanced-options summary small { color: #93a0b0; font-size: 8.5px; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 0 12px 12px; }
.form-footer { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 17px; padding-top: 16px; border-top: 1px solid #edf0f4; }
.primary-button, .secondary-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 9px; border: 1px solid transparent; text-decoration: none; font-size: 10px; font-weight: 800; cursor: pointer; transition: .18s ease; }
.primary-button { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(37,111,221,.2); }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.primary-button svg, .secondary-button svg { width: 15px; }
.secondary-button { color: #4d5d73; background: #fff; border-color: #d8e0eb; }

.analysis-card { overflow: hidden; }
.analysis-visual { height: 205px; position: relative; overflow: hidden; display: grid; place-items: center; color: #7fa9e8; background: radial-gradient(circle at 50% 58%, #e7f1ff 0, #f6faff 54%, #edf5ff 100%); }
.scan-grid { position: absolute; inset: 0; opacity: .4; background-image: linear-gradient(rgba(63,119,199,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(63,119,199,.1) 1px, transparent 1px); background-size: 25px 25px; perspective: 300px; transform: scale(1.25) rotateX(55deg); transform-origin: 50% 100%; }
.car-line { width: 78%; position: relative; z-index: 2; filter: drop-shadow(0 8px 10px rgba(33,81,151,.09)); stroke-width: 1.6; }
.scan-beam { position: absolute; z-index: 3; top: 0; bottom: 0; width: 3px; background: var(--blue); box-shadow: 0 0 17px 5px rgba(37,111,221,.25); animation: scan 3.8s ease-in-out infinite; }
@keyframes scan { 0%, 100% { left: 18%; opacity: .35; } 50% { left: 80%; opacity: 1; } }
.target { position: absolute; z-index: 4; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; background: var(--green); box-shadow: 0 0 0 4px rgba(25,165,96,.18); }
.t1 { left: 31%; top: 57%; }.t2 { left: 58%; top: 39%; }.t3 { left: 71%; top: 59%; }
.analysis-content { padding: 20px; }
.analysis-content h3 { margin: 5px 0 6px; font-size: 17px; }
.analysis-content > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.pipeline-list { list-style: none; padding: 0; margin: 17px 0 0; display: grid; }
.pipeline-list li { display: grid; grid-template-columns: 29px 1fr; gap: 9px; padding: 10px 0; border-top: 1px solid #edf1f5; }
.pipeline-list li > span { color: var(--blue); font-size: 9px; font-weight: 800; }
.pipeline-list strong { font-size: 10.5px; }
.pipeline-list small { display: block; margin-top: 3px; color: #8692a3; font-size: 8.5px; line-height: 1.45; }

.hidden { display: none !important; }
.processing-card { max-width: 1400px; margin: 18px auto 0; padding: 21px 24px; }
.processing-main { display: flex; align-items: center; gap: 15px; }
.processing-main h3 { margin: 4px 0; font-size: 15px; }
.processing-main p { margin: 0; color: var(--muted); font-size: 9.5px; }
.radar { width: 45px; height: 45px; position: relative; border: 1px solid #b9d3fa; background: #eff6ff; border-radius: 50%; display: grid; place-items: center; overflow: hidden; }
.radar span { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.radar i { position: absolute; width: 50%; height: 1px; left: 50%; transform-origin: left; background: var(--blue); animation: radar 1.4s linear infinite; }
@keyframes radar { to { transform: rotate(360deg); } }
.progress-track { height: 6px; margin: 18px 0 13px; background: #e7edf5; border-radius: 10px; overflow: hidden; }
.progress-track span { height: 100%; width: 8%; display: block; border-radius: 10px; background: linear-gradient(90deg, var(--blue), #69a5fa); transition: width .7s ease; }
.processing-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); color: #9aa5b4; font-size: 9px; }
.processing-steps li { display: flex; align-items: center; gap: 6px; }
.processing-steps i { width: 7px; height: 7px; border-radius: 50%; background: #cdd5e1; }
.processing-steps li.active { color: var(--blue); font-weight: 700; }.processing-steps li.active i { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.results { max-width: 1400px; margin: 18px auto 0; }
.result-banner { padding: 19px 22px; display: flex; align-items: center; gap: 14px; border-color: #cce7d9; background: linear-gradient(90deg, #f5fcf8, #fff 65%); }
.complete-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #dff5e9; color: var(--green); }
.complete-icon svg { width: 22px; stroke-width: 2.4; }
.result-banner h2 { margin: 3px 0; font-size: 18px; }
.result-banner p { margin: 0; color: var(--muted); font-size: 9.5px; }
.report-actions { margin-left: auto; display: flex; gap: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 13px; }
.metric-grid article { padding: 15px; display: flex; gap: 11px; align-items: center; box-shadow: 0 8px 24px rgba(39,61,91,.05); }
.metric-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.metric-icon svg { width: 20px; }
.metric-icon.red { background: #fff0f2; color: var(--red); }.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }.metric-icon.amber { background: #fff6e7; color: var(--amber); }.metric-icon.green { background: #eaf8f1; color: var(--green); }
.metric-grid small { display: block; color: #77859a; font-size: 8.5px; }
.metric-grid strong { display: block; margin-top: 1px; font-size: 21px; letter-spacing: -.5px; }
.metric-grid strong.text-metric { font-size: 13px; margin: 5px 0 4px; }
.metric-grid em { display: block; color: #9ca6b4; font-size: 7.5px; font-style: normal; }
.result-grid { display: grid; grid-template-columns: 1.55fr .75fr; gap: 13px; margin-top: 13px; }
.evidence-card, .severity-card, .findings-card { padding: 18px; }
.result-card-header { justify-content: space-between; }
.evidence-actions { display: flex; align-items: center; gap: 7px; }
.view-toggle { border: 1px solid #dce3ed; background: #fff; height: 30px; border-radius: 8px; color: #66758a; padding: 0 10px; font-size: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.view-toggle span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; background: var(--blue); }
.view-toggle svg { width: 13px; }
.evidence-stage { margin-top: 13px; border-radius: 11px; overflow: hidden; background: #0e1725; display: flex; flex-direction: column; align-items: stretch; }
.evidence-stage img { width: 100%; height: auto; max-height: min(72vh, 760px); display: block; object-fit: contain; background: #0e1725; }
.evidence-caption { position: static; display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; background: #172235; border-top: 1px solid rgba(255,255,255,.12); color: #fff; font-size: 8.5px; }
.evidence-caption strong { color: #a8ceff; flex: 0 0 auto; }
.evidence-strip { display: flex; gap: 7px; margin-top: 8px; overflow-x: auto; padding-bottom: 3px; }
.evidence-thumb { position: relative; flex: 0 0 74px; height: 51px; border-radius: 7px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #eef1f5; cursor: pointer; }
.evidence-thumb.active { border-color: var(--blue); }
.evidence-thumb img { width: 100%; height: 100%; object-fit: cover; }
.evidence-thumb small { position: absolute; right: 2px; bottom: 2px; color: #fff; background: rgba(0,0,0,.6); padding: 1px 3px; border-radius: 3px; font-size: 6px; }
.severity-ring-row { display: flex; gap: 20px; align-items: center; padding: 27px 4px 22px; }
.severity-ring { width: 118px; height: 118px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#dce4ef 0 100%); position: relative; }
.severity-ring::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #fff; }
.severity-ring > div { position: relative; z-index: 1; text-align: center; }
.severity-ring strong { display: block; font-size: 25px; }.severity-ring small { color: #8996a8; font-size: 8px; }
.severity-legend { width: 100%; display: grid; gap: 10px; }
.legend-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; font-size: 9px; color: #67758a; }
.legend-row i { width: 8px; height: 8px; border-radius: 3px; }.legend-row strong { color: var(--ink); }
.recommendation-box { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: #fff8eb; border: 1px solid #fae1b7; }
.recommendation-box > span { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; color: #b8750d; background: #ffedca; }
.recommendation-box svg { width: 17px; }
.recommendation-box strong { display: block; color: #7e5516; font-size: 9.5px; }
.recommendation-box p { margin: 3px 0 0; color: #977343; font-size: 8px; line-height: 1.4; }
.findings-card { margin-top: 13px; }
.table-search { width: 190px; height: 32px; padding: 0 10px; border: 1px solid #dce3ed; border-radius: 8px; display: flex; align-items: center; gap: 6px; }
.table-search svg { width: 14px; color: #8592a3; }
.table-search input { width: 100%; border: 0; outline: none; font-size: 9px; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 9px; }
th { padding: 9px 10px; text-align: left; color: #7f8c9e; background: #f6f8fb; font-size: 7.5px; letter-spacing: .5px; text-transform: uppercase; }
td { padding: 11px 10px; border-bottom: 1px solid #edf0f4; color: #4f5d72; }
td strong { color: var(--ink); }
.severity-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 20px; font-weight: 700; font-size: 7.5px; }
.severity-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.severity-badge.light { color: #188c55; background: #e8f7ef; }.severity-badge.medium { color: #b3740e; background: #fff4de; }.severity-badge.heavy { color: #d06824; background: #fff0e7; }.severity-badge.critical { color: #ca3444; background: #ffeaed; }
.coverage-bar { width: 70px; height: 4px; margin-top: 3px; border-radius: 4px; background: #e9edf3; overflow: hidden; }.coverage-bar span { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.no-findings { text-align: center; padding: 32px; }.no-findings span { width: 38px; height: 38px; margin: auto; display: grid; place-items: center; border-radius: 50%; background: #e7f7ef; color: var(--green); font-weight: 900; }.no-findings strong { display: block; margin-top: 9px; font-size: 12px; }.no-findings p { color: var(--muted); font-size: 9px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 360px; padding: 12px 15px; background: #142034; color: #fff; border-radius: 10px; box-shadow: 0 15px 35px rgba(0,0,0,.2); font-size: 10px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: none; }.toast.error { background: #a62d3b; }

.media-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(10, 22, 39, .58); backdrop-filter: blur(4px); cursor: default; }
.media-library { position: relative; z-index: 1; width: min(900px, 100%); max-height: min(760px, calc(100vh - 48px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.3); border-radius: 18px; background: #fff; box-shadow: 0 30px 90px rgba(7,21,41,.3); }
.library-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.library-header h2 { margin: 4px 0; font-size: 20px; letter-spacing: -.5px; }
.library-header p { margin: 0; color: var(--muted); font-size: 9px; }
.library-header code { padding: 2px 5px; border-radius: 4px; background: #eef3f9; color: #465a75; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 9px; background: #f3f6fa; color: #738198; cursor: pointer; }
.modal-close:hover { color: var(--red); background: #fff0f2; }
.modal-close svg { width: 17px; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 24px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.library-toolbar p { margin: 0; }
.library-toolbar strong { display: block; font-size: 10px; }
.library-toolbar span { color: var(--muted); font-size: 8.5px; }
.library-grid { min-height: 260px; padding: 18px 24px; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-content: start; }
.library-loading, .library-empty { grid-column: 1 / -1; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 10px; }
.library-loading i { width: 24px; height: 24px; border: 2px solid #dbe5f2; border-top-color: var(--blue); border-radius: 50%; animation: radar 1s linear infinite; }
.library-item { position: relative; overflow: hidden; border: 2px solid transparent; border-radius: 11px; background: #f3f6fa; cursor: pointer; transition: .17s ease; }
.library-item:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(35,62,98,.12); }
.library-item.selected { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.library-item input { position: absolute; opacity: 0; pointer-events: none; }
.library-item img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; }
.library-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 8px; background: #fff; }
.library-item-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8.5px; }
.library-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: rgba(18,31,49,.55); color: transparent; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.library-item.selected .library-check { background: var(--blue); color: #fff; }
.library-check svg { width: 13px; stroke-width: 2.5; }
.library-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 24px; border-top: 1px solid var(--line); background: #fff; }
.library-footer > div { display: flex; align-items: center; gap: 13px; }
.library-footer > div > span { color: var(--muted); font-size: 9px; }
.evidence-modal { position: fixed; inset: 0; z-index: 230; display: grid; place-items: center; padding: 18px; }
.evidence-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(6,14,26,.82); backdrop-filter: blur(5px); }
.expanded-evidence { position: relative; z-index: 1; width: min(1500px, 100%); height: min(930px, calc(100vh - 36px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: #0b1422; box-shadow: 0 30px 100px rgba(0,0,0,.5); }
.expanded-evidence header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.expanded-evidence header h2 { margin: 3px 0; font-size: 17px; }
.expanded-evidence header p { margin: 0; color: var(--muted); font-size: 9px; }
.expanded-evidence header > div:last-child { display: flex; align-items: center; gap: 8px; }
.expanded-image-wrap { min-height: 0; flex: 1; display: grid; place-items: center; padding: 12px; overflow: auto; }
.expanded-image-wrap img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

@media (max-width: 1100px) {
  .sidebar { width: 210px; }.main-content { width: calc(100% - 210px); margin-left: 210px; padding-inline: 20px; }
  .flow-card { grid-template-columns: 1fr; gap: 20px; }
  .workspace-grid { grid-template-columns: 1fr; }.analysis-card { display: grid; grid-template-columns: .9fr 1.1fr; }.analysis-visual { height: 100%; min-height: 350px; }
  .result-grid { grid-template-columns: 1fr; }.metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; height: 68px; padding: 12px 16px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }.brand small, .side-nav, .model-status, .sidebar-spacer { display: none; }
  .app-shell { display: block; }.main-content { width: 100%; margin: 0; padding: 0 13px 20px; }
  .topbar { height: 66px; }.secure-pill { display: none; }
  .flow-card { margin-top: 14px; padding: 18px; }.flow-copy h2 { font-size: 20px; }.process-flow small { display: none; }
  .workspace-grid { display: block; }.inspection-card { padding: 17px; }.analysis-card { display: block; margin-top: 13px; }
  .field-grid, .advanced-grid { grid-template-columns: 1fr; }
  .drop-zone { text-align: center; flex-direction: column; }.form-footer { align-items: stretch; flex-direction: column; }.form-footer .primary-button { width: 100%; }
  .result-banner { align-items: flex-start; flex-wrap: wrap; }.report-actions { width: 100%; margin: 5px 0 0; }.report-actions a { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .severity-ring-row { justify-content: center; }.processing-steps { grid-template-columns: 1fr 1fr; gap: 8px; }
  .required-note { display: none !important; }
  .media-modal { padding: 10px; }.media-library { max-height: calc(100vh - 20px); }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .library-header, .library-footer { padding: 14px; }.library-toolbar { padding: 11px 14px; }
  .library-footer { align-items: stretch; flex-direction: column; }.library-footer > div { justify-content: space-between; }
  .evidence-actions { align-items: stretch; flex-direction: column; }.evidence-actions .view-toggle { justify-content: center; }
  .evidence-modal { padding: 6px; }.expanded-evidence { height: calc(100vh - 12px); }
  .expanded-evidence header { align-items: flex-start; padding: 11px; }.expanded-evidence header .secondary-button { display: none; }
}
@media (max-width: 430px) {
  .flow-card, .workspace-grid, .inspection-card, .analysis-card { width: 100%; min-width: 0; }
  .flow-copy h2 { overflow-wrap: anywhere; }
  .process-flow { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
  .process-flow::before { display: none; }
  .metric-grid { grid-template-columns: 1fr; }.upload-label-row { align-items: flex-start; gap: 8px; flex-direction: column; }
}
