/* Dirhami: one typeface family for Latin and Arabic, navy for trust, teal for what is verified. */
@font-face { font-family: "Plex"; src: url("/fonts/IBMPlexSans.ttf") format("truetype"); font-weight: 100 700; font-stretch: 85% 100%; font-display: swap; }
@font-face { font-family: "PlexAr"; src: url("/fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PlexAr"; src: url("/fonts/IBMPlexSansArabic-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PlexAr"; src: url("/fonts/IBMPlexSansArabic-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PlexAr"; src: url("/fonts/IBMPlexSansArabic-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0a1638; --ink-2: #2e3a60; --muted: #5a6687; --faint: #8a94ad;
  --line: #e2e7f1; --line-2: #cbd3e4; --paper: #f4f6fa; --panel: #ffffff;
  --navy: #0b2266; --navy-2: #14318c; --blue: #2457f5; --blue-tint: #eaf0ff;
  --teal: #0fb5a0; --teal-ink: #087a6b; --teal-tint: #e2f6f2;
  --high: #b42318; --high-tint: #fdeceb; --med: #9a5a06; --med-tint: #fdf2de; --low: #2b49a6; --low-tint: #e9effc;
  --r: 10px; --r-s: 6px;
  --font: "Plex", "PlexAr", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(10, 22, 56, .06), 0 8px 24px rgba(10, 22, 56, .06);
}
[dir="rtl"] { --font: "PlexAr", "Plex", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--paper); font-feature-settings: "tnum" 0; }
[dir="rtl"] body { line-height: 1.75; }
img, svg { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; font-weight: 600; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; line-height: 1.4; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
bdi { unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: var(--r-s); z-index: 99; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.flip { display: inline-block; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- buttons and fields */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--r-s);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--navy-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--panel); border-color: var(--navy); }
.btn.teal { background: var(--teal-ink); } .btn.teal:hover { background: #066a5d; }
.btn.light { background: #fff; color: var(--navy); } .btn.light:hover { background: #eef2fb; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--high); border-color: #f1c7c3; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font-weight: 500; }
label.f { display: block; margin-bottom: 14px; font-weight: 500; font-size: 14px; }
label.f > span { display: block; margin-bottom: 6px; }
.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-s); padding: 10px 12px; font-size: 15px; }
textarea.in { min-height: 90px; resize: vertical; line-height: 1.6; }
.in:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-tint); }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 4px; display: block; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.err { background: var(--high-tint); color: var(--high); border-radius: var(--r-s); padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.ok { background: var(--teal-tint); color: var(--teal-ink); border-radius: var(--r-s); padding: 10px 12px; font-size: 14px; }

/* ---------- public site */
.top { background: var(--navy); color: #fff; }
.nav { display: flex; align-items: center; gap: 24px; height: 68px; }
.nav .brand img { height: 30px; display: block; }
.nav .links { display: flex; gap: 22px; flex: 1; }
.nav .links a { color: #cfd8f3; font-size: 14px; font-weight: 500; }
.nav .links a:hover, .nav .links a.on { color: #fff; text-decoration: none; }
.nav .end { display: flex; gap: 10px; align-items: center; }
.nav .end .signin { color: #fff; font-size: 14px; font-weight: 500; }
.lang { position: relative; }
.lang > button { display: inline-flex; gap: 6px; align-items: center; background: transparent; border: 1px solid rgba(255,255,255,.28); color: inherit; border-radius: 20px; padding: 5px 11px; font-size: 13px; cursor: pointer; }
.lang.dark > button { border-color: var(--line-2); color: var(--ink); }
.lang ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: #fff; color: var(--ink); border-radius: var(--r-s); box-shadow: var(--shadow); min-width: 150px; z-index: 30; border: 1px solid var(--line); }
.lang li button { width: 100%; text-align: start; background: none; border: 0; padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.lang li button:hover, .lang li button[aria-current="true"] { background: var(--paper); }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

.hero { background: var(--navy); color: #fff; padding: 56px 0 84px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.kicker { color: #8fe6d8; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.hero h1 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: #8fe6d8; }
.hero .lead { font-size: 18px; color: #cfd8f3; max-width: 34em; margin-bottom: 28px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* The evidence thread: a claim tied visibly to the records that prove it. */
.proof { background: #fff; color: var(--ink); border-radius: 14px; padding: 22px; box-shadow: 0 30px 60px rgba(0,0,0,.25); position: relative; }
.proof .lbl { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.proof .claim { font-weight: 600; font-size: 16px; line-height: 1.45; }
.proof .gap { display: inline-block; margin-top: 10px; background: var(--high-tint); color: var(--high); font-weight: 600; padding: 3px 10px; border-radius: 14px; font-size: 14px; }
.thread { position: relative; margin-top: 18px; padding-inline-start: 22px; }
.thread::before { content: ""; position: absolute; inset-inline-start: 6px; top: 4px; bottom: 18px; width: 2px; background: var(--teal); border-radius: 2px; }
.thread .ev { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 12px; font-size: 13px; margin-bottom: 10px; }
.thread .ev::before { content: ""; position: absolute; inset-inline-start: -21px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--teal); }
.thread .ev b { display: block; font-size: 12px; color: var(--teal-ink); font-weight: 600; }
.proof .action { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--navy); }
.proof .action .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.proof .note { font-size: 11.5px; color: var(--faint); margin-top: 10px; }

.sec { padding: 72px 0; }
.sec.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec h2 { font-size: clamp(26px, 3vw, 34px); max-width: 22em; }
.sec .intro { font-size: 17px; color: var(--ink-2); max-width: 40em; margin-bottom: 36px; }
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--navy); }
.why > div { padding: 22px 24px 8px 0; }
[dir="rtl"] .why > div { padding: 22px 0 8px 24px; }
.why .year { font-size: 13px; font-weight: 600; color: var(--teal-ink); margin-bottom: 6px; }
.why h3 { font-size: 19px; }
.why p { color: var(--ink-2); font-size: 15px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 56px 1fr; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); counter-increment: s; }
.steps li::before { content: counter(s, decimal-leading-zero); font-weight: 600; color: var(--teal-ink); font-size: 15px; padding-top: 2px; }
.steps h3 { font-size: 18px; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--ink-2); max-width: 46em; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.trust h3 { font-size: 18px; }
.trust p { color: var(--ink-2); }
.trust .mark { width: 28px; height: 28px; border-radius: 50%; background: var(--teal-tint); color: var(--teal-ink); display: grid; place-items: center; font-weight: 700; margin-bottom: 12px; }
.close { background: var(--navy); color: #fff; border-radius: 16px; padding: 44px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.close h2 { color: #fff; }
.close p { color: #cfd8f3; }

.page { padding: 56px 0 80px; }
.page h1 { font-size: clamp(30px, 3.6vw, 42px); margin-bottom: 14px; }
.page .lead { font-size: 18px; color: var(--ink-2); max-width: 40em; margin-bottom: 36px; }
.prose { max-width: 46em; }
.prose h2 { font-size: 20px; margin-top: 32px; }
.prose p { color: var(--ink-2); }
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.feat > div { padding: 26px 28px 22px 0; border-bottom: 1px solid var(--line); }
[dir="rtl"] .feat > div { padding: 26px 0 22px 28px; }
.feat h3 { font-size: 19px; }
.feat p { color: var(--ink-2); margin: 0; }
.ticks { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 36px; }
.ticks li { break-inside: avoid; padding: 8px 0 8px 26px; position: relative; color: var(--ink-2); }
[dir="rtl"] .ticks li { padding: 8px 26px 8px 0; }
.ticks li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--teal-ink); font-weight: 700; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; max-width: 50em; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 17px; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }
.tools { font-size: 15px; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; line-height: 2; }

.foot { background: #fff; border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--muted); }
.foot .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* ---------- auth */
.auth { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px 16px; }
.auth .card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
.auth h1 { font-size: 24px; }
.choice { display: grid; gap: 8px; margin-bottom: 14px; }
.choice label { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 10px 12px; cursor: pointer; font-size: 14px; }
.choice input:checked + span { font-weight: 600; }

/* ---------- application shell */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--navy) 236px, var(--paper) 236px); }
[dir="rtl"] .app { background: linear-gradient(to left, var(--navy) 236px, var(--paper) 236px); }
.side { background: var(--navy); color: #cfd8f3; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 4px 8px 18px; }
.side .brand img { height: 28px; }
.side a { color: #cfd8f3; padding: 9px 10px; border-radius: var(--r-s); font-weight: 500; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.side a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.side a.on { background: rgba(255,255,255,.12); color: #fff; }
.side .grow { flex: 1; }
.side .who { border-top: 1px solid rgba(255,255,255,.12); padding: 12px 8px 0; font-size: 13px; }
.side .who b { color: #fff; display: block; }
.side .model { font-size: 12px; display: flex; gap: 6px; align-items: center; margin: 8px 0; }
.side .model i { width: 8px; height: 8px; border-radius: 50%; background: #8a94ad; }
.side .model.on i { background: #3fe0c5; }
.main { min-width: 0; }
.bar { background: #fff; border-bottom: 1px solid var(--line); height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 10; }
.bar .crumb { font-size: 14px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .crumb b { color: var(--ink); }
.content { padding: 28px; max-width: 1320px; }
.content h1 { font-size: 26px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 17px; margin-bottom: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; color: var(--muted); max-width: 52em; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 19px; }
.list { border-top: 1px solid var(--line); }
.list .item { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); align-items: center; cursor: pointer; }
.list .item:hover { background: var(--paper); }
.list .item b { display: block; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 12px; padding: 2px 9px; background: var(--paper); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.teal { background: var(--teal-tint); color: var(--teal-ink); border-color: transparent; }
.sev { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 12px; padding: 2px 9px; white-space: nowrap; }
.sev.high { background: var(--high-tint); color: var(--high); }
.sev.medium { background: var(--med-tint); color: var(--med); }
.sev.low, .sev.info { background: var(--low-tint); color: var(--low); }

/* ---------- engagement workspace */
.eng-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.eng-head h1 { margin-bottom: 4px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--navy); }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a .count { font-size: 11px; background: var(--paper); border-radius: 10px; padding: 1px 6px; margin-inline-start: 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.kpi span { font-size: 13px; color: var(--muted); display: block; }
.kpi b { font-size: 24px; font-weight: 600; display: block; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }

/* The agent trace reads like a ledger of steps. */
.trace { list-style: none; padding: 0; margin: 0; }
.trace li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; align-items: start; }
.trace li:last-child { border-bottom: 0; }
.trace .st { width: 18px; height: 18px; border-radius: 50%; background: var(--teal-tint); color: var(--teal-ink); display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 2px; }
.trace .st.failed, .trace .st.blocked { background: var(--high-tint); color: var(--high); }
.trace b { font-weight: 600; display: block; }
.trace .ms { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.trace.live li { animation: in .35s both; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .trace.live li { animation: none; } }
.checks { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.checks li { padding: 6px 0; display: flex; gap: 8px; }
.checks .y { color: var(--teal-ink); font-weight: 700; } .checks .n { color: var(--high); font-weight: 700; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: start; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: #fafbfd; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t td.n, table.t th.n { text-align: end; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--paper); }
table.t tr.total td { font-weight: 600; border-top: 1px solid var(--line-2); background: #fafbfd; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pos { color: var(--teal-ink); } .neg { color: var(--high); }
.stat { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; display: inline-block; }
.stat.good { background: var(--teal-tint); color: var(--teal-ink); }
.stat.bad { background: var(--high-tint); color: var(--high); }
.stat.warn { background: var(--med-tint); color: var(--med); }
.stat.info { background: var(--low-tint); color: var(--low); }

/* Findings: list beside the selected finding's detail. */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button { border: 1px solid var(--line-2); background: #fff; border-radius: 16px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.fsplit { display: grid; grid-template-columns: minmax(300px, .9fr) 1.1fr; gap: 18px; align-items: start; }
.flist { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.frow { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; border-inline-start: 3px solid transparent; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--paper); }
.frow.on { background: var(--blue-tint); border-inline-start-color: var(--navy); }
.frow .t { font-weight: 500; font-size: 14px; line-height: 1.45; }
.frow .m { font-size: 12px; color: var(--muted); margin-top: 5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.frow .amt { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; text-align: end; }
.fdetail { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.fdetail h2 { font-size: 19px; line-height: 1.4; }
.fdetail h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 20px 0 8px; }
.fdetail .bigamt { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fdetail .thread .ev { background: #fff; }
.ev .meta { color: var(--muted); font-size: 12px; }
.ev .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.recommend { background: var(--teal-tint); border: 1px solid #bfe9e1; border-radius: var(--r); padding: 14px 16px; margin-top: 18px; }
.recommend p { margin: 0 0 10px; font-weight: 500; color: #064e45; }
.factors { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--ink-2); }
.factors li { padding: 3px 0; }
.notes .n { border-inline-start: 2px solid var(--line-2); padding: 4px 10px; margin-bottom: 8px; font-size: 14px; }
.notes .n small { color: var(--muted); display: block; }

/* Documents */
.drop { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 30px; text-align: center; background: #fff; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--teal); background: var(--teal-tint); }
.drop b { display: block; font-size: 17px; margin-bottom: 4px; }
.doc { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.doc .name { font-weight: 600; word-break: break-all; }
.doc .why { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.uploads { margin-top: 12px; font-size: 14px; }
.uploads div { padding: 4px 0; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: -1px; }
.bars .bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.bars .track { height: 8px; background: var(--paper); border-radius: 4px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--navy); border-radius: 4px; }
.fc { list-style: none; padding: 0; margin: 0; }
.fc li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fc li.end { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--navy); font-size: 16px; }

/* Letters */
.letter-edit { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 36px 40px; box-shadow: var(--shadow); }
.paper .in { border-color: transparent; padding: 4px 6px; background: transparent; }
.paper .in:hover { border-color: var(--line); }
.paper .in:focus { border-color: var(--blue); background: #fff; }
.paper textarea.in { min-height: 70px; }
.paper .gapfield { background: #fff3c4; }
.paper .facts { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 14px; }
.paper .facts td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.paper .facts td:first-child { font-weight: 600; width: 45%; }
.paper .lock { font-size: 11.5px; color: var(--muted); }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: sticky; top: 76px; }
.side-card .btn { width: 100%; justify-content: center; margin-bottom: 8px; }

/* Agent panel */
.ask-wrap { display: grid; grid-template-columns: 1fr; gap: 14px; }
.msgs { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 760px; }
.msg.user { align-self: flex-end; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; }
[dir="rtl"] .msg.user { border-radius: 14px 14px 14px 4px; }
.msg.bot { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; white-space: pre-wrap; }
.msg.bot .note { font-size: 12.5px; color: var(--med); margin-top: 8px; }
.msg.bot details { margin-top: 10px; font-size: 13px; white-space: normal; }
.msg.bot summary { cursor: pointer; color: var(--muted); }
.msg .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; white-space: normal; }
.sugs { display: flex; gap: 8px; flex-wrap: wrap; }
.sugs button { border: 1px solid var(--line-2); background: #fff; border-radius: 16px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.sugs button:hover { border-color: var(--navy); }
.askbox { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--paper); padding: 10px 0; }
.askbox .in { flex: 1; }
.toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-s); font-size: 14px; z-index: 100; box-shadow: var(--shadow); }
[dir="rtl"] .toast { transform: translateX(50%); }
.modal-bg { position: fixed; inset: 0; background: rgba(10, 22, 56, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 26px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
.spin.dark { border-color: var(--line-2); border-top-color: var(--navy); }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- responsive */
@media (max-width: 1080px) {
  .fsplit, .cols, .letter-edit { grid-template-columns: 1fr; }
  .fdetail, .side-card { position: static; max-height: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .app, [dir="rtl"] .app { background: var(--paper); }
  .nav .links { display: none; }
  .nav.open .links { display: flex; flex-direction: column; position: absolute; top: 68px; inset-inline: 0; background: var(--navy); padding: 12px 24px 20px; z-index: 20; }
  .menu-btn { display: block; }
  .nav .end .signin { display: none; }
  .hero .wrap, .close { grid-template-columns: 1fr; }
  .why, .trust, .feat { grid-template-columns: 1fr; }
  .ticks { columns: 1; }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 2px; }
  .side .brand { padding: 0 8px 0 0; } .side .grow { display: none; } .side .who { border: 0; padding: 0 8px; width: 100%; display: flex; gap: 12px; align-items: center; }
  .bar { padding: 0 16px; } .content { padding: 18px 16px; }
  .paper { padding: 22px 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi b { font-size: 19px; } .hero { padding-top: 36px; } }
@media print { .side, .bar, .tabs, .side-card { display: none !important; } .app { display: block; } body { background: #fff; } }

/* Setup after sign-up */
.auth .card.setup { max-width: 600px; }
.kinds { display: grid; gap: 10px; margin: 6px 0 4px; }
.kind { display: grid; gap: 4px; text-align: start; background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--r); padding: 14px 16px; cursor: pointer; }
.kind b { font-size: 16px; color: var(--navy); }
.kind span { color: var(--muted); font-size: 14px; }
.kind:hover { border-color: var(--teal); }
.kind.on { border-color: var(--teal); background: var(--teal-tint); box-shadow: inset 0 0 0 1px var(--teal); }
.kind:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.goals { display: grid; gap: 8px; }
.goals label { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 10px 12px; cursor: pointer; font-size: 14px; }
.goals input:checked + span { font-weight: 600; }
.setup .will { margin: 18px 0 0; padding: 12px 14px; border-radius: var(--r-s); background: var(--blue-tint); color: var(--ink-2); font-size: 14px; }

/* The agent's proposed next steps */
.panel.next ul { list-style: none; margin: 0; padding: 0; }
.panel.next li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.panel.next li:first-child { border-top: 0; }
.panel.next li .btn { flex: none; }
