/* SurveyLens design system
   Petrol ink + marigold signal. Bricolage Grotesque for display, Figtree for reading.
   Signature element: the HSRP-style number plate. */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,650;12..96,800&family=Figtree:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;600&display=swap');

:root {
  --petrol-950: #082A2D;
  --petrol-900: #0B3A3E;
  --petrol-700: #0E5E63;
  --petrol-500: #2A8086;
  --petrol-100: #D5E8E8;
  --petrol-50: #EBF4F4;
  --marigold: #F2A900;
  --marigold-600: #C98A00;
  --marigold-50: #FFF4D4;
  --ink: #13282C;
  --ink-2: #445A5F;
  --ink-3: #75898D;
  --line: #D9E2E3;
  --line-2: #E8EEEE;
  --bg: #F1F4F4;
  --surface: #FFFFFF;
  --red: #B9342A;
  --red-50: #FBEAE8;
  --green: #23805A;
  --green-50: #E3F3EB;
  --plate-blue: #1E4FB2;
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --body: 'Figtree', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-lg: 16px;
  --r-md: 10px;
  --r-sm: 7px;
  --shadow: 0 1px 2px rgba(8, 42, 45, 0.06), 0 8px 24px -12px rgba(8, 42, 45, 0.18);
  --focus: 0 0 0 3px rgba(242, 169, 0, 0.55);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -0.015em; font-weight: 650; }
