/* Lung26 workspace layout */
.boot { min-height: 100vh; display: grid; place-items: center; }

/* auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 44px;
  background: radial-gradient(1200px 600px at -10% 110%, rgba(255,116,56,.55), transparent 55%),
              radial-gradient(900px 600px at 110% -10%, rgba(43,27,255,.7), transparent 60%), #120a3a;
  display: flex; flex-direction: column; justify-content: space-between; }
.auth-art .logo { color: #fff; } .auth-art .logo small { color: rgba(255,255,255,.6); }
.auth-art h2 { font-family: var(--display); font-weight: 500; font-size: 38px; line-height: 1.12; letter-spacing: -.02em; max-width: 460px; }
.auth-art ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: rgba(255,255,255,.85); }
.auth-art li { display: flex; gap: 10px; align-items: center; }
.auth-art li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff9a66; flex: none; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; background: var(--surface); }
.auth-form form { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth-form h1 { font-size: 26px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.check input { margin-top: 2px; flex: none; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
  background: var(--surface); border-right: 1px solid var(--line); }
.side .logo { padding: 4px 8px 14px; }
.org-chip { margin: 0 4px 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.org-chip b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--ink-2);
  font-weight: 560; font-size: 13.5px; }
.nav a:hover { background: var(--bg-2); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; }
.nav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.nav .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 10px 12px 4px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .search { max-width: 380px; }
.page { padding: 26px 28px 60px; max-width: 1400px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h p { margin-top: 4px; }
.burger { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-2); }
  .shell.nav-open .side { transform: none; }
  .burger { display: inline-flex; }
  .page { padding: 18px 16px 50px; } .topbar { padding: 0 16px; }
}

.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 11px 16px; border-radius: 12px;
  margin-bottom: 18px; background: var(--warn-soft); color: var(--warn); font-weight: 560; border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 560; }
.kpi.alert .v { color: var(--bad); }
.meter { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.meter.hot > i { background: var(--accent); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
@media (max-width: 1150px) { .kpis { grid-template-columns: repeat(2, 1fr); } .dash-grid { grid-template-columns: 1fr; } }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 34px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .track { height: 10px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 99px; }

/* worklist filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.filters input, .filters select { width: auto; min-height: 34px; padding: 6px 10px; font-size: 13px; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: 600 12.5px var(--font); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.status { font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.status.scheduled { color: var(--faint); } .status.analysed { color: var(--info); } .status.first_read, .status.second_read { color: var(--warn); }
.status.finalized, .status.amended { color: var(--ok); }
.prio-stat { color: var(--bad); font-weight: 750; } .prio-urgent { color: var(--warn); font-weight: 700; }

/* study workspace */
.study-h { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.study-h .who h1 { font-size: 22px; }
.pipeline { display: flex; align-items: center; gap: 0; margin-bottom: 16px; overflow-x: auto; }
.pipeline .step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.pipeline .step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px;
  border: 1.5px solid var(--line-2); background: var(--surface); }
.pipeline .step.done { color: var(--ok); } .pipeline .step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.pipeline .step.now { color: var(--brand-ink); } .pipeline .step.now i { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.pipeline .line { width: 34px; height: 1.5px; background: var(--line-2); margin: 0 8px; flex: none; }
.ws { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .ws { grid-template-columns: 1fr; } }

.viewer { background: var(--viewer); border-radius: var(--r-lg); overflow: hidden; color: #cfd6ea; border: 1px solid #1a2033; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #1a2033; flex-wrap: wrap; }
.viewer-bar .btn { background: #121828; border-color: #252d44; color: #dfe4f3; }
.viewer-bar .btn:hover { background: #1a2238; }
.viewer-bar .btn.on { background: #4a18e0; border-color: #4a18e0; color: #fff; }
.stage { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; user-select: none; }
.stage canvas { max-width: 100%; max-height: 100%; image-rendering: auto; cursor: crosshair; touch-action: none; }
.stage .ph { text-align: center; padding: 30px; max-width: 420px; }
.stage .ph b { color: #fff; font-size: 16px; display: block; margin-bottom: 6px; }
.stage .ph p { color: #8d96b0; font-size: 13px; }
.drop.over { outline: 2px dashed #8a6cff; outline-offset: -10px; }
.hud { position: absolute; top: 10px; left: 12px; font: 600 11.5px ui-monospace, Menlo, monospace; color: #9fb0d8; line-height: 1.6; pointer-events: none;
  text-shadow: 0 1px 2px #000; }
.hud.r { left: auto; right: 12px; text-align: right; }
.viewer-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid #1a2033; }
.viewer-foot input[type=range] { flex: 1; min-height: 0; padding: 0; accent-color: #8a6cff; background: transparent; border: 0; }
.scan-ov { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,7,13,.72); backdrop-filter: blur(2px); z-index: 3; }
.scan-ov .ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font: 750 24px var(--font); color: #fff;
  background: conic-gradient(#8a6cff var(--p, 0%), #1d2438 0); position: relative; }
.scan-ov .ring::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #0b0f1b; }
.scan-ov .ring span { position: relative; z-index: 1; }
.scan-line { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, #8a6cff, transparent);
  box-shadow: 0 0 18px #8a6cff; animation: sweep 1.6s ease-in-out infinite alternate; z-index: 2; }
@keyframes sweep { from { top: 4%; } to { top: 96%; } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 13px 12px; font: 600 13px var(--font); color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs button .n { font-size: 11px; background: var(--bg-2); border-radius: 99px; padding: 1px 6px; margin-left: 4px; }

.finding { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: 0; }
.finding.rejected { opacity: .5; }
.finding .crop { width: 76px; height: 76px; border-radius: 10px; background: #000; object-fit: cover; image-rendering: pixelated; cursor: pointer; border: 1px solid var(--line); }
.finding.sel { background: var(--brand-soft); }
.probs { display: grid; grid-template-columns: 70px 1fr 38px; gap: 4px 8px; align-items: center; font-size: 11.5px; margin: 8px 0; }
.probs .track { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.probs .track i { display: block; height: 100%; border-radius: 99px; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); font-weight: 560; }

.read { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; }
.msg .bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; flex: 1; }
.timeline { display: flex; flex-direction: column; }
.timeline .ev { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.timeline .ev i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-top: 6px; }

/* billing */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .plans { grid-template-columns: 1fr; } }
.plan { padding: 18px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan.cur { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.plan .price { font-size: 26px; font-weight: 780; letter-spacing: -.02em; }
.plan ul { margin: 0; padding: 0 0 0 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }

/* print docs (invoice / report preview) */
.doc { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 44px; border-radius: 6px; box-shadow: var(--shadow-2); }
.doc table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.doc td, .doc th { padding: 9px 6px; border-bottom: 1px solid #e5e5e5; text-align: left; font-size: 13px; }
.doc .r { text-align: right; }
@media print {
  .side, .topbar, .no-print, #toasts { display: none !important; }
  .shell { display: block; } .page { padding: 0; } .doc { box-shadow: none; padding: 0; }
  body { background: #fff; }
}
