:root {
  color-scheme: light;
  --ink: #151d35;
  --muted: #53617a;
  --edge: #dce2ef;
  --surface: #fff;
  --page: #f4f6fc;
  --accent: #453ac4;
  --deep: #29218a;
  --soft: #eeecff;
  --navy: #151b35;
  --mint: #b7f5df;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font: 15px/1.55 "Segoe UI", system-ui, sans-serif; background: var(--page); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid #6656e6; outline-offset: 3px; }
.topbar { background: var(--navy); color: white; border-bottom: 1px solid #303b60; }
.nav { max-width: 1320px; margin: auto; padding: 14px clamp(16px, 4vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.nav a { color: white; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: inline-grid; flex: none; place-items: center; width: 39px; height: 39px; background: var(--mint); color: var(--navy); border-radius: 12px; font-size: 15px; font-weight: 800; }
.brand-name { display: block; font-size: 19px; line-height: 1.12; font-weight: 750; letter-spacing: -.025em; }
.brand-name small { display: block; margin-top: 4px; color: #c1cbe2; font-size: 11px; letter-spacing: .01em; font-weight: 550; }
.nav nav { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.nav nav a { border-radius: 8px; padding: 7px 11px; text-decoration: none; font-size: 14px; font-weight: 650; }
.nav nav a:hover, .nav nav a[aria-current="page"] { background: #30375f; }
.nav nav a[aria-current="page"] { color: var(--mint); }
.topbar :focus-visible { outline-color: var(--mint); }
main { max-width: 1320px; margin: auto; padding: clamp(25px, 4vw, 48px) clamp(16px, 4vw, 42px) 56px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(29px, 4vw, 43px); line-height: 1.1; letter-spacing: -.045em; margin-bottom: 10px; }
h2 { font-size: 21px; letter-spacing: -.025em; margin-bottom: 14px; }
h3 { font-size: 15px; margin-bottom: 8px; }
.eyebrow { text-transform: uppercase; font-weight: 750; letter-spacing: .13em; font-size: 11px; color: var(--accent); margin-bottom: 9px; }
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.heading-row p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--edge); border-radius: 18px; padding: clamp(16px, 3vw, 26px); margin-bottom: 20px; box-shadow: 0 3px 12px #212d5b08; }
.narrow { max-width: 580px; margin: 18px auto; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); max-width: 1000px; margin: clamp(10px, 6vw, 68px) auto; border: 1px solid var(--edge); border-radius: 24px; background: var(--surface); box-shadow: 0 18px 45px #25265915; }
.login-intro { display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 5vw, 58px); border-radius: 23px 0 0 23px; color: #eef1ff; background: radial-gradient(ellipse at 95% 100%, #42679e 0%, transparent 57%), linear-gradient(145deg, #191d3c 12%, #373189 88%); }
.login-intro .eyebrow { color: var(--mint); }
.login-headline { max-width: 13ch; margin-bottom: 17px; font-size: clamp(32px, 4.5vw, 54px); line-height: 1.02; letter-spacing: -.052em; font-weight: 750; color: white; }
.login-intro > p:not([class]) { max-width: 36ch; margin-bottom: 28px; }
.login-steps { display: flex; flex-wrap: wrap; gap: 7px; }
.login-steps span { border: 1px solid #ffffff57; border-radius: 999px; padding: 4px 10px; color: white; font-size: 12px; font-weight: 650; }
.login-form { align-self: center; padding: clamp(22px, 4vw, 45px); margin: 0; border: 0; background: transparent; box-shadow: none; }
.login-form .fields { margin-top: 24px; }
.login-form .fields button { justify-self: stretch; margin-top: 4px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.source-grid { align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.table-wrap { overflow-x: auto; }
.filter-grid, .column-options > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px 14px; }
.column-options label { cursor: pointer; }
.case-worklist td { min-width: 112px; }
.case-worklist th:first-child, .case-worklist td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 var(--edge); }
.case-worklist td:first-child { background: var(--surface); }
.column-filters td, .case-worklist .column-filters td:first-child { background: #f0f2fa; }
.column-filters td { padding: 5px 10px 10px; min-width: 122px; font-size: 13px; }
.column-filters input[type=date] { min-width: 138px; }
.column-filters label { font-size: 11px; }
.column-filters input + label { margin-top: 5px; }
table { border-collapse: collapse; width: 100%; text-align: left; margin-top: 14px; }
th { background: #f0f2fa; color: var(--muted); font-size: 12px; white-space: nowrap; }
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }
td, th { border-bottom: 1px solid var(--edge); padding: 12px 13px; vertical-align: top; }
tbody tr:hover { background: #f8f9fe; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); padding: 30px 12px; }
.button, button { display: inline-block; background: var(--accent); color: white; border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; text-decoration: none; font: inherit; font-weight: 650; cursor: pointer; }
.button:hover, button:hover { background: var(--deep); color: white; }
.secondary { color: var(--deep); background: var(--soft); border-color: #d9d4fa; }
.secondary:hover { background: #e1ddfc; color: var(--deep); }
.quiet { background: transparent; color: #e1e6f5; border-color: #ffffff52; padding: 6px 10px; margin-left: 7px; font-size: 13px; }
.quiet:hover { background: #30375f; }
button:disabled { cursor: default; opacity: .55; }
.fields { display: grid; gap: 12px; margin-top: 12px; }
.fields button { justify-self: start; }
.fields label:not(.check) { display: block; font-weight: 650; margin-bottom: 3px; }
.check { display: flex; gap: 7px; align-items: baseline; }
input:not([type=checkbox],[type=hidden]), select, textarea { color: var(--ink); background: white; border: 1px solid #a4afc7; border-radius: 8px; font: inherit; padding: 8px 10px; max-width: 100%; }
input[type=checkbox] { accent-color: var(--accent); }
.fields input:not([type=checkbox],[type=hidden]), .fields select, .fields textarea { width: 100%; }
textarea { resize: vertical; }
.helptext { color: var(--muted); font-size: 13px; }
.errorlist { padding-left: 20px; color: #8b2f28; }
.notice { background: #eef4fa; border: 1px solid #b9d3e5; padding: 9px 12px; border-radius: 7px; }
.notice.error, .failed { background: #f9e6e3; color: #802e24; }
.notice.success, .signed, .done { background: #e1f4eb; color: #155442; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 9px; background: #edf0f7; color: #43506c; font-size: 12px; font-weight: 700; }
.badge.intake, .badge.queued { background: #eeecff; color: #382c9f; }
.badge.running { background: #e6effb; color: #254f7f; }
.badge.review { background: #fff2d4; color: #664808; }
.badge.signed, .badge.done { background: #def3ea; color: #155442; }
.badge.submitted { background: #e6effb; color: #254f7f; }
.badge.failed { background: #f9e6e3; color: #802e24; }
.back { display: inline-block; margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; }
details { padding: 10px 0; border-top: 1px solid var(--edge); }
summary { font-weight: 650; cursor: pointer; }
.record-list, .timeline { list-style: none; padding: 0; margin: 0; overflow-wrap: anywhere; }
.record-list > li, .timeline > li { border-bottom: 1px solid var(--edge); padding: 8px 0; }
.record-list > li:last-child, .timeline > li:last-child { border-bottom: 0; }
.timeline p, .record-list p { margin: 4px 0; }
.page-links { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 5px 14px; }
.page-links .muted { font-size: 12px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.draft, .sign-panel, .evidence { padding: 15px; background: #f2f4fb; border-radius: 11px; margin: 12px 0; }
.top-space { margin-top: 14px; }
.crop-stage { position: relative; max-width: 100%; width: fit-content; }
.crop-stage img { display: block; max-width: 100%; height: auto; }
.crop-stage[data-crop-stage] { cursor: crosshair; touch-action: none; user-select: none; }
.crop-box { position: absolute; border: 2px solid var(--accent); background: #6656e628; pointer-events: none; }
@media (max-width: 780px) { .grid { grid-template-columns: 1fr; gap: 0; } .nav { align-items: flex-start; } }
@media (max-width: 650px) {
  .login-layout { grid-template-columns: 1fr; margin: 0 auto; }
  .login-intro { border-radius: 23px 23px 0 0; }
  .login-headline { max-width: 20ch; }
  .login-intro > p:not([class]) { margin-bottom: 16px; }
}
@media (max-width: 470px) { .nav { flex-direction: column; gap: 8px; } .toolbar input { flex: 1 1 180px; } .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); } }
