:root {
  --ink: #17212f;
  --ink-2: #233044;
  --ink-3: #3e4b5d;
  --muted: #6d7787;
  --canvas: #f5f7fa;
  --surface: #ffffff;
  --line: #dfe4eb;
  --line-strong: #cbd2dc;
  --cobalt: #375cf6;
  --cobalt-dark: #2746cf;
  --cobalt-soft: #eaf0ff;
  --mint: #12a594;
  --mint-soft: #e2f7f2;
  --coral: #e95f56;
  --coral-soft: #ffebe8;
  --amber: #c88719;
  --amber-soft: #fff3da;
  --violet: #7656d8;
  --violet-soft: #f0ebff;
  --danger: #c6404c;
  --danger-soft: #fff0f1;
  --shadow-sm: 0 1px 2px rgba(23, 33, 47, 0.05), 0 5px 16px rgba(23, 33, 47, 0.04);
  --shadow-lg: 0 20px 60px rgba(23, 33, 47, 0.16);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { letter-spacing: 0; }
svg { flex: 0 0 auto; }
.hidden, [hidden] { display: none !important; }

.overline {
  display: block;
  margin-bottom: 7px;
  color: var(--cobalt);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.overline.light { color: #aebfff; }

.button,
.icon-button,
.text-button,
.filter-chip {
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.button { min-height: 42px; padding: 0 16px; }
.button.compact { min-height: 36px; padding: 0 12px; font-size: .83rem; }
.button.primary { color: white; background: var(--cobalt); box-shadow: 0 7px 18px rgba(55, 92, 246, .2); }
.button.primary:hover { background: var(--cobalt-dark); box-shadow: 0 9px 22px rgba(55, 92, 246, .28); transform: translateY(-1px); }
.button.secondary { color: var(--ink-2); background: var(--surface); border-color: var(--line); }
.button.secondary:hover { border-color: var(--line-strong); background: #f9fafc; }
.button.light { color: var(--ink); background: white; box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.button.ghost-light { color: white; background: transparent; border-color: rgba(255,255,255,.28); }
.button:active, .icon-button:active, .text-button:active { transform: translateY(1px) scale(.98); }
.button.is-loading { color: transparent; position: relative; }
.button.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-button { width: 38px; height: 38px; padding: 0; color: var(--ink-3); background: white; border-color: var(--line); position: relative; }
.icon-button:hover { color: var(--cobalt); border-color: #b8c6ff; background: var(--cobalt-soft); }
.icon-button.dark { color: #bac5d4; border-color: #3b485b; background: #202c3d; }
.icon-button.accent { color: white; background: var(--cobalt); border-color: var(--cobalt); }
.text-button { min-height: 32px; padding: 0; background: transparent; color: var(--cobalt); }
.text-button:hover { color: var(--cobalt-dark); }

input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(55,92,246,.12); }
label { display: grid; gap: 7px; color: var(--ink-3); font-size: .8rem; font-weight: 750; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-3);
  background: #f5f7fa;
  font-size: .69rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: capitalize;
}
.badge.success { color: #087a6c; border-color: #bce7de; background: var(--mint-soft); }
.badge.info { color: var(--cobalt-dark); border-color: #c7d2ff; background: var(--cobalt-soft); }
.badge.warning { color: #94600a; border-color: #f0d49b; background: var(--amber-soft); }
.badge.danger { color: var(--danger); border-color: #efc2c7; background: var(--danger-soft); }

/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr); background: white; }
.login-story { min-height: 100vh; padding: clamp(34px, 6vw, 78px); color: white; background: var(--ink); display: flex; flex-direction: column; position: relative; overflow: hidden; isolation: isolate; }
.login-story::before { content: ""; position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 54px 54px; }
.login-story::after { content: ""; position: absolute; z-index: -1; width: 210px; height: 12px; right: 11%; bottom: 18%; background: var(--coral); transform: rotate(-14deg); }
.login-brand, .brand-row { display: flex; align-items: center; gap: 12px; }
.login-brand strong, .brand-row strong { display: block; font-size: 1.22rem; line-height: 1; }
.login-brand small, .brand-row span { display: block; margin-top: 4px; color: #90a0b5; font-size: .69rem; font-weight: 700; text-transform: uppercase; }
.brand-symbol { width: 47px; height: 47px; display: grid; place-items: center; color: white; background: var(--cobalt); border-radius: 6px 6px 18px 6px; font-size: 1.35rem; font-weight: 900; box-shadow: inset -6px -6px 0 rgba(0,0,0,.1); }
.brand-symbol.small { width: 38px; height: 38px; border-radius: 5px 5px 14px 5px; font-size: 1.05rem; }
.story-copy { max-width: 760px; margin: auto 0; padding: 74px 0; }
.story-copy h1 { max-width: 680px; margin-bottom: 22px; font-size: clamp(2.55rem, 5.2vw, 5.6rem); line-height: .98; font-weight: 780; }
.story-copy p { max-width: 640px; margin-bottom: 0; color: #b9c4d2; font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.7; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 22px; color: #d6dee8; font-size: .78rem; font-weight: 700; }
.trust-strip span { display: inline-flex; align-items: center; gap: 7px; }
.trust-strip svg { color: var(--mint); }
.login-orbit { position: absolute; z-index: -1; border: 1px solid rgba(255,255,255,.09); transform: rotate(19deg); }
.orbit-one { width: 290px; height: 290px; right: -95px; top: 12%; }
.orbit-two { width: 150px; height: 150px; left: 58%; bottom: -80px; border-color: rgba(55,92,246,.42); }
.login-access { min-height: 100vh; padding: 48px clamp(34px, 6vw, 82px); display: flex; flex-direction: column; justify-content: center; background: #fbfcfe; }
.login-form { width: min(100%, 470px); margin: auto; display: grid; gap: 17px; }
.access-heading { display: flex; align-items: center; gap: 14px; }
.access-heading h2 { margin: 0; font-size: 1.8rem; }
.access-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--cobalt); background: var(--cobalt-soft); border-radius: 7px; }
.login-help { margin: -4px 0 7px; color: var(--muted); line-height: 1.6; }
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-field .icon-button { position: absolute; right: 3px; top: 2px; border: 0; }
.login-submit { width: 100%; justify-content: space-between; margin-top: 4px; }
.demo-block { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-block > span { color: var(--muted); font-size: .72rem; font-weight: 750; }
.demo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.demo-row button { min-height: 34px; padding: 0 8px; color: var(--ink-3); background: white; border: 1px solid var(--line); border-radius: 6px; font-size: .69rem; font-weight: 750; }
.demo-row button:hover { color: var(--cobalt); border-color: #bbc7ff; background: var(--cobalt-soft); }
.login-foot { margin: 36px auto 0; color: #96a0ae; font-size: .7rem; }
.form-error { margin: 0; padding: 11px 12px; color: var(--danger); background: var(--danger-soft); border: 1px solid #efc2c7; border-radius: 6px; font-size: .78rem; font-weight: 700; }

/* Application shell */
.app-shell { width: 100%; min-width: 0; min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { width: 248px; height: 100vh; position: fixed; inset: 0 auto 0 0; z-index: 30; padding: 20px 15px 16px; color: #e8edf4; background: var(--ink); display: flex; flex-direction: column; overflow-y: auto; }
.brand-row { min-height: 52px; padding: 0 8px 16px; border-bottom: 1px solid #303c4e; }
.main-nav { display: grid; gap: 22px; padding: 22px 0; }
.nav-group { display: grid; gap: 4px; }
.nav-label { padding: 0 12px 6px; color: #73839a; font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.nav-button { min-height: 42px; position: relative; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #aeb9c8; background: transparent; border: 0; border-radius: 6px; font-size: .79rem; font-weight: 700; text-align: left; transition: color .16s ease, background .16s ease, transform .16s ease; }
.nav-button:hover { color: white; background: #222f41; transform: translateX(2px); }
.nav-button.active { color: white; background: #2a3850; }
.nav-button.active svg { color: #9eb0ff; }
.nav-button.active i { width: 3px; height: 22px; position: absolute; right: -15px; background: var(--cobalt); border-radius: 3px 0 0 3px; }
.sidebar-status { display: flex; align-items: center; gap: 10px; margin: auto 5px 10px; padding: 11px; border: 1px solid #344155; border-radius: 7px; background: #202c3d; }
.sidebar-status strong, .sidebar-status span { display: block; }
.sidebar-status strong { font-size: .72rem; }
.sidebar-status span { margin-top: 2px; color: #8190a4; font-size: .65rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(18,165,148,.14); animation: pulse 2.2s ease infinite; }
.user-panel { min-height: 55px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 4px 0; border-top: 1px solid #303c4e; }
.user-panel strong, .user-panel span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel strong { font-size: .72rem; }
.user-panel div > span { margin-top: 3px; color: #7e8ca0; font-size: .64rem; text-transform: capitalize; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; color: white; background: var(--violet); border-radius: 50%; font-size: .67rem; font-weight: 850; }
.workspace { width: 100%; min-width: 0; grid-column: 2; overflow-x: hidden; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 520px) minmax(280px, 1fr); align-items: center; gap: 20px; padding: 0 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title h1 { margin: 1px 0 0; font-size: 1.13rem; }
.breadcrumb { display: block; color: var(--muted); font-size: .61rem; font-weight: 700; text-transform: uppercase; }
.mobile-menu { display: none; }
.global-search { height: 40px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 7px; background: #f7f8fa; }
.global-search svg { color: var(--muted); }
.global-search input { min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: .78rem; }
kbd { padding: 3px 6px; color: #808a98; background: white; border: 1px solid var(--line); border-radius: 4px; font-family: inherit; font-size: .61rem; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.top-actions .icon-button b { min-width: 16px; height: 16px; position: absolute; right: -5px; top: -5px; display: grid; place-items: center; color: white; background: var(--coral); border: 2px solid white; border-radius: 50%; font-size: .55rem; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: #516070; font-size: .7rem; font-weight: 750; }
.connection-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.view-container { padding: 26px 28px 48px; }
.page-stack { min-width: 0; display: grid; gap: 18px; max-width: 1600px; margin: 0 auto; }
.page-stack > * { min-width: 0; }
.reveal { animation: reveal .34s cubic-bezier(.2,.7,.2,1) both; }
.surface { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 1.02rem; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: .77rem; }
.alert-stack { position: fixed; z-index: 70; right: 24px; top: 90px; display: grid; gap: 8px; }
.toast { width: min(390px, calc(100vw - 32px)); min-height: 50px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px 8px 8px 13px; background: white; border: 1px solid var(--line); border-left: 4px solid var(--mint); border-radius: 7px; box-shadow: var(--shadow-lg); font-size: .76rem; font-weight: 700; animation: toast-in .25s ease both; }
.toast.success > svg { color: var(--mint); }
.toast.error { border-left-color: var(--danger); }
.toast.error > svg { color: var(--danger); }

/* Dashboard */
.command-band { min-height: 214px; position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0,1.3fr) auto; align-items: center; gap: 30px; padding: 30px 34px; color: white; background: var(--ink-2); border-radius: 8px; }
.command-copy { max-width: 760px; position: relative; z-index: 2; }
.command-copy h2 { margin-bottom: 9px; font-size: clamp(1.55rem, 2.6vw, 2.35rem); }
.command-copy p { margin-bottom: 20px; color: #c5ceda; font-size: .88rem; line-height: 1.6; }
.command-copy p strong { color: white; }
.command-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.case-pulse { min-width: 255px; position: relative; z-index: 2; display: flex; align-items: center; gap: 17px; padding: 18px; background: rgba(13,22,35,.48); border: 1px solid #3b4a61; border-radius: 8px; }
.case-pulse > div:last-child span, .case-pulse > div:last-child strong, .case-pulse > div:last-child small { display: block; }
.case-pulse > div:last-child span { color: #95a4b8; font-size: .65rem; }
.case-pulse > div:last-child strong { max-width: 150px; margin: 5px 0; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-pulse > div:last-child small { color: #94a0b1; font-size: .66rem; }
.progress-ring { --progress: 0deg; width: 82px; aspect-ratio: 1; padding: 7px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--mint) var(--progress), #3c4a5e 0); }
.progress-ring::before { content: ""; grid-area: 1/1; width: 100%; height: 100%; background: var(--ink-2); border-radius: 50%; }
.progress-ring > div { grid-area: 1/1; z-index: 1; text-align: center; }
.progress-ring strong, .progress-ring span { display: block; }
.progress-ring strong { font-size: 1rem; }
.progress-ring span { margin-top: 2px; color: #93a1b3; font-size: .56rem; }
.band-pattern { width: 230px; height: 230px; position: absolute; right: -65px; top: -75px; z-index: 0; border: 35px solid rgba(55,92,246,.28); transform: rotate(24deg); animation: drift 9s ease-in-out infinite alternate; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.metric { min-height: 105px; display: flex; align-items: center; gap: 13px; padding: 17px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.metric-icon, .list-icon, .system-mark, .connection-icon { display: grid; place-items: center; border-radius: 7px; }
.metric-icon { width: 42px; height: 42px; }
.metric-icon.cobalt, .list-icon.cobalt, .system-mark.cobalt { color: var(--cobalt); background: var(--cobalt-soft); }
.metric-icon.mint, .list-icon.mint, .system-mark.mint { color: var(--mint); background: var(--mint-soft); }
.metric-icon.coral, .list-icon.coral, .system-mark.coral { color: var(--coral); background: var(--coral-soft); }
.metric-icon.amber, .list-icon.amber, .system-mark.amber { color: var(--amber); background: var(--amber-soft); }
.system-mark.violet { color: var(--violet); background: var(--violet-soft); }
.metric div > span, .metric div > strong, .metric div > small { display: block; }
.metric div > span { color: var(--muted); font-size: .66rem; font-weight: 700; }
.metric div > strong { margin: 3px 0 1px; font-size: 1.55rem; line-height: 1; }
.metric div > small { color: #98a1ae; font-size: .61rem; }
.workflow-track { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(8, minmax(110px,1fr)); gap: 0; overflow-x: auto; padding: 5px 0 4px; }
.workflow-step { min-width: 110px; position: relative; display: grid; justify-items: start; gap: 4px; padding: 2px 10px 2px 0; color: var(--muted); background: transparent; border: 0; text-align: left; }
.workflow-step::after { content: ""; width: calc(100% - 36px); height: 2px; position: absolute; left: 34px; top: 14px; background: var(--line); }
.workflow-step:last-child::after { display: none; }
.workflow-step > span { width: 29px; height: 29px; z-index: 1; display: grid; place-items: center; color: #7d8898; background: white; border: 2px solid var(--line); border-radius: 50%; font-size: .66rem; font-weight: 850; }
.workflow-step strong { margin-top: 5px; color: var(--ink-3); font-size: .69rem; line-height: 1.25; }
.workflow-step small { font-size: .59rem; }
.workflow-step.done > span { color: white; background: var(--mint); border-color: var(--mint); }
.workflow-step.done::after { background: var(--mint); }
.workflow-step.current > span { color: var(--cobalt); border-color: var(--cobalt); box-shadow: 0 0 0 4px var(--cobalt-soft); }
.workflow-step.current strong { color: var(--cobalt-dark); }
.dashboard-columns { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(320px,.75fr); gap: 18px; }
.case-table { display: grid; }
.case-table-row { min-height: 66px; display: grid; grid-template-columns: auto minmax(180px,1fr) auto auto auto; align-items: center; gap: 11px; padding: 10px 3px; color: var(--ink); background: transparent; border: 0; border-top: 1px solid var(--line); text-align: left; transition: background .15s ease, padding .15s ease; }
.case-table-row:hover { padding-left: 8px; background: #f8f9fb; }
.case-table-row > div strong, .case-table-row > div span { display: block; }
.case-table-row > div strong { font-size: .77rem; }
.case-table-row > div span { margin-top: 4px; color: var(--muted); font-size: .66rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-avatar, .doc-type { width: 37px; height: 37px; display: grid; place-items: center; color: var(--cobalt); background: var(--cobalt-soft); border-radius: 7px; }
.row-arrow { color: #a4adba; transition: transform .15s ease; }
.case-table-row:hover .row-arrow { color: var(--cobalt); transform: translateX(3px); }
.count-badge { min-width: 31px; height: 31px; display: grid; place-items: center; color: var(--coral); background: var(--coral-soft); border-radius: 50%; font-size: .76rem; font-weight: 850; }
.action-list { display: grid; }
.action-list button { min-height: 67px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 10px 2px; color: var(--ink); background: transparent; border: 0; border-top: 1px solid var(--line); text-align: left; }
.action-list button:hover > svg { color: var(--cobalt); transform: translateX(3px); }
.list-icon { width: 37px; height: 37px; }
.action-list strong, .action-list span { display: block; }
.action-list strong { font-size: .75rem; }
.action-list div span { margin-top: 4px; color: var(--muted); font-size: .65rem; }
.system-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.system-strip > div { min-height: 87px; display: grid; grid-template-columns: auto minmax(0,1fr); align-content: center; gap: 3px 10px; padding: 13px; background: white; }
.system-mark { width: 34px; height: 34px; grid-row: 1/3; }
.system-strip strong { align-self: end; font-size: .68rem; }
.system-strip small { color: var(--muted); font-size: .6rem; }

/* Context and cases */
.context-bar { min-height: 70px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 16px; background: white; border: 1px solid var(--line); border-left: 4px solid var(--cobalt); border-radius: 7px; box-shadow: var(--shadow-sm); }
.context-bar > div strong, .context-bar > div span { display: block; }
.context-bar > div strong { font-size: .86rem; }
.context-bar > div > span:last-child { max-width: 700px; margin-top: 4px; color: var(--muted); font-size: .67rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-bar label { width: 280px; display: flex; align-items: center; gap: 9px; }
.context-bar label span { white-space: nowrap; font-size: .65rem; }
.context-bar select { min-height: 36px; font-size: .7rem; }
.case-workspace { max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: 290px minmax(0,1fr); gap: 18px; align-items: start; }
.case-index { position: sticky; top: 102px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.case-index-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.case-index-head h2 { margin: 0; font-size: 1rem; }
.case-search { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 5px; margin-bottom: 12px; padding-left: 9px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 6px; }
.case-search > svg { color: var(--muted); }
.case-search input { min-height: 37px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: .69rem; }
.case-search .icon-button { width: 34px; height: 34px; border: 0; background: transparent; }
.case-list { max-height: calc(100vh - 260px); display: grid; gap: 5px; overflow-y: auto; padding-right: 3px; }
.case-row { min-height: 70px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 6px; text-align: left; transition: background .15s ease, border-color .15s ease; }
.case-row:hover { background: #f7f8fa; }
.case-row.active { background: var(--cobalt-soft); border-color: #c7d2ff; }
.case-row > div strong, .case-row > div span, .case-row > div small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-row > div strong { font-size: .71rem; }
.case-row > div span { margin-top: 4px; color: var(--ink-3); font-size: .66rem; }
.case-row > div small { margin-top: 3px; color: var(--muted); font-size: .59rem; }
.risk-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.risk-dot.alto { background: var(--coral); }
.risk-dot.bajo { background: var(--mint); }
.case-detail { min-width: 0; display: grid; gap: 16px; }
.case-hero { min-height: 134px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; color: white; background: var(--ink-2); border-radius: 8px; }
.case-badges { display: flex; gap: 6px; }
.case-hero h2 { margin: 11px 0 5px; font-size: 1.65rem; }
.case-hero p { margin: 0; color: #c3ccd8; font-size: .8rem; }
.case-hero p span { padding: 0 6px; color: #77879b; }
.stage-control { width: min(290px, 100%); color: #aab6c6; }
.stage-control select { color: white; background: #1b2738; border-color: #46556b; }
.case-tabs { min-height: 52px; display: flex; align-items: stretch; gap: 4px; padding: 0 10px; overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 8px; }
.case-tabs button { min-width: max-content; position: relative; display: flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--muted); background: transparent; border: 0; font-size: .7rem; font-weight: 750; }
.case-tabs button.active { color: var(--cobalt); }
.case-tabs button.active::after { content: ""; height: 2px; position: absolute; inset: auto 10px 0; background: var(--cobalt); }
.case-tabs button b { min-width: 19px; height: 19px; display: grid; place-items: center; background: #eef1f5; border-radius: 50%; font-size: .58rem; }
.case-summary-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,.6fr); gap: 16px; }
.data-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.data-grid > div { min-height: 67px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-grid dt { color: var(--muted); font-size: .62rem; font-weight: 700; }
.data-grid dd { margin: 6px 0 0; font-size: .75rem; font-weight: 750; }
.claim-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.claim-list > span:first-child { width: 100%; color: var(--muted); font-size: .64rem; font-weight: 700; }
.summary-text { margin-top: 15px; padding: 13px; background: #f7f8fa; border-left: 3px solid var(--cobalt); }
.summary-text > span { color: var(--muted); font-size: .63rem; font-weight: 750; }
.summary-text p { margin: 5px 0 0; color: var(--ink-3); font-size: .73rem; line-height: 1.55; }
.readiness .section-heading > strong { color: var(--cobalt); font-size: 1.1rem; }
.readiness-row { min-height: 46px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--line); color: #9aa3af; }
.readiness-row > span { color: #a6afbb; }
.readiness-row strong { color: var(--ink-3); font-size: .69rem; }
.readiness-row small { font-size: .59rem; }
.readiness-row.complete > span { color: var(--mint); }
.readiness-row.complete small { color: #087a6c; }
.timeline { display: grid; }
.timeline article { min-height: 60px; position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); }
.timeline-dot { width: 11px; height: 11px; margin-top: 5px; border: 3px solid white; border-radius: 50%; background: var(--cobalt); box-shadow: 0 0 0 1px #adbcff; }
.timeline strong { font-size: .71rem; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: .64rem; }
.timeline time { color: var(--muted); font-size: .61rem; white-space: nowrap; }

/* DMS and evidence */
.pipeline-band { padding: 22px; color: white; background: var(--ink-2); border-radius: 8px; }
.pipeline { display: grid; grid-template-columns: repeat(8,minmax(90px,1fr)); overflow-x: auto; }
.pipeline-step { min-width: 90px; position: relative; display: grid; gap: 6px; color: #8190a4; }
.pipeline-step::after { content: ""; height: 1px; position: absolute; left: 31px; right: 4px; top: 13px; background: #435066; }
.pipeline-step:last-child::after { display: none; }
.pipeline-step span { width: 27px; height: 27px; z-index: 1; display: grid; place-items: center; color: #8290a3; background: var(--ink-2); border: 1px solid #526078; border-radius: 50%; font-size: .61rem; font-weight: 800; }
.pipeline-step strong { padding-right: 7px; font-size: .65rem; }
.pipeline-step.active span { color: white; background: var(--cobalt); border-color: var(--cobalt); }
.pipeline-step.active { color: white; }
.pipeline-step.active::after { background: var(--cobalt); }
.dms-layout, .evidence-layout, .ai-layout, .audit-layout { display: grid; grid-template-columns: minmax(300px,.72fr) minmax(0,1.28fr); gap: 18px; align-items: start; }
.upload-surface, .proof-form { display: grid; gap: 13px; }
.file-drop { min-height: 112px; place-items: center; align-content: center; gap: 5px; color: var(--muted); background: #f8f9fb; border: 1px dashed #b8c1cd; text-align: center; cursor: pointer; }
.file-drop:hover { color: var(--cobalt); border-color: var(--cobalt); background: var(--cobalt-soft); }
.file-drop input { display: none; }
.file-drop strong { color: var(--ink-3); font-size: .73rem; }
.file-drop small { font-size: .62rem; }
.quality-checks { display: grid; gap: 7px; padding: 11px; background: #f7f9fa; border-radius: 6px; }
.quality-checks span { display: flex; align-items: center; gap: 7px; color: #257b70; font-size: .65rem; font-weight: 700; }
.quality-checks span.pending { color: #93600a; }
.document-list { display: grid; }
.document-list article { min-height: 75px; display: grid; grid-template-columns: auto minmax(140px,1fr) auto auto; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
.document-list article > div:nth-child(2) strong, .document-list article > div:nth-child(2) span, .document-list article > div:nth-child(2) small { display: block; }
.document-list article > div:nth-child(2) strong { font-size: .73rem; }
.document-list article > div:nth-child(2) span { margin-top: 4px; color: var(--ink-3); font-size: .66rem; }
.document-list article > div:nth-child(2) small { margin-top: 4px; color: var(--muted); font-size: .59rem; }
.confidence { min-width: 58px; text-align: right; }
.confidence strong, .confidence span { display: block; }
.confidence strong { color: var(--cobalt); font-size: .85rem; }
.confidence span { color: var(--muted); font-size: .55rem; }
.evidence-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 8px; }
.evidence-overview > div { min-height: 80px; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: white; }
.evidence-overview span, .evidence-overview strong { display: block; }
.evidence-overview div > div span { color: var(--muted); font-size: .64rem; }
.evidence-overview div > div strong { margin-top: 4px; font-size: 1.25rem; }
.evidence-layout { grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); }
.fact-table { border-top: 1px solid var(--line); }
.fact-head, .fact-row { display: grid; grid-template-columns: minmax(220px,1fr) 100px 120px; align-items: center; gap: 12px; }
.fact-head { min-height: 38px; color: var(--muted); background: #f7f8fa; font-size: .6rem; font-weight: 750; }
.fact-head span, .fact-row > span, .fact-row > .badge { padding: 0 10px; }
.fact-row { min-height: 72px; border-bottom: 1px solid var(--line); }
.fact-row > div { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 2px 9px; align-items: center; padding: 8px 10px; }
.fact-number { width: 29px; height: 29px; grid-row: 1/3; display: grid; place-items: center; color: var(--cobalt); background: var(--cobalt-soft); border-radius: 5px; font-size: .61rem; font-weight: 850; }
.fact-row strong { font-size: .7rem; }
.fact-row small, .fact-row > span { color: var(--muted); font-size: .6rem; }
.proof-register { display: grid; margin-top: 15px; }
.proof-register article { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.proof-register strong { font-size: .7rem; }
.proof-register p { margin: 4px 0; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.proof-register small { color: #9099a6; font-size: .59rem; }
.human-notice { display: flex; gap: 9px; padding: 11px; color: #087a6c; background: var(--mint-soft); border: 1px solid #bce7de; border-radius: 6px; }
.human-notice p { margin: 0; }
.human-notice strong, .human-notice span { display: block; }
.human-notice strong { font-size: .68rem; }
.human-notice span { margin-top: 3px; color: #3e706b; font-size: .6rem; line-height: 1.4; }

/* AI */
.ai-command { min-height: 238px; position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0,1.25fr) auto; align-items: center; gap: 25px; padding: 30px 34px; color: white; background: #232943; border-radius: 8px; }
.ai-command > div:first-child { z-index: 2; max-width: 770px; }
.ai-mark { width: 45px; height: 45px; display: grid; place-items: center; margin-bottom: 14px; color: #ffe3dc; background: var(--coral); border-radius: 7px; box-shadow: 7px 7px 0 rgba(233,95,86,.2); }
.ai-command h2 { margin-bottom: 9px; font-size: clamp(1.5rem,2.7vw,2.25rem); }
.ai-command p { max-width: 700px; margin-bottom: 18px; color: #bcc3d7; font-size: .8rem; line-height: 1.6; }
.ai-context { z-index: 2; min-width: 280px; display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: #424965; border: 1px solid #424965; border-radius: 8px; overflow: hidden; }
.ai-context > div { min-height: 86px; display: grid; grid-template-columns: auto 1fr; align-content: center; gap: 2px 8px; padding: 14px; background: #2d344f; }
.ai-context span { grid-row: 1/3; color: #aebaff; }
.ai-context strong { font-size: 1.3rem; }
.ai-context small { color: #949db6; font-size: .59rem; }
.ai-grid-pattern { width: 200px; height: 200px; position: absolute; right: -45px; bottom: -75px; z-index: 0; border: 28px solid rgba(118,86,216,.25); transform: rotate(18deg); }
.ai-layout { grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); }
.criterion-mini-list { display: grid; }
.criterion-mini-list article { padding: 13px 2px; border-top: 1px solid var(--line); }
.criterion-mini-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.criterion-key { color: var(--cobalt); font-family: "Cascadia Code", Consolas, monospace; font-size: .68rem; font-weight: 800; }
.criterion-mini-list strong { display: block; margin-top: 8px; font-size: .74rem; }
.criterion-mini-list p { margin: 5px 0; color: var(--ink-3); font-size: .66rem; line-height: 1.45; }
.criterion-mini-list small { color: var(--muted); font-size: .59rem; }
.safeguards > div:not(.section-heading) { min-height: 49px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 2px 9px; border-top: 1px solid var(--line); }
.safeguard-check { width: 27px; height: 27px; grid-row: 1/3; display: grid; place-items: center; color: #8792a0; background: #f0f2f5; border-radius: 50%; }
.safeguard-check.ready { color: #087a6c; background: var(--mint-soft); }
.safeguards strong { align-self: end; font-size: .68rem; }
.safeguards small { align-self: start; color: var(--muted); font-size: .58rem; }
.draft-list { display: grid; gap: 10px; }
.draft-card { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.draft-card > header { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; background: #f8f9fb; }
.draft-card header > div { display: flex; align-items: center; gap: 10px; }
.draft-icon { width: 37px; height: 37px; display: grid; place-items: center; color: var(--coral); background: var(--coral-soft); border-radius: 6px; }
.draft-card header strong, .draft-card header span { display: block; }
.draft-card header strong { font-size: .72rem; }
.draft-card header div div span { margin-top: 3px; color: var(--muted); font-size: .59rem; }
.draft-card details { border-top: 1px solid var(--line); }
.draft-card summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; color: var(--cobalt); font-size: .67rem; font-weight: 750; cursor: pointer; list-style: none; }
.draft-card pre { max-height: 330px; margin: 0; overflow: auto; padding: 15px; color: #344154; background: #f5f7fa; border-top: 1px solid var(--line); white-space: pre-wrap; font: .66rem/1.6 "Cascadia Code", Consolas, monospace; }
.review-box { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.review-box textarea { min-height: 58px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* Criteria */
.knowledge-head, .audit-head { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 25px 28px; background: white; border-left: 5px solid var(--amber); border-radius: 8px; box-shadow: var(--shadow-sm); }
.knowledge-head > div, .audit-head > div { max-width: 850px; }
.knowledge-head h2, .audit-head h2 { margin-bottom: 8px; font-size: clamp(1.35rem,2.3vw,2rem); }
.knowledge-head p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.knowledge-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 8px 10px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.knowledge-toolbar form, .inline-search { display: flex; align-items: center; gap: 8px; min-width: 330px; padding: 0 8px; }
.knowledge-toolbar input, .inline-search input { min-height: 34px; padding: 0; border: 0; box-shadow: none; font-size: .71rem; }
.knowledge-toolbar > div { display: flex; align-items: center; gap: 6px; }
.filter-chip { min-height: 32px; padding: 0 10px; color: var(--ink-3); background: #f6f7f9; border-color: var(--line); font-size: .66rem; }
.filter-chip.active { color: var(--cobalt); background: var(--cobalt-soft); border-color: #c4d0ff; }
.criteria-register { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.criteria-head, .criteria-row { min-width: 990px; display: grid; grid-template-columns: 130px minmax(300px,1fr) 145px 130px 130px; align-items: center; gap: 14px; padding: 0 18px; }
.criteria-head { min-height: 42px; color: var(--muted); background: #f7f8fa; border-bottom: 1px solid var(--line); font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.criteria-row { min-height: 105px; border-bottom: 1px solid var(--line); }
.criteria-row:last-child { border-bottom: 0; }
.criteria-row > div:first-child span, .criteria-row > div:first-child small, .criteria-row > div:nth-child(2) strong, .criteria-row > div:nth-child(2) p, .criteria-row > div:nth-child(2) small, .criteria-row > div:nth-child(4) strong, .criteria-row > div:nth-child(4) small { display: block; }
.criteria-row > div:first-child small, .criteria-row > div:nth-child(4) small { margin-top: 4px; color: var(--muted); font-size: .59rem; }
.criteria-row > div:nth-child(2) strong { font-size: .72rem; }
.criteria-row > div:nth-child(2) p { margin: 4px 0; color: var(--ink-3); font-size: .65rem; line-height: 1.35; }
.criteria-row > div:nth-child(2) small { color: var(--muted); font-size: .58rem; }
.criteria-row > span, .criteria-row > div:nth-child(4) strong { font-size: .66rem; }

/* Audit and infrastructure */
.audit-head { color: white; background: var(--ink-2); border-left-color: var(--mint); box-shadow: none; }
.audit-head .overline { color: #76d6cb; }
.audit-seal { display: flex; align-items: center; gap: 12px; padding: 14px 17px; background: #1b2738; border: 1px solid #415069; border-radius: 7px; }
.audit-seal svg { color: var(--mint); }
.audit-seal strong, .audit-seal span { display: block; }
.audit-seal strong { font-size: 1.35rem; }
.audit-seal span { color: #95a1b2; font-size: .62rem; }
.audit-layout { grid-template-columns: minmax(0,1.4fr) minmax(290px,.6fr); }
.inline-search { min-width: 210px; border: 1px solid var(--line); border-radius: 6px; }
.ledger-list { max-height: 690px; overflow-y: auto; }
.ledger-list article { min-height: 71px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; padding: 11px 2px; border-top: 1px solid var(--line); }
.ledger-icon { width: 35px; height: 35px; display: grid; place-items: center; color: var(--violet); background: var(--violet-soft); border-radius: 6px; }
.ledger-list strong { font-size: .71rem; }
.ledger-list p { margin: 4px 0; color: var(--ink-3); font-size: .64rem; }
.ledger-list small { display: block; max-width: 620px; color: var(--muted); font-size: .58rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-list time { color: var(--muted); font-size: .59rem; white-space: nowrap; }
.audit-side { display: grid; gap: 18px; }
.role-row { min-height: 57px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.small-avatar { width: 31px; height: 31px; font-size: .62rem; }
.role-row strong, .role-row span { display: block; }
.role-row strong { font-size: .69rem; }
.role-row div span { margin-top: 3px; color: var(--muted); font-size: .58rem; line-height: 1.35; }
.ai-trace dl { margin: 0; }
.ai-trace dl div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .64rem; }
.ai-trace dt { color: var(--muted); }
.ai-trace dd { margin: 0; font-weight: 750; text-align: right; }
.coverage-score { text-align: right; }
.coverage-score strong, .coverage-score span { display: block; }
.coverage-score strong { color: var(--cobalt); font-size: 1.2rem; }
.coverage-score span { color: var(--muted); font-size: .58rem; }
.coverage-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.coverage-grid > div { min-height: 62px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 4px 7px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coverage-state { width: 24px; height: 24px; grid-row: 1/3; display: grid; place-items: center; border-radius: 50%; }
.coverage-state.success { color: #087a6c; background: var(--mint-soft); }
.coverage-state.info { color: var(--cobalt); background: var(--cobalt-soft); }
.coverage-state.warning { color: #94600a; background: var(--amber-soft); }
.coverage-grid strong { font-size: .66rem; }
.infra-head { min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 30px 34px; color: white; background: #1d3442; border-radius: 8px; }
.infra-head > div:first-child { max-width: 780px; }
.infra-head h2 { margin-bottom: 9px; font-size: clamp(1.55rem,2.8vw,2.35rem); }
.infra-head p { margin: 0; color: #bbccd4; font-size: .79rem; line-height: 1.6; }
.uptime { display: flex; align-items: center; gap: 12px; padding: 14px 17px; background: #152a36; border: 1px solid #395361; border-radius: 7px; }
.uptime strong, .uptime small { display: block; }
.uptime strong { font-size: .71rem; }
.uptime small { margin-top: 4px; color: #87a0ab; font-size: .59rem; }
.connection-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.connection-grid article { min-height: 145px; position: relative; display: grid; align-content: start; gap: 10px; padding: 15px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.connection-icon { width: 40px; height: 40px; }
.connection-icon.online { color: var(--mint); background: var(--mint-soft); }
.connection-icon.pending { color: var(--amber); background: var(--amber-soft); }
.connection-grid article > div span, .connection-grid article > div strong, .connection-grid article > div small { display: block; }
.connection-grid article > div span { color: var(--muted); font-size: .6rem; }
.connection-grid article > div strong { margin: 4px 0; font-size: .69rem; }
.connection-grid article > div small { color: #99a2af; font-size: .56rem; overflow-wrap: anywhere; }
.connection-grid article > .badge { position: absolute; right: 10px; top: 10px; }
.topology-map { width: 100%; min-width: 0; max-width: 100%; display: grid; justify-items: center; overflow-x: auto; padding: 10px; }
.topology-node { width: 190px; min-height: 78px; display: grid; grid-template-columns: auto minmax(0,1fr); align-content: center; gap: 3px 9px; padding: 13px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 7px; }
.topology-node svg { grid-row: 1/3; color: var(--cobalt); }
.topology-node strong { font-size: .7rem; }
.topology-node span { color: var(--muted); font-size: .59rem; }
.topology-node.primary-node { color: white; background: var(--ink-2); border-color: var(--ink-2); }
.topology-node.primary-node span { color: #99a7b9; }
.topology-node.pending-node { border-style: dashed; }
.connector-line { width: 1px; height: 24px; background: var(--line-strong); }
.topology-branches { width: 425px; height: 25px; position: relative; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }
.topology-branches::before { content: ""; width: 1px; height: 25px; position: absolute; left: 50%; top: 0; background: var(--line-strong); }
.topology-leaves { display: grid; grid-template-columns: repeat(3,190px); gap: 22px; }
.continuity-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.continuity-grid article { min-height: 100px; display: grid; grid-template-columns: auto minmax(0,1fr); align-content: center; gap: 3px 10px; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.continuity-grid .list-icon { grid-row: 1/4; }
.continuity-grid span, .continuity-grid strong, .continuity-grid small { display: block; }
.continuity-grid div > span { color: var(--muted); font-size: .61rem; }
.continuity-grid div > strong { margin: 4px 0; font-size: .76rem; }
.continuity-grid div > small { color: #939daa; font-size: .57rem; line-height: 1.3; }
.continuity-grid .badge { grid-column: 2; margin-top: 5px; }
.access-denied, .empty-state { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.access-denied { max-width: 720px; margin: 80px auto; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.access-denied svg { color: var(--cobalt); }
.access-denied h2, .empty-state h2, .empty-state h3 { margin: 0; color: var(--ink); }
.access-denied p, .empty-state p { margin: 0; font-size: .74rem; }
.empty-state.large { min-height: 320px; background: white; border: 1px dashed var(--line-strong); border-radius: 8px; }

/* Drawer and modal */
.drawer-layer { position: fixed; inset: 0; z-index: 80; visibility: hidden; pointer-events: none; }
.drawer-layer.open { visibility: visible; pointer-events: auto; }
.drawer-scrim, .nav-scrim { position: absolute; inset: 0; border: 0; background: rgba(14,22,33,.38); opacity: 0; transition: opacity .22s ease; }
.drawer-layer.open .drawer-scrim { opacity: 1; }
.drawer { width: min(430px, 100vw); position: absolute; inset: 0 0 0 auto; padding: 20px; background: white; box-shadow: -20px 0 60px rgba(23,33,47,.18); transform: translateX(102%); transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.drawer-layer.open .drawer { transform: translateX(0); }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; font-size: 1.2rem; }
.drawer-list { display: grid; }
.drawer-list article { min-height: 88px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.drawer-list strong { font-size: .7rem; }
.drawer-list p { margin: 4px 0; color: var(--ink-3); font-size: .64rem; line-height: 1.4; }
.drawer-list small { color: var(--muted); font-size: .58rem; }
.modal { width: min(760px, calc(100vw - 30px)); max-height: calc(100vh - 30px); margin: auto; padding: 0; overflow-y: auto; color: var(--ink); background: white; border: 0; border-radius: 8px; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(14,22,33,.55); backdrop-filter: blur(3px); }
.modal-close-row { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 10px 10px 0; background: white; }
.modal-close-row .icon-button { border: 0; }
.modal-form { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 7px 13px; padding: 0 26px 26px; }
.modal-icon { width: 44px; height: 44px; grid-row: 1/2; display: grid; place-items: center; color: var(--cobalt); background: var(--cobalt-soft); border-radius: 7px; }
.modal-icon.amber { color: var(--amber); background: var(--amber-soft); }
.modal-form > div:nth-child(2) h2 { margin-bottom: 5px; font-size: 1.3rem; }
.modal-form > div:nth-child(2) p { margin-bottom: 0; color: var(--muted); font-size: .7rem; }
.form-grid { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin-top: 16px; }
.form-grid .full { grid-column: 1/-1; }
.modal-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }

@keyframes reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(18,165,148,.12); } 50% { box-shadow: 0 0 0 7px rgba(18,165,148,.04); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translate(-12px, 9px) rotate(29deg); } }

@media (max-width: 1240px) {
  .topbar { grid-template-columns: minmax(190px,1fr) minmax(240px,1.2fr) auto; padding: 0 20px; }
  .connection-state { display: none; }
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .system-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .connection-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .coverage-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .continuity-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 52vh; padding: 34px; }
  .story-copy { padding: 60px 0; }
  .story-copy h1 { font-size: clamp(2.35rem,8vw,4.5rem); }
  .login-access { min-height: 48vh; padding: 42px 30px; }
  .app-shell { grid-template-columns: minmax(0,1fr); overflow-x: hidden; }
  .sidebar { transform: translateX(-102%); transition: transform .24s cubic-bezier(.2,.7,.2,1); box-shadow: 18px 0 45px rgba(17,26,38,.22); }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .nav-scrim { display: block; z-index: 25; pointer-events: none; }
  .app-shell.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .workspace { width: 100%; max-width: 100vw; grid-column: 1; }
  .mobile-menu { display: inline-flex; }
  .topbar { grid-template-columns: minmax(190px,1fr) minmax(220px,1fr) auto; }
  .top-actions .button span { display: none; }
  .command-band, .ai-command { grid-template-columns: 1fr; }
  .case-pulse, .ai-context { width: 100%; }
  .dashboard-columns, .case-summary-grid, .dms-layout, .evidence-layout, .ai-layout, .audit-layout { grid-template-columns: 1fr; }
  .case-workspace { grid-template-columns: 240px minmax(0,1fr); }
  .connection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .coverage-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .login-story { min-height: 56vh; padding: 24px; }
  .login-brand { margin-bottom: 26px; }
  .story-copy { margin: 0; padding: 38px 0; }
  .story-copy h1 { font-size: 2.55rem; }
  .trust-strip { gap: 10px 18px; }
  .login-access { min-height: 44vh; padding: 34px 20px; }
  .demo-row { grid-template-columns: 1fr; }
  .topbar { height: 66px; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 0 12px; }
  .global-search { display: none; }
  .topbar-title h1 { font-size: .95rem; }
  .top-actions { gap: 6px; }
  .top-actions .button { width: 38px; min-height: 38px; padding: 0; }
  .view-container { padding: 14px 12px 38px; }
  .command-band, .ai-command, .infra-head { padding: 23px 20px; }
  .case-pulse { min-width: 0; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 96px; padding: 12px; }
  .metric-icon { width: 36px; height: 36px; }
  .metric div > strong { font-size: 1.3rem; }
  .workflow-surface { padding: 16px; }
  .system-strip { grid-template-columns: 1fr; }
  .case-table-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .case-table-row > .badge { display: none; }
  .case-workspace { display: block; }
  .case-index { position: static; margin-bottom: 12px; }
  .case-list { max-height: 230px; }
  .case-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
  .stage-control { width: 100%; }
  .data-grid { grid-template-columns: 1fr; }
  .context-bar { align-items: stretch; flex-direction: column; }
  .context-bar label { width: 100%; }
  .pipeline-band { padding: 18px; }
  .evidence-overview { grid-template-columns: 1fr; }
  .document-list article { grid-template-columns: auto minmax(0,1fr) auto; }
  .document-list article > .badge { grid-column: 2/4; }
  .confidence { display: none; }
  .fact-head, .fact-row { grid-template-columns: minmax(170px,1fr) 110px; }
  .fact-head span:nth-child(2), .fact-row > span { display: none; }
  .ai-context { min-width: 0; }
  .review-box { grid-template-columns: 1fr; }
  .review-actions { justify-content: flex-start; }
  .knowledge-head, .audit-head, .infra-head { min-height: 0; align-items: flex-start; flex-direction: column; padding: 20px; }
  .knowledge-toolbar { align-items: stretch; flex-direction: column; }
  .knowledge-toolbar form { min-width: 0; }
  .knowledge-toolbar > div { overflow-x: auto; }
  .audit-seal, .uptime { width: 100%; }
  .connection-grid, .continuity-grid, .coverage-grid { grid-template-columns: 1fr; }
  .topology-map { justify-items: start; }
  .topology-branches { width: 404px; }
  .topology-leaves { grid-template-columns: repeat(3,180px); }
  .ledger-list article { grid-template-columns: auto minmax(0,1fr); }
  .ledger-list time { grid-column: 2; }
  .section-heading { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .modal-form { padding: 0 18px 20px; }
}

@media (max-width: 420px) {
  .story-copy h1 { font-size: 2.15rem; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric { min-height: 82px; }
  .case-pulse { align-items: flex-start; flex-direction: column; }
  .ai-context { grid-template-columns: 1fr 1fr; }
  .case-tabs { padding: 0 4px; }
  .case-tabs button { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
