@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/static/fonts/ibm-plex-arabic-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* Public site */
.landing-page {
  min-height: 100vh;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
}
.landing-container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}
.landing-header {
  position: sticky;
  z-index: 60;
  top: 0;
  height: 74px;
  border-bottom: 1px solid #e2e8ec;
  background: rgba(255, 255, 255, 0.97);
}
.landing-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 36px;
}
.landing-brand {
  height: 100%;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.landing-brand img { width: 150px; height: auto; display: block; }
.landing-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  color: #42546a;
  font-size: 14px;
  font-weight: 600;
}
.landing-nav a { transition: color 150ms ease; }
.landing-nav a:hover { color: var(--brand-deep); }
.landing-entry { margin-inline-start: auto; }
.landing-nav-toggle { display: none !important; margin-inline-start: auto; }
.landing-hero {
  position: relative;
  padding: 86px 0 0;
  overflow: hidden;
  border-bottom: 1px solid #dfe7ea;
  background: #fff;
}
.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--nav);
}
.landing-hero-copy {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}
.landing-eyebrow {
  margin-bottom: 23px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--brand-deep);
  font-size: 14px;
  font-weight: 700;
}
.landing-eyebrow svg { width: 18px; height: 18px; }
.landing-hero h1 {
  max-width: 900px;
  margin-bottom: 22px;
  color: var(--nav);
  font-size: 56px;
  line-height: 1.22;
}
.landing-hero-copy > p {
  max-width: 740px;
  margin-bottom: 30px;
  color: #53657a;
  font-size: 19px;
  line-height: 1.95;
}
.landing-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.landing-hero-actions .button { min-width: 158px; }
.landing-context {
  margin-top: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
}
.landing-context svg { width: 16px; height: 16px; color: var(--brand); }
.landing-product-preview {
  position: relative;
  width: min(1120px, calc(100% - 72px));
  height: 430px;
  margin: 58px auto -84px;
  overflow: hidden;
  border: 1px solid #cdd8de;
  border-radius: 8px 8px 0 0;
  background: #f3f7f8;
  box-shadow: 0 22px 50px rgba(1, 23, 71, 0.13);
}
.landing-product-preview > img,
.landing-product-preview video {
  width: 100%;
  height: calc(100% - 34px);
  display: block;
  object-fit: cover;
  object-position: center top;
  background: #eff4f5;
}
.landing-tour-toggle {
  position: absolute;
  z-index: 3;
  left: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  background: rgba(1, 23, 71, 0.86);
  box-shadow: 0 5px 16px rgba(1, 23, 71, 0.2);
}
.landing-tour-toggle:hover { background: #011747; }
.landing-tour-toggle svg { width: 17px; height: 17px; }
@media (prefers-reduced-motion: reduce) {
  .landing-product-preview video { animation: none; }
}
.landing-preview-bar {
  height: 34px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #dce5e8;
  color: #708096;
  background: #f8fafb;
  font-size: 11px;
}
.landing-preview-bar > span:first-child {
  width: 48px;
  height: 6px;
  justify-self: start;
  border-radius: 3px;
  background: #dce5e8;
}
.landing-band { padding: 118px 0 94px; background: #f6f8f9; }
.landing-section-heading { max-width: 610px; }
.landing-section-heading > span,
.landing-final-inner > div > span {
  margin-bottom: 11px;
  display: block;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
}
.landing-section-heading h2 {
  margin-bottom: 14px;
  color: var(--nav);
  font-size: 34px;
  line-height: 1.35;
}
.landing-section-heading p {
  margin: 0;
  color: #607086;
  font-size: 16px;
  line-height: 1.85;
}
.capability-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #cfd9de;
  border-bottom: 1px solid #cfd9de;
}
.capability-grid article {
  position: relative;
  min-height: 270px;
  padding: 34px 30px 32px;
  border-inline-start: 1px solid #cfd9de;
}
.capability-grid article:last-child { border-inline-start: 0; }
.capability-grid article > svg {
  width: 27px;
  height: 27px;
  margin-bottom: 44px;
  color: var(--brand-deep);
}
.capability-grid article > span {
  position: absolute;
  top: 34px;
  inset-inline-end: 30px;
  color: #91a0ae;
  font-size: 12px;
  font-weight: 600;
}
.capability-grid h3 { margin-bottom: 12px; color: var(--nav); font-size: 20px; }
.capability-grid p { margin: 0; color: #5c6d80; line-height: 1.85; }
.landing-workflow { padding: 100px 0; background: #fff; }
.workflow-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
  gap: 96px;
  align-items: start;
}
.workflow-steps { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.workflow-steps li {
  position: relative;
  min-height: 138px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 21px;
}
.workflow-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 48px;
  bottom: 2px;
  right: 22px;
  width: 1px;
  background: #ccd7dc;
}
.workflow-steps li > span {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #aebdc5;
  border-radius: 50%;
  color: var(--nav);
  background: #fff;
  font-weight: 700;
}
.workflow-steps h3 { margin: 2px 0 8px; color: var(--nav); font-size: 19px; }
.workflow-steps p { margin: 0; color: #607086; line-height: 1.8; }
.deployment-band { padding-top: 94px; background: var(--nav); color: #fff; }
.deployment-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(500px, 1.2fr);
  gap: 92px;
  align-items: start;
}
.deployment-band .landing-section-heading > span { color: #45c0b6; }
.deployment-band .landing-section-heading h2 { color: #fff; }
.deployment-list { border-top: 1px solid rgba(255, 255, 255, 0.24); }
.deployment-list > div {
  min-height: 104px;
  padding: 22px 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}
.deployment-list > div > svg { margin-top: 3px; color: #45c0b6; }
.deployment-list span { display: flex; flex-direction: column; gap: 5px; }
.deployment-list strong { font-size: 17px; }
.deployment-list small { color: #bdc9d9; font-size: 14px; line-height: 1.75; }
.landing-final { padding: 72px 0; border-bottom: 1px solid #e0e7ea; background: #fff; }
.landing-final-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.landing-final-inner h2 { margin-bottom: 7px; color: var(--nav); font-size: 29px; }
.landing-final-inner p { margin: 0; color: #65758a; }
.landing-final-inner .button { min-width: 155px; }
.landing-footer { padding: 26px 0; background: #fff; color: #617187; font-size: 13px; }
.landing-footer .landing-container { display: flex; align-items: center; gap: 11px; }
.landing-footer img { width: 31px; height: 31px; object-fit: contain; }
.landing-footer a { margin-inline-start: auto; color: var(--nav); font-weight: 700; }
.login-home-link {
  width: max-content;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #607086;
  font-size: 13px;
  font-weight: 600;
}
.login-home-link:hover { color: var(--brand-deep); }
.login-home-link svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .landing-container { width: min(100% - 36px, 760px); }
  .landing-header-inner { gap: 18px; }
  .landing-nav-toggle { display: grid !important; }
  .landing-nav {
    position: absolute;
    top: 73px;
    right: 18px;
    left: 18px;
    padding: 12px;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }
  .landing-nav.open { display: flex; }
  .landing-nav a { min-height: 46px; padding: 0 12px; display: flex; align-items: center; border-bottom: 1px solid #edf1f3; }
  .landing-nav a:last-child { border-bottom: 0; }
  .landing-entry { margin-inline-start: 0; }
  .landing-hero { padding-top: 68px; }
  .landing-hero h1 { max-width: 720px; font-size: 44px; }
  .landing-product-preview { width: calc(100% - 36px); height: 350px; margin-top: 48px; }
  .landing-band { padding: 102px 0 76px; }
  .workflow-layout, .deployment-layout { grid-template-columns: 1fr; gap: 50px; }
  .landing-workflow { padding: 80px 0; }
}

@media (max-width: 680px) {
  .landing-container { width: calc(100% - 28px); }
  .landing-header { height: 66px; }
  .landing-brand img { width: 124px; }
  .landing-nav { top: 65px; right: 14px; left: 14px; }
  .landing-entry { width: 42px; min-width: 42px; padding: 0; }
  .landing-entry span { display: none; }
  .landing-hero { padding-top: 54px; }
  .landing-eyebrow { margin-bottom: 17px; font-size: 12px; }
  .landing-hero h1 { margin-bottom: 16px; font-size: 34px; line-height: 1.32; }
  .landing-hero-copy > p { margin-bottom: 24px; font-size: 16px; line-height: 1.85; }
  .landing-hero-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .landing-hero-actions .button { width: 100%; }
  .landing-context { align-items: flex-start; text-align: start; }
  .landing-product-preview { width: calc(100% - 20px); height: 215px; margin: 38px auto -40px; }
  .landing-preview-bar { height: 28px; }
  .landing-band { padding: 72px 0 60px; }
  .landing-section-heading h2 { font-size: 27px; }
  .capability-grid { grid-template-columns: 1fr; margin-top: 36px; }
  .capability-grid article { min-height: 0; padding: 27px 4px; border-inline-start: 0; border-bottom: 1px solid #cfd9de; }
  .capability-grid article:last-child { border-bottom: 0; }
  .capability-grid article > svg { margin-bottom: 24px; }
  .capability-grid article > span { top: 29px; inset-inline-end: 4px; }
  .landing-workflow { padding: 66px 0; }
  .workflow-layout { gap: 38px; }
  .workflow-steps li { min-height: 144px; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
  .workflow-steps li > span { width: 40px; height: 40px; }
  .workflow-steps li:not(:last-child)::after { top: 42px; right: 19px; }
  .deployment-band { padding-top: 66px; }
  .deployment-layout { gap: 34px; }
  .deployment-list > div { grid-template-columns: 32px minmax(0, 1fr); gap: 13px; }
  .landing-final { padding: 52px 0; }
  .landing-final-inner { align-items: stretch; flex-direction: column; gap: 24px; }
  .landing-final-inner h2 { font-size: 25px; }
  .landing-final-inner .button { width: 100%; }
  .landing-footer .landing-container { align-items: flex-start; flex-wrap: wrap; }
  .landing-footer a { width: 100%; margin-inline-start: 42px; }
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/static/fonts/ibm-plex-arabic-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/static/fonts/ibm-plex-arabic-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/static/fonts/ibm-plex-arabic-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f3f7f8;
  --surface: #ffffff;
  --surface-muted: #f7fafb;
  --ink: #071a33;
  --ink-soft: #26394f;
  --muted: #64748b;
  --line: #dce5e8;
  --line-strong: #c8d4d9;
  --nav: #011747;
  --nav-soft: #09275b;
  --brand: #078f89;
  --brand-deep: #006f6a;
  --blue: #078f89;
  --blue-soft: #e5f5f3;
  --process: #2867a8;
  --process-deep: #174f89;
  --process-soft: #eaf2fb;
  --waiting: #6b7788;
  --waiting-soft: #f1f4f6;
  --amber: #a96312;
  --amber-soft: #fff4df;
  --red: #b4233c;
  --red-soft: #fdecee;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.05);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}
button, input, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 32px; line-height: 1.25; font-weight: 700; }
h2 { margin-bottom: 0; font-size: 20px; line-height: 1.4; font-weight: 700; }
h3 { margin-bottom: 6px; font-size: 16px; line-height: 1.45; font-weight: 700; }
svg { width: 20px; height: 20px; stroke-width: 1.8; }
.muted { color: var(--muted); line-height: 1.8; }
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(1, 23, 71, 0.05);
}
.topbar-inner {
  width: min(1480px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 34px;
}
.brand {
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
}
.brand img { width: 160px; height: auto; display: block; }
.primary-nav {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.primary-nav a {
  position: relative;
  min-width: 108px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #526276;
  font-weight: 600;
  transition: color 160ms ease, background 160ms ease;
}
.primary-nav a:hover { color: var(--nav); background: #f5f9fa; }
.primary-nav a.active { color: var(--nav); background: #edf7f6; }
.primary-nav a.active::after {
  content: "";
  position: absolute;
  right: 16px;
  left: 16px;
  bottom: 0;
  height: 3px;
  background: var(--brand);
}
.primary-nav svg { width: 18px; height: 18px; }
.account-area {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-area form { display: flex; }
.institution-name {
  max-width: 180px;
  overflow: hidden;
  color: #5c6a7d;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--nav);
  border-radius: 50%;
  color: #fff;
  background: var(--nav);
  font-size: 13px;
  font-weight: 700;
}
.nav-toggle { display: none !important; }

.page-shell {
  width: min(1420px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 64px;
}
.page-heading,
.case-header,
.investigator-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.page-heading > div:first-child,
.case-header > div:first-child,
.investigator-header > div:first-child { min-width: 0; }
.page-heading p,
.case-header p,
.investigator-header p { margin: 0; color: var(--muted); line-height: 1.7; }
.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}
.page-heading-stats { display: flex; align-items: center; gap: 8px; }
.heading-line { display: flex; align-items: center; gap: 12px; }
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}
.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}
.status-dot.attention { color: var(--red); }
.status-dot.attention::before { background: var(--red); }
.status-dot.success { color: var(--brand-deep); }
.status-dot.success::before { background: var(--brand); }

.workflow-badge {
  min-height: 29px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: #f7f9fa;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.workflow-badge svg { width: 14px; height: 14px; }
.workflow-badge.workflow-processing { color: var(--process-deep); border-color: #bdd2e8; background: var(--process-soft); }
.workflow-badge.workflow-processing svg,
.document-workflow-state.state-active svg { animation: workflow-spin 1.2s linear infinite; }
.workflow-badge.workflow-queued { color: #76520e; border-color: #efd6a3; background: var(--amber-soft); }
.workflow-badge.workflow-failed { color: #982531; border-color: #f0c9cf; background: var(--red-soft); }

.processing-page { width: min(1180px, calc(100% - 48px)); }
.processing-heading { margin-bottom: 20px; }
.back-link { margin-bottom: 21px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.back-link:hover { color: var(--nav); }
.back-link svg { width: 16px; height: 16px; }
.processing-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.processing-title-row p { margin: 0; color: var(--muted); }
.processing-heading-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.scan-reference { min-height: 30px; padding: 3px 4px 3px 9px; border: 1px solid var(--line); border-radius: 5px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: #fff; font-size: 10px; }
.scan-reference code { max-width: 190px; overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reference-copy { width: 27px; height: 27px; border-radius: 4px; color: var(--muted); }
.reference-copy svg { width: 13px; height: 13px; }
.reference-copy.is-copied { color: var(--brand-deep); background: var(--blue-soft); }

.processing-steps {
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
}
.processing-steps li { position: relative; min-width: 0; display: grid; justify-items: center; gap: 7px; color: var(--waiting); font-size: 11px; font-weight: 600; text-align: center; }
.processing-steps li::after { content: ""; position: absolute; z-index: -1; top: 18px; right: calc(50% + 20px); width: calc(100% - 40px); height: 2px; background: var(--line-strong); }
.processing-steps li:first-child::after { display: none; }
.processing-step-icon { width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; display: grid; place-items: center; color: var(--waiting); background: var(--surface); transition: color 180ms ease, border-color 180ms ease, background 180ms ease; }
.processing-step-icon svg { width: 17px; height: 17px; }
.processing-steps li.is-complete { color: var(--brand-deep); }
.processing-steps li.is-complete::after { background: var(--brand); }
.processing-steps li.is-complete .processing-step-icon { border-color: #acd6d2; color: var(--brand-deep); background: var(--blue-soft); }
.processing-steps li.is-current { color: var(--process-deep); }
.processing-steps li.is-current .processing-step-icon { border-color: var(--process); color: #fff; background: var(--process); box-shadow: 0 0 0 4px rgba(40, 103, 168, .10); }
.processing-steps.has-error li.is-current { color: var(--red); }
.processing-steps.has-error li.is-current .processing-step-icon { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 4px rgba(180, 35, 60, .10); }

.processing-workspace {
  min-height: 0;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--process);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.processing-workspace.is-failed { border-inline-start-color: var(--red); }
.processing-main { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 18px; }
.processing-main h2 { margin-bottom: 5px; font-size: 21px; }
.processing-main p { margin: 0; color: var(--muted); line-height: 1.8; }
.processing-symbol {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--process);
  clip-path: polygon(24% 0, 76% 0, 100% 24%, 100% 76%, 76% 100%, 24% 100%, 0 76%, 0 24%);
}
.processing-symbol svg { width: 27px; height: 27px; }
.is-failed .processing-symbol { color: #fff; background: var(--red); }
.danger-kicker { color: var(--red); }
.process-kicker { color: var(--process); }
.processing-progress { margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--line); }
.processing-progress-meta { margin-bottom: 9px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.processing-progress-meta span { color: var(--muted); }
.processing-progress-meta strong { color: var(--process-deep); }
.document-progress-segments { width: 100%; min-height: 10px; display: flex; gap: 5px; direction: rtl; }
.document-progress-segments > span { height: 10px; flex: 1; min-width: 10px; border-radius: 3px; background: var(--waiting-soft); transition: background 220ms ease, transform 220ms ease; }
.document-progress-segments .segment-done { background: var(--brand); }
.document-progress-segments .segment-active { background: var(--process); transform: scaleY(1.16); animation: processing-pulse 1.6s ease-in-out infinite; }
.document-progress-segments .segment-failed { background: var(--red); }
.processing-progress small { margin-top: 11px; display: block; color: var(--muted); line-height: 1.7; }
.processing-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 9px; }
.processing-documents { margin-top: 28px; }
.processing-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.processing-document {
  position: relative;
  min-height: 86px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--line-strong);
  border-radius: 7px;
  display: grid;
  grid-template-columns: 22px 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  transition: border-color 180ms ease, background 180ms ease;
}
.processing-document.is-active { border-color: #b8cfe6; border-inline-start-color: var(--process); background: #fbfdff; }
.processing-document.is-done { border-inline-start-color: var(--brand); }
.processing-document.is-failed { border-color: #efc8ce; border-inline-start-color: var(--red); background: #fffafa; }
.processing-document-number { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; color: var(--muted); background: var(--waiting-soft); font-size: 10px; font-weight: 700; }
.processing-document.is-active .processing-document-number { color: var(--process-deep); background: var(--process-soft); }
.processing-document.is-done .processing-document-number { color: var(--brand-deep); background: var(--blue-soft); }
.processing-document.is-failed .processing-document-number { color: var(--red); background: var(--red-soft); }
.processing-document-icon { width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center; color: var(--nav); background: #eef2f7; }
.processing-document.is-active .processing-document-icon { color: var(--process-deep); background: var(--process-soft); }
.processing-document-icon svg { width: 19px; height: 19px; }
.processing-document > div { min-width: 0; }
.processing-document strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.processing-document small { margin-top: 3px; display: block; color: var(--muted); font-size: 10px; }
.document-workflow-state { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.document-workflow-state > span:first-child { display: inline-flex; }
.document-workflow-state svg { width: 13px; height: 13px; }
.document-workflow-state.state-done { color: var(--brand-deep); }
.document-workflow-state.state-active { color: var(--process-deep); }
.document-workflow-state.state-failed { color: var(--red); }

@keyframes workflow-spin { to { transform: rotate(360deg); } }
@keyframes processing-pulse { 50% { opacity: .62; } }
@media (prefers-reduced-motion: reduce) {
  .workflow-badge.workflow-processing svg,
  .document-workflow-state.state-active svg { animation: none; }
  .document-progress-segments .segment-active { animation: none; }
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.button svg { width: 18px; height: 18px; }
.button.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.button.secondary { color: var(--ink-soft); background: var(--surface); border-color: var(--line-strong); }
.button.secondary:hover { border-color: #9ca7b7; background: var(--surface-muted); }
.button.compact { min-height: 36px; padding: 6px 11px; font-size: 13px; }
.button.full { width: 100%; }
.icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.icon-button svg { width: 18px; height: 18px; }
.icon-button.dark { color: #55657a; }
.icon-button.dark:hover { color: var(--red); background: var(--red-soft); }
.icon-button.light { color: var(--ink-soft); border-color: var(--line); background: #fff; }
.icon-button.light:hover { border-color: #9ca7b7; background: var(--surface-muted); }
.icon-button.table-action { width: 32px; height: 32px; color: var(--muted); }
.icon-button.table-action:hover { color: var(--brand); background: var(--blue-soft); }
.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible { outline: 2px solid rgba(40, 103, 168, .36); outline-offset: 2px; }

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel-heading,
.section-heading {
  margin-bottom: 19px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.panel-heading-icon { width: 20px; height: 20px; color: var(--nav); }
.panel-heading p,
.section-heading p { margin: 4px 0 0; color: var(--muted); line-height: 1.7; }
.quiet-badge,
.page-count,
.risk-badge,
.severity,
.engine-indicator,
.inline-status {
  min-height: 27px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.quiet-badge, .page-count { color: var(--ink-soft); background: #eef1f5; }
.quiet-badge svg { width: 14px; height: 14px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-size: 13px; font-weight: 600; }
.text-link svg { width: 15px; height: 15px; }

.metric-grid {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric {
  min-width: 0;
  min-height: 116px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
}
.metric-icon.navy { color: #fff; background: var(--nav); }
.metric-icon.blue { color: var(--process-deep); background: var(--process-soft); }
.metric-icon.success { color: var(--brand-deep); background: var(--blue-soft); }
.metric-icon.amber { color: #8f540b; background: #fff0d3; }
.metric-icon.burgundy { color: #a51f38; background: var(--red-soft); }
.metric-icon svg { width: 21px; height: 21px; }
.metric > div:last-child { min-width: 0; }
.metric span, .metric small { display: block; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric strong { display: block; margin: 2px 0; font-size: 29px; line-height: 1.25; }
.metric small { color: #8a93a3; font-size: 11px; }

.workspace-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, .78fr) minmax(0, 1.5fr);
  gap: 18px;
  align-items: start;
}
.scan-upload { position: sticky; top: 90px; }
.field { display: grid; gap: 7px; }
.field > span { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
input,
select {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
}
input::placeholder { color: #98a1b0; }
input:focus,
select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(7, 143, 137, 0.13); }
.input-with-icon { position: relative; }
.input-with-icon > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 12px;
  width: 17px;
  height: 17px;
  color: #7d8796;
  transform: translateY(-50%);
  pointer-events: none;
}
.input-with-icon input { padding-right: 39px; }
.select-with-icon { position: relative; display: block; }
.select-with-icon > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 12px;
  width: 17px;
  height: 17px;
  color: #7d8796;
  transform: translateY(-50%);
  pointer-events: none;
}
.select-with-icon select { padding-right: 39px; appearance: none; cursor: pointer; }
.form-stack { margin-top: 25px; display: grid; gap: 18px; }
.file-picker { margin: 17px 0; }
.file-drop {
  position: relative;
  min-height: 188px;
  border: 1px dashed #aeb8c7;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  background: var(--surface-muted);
  text-align: center;
  cursor: pointer;
}
.file-drop:hover,
.file-drop.is-dragging { border-color: var(--brand); background: #f2faf9; }
.file-drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.file-drop-icon {
  width: 43px;
  height: 43px;
  margin-bottom: 4px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  clip-path: polygon(22% 0, 78% 0, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0 78%, 0 22%);
}
.file-drop > span:not(.file-drop-icon) { color: var(--muted); font-size: 13px; }
.file-drop small { color: var(--brand); font-weight: 600; }
.file-drop.has-files { border-style: solid; border-color: var(--brand); background: #f2faf9; }
.selected-files-panel {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.selected-files-panel > header {
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-muted);
}
.selected-files-panel > header span,
.selected-files-panel > header strong { display: block; }
.selected-files-panel > header span { color: var(--muted); font-size: 11px; font-weight: 600; }
.selected-files-panel > header strong { margin-top: 2px; color: var(--ink-soft); font-size: 13px; }
.file-selection-actions { display: flex; gap: 5px; }
.icon-button.danger:hover { border-color: #e7aab2; color: var(--red); background: var(--red-soft); }
.selected-file-list {
  max-height: 270px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.selected-file-row {
  min-height: 59px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
}
.selected-file-row:last-child { border-bottom: 0; }
.selected-file-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--process-deep);
  background: var(--process-soft);
}
.selected-file-icon svg { width: 18px; height: 18px; }
.selected-file-row > div { min-width: 0; }
.selected-file-row strong,
.selected-file-row small { display: block; }
.selected-file-row strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-file-row small { margin-top: 2px; color: var(--muted); font-size: 11px; direction: ltr; text-align: right; }
.selected-file-remove { width: 32px; height: 32px; color: #7b8796; }
.selected-file-remove:hover { color: var(--red); background: var(--red-soft); }
.selected-file-remove svg { width: 16px; height: 16px; }
.file-selection-error { margin: 9px 2px 0; color: var(--red); font-size: 12px; font-weight: 600; }

.table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.history-panel { min-width: 0; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; text-align: right; }
.data-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.data-table [dir="ltr"] { white-space: nowrap; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbfc; }
.clickable-report-row { cursor: pointer; transition: background-color .15s ease; }
.clickable-report-row:hover { background: #f4f8fb !important; }
.clickable-report-row:hover .case-link { color: var(--brand-deep); }
.clickable-report-row:hover .table-action { color: var(--brand); background: var(--blue-soft); }
.history-table .scan-row.status-processing td { background: #fbfdff; }
.history-table .scan-row.status-processing td:first-child { box-shadow: inset -3px 0 var(--process); }
.history-table .scan-row.status-queued td:first-child { box-shadow: inset -3px 0 var(--amber); }
.history-table .scan-row.status-failed td { background: #fffafa; }
.history-table .scan-row.status-failed td:first-child { box-shadow: inset -3px 0 var(--red); }
.case-link { display: block; max-width: 330px; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.data-table td small { display: block; margin-top: 3px; color: #929aa8; font-size: 10px; direction: ltr; text-align: right; }
.history-table th:first-child { min-width: 220px; }
.risk-badge.risk-منخفض { color: var(--brand-deep); background: var(--blue-soft); }
.risk-badge.risk-متوسط { color: #88500d; background: var(--amber-soft); }
.risk-badge.risk-مرتفع { color: #9f2430; background: var(--red-soft); }
.empty-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}
.empty-state svg { width: 30px; height: 30px; color: #8c96a6; }
.empty-state strong { color: var(--ink-soft); }

.alert {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #f0bdc3;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8f2430;
  background: #fff1f2;
}
.alert svg { width: 18px; height: 18px; }
.page-alert { margin-bottom: 18px; }
.success-alert { margin-bottom: 18px; color: var(--brand-deep); border-color: #a9d9d5; background: var(--blue-soft); }

.breadcrumbs {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}
.breadcrumbs a { color: var(--blue); font-weight: 600; }
.breadcrumbs svg { width: 14px; height: 14px; flex: 0 0 auto; }
.breadcrumbs span { overflow: hidden; text-overflow: ellipsis; }
.case-actions { display: flex; align-items: center; gap: 9px; }
.risk-score {
  width: 88px;
  height: 72px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  align-content: center;
  color: #fff;
}
.risk-score span { font-size: 30px; line-height: 1; font-weight: 700; }
.risk-score small { margin-top: 4px; font-size: 11px; font-weight: 600; }
.risk-score.risk-منخفض { background: var(--brand); }
.risk-score.risk-متوسط { background: #a86616; }
.risk-score.risk-مرتفع { background: #a72733; }

.case-result-shell { width: min(1240px, calc(100% - 40px)); }
.result-header { margin-bottom: 18px; }
.case-view-tabs {
  min-height: 58px;
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.case-view-tabs::-webkit-scrollbar { display: none; }
.case-view-tabs button {
  min-width: 138px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.case-view-tabs button:hover { color: var(--ink); background: #f8fafb; }
.case-view-tabs button.active { border-bottom-color: var(--brand); color: var(--ink); }
.case-view-tabs button:focus-visible { outline: 2px solid rgba(7, 143, 137, .28); outline-offset: -3px; }
.case-view-tabs svg { width: 17px; height: 17px; }
.case-view-tabs b { min-width: 21px; height: 21px; padding: 0 5px; border-radius: 4px; display: grid; place-items: center; color: #596476; background: #edf0f3; font-size: 10px; }
.case-view-tabs b.attention { color: #982531; background: var(--red-soft); }
.case-view-content { min-height: 520px; padding-top: 28px; }
.case-view-pane[hidden] { display: none; }
.outcome-summary {
  padding: 26px 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-inline-start: 4px solid var(--brand);
  display: grid;
  grid-template-columns: minmax(210px, .45fr) minmax(0, 1.55fr);
  align-items: center;
  gap: 32px;
}
.outcome-summary.risk-متوسط { border-inline-start-color: #a86616; }
.outcome-summary.risk-مرتفع { border-inline-start-color: var(--red); }
.outcome-heading { padding-inline-start: 22px; display: flex; align-items: center; gap: 13px; }
.outcome-icon { width: 48px; height: 48px; border-radius: 7px; display: grid; place-items: center; color: var(--brand-deep); background: var(--blue-soft); }
.risk-متوسط .outcome-icon { color: #87500e; background: var(--amber-soft); }
.risk-مرتفع .outcome-icon { color: #982531; background: var(--red-soft); }
.outcome-icon svg { width: 24px; height: 24px; }
.outcome-heading span { color: var(--muted); font-size: 11px; }
.outcome-heading h2 { margin: 2px 0 0; font-size: 27px; }
.outcome-summary > p { margin: 0; padding-inline-end: 24px; color: var(--ink-soft); line-height: 1.9; font-size: 15px; }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.overview-metrics > div { min-width: 0; padding: 19px 16px; border-inline-start: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 9px; }
.overview-metrics > div:first-child { border-inline-start: 0; }
.overview-metrics span { color: var(--muted); font-size: 11px; }
.overview-metrics strong { grid-row: 2; font-size: 25px; line-height: 1.2; }
.overview-metrics svg { grid-column: 2; grid-row: 1 / 3; width: 19px; height: 19px; color: var(--brand); }
.overview-metrics .metric-danger svg, .overview-metrics .metric-danger strong { color: var(--red); }
.overview-metrics .metric-review svg { color: #a86616; }
.overview-next-actions { padding: 22px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.case-pane-heading { min-height: 56px; margin-bottom: 18px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.case-pane-heading h2 { margin: 2px 0 15px; font-size: 22px; }
.case-pane-heading .panel-heading-icon { width: 22px; height: 22px; color: var(--brand); }
.case-pane-heading .triggered-count { color: #982531; background: var(--red-soft); }
.document-grid.result-document-grid { max-width: none; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 16px; }
.document-tile.result-document-tile {
  min-height: 210px;
  padding: 0;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}
.document-tile.result-document-tile.has-findings { border-inline-start: 3px solid var(--red); }
.document-tile.result-document-tile.is-clear { border-inline-start: 3px solid var(--brand); }
.result-document-thumbnail {
  min-width: 0;
  position: relative;
  border-inline-end: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--brand-deep);
  background: #e9edf1;
}
.result-document-thumbnail img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  border: 1px solid #d4d9e0;
  display: block;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 3px 10px rgba(17, 24, 39, .12);
}
.thumbnail-fallback { display: grid; place-items: center; gap: 7px; }
.thumbnail-fallback svg { width: 32px; height: 32px; }
.thumbnail-fallback b { font-size: 10px; letter-spacing: 0; }
.result-document-body { min-width: 0; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 16px; }
.result-document-body .document-info { width: 100%; }
.result-document-body .document-info > strong { text-align: start; }
.result-document-body .document-info > span { margin-top: 6px; }
.document-card-facts { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 11px; }
.document-card-facts span { display: inline-flex; align-items: center; gap: 5px; }
.document-card-facts svg { width: 14px; height: 14px; color: var(--brand); }
.result-document-tile .document-info small { width: fit-content; margin-top: 10px; padding: 2px 6px; border-radius: 4px; display: block; color: #596476; background: #f0f2f5; font-size: 10px; }
.result-document-tile .document-info small svg { width: 12px; height: 12px; margin-inline-end: 4px; vertical-align: -2px; }
.result-document-tile .document-info small.document-attention { color: #982531; background: var(--red-soft); }
.result-document-tile .document-info small.ready { color: var(--brand-deep); background: var(--blue-soft); }
.package-findings-section { border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.package-findings-section > header {
  min-height: 92px;
  padding: 17px 14px;
  border-inline-start: 4px solid var(--nav);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  background: #f7f9fc;
}
.package-scope-icon { width: 42px; height: 42px; border-radius: 6px; display: grid; place-items: center; color: #fff; background: var(--nav); }
.package-scope-icon svg { width: 20px; height: 20px; }
.package-findings-section > header > div > span { color: var(--process-deep); font-size: 10px; font-weight: 700; }
.package-findings-section > header h3 { margin: 1px 0 2px; font-size: 17px; }
.package-findings-section > header p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.package-findings-count { min-width: 30px; height: 30px; border-radius: 4px; display: grid; place-items: center; color: #982531; background: var(--red-soft); font-size: 12px; font-weight: 700; }
.package-findings-list { padding: 12px 0 16px; display: grid; gap: 9px; }
.package-finding { border-inline-start: 3px solid var(--red); border-right-width: 1px; }
.finding-scope-heading { min-height: 58px; padding: 0 4px 9px; border-bottom: 1px solid var(--line-strong); display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.finding-scope-heading.after-package { margin-top: 28px; }
.finding-scope-heading > div > span { color: var(--process-deep); font-size: 10px; font-weight: 700; }
.finding-scope-heading h3 { margin: 1px 0 0; font-size: 17px; }
.finding-scope-heading > span { min-width: 27px; height: 27px; border-radius: 4px; display: grid; place-items: center; color: #982531; background: var(--red-soft); font-size: 11px; font-weight: 700; }
.result-category-list { border-top: 1px solid var(--line); }
.result-category-disclosure { border-bottom: 1px solid var(--line); }
.result-category-disclosure > summary {
  width: 100%;
  min-height: 68px;
  padding: 10px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink);
}
.result-category-disclosure > summary::-webkit-details-marker,
.clear-results-disclosure > summary::-webkit-details-marker { display: none; }
.result-category-disclosure > summary:hover { background: #fafbfc; }
.result-category-title { min-width: 0; display: flex; align-items: center; gap: 11px; }
.result-category-title > svg { width: 20px; height: 20px; color: var(--red); }
.result-category-title strong, .result-category-title small { display: block; }
.result-category-title strong { font-size: 14px; }
.result-category-title small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.result-category-count { display: flex; align-items: center; gap: 10px; color: #982531; font-size: 12px; }
.result-category-count svg { width: 16px; height: 16px; transition: transform 150ms ease; }
.result-category-disclosure[open] .result-category-count svg { transform: rotate(180deg); }
.result-findings-list { padding: 2px 0 18px 31px; }
.clear-results-disclosure { margin-top: 30px; border: 1px solid var(--line); border-radius: 6px; }
.clear-results-disclosure > summary { min-height: 62px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); }
.clear-results-disclosure > summary > span { display: flex; align-items: center; gap: 9px; }
.clear-results-disclosure > summary svg { width: 18px; height: 18px; color: var(--brand); }
.clear-results-disclosure > summary strong, .clear-results-disclosure > summary small { display: block; }
.clear-results-disclosure > summary small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.clear-results-disclosure > summary > svg { transition: transform 150ms ease; }
.clear-results-disclosure[open] > summary > svg { transform: rotate(180deg); }
.clear-category-list { padding: 0 14px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.clear-category-list section { min-width: 0; border-top: 1px solid var(--line); }
.clear-category-list header { min-height: 46px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.clear-category-list header svg { width: 15px; height: 15px; color: var(--brand); }
.clear-category-list header strong { font-size: 11px; }
.clear-category-list header span { color: var(--muted); font-size: 10px; }
.clear-category-list section > div { display: grid; }
.clear-category-list p { min-width: 0; min-height: 38px; margin: 0; border-top: 1px solid #eef0f2; display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.clear-category-list p svg { width: 13px; height: 13px; color: var(--brand); }
.clear-category-list p span { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.clear-category-list p code { color: var(--muted); font-size: 9px; }
.compact-empty-state { min-height: 240px; }
.result-messages { min-height: 280px; max-height: 500px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; }
.result-chat-form { margin-top: 10px; }

.summary-layout {
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .65fr);
  gap: 16px;
}
.executive-text { min-height: 56px; margin-bottom: 20px; color: var(--ink-soft); line-height: 1.9; font-size: 16px; }
.summary-counts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.summary-counts > div { min-width: 0; padding-top: 15px; display: grid; grid-template-columns: 9px auto; column-gap: 8px; align-items: center; }
.summary-counts strong { font-size: 21px; }
.summary-counts small { grid-column: 2; color: var(--muted); }
.count-dot { width: 7px; height: 7px; border-radius: 50%; }
.count-dot.flag { background: var(--red); }
.count-dot.review { background: var(--amber); }
.count-dot.clear { background: var(--blue); }
.fact-list { margin: 0; display: grid; }
.fact-list > div { padding: 9px 0; display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); gap: 12px; }
.fact-list dt { color: var(--muted); }
.fact-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-weight: 600; text-align: left; }
.fact-list.bordered > div { border-bottom: 1px solid var(--line); }
.fact-list.bordered > div:last-child { border-bottom: 0; }

.section-block { margin-top: 32px; }
.section-heading { margin-bottom: 14px; }
.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.document-tile {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  background: var(--surface);
}
.document-tile:hover { border-color: #b6bfcc; box-shadow: var(--shadow); }
.document-type { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 7px; color: var(--brand-deep); background: var(--blue-soft); }
.document-info { min-width: 0; }
.document-info > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-info > span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.document-tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.document-tags span { padding: 2px 6px; border-radius: 4px; color: #596476; background: #f0f2f5; font-size: 10px; }
.document-tags .engine-state.ready { color: var(--brand-deep); background: var(--blue-soft); }

.finding-groups { display: grid; gap: 22px; }
.finding-category-group { min-width: 0; }
.finding-category-heading {
  min-height: 42px;
  margin-bottom: 9px;
  padding: 0 3px 9px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.finding-category-heading > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.finding-category-heading svg { width: 17px; height: 17px; color: var(--brand); }
.finding-category-heading h3 { margin: 0; font-size: 14px; }
.finding-category-group.actionable .finding-category-heading svg { color: var(--red); }
.finding-category-heading .triggered-count { color: #982531; background: var(--red-soft); }
.findings-list { display: grid; gap: 9px; }
.finding-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-right: 3px solid #8e99aa;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  background: var(--surface);
}
.finding-item.finding-مؤشر { border-right-color: var(--red); background: #fffdfd; }
.finding-item.finding-مراجعة { border-right-color: #d1485c; background: #fffdfd; }
.finding-item.finding-سليم { border-right-color: var(--blue); }
.finding-marker { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: #657084; background: #eef1f5; }
.finding-مؤشر .finding-marker { color: var(--red); background: var(--red-soft); }
.finding-مراجعة .finding-marker { color: var(--red); background: var(--red-soft); }
.finding-سليم .finding-marker { color: var(--blue); background: var(--blue-soft); }
.finding-marker svg { width: 17px; height: 17px; }
.finding-title-row { display: flex; justify-content: space-between; gap: 14px; }
.finding-title-row > div:first-child > span { color: var(--muted); font-size: 11px; }
.finding-title-row h3 { margin: 3px 0 0; }
.finding-badges { display: flex; align-items: flex-start; gap: 6px; }
.finding-badges code { padding: 4px 7px; border-radius: 4px; color: #596476; background: #f0f2f5; direction: ltr; font-size: 11px; }
.finding-مؤشر .finding-badges code,
.finding-مراجعة .finding-badges code { color: #982531; background: var(--red-soft); }
.finding-content > p { margin: 8px 0 9px; color: var(--muted); line-height: 1.75; }
.related-documents { margin: 11px 0 13px; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 10px; }
.related-documents > span { padding-top: 5px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.related-documents > span svg { width: 13px; height: 13px; }
.related-documents > div { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.related-documents a { max-width: 230px; min-height: 29px; padding: 4px 7px; border: 1px solid #cbd9e7; border-radius: 4px; display: inline-flex; align-items: center; gap: 5px; color: var(--process-deep); background: var(--process-soft); font-size: 10px; font-weight: 600; }
.related-documents a:hover { border-color: var(--process); background: #f5f9fe; }
.related-documents a svg { width: 13px; height: 13px; flex: 0 0 auto; }
.related-documents a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.severity-حرج, .severity-مرتفع { color: #982531; background: var(--red-soft); }
.severity-متوسط { color: #87500e; background: var(--amber-soft); }
.severity-منخفض, .severity-معلومة { color: #2b5886; background: var(--blue-soft); }
details summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
details summary svg { width: 14px; height: 14px; }
details summary:focus-visible { border-radius: 3px; outline: 2px solid rgba(180, 35, 60, .3); outline-offset: 3px; }
.finding-مؤشر details summary,
.finding-مراجعة details summary { color: var(--red); }
.evidence-grid { margin-top: 13px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 15px; }
.evidence-grid > div { min-width: 0; }
.evidence-grid > div > strong { display: block; margin-bottom: 7px; font-size: 12px; }
.evidence-list { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.evidence-row {
  min-width: 0;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  border-inline-start: 2px solid #ef9eaa;
  display: grid;
  grid-template-columns: minmax(110px, .38fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.evidence-row:last-child { border-bottom: 0; }
.evidence-row > span { color: var(--muted); font-size: 11px; }
.evidence-values { min-width: 0; display: grid; gap: 4px; }
.evidence-values strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.empty-evidence { margin: 0; padding: 11px; color: var(--muted); font-size: 12px; }
.evidence-grid p { margin: 0 0 8px; color: var(--ink-soft); line-height: 1.8; }
.evidence-grid small { color: var(--muted); }

.chat-panel { margin-top: 32px; }
.messages { max-height: 410px; overflow-y: auto; display: grid; gap: 9px; }
.message { width: fit-content; max-width: min(760px, 84%); padding: 10px 12px; border-radius: 7px; }
.message.assistant { justify-self: start; color: #075f5b; background: var(--blue-soft); }
.message.user { justify-self: end; color: #17345f; background: #edf2f8; }
.message span { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 700; opacity: .72; }
.message-content { display: grid; gap: 8px; line-height: 1.75; overflow-wrap: anywhere; }
.message-content p { margin: 0; }
.message-content h4 { margin: 3px 0 0; color: var(--ink); font-size: 13px; }
.message-content ul,
.message-content ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 5px; }
.message-content li::marker { color: var(--red); font-weight: 700; }
.message-content strong { color: var(--ink); }
.message-content code { padding: 1px 4px; border: 1px solid rgba(7, 95, 91, .16); border-radius: 3px; background: rgba(255, 255, 255, .65); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.chat-form { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }

.investigator-shell { width: min(1580px, calc(100% - 40px)); }
.investigator-header { margin-bottom: 18px; }
.investigator-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(420px, .75fr); gap: 14px; align-items: start; }
.viewer-panel,
.inspector-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.viewer-panel { position: sticky; top: 84px; }
.viewer-toolbar {
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f9fb;
}
.toolbar-group { display: flex; gap: 5px; }
.viewer-page-control { display: flex; align-items: center; gap: 4px; }
.viewer-page-control label {
  height: 34px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.viewer-page-control input { width: 34px; padding: 0; border: 0; outline: 0; text-align: center; font-weight: 700; }
.viewer-revision-label { max-width: 150px; padding: 4px 7px; border-radius: 4px; overflow: hidden; color: var(--nav); background: #e8f4f3; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; }
.viewer-scale { margin-inline-start: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.viewer-stage {
  height: calc(100vh - 220px);
  min-height: 580px;
  overflow: auto;
  display: grid;
  place-items: start center;
  background: #dfe3e8;
}
.document-preview { transform-origin: top center; transition: transform 140ms ease; }
.pdf-preview { width: 100%; height: 100%; min-height: 720px; border: 0; background: #fff; }
.image-preview { max-width: 100%; height: auto; display: block; box-shadow: 0 3px 14px rgba(17,24,39,.16); }
.unsupported-preview { min-height: 500px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.unsupported-preview svg { width: 42px; height: 42px; }

.inspector-tabs {
  min-height: 54px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  background: #f8f9fb;
}
.inspector-tabs button {
  min-width: 68px;
  flex: 1 0 68px;
  border: 0;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.inspector-tabs button:hover { color: var(--ink); }
.inspector-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.inspector-tabs svg { width: 15px; height: 15px; }
.inspector-content { min-height: 680px; padding: 20px; }
.inspector-section-heading { margin-bottom: 17px; }
.analysis-status { margin-bottom: 15px; display: flex; align-items: center; gap: 11px; }
.analysis-status span, .analysis-status small { display: block; }
.analysis-status span { color: var(--muted); font-size: 11px; }
.analysis-status strong { display: block; }
.analysis-status small { color: #8d96a4; font-size: 10px; direction: ltr; }
.analysis-summary { padding: 12px; border-right: 3px solid var(--process); color: var(--ink-soft); background: var(--process-soft); line-height: 1.8; }
.forensic-summary-grid { margin: 14px 0 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.forensic-summary-grid > div {
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 2px 7px;
  background: #fbfcfd;
}
.forensic-summary-grid > div.attention { border-color: #edc2c9; background: #fffafa; }
.forensic-summary-grid svg { grid-row: 1 / 3; width: 18px; height: 18px; color: var(--brand); }
.forensic-summary-grid .attention svg { color: var(--red); }
.forensic-summary-grid span { color: var(--muted); font-size: 10px; }
.forensic-summary-grid strong { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.hash-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.text-tools { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 7px; }
.copy-status { min-height: 20px; padding-top: 3px; color: var(--blue); font-size: 11px; }
.extracted-text {
  max-height: 590px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.extracted-text mark { padding: 1px 2px; color: #4f2d08; background: #ffe096; }
.kv-list { display: grid; }
.kv-list > div { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 13px; }
.kv-list > div:last-child { border-bottom: 0; }
.kv-list span { color: var(--muted); }
.kv-list strong { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.subsection-title { margin: 22px 0 10px; color: var(--ink-soft); font-size: 14px; }
.subsection-title.first-title { margin-top: 0; }
.forensic-notice,
.forensic-warning {
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid #cfe3e2;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  color: #164b50;
  background: #f2f9f8;
}
.forensic-notice.compact, .forensic-warning.compact { margin-top: 10px; padding: 9px 10px; }
.forensic-notice svg, .forensic-warning svg { width: 17px; height: 17px; margin-top: 2px; color: var(--brand); }
.forensic-notice p, .forensic-warning p { margin: 0; line-height: 1.75; }
.forensic-warning { border-color: #efc3ca; color: #74212e; background: var(--red-soft); }
.forensic-warning svg { color: var(--red); }
.forensic-warning strong, .forensic-warning code { display: block; }
.forensic-warning code { margin-top: 6px; overflow-wrap: anywhere; color: #982531; font-size: 10px; }
.revision-summary-strip { margin: 14px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.revision-summary-strip > div { min-width: 0; padding: 10px; border-inline-start: 1px solid var(--line); background: #fbfcfd; }
.revision-summary-strip > div:first-child { border-inline-start: 0; }
.revision-summary-strip span, .revision-summary-strip strong { display: block; }
.revision-summary-strip span { color: var(--muted); font-size: 9px; }
.revision-summary-strip strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 12px; }
.version-list { display: flex; flex-wrap: wrap; gap: 6px; }
.version-list span { padding: 5px 8px; border: 1px solid #b9d8d6; border-radius: 4px; color: #076a66; background: var(--blue-soft); font-size: 11px; font-weight: 700; }
.revision-timeline { position: relative; margin-top: 19px; display: grid; gap: 13px; }
.revision-timeline::before { content: ""; position: absolute; top: 16px; right: 15px; bottom: 18px; width: 1px; background: var(--line-strong); }
.revision-card { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.revision-marker { position: relative; z-index: 1; padding-top: 4px; }
.revision-marker span { width: 31px; height: 31px; border: 3px solid #fff; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--brand); font-size: 11px; font-weight: 700; box-shadow: 0 0 0 1px #a9d4d1; }
.revision-card.flagged .revision-marker span { background: var(--red); box-shadow: 0 0 0 1px #e7aab4; }
.revision-content { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.revision-card.flagged .revision-content { border-color: #edc2c9; }
.revision-content > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.revision-content > header strong, .revision-content > header span { display: block; }
.revision-content > header span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.revision-version { flex: 0 0 auto; padding: 4px 6px; border-radius: 4px; color: var(--nav) !important; background: #eef1f5; font-weight: 700; }
.revision-actions { margin-top: 9px; display: flex; align-items: center; gap: 5px; }
.revision-actions .button { min-height: 32px; flex: 1; justify-content: center; }
.revision-actions .button.active { border-color: #73bdb8; color: #067b75; background: #e8f4f3; }
.revision-stats { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.revision-stats > div { min-width: 0; padding: 8px 4px 5px; }
.revision-stats span, .revision-stats strong { display: block; }
.revision-stats span { color: var(--muted); font-size: 9px; }
.revision-stats strong { margin-top: 2px; overflow-wrap: anywhere; font-size: 11px; }
.revision-dates { margin-top: 6px; padding: 7px; border-radius: 4px; background: #f5f7f9; font-size: 10px; }
.revision-dates span { color: var(--muted); }
.revision-dates code { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.revision-changes { margin-top: 9px; border-top: 1px solid var(--line); }
.revision-change { min-height: 50px; padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.revision-change:last-child { border-bottom: 0; }
.revision-change > svg { width: 15px; height: 15px; color: var(--brand); }
.revision-change.redefined > svg, .revision-change.redefined > div > strong { color: var(--red); }
.revision-change > div { min-width: 0; }
.revision-change > div > strong, .revision-change > div > span { display: block; }
.revision-change > div > span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.revision-change code { color: var(--ink-soft); }
.revision-page-maps { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.revision-page-maps > span { color: var(--muted); font-size: 9px; font-weight: 600; }
.revision-page-maps > div { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.revision-page-maps button { min-height: 30px; padding: 4px 7px; border: 1px solid #edc2c9; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; color: #a31f37; background: #fff5f7; cursor: pointer; font-size: 10px; font-weight: 700; }
.revision-page-maps svg { width: 13px; height: 13px; }
.revision-image-changes { margin-top: 10px; padding-top: 10px; border-top: 1px solid #edc2c9; display: grid; gap: 6px; }
.revision-image-changes > strong { display: flex; align-items: center; gap: 5px; color: #a31f37; font-size: 10px; }
.revision-image-changes > strong svg, .revision-image-changes > p svg { width: 14px; height: 14px; }
.revision-image-changes > button { width: 100%; min-height: 62px; padding: 5px; border: 1px solid #edc2c9; border-radius: 5px; display: grid; grid-template-columns: 58px minmax(0, 1fr) 18px; align-items: center; gap: 8px; text-align: start; color: var(--ink); background: #fff8f9; cursor: pointer; }
.revision-image-changes > button > img { width: 58px; height: 48px; border-radius: 3px; display: block; object-fit: contain; background: #eef1f5; }
.revision-image-changes > button span, .revision-image-changes > button b, .revision-image-changes > button small { min-width: 0; display: block; }
.revision-image-changes > button b { color: #a31f37; font-size: 10px; }
.revision-image-changes > button small { margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.revision-image-changes > button > svg { width: 16px; color: var(--red); }
.revision-image-changes > p { margin: 0; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.token-list { display: flex; flex-wrap: wrap; gap: 6px; }
.token-list span { max-width: 100%; padding: 5px 8px; border-radius: 4px; overflow: hidden; color: #334155; background: #eef1f5; font-size: 11px; text-overflow: ellipsis; }
.token-list .empty-token { color: var(--muted); font-family: inherit; }
.font-detail-list { margin-top: 12px; display: grid; border-top: 1px solid var(--line); }
.font-detail-list > div {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.font-detail-list strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.font-detail-list span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.image-forensic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.forensic-image-card { min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; cursor: pointer; text-align: right; }
.forensic-image-card img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: contain; background: #eef1f5; }
.forensic-image-card > span { padding: 8px; display: block; }
.forensic-image-card strong, .forensic-image-card small { display: block; }
.forensic-image-card small { margin-top: 2px; color: var(--muted); }
.forensic-image-card.analysis-map img { background: #071a31; }
.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.asset-card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.asset-preview-button { position: relative; width: 100%; padding: 0; border: 0; display: block; background: #eef1f5; cursor: pointer; }
.asset-preview-button img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: contain; background: #eef1f5; }
.asset-zoom { position: absolute; left: 7px; bottom: 7px; width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; color: #fff; background: rgba(1,23,71,.82); opacity: 0; transition: opacity 140ms ease; }
.asset-preview-button:hover .asset-zoom, .asset-preview-button:focus-visible .asset-zoom { opacity: 1; }
.asset-zoom svg { width: 15px; height: 15px; }
.asset-card-body { padding: 8px; }
.asset-card strong, .asset-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card strong { font-size: 11px; }
.asset-card span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.asset-actions { margin-top: 8px; display: flex; gap: 5px; }
.asset-actions button, .asset-actions a { min-height: 30px; padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); background: #fff; cursor: pointer; font-size: 10px; font-weight: 600; }
.asset-actions svg { width: 13px; height: 13px; }
.asset-dialog { width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 8px; overflow: auto; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(1,23,71,.28); }
.asset-dialog::backdrop { background: rgba(1,14,43,.68); }
.asset-dialog > header { min-height: 64px; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.asset-dialog h3 { margin: 2px 0 0; font-size: 17px; }
.asset-dialog-toolbar { padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.asset-dialog-stage { min-height: 360px; max-height: 64vh; padding: 14px; overflow: auto; display: grid; place-items: center; background: #e7eaee; }
.asset-dialog-stage img { max-width: 100%; max-height: 58vh; display: block; object-fit: contain; box-shadow: 0 3px 18px rgba(17,24,39,.16); }
.asset-dialog > p { margin: 0; padding: 10px 16px 0; color: var(--muted); }
.asset-dialog > .forensic-notice { margin: 10px 16px 16px; }
.empty-inline { padding: 14px; color: var(--muted); background: #f7f8fa; text-align: center; }
.metadata-table { display: grid; }
.metadata-table > div { padding: 9px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
.metadata-table > div:last-child { border-bottom: 0; }
.metadata-table span { color: var(--muted); font-size: 11px; }
.metadata-table strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }
.compact-findings { display: grid; }
.compact-finding-group { margin-bottom: 18px; }
.compact-finding-group > header {
  min-height: 36px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}
.compact-finding-group > header svg { width: 16px; height: 16px; color: var(--brand); }
.compact-finding-group > header strong { font-size: 12px; }
.compact-finding-group > header span {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-deep);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 700;
}
.compact-finding-group.actionable > header svg { color: var(--red); }
.compact-finding-group.actionable > header span { color: #982531; background: var(--red-soft); }
.compact-finding {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  border-inline-start: 3px solid transparent;
}
.compact-finding.finding-مؤشر,
.compact-finding.finding-مراجعة { border-inline-start-color: var(--red); background: #fffafa; }
.compact-finding:last-child { border-bottom: 0; }
.compact-finding > div > span { display: block; color: var(--muted); font-size: 10px; direction: ltr; text-align: right; }
.compact-finding.finding-مؤشر > div > span,
.compact-finding.finding-مراجعة > div > span { color: #982531; }
.compact-finding > div > strong { display: block; margin-top: 2px; }
.compact-finding p { margin: 6px 0; color: var(--muted); line-height: 1.7; }
.compact-finding small { color: var(--blue); line-height: 1.6; }
.investigator-package-link { margin-top: 18px; padding: 13px 2px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--process-deep); }
.investigator-package-link > span { min-width: 0; display: flex; align-items: center; gap: 8px; }
.investigator-package-link > span > svg { width: 18px; height: 18px; flex: 0 0 auto; }
.investigator-package-link strong, .investigator-package-link small { display: block; }
.investigator-package-link strong { font-size: 12px; }
.investigator-package-link small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.investigator-package-link > svg { width: 16px; height: 16px; flex: 0 0 auto; }
.investigator-package-link:hover { color: var(--nav); }
.compact-evidence-disclosure { margin-top: 9px; }
.compact-evidence-disclosure summary { color: var(--red); }
.compact-evidence-list { margin-top: 8px; border-top: 1px solid #f0c9cf; }
.compact-evidence-list > div { padding: 7px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.compact-evidence-list > div:last-child { border-bottom: 0; }
.compact-evidence-list span { color: var(--muted); font-size: 10px; }
.compact-evidence-list strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.compact-evidence-list p { margin: 0; padding: 7px 0; font-size: 11px; }

.charts-grid { margin-bottom: 18px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 14px; }
.chart-panel { min-width: 0; border-top: 3px solid var(--line-strong); box-shadow: none; }
.chart-panel.accent-process { border-top-color: var(--process); }
.chart-panel.accent-risk { border-top-color: var(--amber); }
.chart-panel.accent-danger { border-top-color: var(--red); }
.chart-panel.accent-brand { border-top-color: var(--brand); }
.chart-heading-tools { display: flex; align-items: center; gap: 10px; }
.accent-process .panel-heading-icon { color: var(--process); }
.accent-risk .panel-heading-icon { color: var(--amber); }
.accent-danger .panel-heading-icon { color: var(--red); }
.accent-brand .panel-heading-icon { color: var(--brand); }
.chart-wide:last-child { grid-column: 1 / -1; }
.chart-frame { position: relative; width: 100%; height: 310px; }
.chart-frame.doughnut { height: 310px; }

.rules-toolbar {
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(230px, .56fr) auto;
  align-items: center;
  gap: 12px;
}
.rules-search { width: 100%; }
.rules-category-select { width: 100%; }
.segmented-control { padding: 3px; display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 7px; background: #f3f5f7; }
.segmented-control button { min-width: 72px; min-height: 34px; border: 0; border-radius: 5px; padding: 5px 11px; background: transparent; cursor: pointer; color: var(--muted); font-weight: 600; }
.segmented-control button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.rule-library { display: grid; }
.rule-category-section {
  padding: 24px 0 8px;
  border-top: 1px solid var(--line-strong);
}
.rule-category-section:first-child { border-top: 0; }
.rule-category-heading {
  min-height: 52px;
  margin-bottom: 7px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.rule-category-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--process-deep);
  background: var(--process-soft);
}
.rule-category-section:nth-child(5n + 2) .rule-category-icon { color: var(--brand-deep); background: var(--blue-soft); }
.rule-category-section:nth-child(5n + 3) .rule-category-icon { color: #87500e; background: var(--amber-soft); }
.rule-category-section:nth-child(5n + 4) .rule-category-icon { color: var(--nav); background: #edf1f6; }
.rule-category-section:nth-child(5n + 5) .rule-category-icon { color: #982531; background: var(--red-soft); }
.rule-category-icon svg { width: 18px; height: 18px; }
.rule-category-heading h2 { font-size: 16px; }
.rule-category-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.rules-list { display: grid; }
.rule-row { min-height: 88px; padding: 13px 4px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.rule-row:last-child { border-bottom: 0; }
.rule-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; color: var(--nav); background: #f0f3f6; }
.rule-icon svg { width: 17px; height: 17px; }
.rule-copy { min-width: 0; }
.rule-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.rule-row code { color: var(--brand-deep); font-size: 10px; direction: ltr; }
.rule-row h3 { margin: 3px 0 2px; font-size: 14px; }
.rule-row p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.rules-empty { min-height: 150px; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 16px; align-items: start; }
.settings-side { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full-field { grid-column: 1 / -1; }
.toggle-row { margin-top: 22px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 3px; color: var(--muted); }
.toggle-row input {
  width: 40px;
  height: 22px;
  min-height: 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}
.form-actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.engine-indicator.online, .inline-status.online { color: var(--brand-deep); background: var(--blue-soft); }
.engine-indicator.offline, .inline-status.offline { color: #76520e; background: #fff2d9; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr); background: #fff; }
.login-visual {
  position: relative;
  min-height: 100vh;
  padding: 46px clamp(40px, 7vw, 100px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: var(--nav);
  overflow: hidden;
}
.login-visual::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 100%;
  background: var(--brand);
}
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand img { width: 252px; height: auto; display: block; border-radius: 4px; }
.login-copy { position: relative; z-index: 1; max-width: 660px; }
.login-copy .section-kicker { color: #44c2b8; }
.login-copy h1 { max-width: 630px; font-size: 48px; line-height: 1.35; }
.login-copy p { max-width: 600px; margin: 0; color: #b8c1d0; font-size: 17px; line-height: 2; }
.login-points { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 18px; color: #c6ceda; }
.login-points span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.login-points svg { width: 16px; height: 16px; color: #44c2b8; }
.login-form-panel { display: grid; place-items: center; padding: 40px; }
.login-form-wrap { width: min(390px, 100%); }
.login-form-wrap h2 { margin-bottom: 5px; font-size: 28px; }
.login-form-wrap > .muted { margin-bottom: 0; }
.login-form-wrap .alert { margin-top: 18px; }
.mobile-login-logo { display: none; }
.mobile-login-logo img { width: 205px; height: auto; display: block; }

@media (max-width: 1180px) {
  .primary-nav a { min-width: 90px; padding-inline: 11px; }
  .institution-name { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .scan-upload { position: static; }
  .document-grid { grid-template-columns: 1fr; }
  .investigator-layout { grid-template-columns: 1fr; }
  .viewer-panel { position: static; }
  .viewer-stage { height: 720px; }
  .inspector-content { min-height: 0; }
}

@media (max-width: 860px) {
  h1 { font-size: 27px; }
  .topbar-inner { padding: 0 18px; gap: 14px; }
  .nav-toggle { display: inline-grid !important; color: var(--nav); margin-inline-start: auto; }
  .primary-nav {
    position: absolute;
    top: 76px;
    right: 14px;
    left: 14px;
    height: auto;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    display: none;
    align-items: stretch;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 16px 35px rgba(1,23,71,.16);
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { min-height: 45px; justify-content: flex-start; border-radius: 6px; }
  .primary-nav a.active::after { top: 8px; right: 0; bottom: 8px; left: auto; width: 3px; height: auto; }
  .account-area { margin-inline-start: 0; }
  .account-area .user-badge { display: none; }
  .page-shell, .investigator-shell { width: min(calc(100% - 28px), 1420px); padding-top: 25px; }
  .page-heading, .case-header, .investigator-header { flex-direction: column; }
  .rules-toolbar { grid-template-columns: 1fr; }
  .case-actions { width: 100%; flex-wrap: wrap; }
  .summary-layout, .settings-layout, .charts-grid { grid-template-columns: 1fr; }
  .chart-wide:last-child { grid-column: auto; }
  .login-page { grid-template-columns: 1fr; }
  .processing-document-grid { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form-panel { min-height: 100vh; padding: 28px; }
  .mobile-login-logo { margin-bottom: 50px; display: flex; align-items: center; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .brand img { width: 132px; }
  .case-result-shell { width: min(100% - 24px, 1240px); }
  .result-header { align-items: flex-start; }
  .result-header .case-actions { width: 100%; justify-content: space-between; }
  .result-header .case-actions .button { flex: 1; }
  .result-header .risk-score { width: 72px; height: 58px; flex: 0 0 auto; }
  .result-header .risk-score span { font-size: 24px; }
  .case-view-tabs { margin-inline: -12px; padding-inline: 8px; }
  .case-view-tabs button { min-width: 91px; padding: 0 8px; gap: 5px; }
  .case-view-tabs button span { font-size: 11px; }
  .case-view-content { min-height: 420px; padding-top: 20px; }
  .outcome-summary { padding: 19px 0; grid-template-columns: 1fr; gap: 13px; }
  .outcome-heading { padding-inline: 16px; }
  .outcome-summary > p { padding-inline: 16px; font-size: 13px; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-metrics > div { border-top: 1px solid var(--line); }
  .overview-metrics > div:nth-child(odd) { border-inline-start: 0; }
  .overview-metrics > div:nth-child(-n+2) { border-top: 0; }
  .overview-next-actions { display: grid; grid-template-columns: 1fr; }
  .overview-next-actions .button { width: 100%; }
  .case-pane-heading h2 { font-size: 19px; }
  .document-grid.result-document-grid { grid-template-columns: 1fr; }
  .document-tile.result-document-tile { min-height: 178px; grid-template-columns: 104px minmax(0, 1fr); }
  .result-document-thumbnail img { inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); }
  .result-document-body { padding: 14px; gap: 12px; }
  .result-document-tile .button { grid-column: auto; width: 100%; }
  .result-category-disclosure > summary { min-height: 62px; }
  .result-findings-list { padding-inline-start: 0; }
  .package-findings-section > header { grid-template-columns: 36px minmax(0, 1fr) auto; padding-inline: 10px; gap: 9px; }
  .package-scope-icon { width: 36px; height: 36px; }
  .package-findings-section > header p { font-size: 10px; }
  .related-documents { flex-direction: column; gap: 7px; }
  .related-documents > div, .related-documents a { width: 100%; }
  .related-documents a { max-width: none; }
  .clear-category-list { grid-template-columns: 1fr; }
  .result-messages { min-height: 220px; padding: 10px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 96px; }
  .panel { padding: 16px; }
  .panel-heading, .section-heading { align-items: stretch; flex-direction: column; }
  .rules-toolbar { flex-direction: column; }
  .rules-search { width: 100%; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; min-width: 0; }
  .page-heading-stats { width: 100%; }
  .rule-category-heading { grid-template-columns: 36px minmax(0, 1fr); }
  .rule-category-heading > .quiet-badge { grid-column: 2; justify-self: start; }
  .rule-category-icon { width: 34px; height: 34px; }
  .rule-row { grid-template-columns: 34px minmax(0, 1fr); align-items: start; }
  .rule-row > .quiet-badge { grid-column: 2; justify-self: start; }
  .document-tile { grid-template-columns: 40px minmax(0, 1fr); }
  .document-tile .button { grid-column: 1 / -1; width: 100%; }
  .summary-counts { grid-template-columns: 1fr; }
  .summary-counts > div { padding-bottom: 10px; }
  .finding-item { grid-template-columns: 1fr; }
  .finding-marker { display: none; }
  .finding-title-row { flex-direction: column; }
  .finding-badges { flex-wrap: wrap; }
  .evidence-grid { grid-template-columns: 1fr; }
  .evidence-row, .compact-evidence-list > div { grid-template-columns: 1fr; gap: 3px; }
  .chat-form { grid-template-columns: 1fr; }
  .message { max-width: 100%; }
  .viewer-stage { min-height: 480px; height: 62vh; }
  .viewer-toolbar { height: auto; min-height: 52px; padding-block: 7px; flex-wrap: wrap; }
  .viewer-page-control { order: 5; width: 100%; padding-top: 6px; border-top: 1px solid var(--line); justify-content: center; }
  .inspector-tabs button { min-width: 70px; }
  .inspector-tabs button span { display: none; }
  .inspector-tabs svg { width: 18px; height: 18px; }
  .kv-list > div, .metadata-table > div { grid-template-columns: 1fr; gap: 4px; }
  .asset-grid, .image-forensic-grid { grid-template-columns: 1fr; }
  .revision-summary-strip { grid-template-columns: 1fr; }
  .revision-summary-strip > div { border-inline-start: 0; border-top: 1px solid var(--line); }
  .revision-summary-strip > div:first-child { border-top: 0; }
  .revision-content { padding: 10px; }
  .revision-content > header { flex-direction: column; }
  .revision-stats { grid-template-columns: 1fr 1fr; }
  .revision-change { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .asset-dialog-toolbar { align-items: stretch; flex-direction: column; }
  .asset-dialog-toolbar .button { width: 100%; }
  .asset-dialog-stage { min-height: 260px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .toggle-row { align-items: flex-start; }
  .data-table th, .data-table td { padding: 10px 9px; }
  .chart-frame, .chart-frame.doughnut { height: 270px; }
  .login-form-panel { padding: 22px; }
  .processing-page { width: min(100% - 24px, 1180px); }
  .processing-title-row { flex-direction: column; gap: 12px; }
  .processing-heading-meta { width: 100%; align-items: flex-start; }
  .scan-reference { max-width: 100%; }
  .processing-steps { margin-inline: -4px; padding: 4px; grid-template-columns: repeat(5, minmax(92px, 1fr)); overflow-x: auto; }
  .processing-steps li { font-size: 10px; }
  .processing-workspace { min-height: 0; padding: 25px 18px; }
  .processing-main { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
  .processing-symbol { width: 48px; height: 48px; }
  .processing-symbol svg { width: 23px; height: 23px; }
  .processing-main h2 { font-size: 18px; }
  .processing-document { grid-template-columns: 22px 38px minmax(0, 1fr); }
  .processing-document > .document-workflow-state { grid-column: 3; justify-self: start; }
  .processing-document-icon { width: 38px; height: 38px; }
}