h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 0.8em; }
a { color: var(--petrol-700); text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.num, td.n, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.lead { font-size: 16px; color: var(--ink-2); }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Layout helpers ---------- */
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 10px; } .gap-s { gap: 6px; } .gap-l { gap: 18px; }
.end { justify-content: flex-end; } .between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--petrol-900); color: #CFE3E3; padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand b { font: 800 20px/1 var(--display); letter-spacing: -0.02em; }
.rail a.nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: #BFD8D8; text-decoration: none; font-weight: 500; }
.rail a.nav svg { width: 19px; height: 19px; flex: none; opacity: 0.85; }
.rail a.nav:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.rail a.nav.on { background: rgba(242, 169, 0, 0.14); color: #fff; box-shadow: inset 3px 0 0 var(--marigold); }
.rail .rail-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; }
.rail .rail-foot b { color: #fff; display: block; font-weight: 600; }
.rail .rail-foot button { background: none; border: 0; color: #9FC2C2; padding: 0; margin-top: 6px; cursor: pointer; text-decoration: underline; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: rgba(241, 244, 244, 0.9); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.topbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--ink-3); }
.page { padding: 26px 28px 80px; max-width: 1320px; width: 100%; }
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { padding: 10px 14px; }
  .page { padding: 18px 14px 96px; }
  .mobile-bar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--petrol-900); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
  .mobile-bar a { color: #BFD8D8; text-decoration: none; font-size: 11px; display: grid; justify-items: center; gap: 2px; padding: 4px 0; }
  .mobile-bar a svg { width: 21px; height: 21px; }
  .mobile-bar a.on { color: var(--marigold); }
  .mobile-bar a.fab { color: var(--petrol-950); }
  .mobile-bar a.fab span:first-child { background: var(--marigold); border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; margin-top: -16px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 9px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.05s; }
.btn:hover { border-color: #B9C8CA; background: #FAFCFC; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--petrol-700); border-color: var(--petrol-700); color: #fff; }
.btn.primary:hover { background: var(--petrol-900); }
.btn.signal { background: var(--marigold); border-color: var(--marigold); color: var(--petrol-950); }
.btn.signal:hover { background: #E09D00; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(14, 94, 99, 0.07); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 11px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.block { width: 100%; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; position: relative; color: var(--ink-2); }
.icon-btn svg { width: 18px; }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--marigold); border: 2px solid #fff; }

/* ---------- Forms ---------- */
.fld { display: grid; gap: 5px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fld .req { color: var(--red); margin-left: 3px; font-weight: 700; }
.fld small { color: var(--ink-3); font-size: 12px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=month], input:not([type]), select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; min-height: 40px;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marigold); box-shadow: var(--focus); }
.fld.bad input, .fld.bad select { border-color: var(--red); background: var(--red-50); }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px rgba(242, 169, 0, 0.7); } 100% { box-shadow: 0 0 0 0 rgba(242, 169, 0, 0); } }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--petrol-700); margin-top: 2px; flex: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 999px; background: #C5D2D3; position: relative; cursor: pointer; transition: background 0.2s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked { background: var(--petrol-700); }
.switch input:checked::after { transform: translateX(17px); }
.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-h h3 { font-size: 16px; }
.section-title { font: 650 15px/1.2 var(--display); color: var(--ink); margin: 6px 0 12px; display: flex; gap: 10px; align-items: center; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty > svg { width: 54px; margin: 0 auto 14px; color: var(--petrol-500); }
.empty h3 { margin-bottom: 6px; }

/* ---------- Number plate (signature) ---------- */
.plate { display: inline-flex; align-items: stretch; color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; background: #fff; overflow: hidden; font-family: var(--display); line-height: 1; box-shadow: inset 0 0 0 1.5px #fff, inset 0 0 0 2.5px rgba(19, 40, 44, 0.25); vertical-align: middle; }
.plate-ind { background: var(--plate-blue); color: #fff; font: 700 8px/1 var(--body); display: grid; place-items: center; align-content: center; gap: 3px; padding: 0 5px; letter-spacing: 0.04em; }
.plate-ind i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #F2D45C; display: block; }
.plate-no { padding: 6px 10px 5px; font-weight: 800; font-size: 15px; letter-spacing: 0.06em; white-space: nowrap; font-stretch: condensed; }
.plate.lg .plate-no { font-size: 30px; padding: 9px 16px 7px; letter-spacing: 0.07em; }
.plate.lg .plate-ind { font-size: 10px; padding: 0 8px; }
.plate.lg .plate-ind i { width: 13px; height: 13px; }
.plate.sm .plate-no { font-size: 12px; padding: 4px 7px 3px; }
.plate.sm .plate-ind { padding: 0 3px; font-size: 6px; }
.plate.sm .plate-ind i { width: 6px; height: 6px; }

/* ---------- Stage track ---------- */
.track { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; }
.track li { flex: 1; height: 6px; border-radius: 3px; background: var(--line); position: relative; }
.track li.done { background: var(--petrol-500); }
.track li.now { background: var(--marigold); }
.track li span { position: absolute; left: 0; top: 10px; font-size: 12px; color: var(--ink-3); white-space: nowrap; display: none; }
.track.labels { padding-bottom: 22px; }
.track.labels li span { display: block; }
.track.labels li.now span { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .track.labels li span { display: none; } .track.labels li.now span { display: block; } .track.labels { padding-bottom: 20px; } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--green-50); color: var(--green); }
.badge.warn { background: var(--marigold-50); color: #8A5B00; }
.badge.bad { background: var(--red-50); color: var(--red); }
.badge.info { background: var(--petrol-50); color: var(--petrol-700); }
.badge svg { width: 13px; height: 13px; }
.score { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font: 700 14px var(--display); background: conic-gradient(var(--c, var(--green)) calc(var(--v) * 1%), var(--line-2) 0); position: relative; flex: none; }
.score::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.score b { position: relative; }

/* ---------- Hub ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hello p { margin: 6px 0 0; color: var(--ink-2); }
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--petrol-900); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 22px; color: #CFE3E3; }
.pipeline button { background: none; border: 0; color: inherit; text-align: left; padding: 16px 18px 14px; cursor: pointer; border-right: 1px solid rgba(255, 255, 255, 0.07); position: relative; }
.pipeline button:last-child { border-right: 0; }
.pipeline button b { display: block; font: 800 30px/1 var(--display); color: #fff; margin-bottom: 6px; }
.pipeline button span { font-size: 13px; }
.pipeline button.on { background: rgba(242, 169, 0, 0.12); }
.pipeline button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--marigold); }
.pipeline button:hover { background: rgba(255, 255, 255, 0.05); }
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(3, 1fr); } .pipeline button { border-bottom: 1px solid rgba(255, 255, 255, 0.07); } .pipeline button b { font-size: 24px; } }
.hub { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .hub { grid-template-columns: 1fr; } }
.claims { display: grid; gap: 10px; }
.claim-row { display: grid; grid-template-columns: 76px minmax(0, 1.5fr) minmax(0, 1fr) 150px 44px; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 12px 12px; text-decoration: none; color: inherit; transition: border-color 0.15s; }
.claim-row:hover { border-color: var(--petrol-500); }
.claim-row .thumb { width: 76px; height: 58px; border-radius: 9px; background: var(--petrol-50) center/cover; display: grid; place-items: center; color: var(--petrol-500); }
.claim-row .thumb svg { width: 30px; }
.claim-row .who { display: grid; gap: 5px; min-width: 0; }
.claim-row .who .meta { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.claim-row .mid { font-size: 13px; color: var(--ink-2); display: grid; gap: 6px; }
.claim-row .money { text-align: right; }
.claim-row .money b { font: 650 17px var(--display); display: block; }
.claim-row .pins { display: flex; gap: 5px; flex-wrap: wrap; }
.pin { font-size: 12px; background: var(--marigold-50); color: #7A5100; padding: 2px 8px; border-radius: 6px; }
@media (max-width: 760px) {
  .claim-row { grid-template-columns: 60px minmax(0, 1fr) 44px; gap: 12px; }
  .claim-row .thumb { width: 60px; height: 50px; }
  .claim-row .mid, .claim-row .money { display: none; }
}
.side-list { display: grid; gap: 2px; }
.side-item { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line-2); font-size: 14px; align-items: flex-start; }
.side-item:last-child { border-bottom: 0; }
.side-item .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--petrol-50); color: var(--petrol-700); }
.side-item .ic.warn { background: var(--marigold-50); color: #8A5B00; }
.side-item .ic svg { width: 15px; }
.side-item a { color: inherit; text-decoration: none; }
.side-item small { display: block; color: var(--ink-3); font-size: 12px; }

/* ---------- Claim workspace ---------- */
.claim-head { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 22px 6px; margin-bottom: 18px; }
.claim-head .top { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.claim-head .ident { flex: 1; min-width: 240px; display: grid; gap: 8px; }
.claim-head .ident h1 { font-size: 22px; font-weight: 650; }
.claim-head .facts { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--ink-2); }
.claim-head .facts b { color: var(--ink); font-weight: 600; }
.claim-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.claim-head .track { margin-top: 20px; }
.tabs { display: flex; gap: 2px; border-top: 1px solid var(--line-2); margin: 16px -22px 0; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 13px 12px 11px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs a.on { color: var(--ink); border-color: var(--marigold); }
.tabs a .badge { padding: 1px 7px; font-size: 11px; }
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.ws > .aside { position: sticky; top: 84px; display: grid; gap: 14px; }
@media (max-width: 1100px) { .ws { grid-template-columns: 1fr; } .ws > .aside { position: static; } }
.saved { font-size: 12px; color: var(--ink-3); }

/* link panel */
.link-card { background: var(--petrol-900); color: #D3E7E7; border-radius: var(--r-lg); padding: 18px; }
.link-card h3 { color: #fff; margin-bottom: 4px; }
.link-card .url { background: rgba(0, 0, 0, 0.25); border-radius: 8px; padding: 9px 10px; font-size: 13px; word-break: break-all; color: #fff; margin: 12px 0; }
.link-card .btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); color: #fff; }
.link-card .btn.signal { background: var(--marigold); color: var(--petrol-950); border-color: var(--marigold); }
.link-card .qr { background: #fff; border-radius: 10px; padding: 8px; width: 132px; }
.link-card .stat { font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.link-card .stat b { color: #fff; }

/* evidence */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.slot { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.slot .ph { aspect-ratio: 4 / 3; background: var(--petrol-50); position: relative; display: grid; place-items: center; color: var(--petrol-500); cursor: pointer; border: 0; padding: 0; width: 100%; }
.slot .ph img, .slot .ph video { width: 100%; height: 100%; object-fit: cover; }
.slot .ph .stencil { width: 70%; color: var(--petrol-500); opacity: 0.7; }
.slot .ph .flags { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.slot .ph .count { position: absolute; right: 6px; bottom: 6px; background: rgba(8, 42, 45, 0.8); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 6px; }
.slot .cap { padding: 8px 10px; font-size: 13px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.slot .cap b { font-weight: 600; }
.slot.missing .ph { background: repeating-linear-gradient(135deg, #F7F9F9 0 10px, #EFF3F3 10px 20px); }
.dot-ok, .dot-miss { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--green); } .dot-miss { background: var(--line); border: 1.5px solid var(--ink-3); }
.flag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.92); color: var(--ink-2); }
.flag.bad { background: var(--red); color: #fff; }
.flag.warn { background: var(--marigold); color: var(--petrol-950); }
.flag.ok { background: var(--green); color: #fff; }

/* lightbox */
.lb { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.lb .stage { background: #0A1F22; border-radius: 12px; display: grid; place-items: center; min-height: 360px; overflow: hidden; }
.lb .stage img, .lb .stage video { max-height: 72vh; width: auto; }
.lb dl { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 13px; margin: 0; }
.lb dt { color: var(--ink-3); } .lb dd { margin: 0; word-break: break-word; }
@media (max-width: 860px) { .lb { grid-template-columns: 1fr; } }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFCFC; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl td.n, .tbl th.n { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tfoot td { font-weight: 700; background: #FAFCFC; border-top: 1px solid var(--line); }
.tbl input, .tbl select { min-height: 34px; padding: 5px 8px; border-color: transparent; background: transparent; }
.tbl input:hover, .tbl select:hover { border-color: var(--line); background: #fff; }
.tbl input[type=number] { text-align: right; width: 110px; }
.tbl .x { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 6px; }
.tbl .x:hover { color: var(--red); background: var(--red-50); }
.tbl tbody tr:hover { background: #FBFDFD; }
.tbl .over input { color: var(--red); font-weight: 700; }

/* summary */
.sum { display: grid; gap: 0; }
.sum div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.sum div b { font-variant-numeric: tabular-nums; font-weight: 600; }
.sum div.minus b { color: var(--red); }
.sum div.net { border: 0; padding-top: 14px; font: 700 15px var(--display); }
.sum div.net b { font: 800 28px/1 var(--display); color: var(--petrol-700); }
.meter { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin: 6px 0 3px; }
.meter i { display: block; height: 100%; background: var(--petrol-500); border-radius: 4px; }
.meter.hot i { background: var(--red); }
.meter.warm i { background: var(--marigold); }

/* audit */
.issue { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; align-items: flex-start; cursor: pointer; text-align: left; width: 100%; }
.issue + .issue { margin-top: 8px; }
.issue:hover { border-color: var(--petrol-500); }
.issue .sev { width: 8px; align-self: stretch; border-radius: 4px; flex: none; }
.issue.must .sev { background: var(--red); }
.issue.review .sev { background: var(--marigold); }
.issue small { display: block; color: var(--ink-3); }
.bigscore { display: flex; gap: 18px; align-items: center; }
.bigscore .score { width: 88px; height: 88px; font-size: 26px; }
.bigscore .score::before { inset: 8px; }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { padding: 0 0 18px 26px; position: relative; font-size: 14px; }
.tl li::before { content: ''; position: absolute; left: 5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--petrol-500); }
.tl li::after { content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.tl li.insured::before { background: var(--marigold); }
.tl li small { display: block; color: var(--ink-3); }

/* reports */
.reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.report-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; display: grid; gap: 8px; align-content: start; }
.report-card h3 { font-size: 16px; }
.remark-picks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.remark-picks button { border: 1px dashed var(--petrol-500); background: var(--petrol-50); color: var(--petrol-700); border-radius: 7px; padding: 4px 9px; font-size: 12.5px; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* modal / toast */
.modal-back { position: fixed; inset: 0; background: rgba(8, 30, 33, 0.55); z-index: 100; display: grid; place-items: center; padding: 18px; animation: fade 0.15s; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); position: relative; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4); max-height: calc(100vh - 36px); overflow-y: auto; }
.modal-wide { width: min(1080px, 100%); }
.modal-body { padding: 26px; }
.modal-body h2 { margin-bottom: 6px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--line-2); font-size: 20px; cursor: pointer; z-index: 2; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; width: min(420px, calc(100% - 28px)); }
.toast { background: var(--petrol-950); color: #fff; padding: 12px 16px; border-radius: 11px; font-size: 14px; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.4); transition: opacity 0.3s, transform 0.3s; border-left: 4px solid var(--petrol-500); }
.toast-ok { border-left-color: #4CC38A; }
.toast-err { border-left-color: #FF6B5E; }
.toast.out { opacity: 0; transform: translateY(8px); }
@media (max-width: 900px) { #toasts { bottom: 86px; } }

/* dropdown */
.dd { position: absolute; right: 0; top: 46px; width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 50; max-height: 70vh; overflow-y: auto; }
.dd a { display: block; padding: 10px; border-radius: 8px; text-decoration: none; color: inherit; font-size: 14px; }
.dd a:hover { background: var(--bg); }
.dd a.unread { background: var(--marigold-50); }
.dd a small { display: block; color: var(--ink-3); }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--petrol-900); color: #D3E7E7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h1 { color: #fff; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.02; max-width: 12ch; margin: 18px 0 18px; }
.auth-art p { max-width: 44ch; font-size: 16px; }
.auth-art .phone { position: absolute; right: -40px; bottom: -60px; width: 300px; transform: rotate(-8deg); opacity: 0.95; }
.auth-art ol { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; max-width: 420px; counter-reset: s; position: relative; z-index: 1; }
.auth-art ol li { counter-increment: s; display: flex; gap: 12px; align-items: baseline; }
.auth-art ol li::before { content: counter(s); font: 800 13px var(--display); color: var(--petrol-950); background: var(--marigold); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; transform: translateY(4px); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: #fff; }
.auth-form form { width: min(380px, 100%); display: grid; gap: 14px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { padding: 28px 22px 32px; } .auth-art .phone { display: none; } .auth-art ol { display: none; } }

/* print reports */
.print-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.sheet { background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto 24px; padding: 14mm 15mm; box-shadow: var(--shadow); font: 10.5pt/1.45 var(--body); color: #111; }
.sheet h2 { font-size: 15pt; margin: 4mm 0 3mm; text-align: center; }
.sheet h4 { font: 700 10.5pt var(--body); margin: 4mm 0 1.6mm; padding-bottom: 1mm; border-bottom: 1.5px solid var(--lh, #0E5E63); color: var(--lh, #0E5E63); }
.sheet table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.sheet td, .sheet th { border: 1px solid #C8D1D2; padding: 1.1mm 1.8mm; vertical-align: top; text-align: left; }
.sheet th { background: #F2F5F5; font-weight: 600; }
.sheet .kv td:nth-child(odd) { width: 22%; color: #444; background: #FAFBFB; }
.sheet td.n, .sheet th.n { text-align: right; font-variant-numeric: tabular-nums; }
.lh-band { background: var(--lh); color: #fff; margin: -14mm -15mm 6mm; padding: 9mm 15mm 7mm; display: flex; gap: 6mm; align-items: center; }
.lh-band img { height: 16mm; background: #fff; border-radius: 3mm; padding: 1.5mm; }
.lh-band b { font: 800 17pt/1.1 var(--display); display: block; }
.lh-rule { border-bottom: 3px double var(--lh); padding-bottom: 4mm; margin-bottom: 5mm; display: flex; gap: 6mm; align-items: center; color: #222; }
.lh-rule b { font: 800 17pt/1.1 var(--display); color: var(--lh); display: block; }
.lh-rule img { height: 16mm; }
.lh-center { text-align: center; border-bottom: 1.5px solid var(--lh); padding-bottom: 4mm; margin-bottom: 5mm; }
.lh-center b { font: 800 18pt/1.1 var(--display); color: var(--lh); display: block; }
.lh-center img { height: 14mm; margin: 0 auto 2mm; }
.lh-meta { font-size: 9pt; opacity: 0.92; }
.sheet .sig { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10mm; gap: 8mm; }
.sheet .sig img.esig { height: 18mm; }
.sheet .qr { width: 24mm; }
.album { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.album figure { margin: 0; border: 1px solid #DDE3E3; border-radius: 2mm; overflow: hidden; break-inside: avoid; }
.album img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.album figcaption { padding: 1.5mm 2.5mm; font-size: 8.5pt; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .rail, .topbar, .mobile-bar, .print-bar, #toasts { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .sheet { box-shadow: none; margin: 0; width: auto; min-height: auto; page-break-after: always; }
  .sheet:last-child { page-break-after: auto; }
}

/* photo editor */
.editor { display: grid; gap: 12px; }
.editor .tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.editor .tools .btn.on { background: var(--petrol-700); color: #fff; border-color: var(--petrol-700); }
.editor .canvas-wrap { background: #0A1F22; border-radius: 12px; display: grid; place-items: center; overflow: auto; max-height: 68vh; touch-action: none; }
.editor canvas { max-width: 100%; max-height: 66vh; cursor: crosshair; }

.ai-parts { display: grid; gap: 6px; margin-top: 8px; }
.ai-part { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 7px 10px; border-radius: 8px; background: var(--bg); }
.kbd { font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.callout { background: var(--marigold-50); border: 1px solid #F1D88A; border-radius: 11px; padding: 12px 14px; font-size: 14px; }
.callout.info { background: var(--petrol-50); border-color: var(--petrol-100); }
.callout.bad { background: var(--red-50); border-color: #F0C2BC; }
.lh-band > div > span, .lh-rule > div > span, .lh-center > span { display: block; font-size: 9.5pt; margin-bottom: 1mm; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile span { font-size: 13px; color: var(--ink-2); }
.tile b { display: block; font: 750 24px/1.15 var(--display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.bar-cell { position: relative; }
.bar-cell i { position: absolute; left: 0; top: 50%; height: 6px; transform: translateY(-50%); background: var(--petrol-100); border-radius: 3px; z-index: 0; }
.bar-cell span { position: relative; z-index: 1; }
.tbl select { width: auto; min-width: 92px; padding-right: 26px; }
#pt, #lt { min-width: 860px; }
#pt td:first-child input, #lt td:first-child input { min-width: 190px; }
.tbl input[type=number] { width: 100px; }
.rail { align-self: start; }
.claim-row .mid svg { width: 14px; height: 14px; flex: none; }
