/* OCTA RSD Gateway — design tokens
   Ink teal for authority, amber for the "tracked unit", cool paper not cream. */
:root {
  --ink: #0F4C51;
  --ink-2: #0A3438;
  --ink-soft: #E3EEEC;
  --amber: #C98A1B;
  --amber-soft: #FBF1DC;
  --paper: #F4F7F6;
  --surface: #FFFFFF;
  --surface-2: #F9FBFA;
  --line: #DCE5E3;
  --line-strong: #C3D1CE;
  --text: #13201F;
  --muted: #5B6B69;
  --faint: #8A9997;

  --ok: #1E7B4E;   --ok-bg: #E2F3EA;
  --warn: #9A6400; --warn-bg: #FCF0D6;
  --bad: #B3261E;  --bad-bg: #FBE6E4;
  --info: #255E9C; --info-bg: #E4EEF9;
  --vio: #6A3FA0;  --vio-bg: #EFE7F8;
  --gray-bg: #ECF0EF;

  --r-ctl: 6px;
  --r-panel: 10px;
  --shadow-pop: 0 18px 50px rgba(10, 52, 56, .18);
  --font: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", sans-serif;
  --side-w: 248px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #4FB3AE;
    --ink-2: #0B1E20;
    --ink-soft: #16302F;
    --amber: #E8AE48;
    --amber-soft: #3A2C10;
    --paper: #0E1716;
    --surface: #142120;
    --surface-2: #182726;
    --line: #253735;
    --line-strong: #345050;
    --text: #E4EEEC;
    --muted: #9CB0AD;
    --faint: #6E8481;
    --ok: #5CC892;   --ok-bg: #133325;
    --warn: #E8B154; --warn-bg: #3A2A0E;
    --bad: #F08A80;  --bad-bg: #3B1714;
    --info: #86B6EC; --info-bg: #15283E;
    --vio: #BC9BEA;  --vio-bg: #2A1E3B;
    --gray-bg: #1E2C2B;
    --shadow-pop: 0 18px 50px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
code, .ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.code { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; font-size: 14px;
  padding: 8px 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
@media (prefers-color-scheme: dark) { .btn { color: #0B1E20; } }
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--ink-soft); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn.ghost:hover { background: var(--ink-soft); color: var(--ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #1d1300; }
.btn.amber:hover { filter: brightness(.95); background: var(--amber); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.lg { padding: 12px 24px; font-size: 16px; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, select.input, textarea.input {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl); padding: 8px 12px; width: 100%;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ink-soft); }
.input.ltr { direction: ltr; text-align: left; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; line-height: 1;
  padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--gray-bg); color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-vio { background: var(--vio-bg); color: var(--vio); }
.b-gray { background: var(--gray-bg); color: var(--muted); }

/* ---------- layout: app shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  background: var(--ink-2); color: #CFE2E0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
@media (prefers-color-scheme: dark) { .side { background: #08201F; border-inline-end: 1px solid var(--line); } }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand b { font-size: 17px; font-weight: 700; display: block; line-height: 1.2; }
.brand small { font-size: 11px; color: #8FB3B0; }
.nav { padding: 6px 10px 20px; flex: 1; }
.nav-group { font-size: 12px; color: #7FA3A0; padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-ctl);
  color: #CFE2E0; font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(242,181,68,.14); color: #F7CF7D; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side-foot { padding: 14px 20px; font-size: 11px; color: #6F9592; border-top: 1px solid rgba(255,255,255,.07); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .tenant { font-weight: 600; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 28px; max-width: 1280px; width: 100%; }
.banner {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 28px; font-size: 14px;
  background: var(--bad-bg); color: var(--bad); border-bottom: 1px solid var(--line);
}
.banner.warn { background: var(--warn-bg); color: var(--warn); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; inset-inline-end: auto; width: 270px; z-index: 60; transform: translateX(105%); transition: transform .2s; }
  [dir="ltr"] .side { transform: translateX(-105%); }
  .side.open { transform: none; box-shadow: var(--shadow-pop); }
  .menu-btn { display: inline-flex; }
  .content { padding: 18px 16px; }
  .topbar { padding: 10px 16px; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
}

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14px; max-width: 70ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 15px; }
.panel-body { padding: 18px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1050px) { .cols, .cols-even { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }

/* KPI strip: one panel, divided, not identical cards */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.kpi { padding: 16px 18px; border-inline-start: 1px solid var(--line); }
.kpi:first-child { border-inline-start: none; }
.kpi .v { font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi.lead .v { color: var(--ink); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpi:nth-child(4) { border-inline-start: none; } .kpi:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi { border-inline-start: none !important; border-top: 1px solid var(--line); } .kpi:nth-child(-n+2) { border-top: none; } .kpi:nth-child(even) { border-inline-start: 1px solid var(--line) !important; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: start; font-weight: 500; font-size: 12.5px; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: none; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--surface-2); }
.t .end { text-align: end; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.loading { padding: 32px; text-align: center; color: var(--faint); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.err-box { padding: 12px 16px; background: var(--bad-bg); color: var(--bad); border-radius: var(--r-ctl); font-size: 14px; }
.note { padding: 12px 16px; background: var(--ink-soft); color: var(--text); border-radius: var(--r-ctl); font-size: 14px; }
.note.amber { background: var(--amber-soft); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; min-width: 140px; }

.seg { display: inline-flex; background: var(--gray-bg); border-radius: var(--r-ctl); padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 13px; border: none; background: transparent; color: var(--muted); padding: 5px 12px; border-radius: 4px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs button { font: inherit; font-size: 14px; background: none; border: none; padding: 12px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

.bar { height: 8px; background: var(--gray-bg); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.bar.warn > i { background: var(--amber); }
.bar.bad > i { background: var(--bad); }

pre.code-block {
  direction: ltr; text-align: left; margin: 0;
  background: #0B2124; color: #D7ECE9; padding: 14px 16px; border-radius: var(--r-ctl);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6;
  overflow: auto; max-height: 420px; white-space: pre;
}

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 28, 30, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--r-panel); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.modal.wide { max-width: 760px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; }
.x { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.x:hover { background: var(--gray-bg); }

.drawer-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(8, 28, 30, .35); }
.drawer {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(760px, 100%);
  background: var(--surface); box-shadow: var(--shadow-pop); display: flex; flex-direction: column;
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(-30px); opacity: .6; } }
@keyframes slideInLtr { from { transform: translateX(30px); opacity: .6; } }
[dir="ltr"] .drawer { animation-name: slideInLtr; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-body { overflow-y: auto; flex: 1; }

.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: var(--ink-2); color: #fff; padding: 12px 16px; border-radius: var(--r-ctl); box-shadow: var(--shadow-pop); font-size: 14px; border-inline-start: 4px solid var(--amber); animation: slideIn .18s ease-out; }
.toast.bad { border-inline-start-color: #F08A80; }
.toast.ok { border-inline-start-color: #5CC892; }
@media (prefers-color-scheme: dark) { .toast { background: #23403E; } }

dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }

.secret { padding: 12px 14px; background: var(--amber-soft); border: 1px solid var(--amber); border-radius: var(--r-ctl); word-break: break-all; }

/* checks progress */
.checks { display: flex; flex-direction: column; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: none; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; margin-top: 2px; }
.dot.passed { background: var(--ok-bg); color: var(--ok); }
.dot.failed { background: var(--bad-bg); color: var(--bad); }
.dot.pending { background: var(--gray-bg); color: var(--faint); }

/* chart */
.chart { width: 100%; height: auto; display: block; }
.chart .g-ok { fill: var(--ink); }
.chart .g-bad { fill: var(--amber); }
.chart text { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.chart line { stroke: var(--line); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: -1px; }

/* product result list */
.res-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.res-item:last-child { border-bottom: none; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--ink-2); color: #DDEBEA; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { color: #fff; font-size: 30px; font-weight: 600; max-width: 18ch; margin-top: 40px; }
.auth-side p { color: #A9C6C3; margin-top: 14px; max-width: 46ch; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- landing ---------- */
.lp { background: var(--paper); }
.lp-nav { display: flex; align-items: center; gap: 24px; padding: 18px 40px; max-width: 1240px; margin: 0 auto; }
.lp-nav .brand { padding: 0; color: var(--text); }
.lp-nav .brand small { color: var(--muted); }
.lp-nav nav { display: flex; gap: 22px; flex: 1; font-size: 14px; }
.lp-nav nav a { color: var(--muted); }
.lp-hero { max-width: 1240px; margin: 0 auto; padding: 48px 40px 64px; display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.lp-hero h1 { font-size: 46px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--ink-2); }
@media (prefers-color-scheme: dark) { .lp-hero h1 { color: #fff; } }
.lp-hero .lead { font-size: 18px; color: var(--muted); margin-top: 18px; max-width: 48ch; }
.lp-hero .cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.lp-hero .fine { margin-top: 16px; font-size: 13px; color: var(--faint); }

/* the signature element: a serialized pack's journey */
.trace { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 30px 60px -30px rgba(10,52,56,.35); }
.trace-head { display: flex; gap: 16px; align-items: center; padding-bottom: 16px; border-bottom: 1px dashed var(--line-strong); }
.dm { width: 64px; height: 64px; flex: none; }
.trace-head .ai { font-size: 13px; line-height: 1.7; direction: ltr; text-align: left; font-variant-numeric: tabular-nums; color: var(--muted); }
.trace-head .ai b { color: var(--text); font-weight: 600; }
.journey { list-style: none; margin: 0; padding: 18px 0 0; position: relative; }
.journey::before { content: ""; position: absolute; top: 26px; bottom: 26px; inset-inline-start: 11px; width: 2px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 4px, transparent 4px 8px); }
.journey li { display: grid; grid-template-columns: 24px 1fr auto; gap: 14px; align-items: center; padding: 9px 0; position: relative; }
.journey .pin { width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); display: grid; place-items: center; z-index: 1; }
.journey .pin::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.journey li.now .pin { border-color: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.journey li.now .pin::after { background: var(--amber); }
.journey .who b { display: block; font-size: 14px; font-weight: 600; }
.journey .who span { font-size: 12.5px; color: var(--muted); }
.journey .op { font-size: 12px; direction: ltr; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .journey li { opacity: 0; animation: rise .45s ease-out forwards; }
  .journey li:nth-child(1) { animation-delay: .1s; } .journey li:nth-child(2) { animation-delay: .35s; }
  .journey li:nth-child(3) { animation-delay: .6s; } .journey li:nth-child(4) { animation-delay: .85s; }
  .journey li:nth-child(5) { animation-delay: 1.1s; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

.lp-sec { max-width: 1240px; margin: 0 auto; padding: 64px 40px; }
.lp-sec h2 { font-size: 30px; font-weight: 700; max-width: 26ch; }
.lp-sec .sec-lead { color: var(--muted); margin-top: 10px; max-width: 64ch; font-size: 16px; }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 36px; counter-reset: s; }
.steps li { list-style: none; padding: 0 0 0 24px; border-inline-start: 2px solid var(--line); padding-inline-start: 20px; padding-inline-end: 16px; counter-increment: s; }
.steps li::before { content: counter(s); display: block; font-size: 40px; font-weight: 300; color: var(--amber); line-height: 1; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.steps li h4 { font-size: 17px; }
.steps li p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.steps { padding: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 28px; } }
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 40px; margin-top: 36px; }
.feat div h4 { font-size: 16px; display: flex; gap: 10px; align-items: center; }
.feat div h4 svg { width: 20px; height: 20px; color: var(--ink); flex: none; }
.feat div p { color: var(--muted); font-size: 14px; margin-top: 6px; }
@media (max-width: 900px) { .feat { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feat, .steps { grid-template-columns: 1fr; } }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px; display: flex; flex-direction: column; }
.plan.hl { border: 2px solid var(--ink); }
.plan .pname { font-size: 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan .tag { color: var(--muted); font-size: 13px; margin-top: 4px; min-height: 40px; }
.plan .price { margin: 16px 0 4px; font-size: 32px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 14px; font-weight: 400; color: var(--muted); }
.plan .was { font-size: 13px; color: var(--faint); text-decoration: line-through; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 20px; font-size: 14px; flex: 1; }
.plan li { padding: 5px 0; display: flex; gap: 8px; }
.plan li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.plan.current { outline: 3px solid var(--amber-soft); }

.lp-cta { background: var(--ink-2); color: #DDEBEA; border-radius: 14px; padding: 44px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.lp-cta h2 { color: #fff; }
.lp-cta p { color: #A9C6C3; margin-top: 8px; }
.lp-foot { max-width: 1240px; margin: 0 auto; padding: 28px 40px 40px; font-size: 13px; color: var(--faint); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; padding: 24px 16px 40px; gap: 32px; }
  .lp-hero h1 { font-size: 34px; }
  .lp-nav { padding: 14px 16px; flex-wrap: wrap; }
  .lp-nav nav { display: none; }
  .lp-sec { padding: 44px 16px; }
  .lp-foot { padding: 24px 16px; }
  .lp-cta { padding: 28px; }
}

/* invoice print */
.invoice { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 40px; border: 1px solid var(--line); border-radius: var(--r-panel); }
.invoice table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.invoice th, .invoice td { padding: 8px 10px; border-bottom: 1px solid #ddd; text-align: start; }
.invoice .tot td { font-weight: 600; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 2px solid #0F4C51; padding-bottom: 18px; }
@media print {
  .side, .topbar, .banner, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .invoice { border: none; }
}

.steps-dev { counter-reset: d; list-style: none; padding: 0; margin: 0; }
.steps-dev > li { counter-increment: d; position: relative; padding: 0 0 26px; padding-inline-start: 46px; }
.steps-dev > li::before { content: counter(d); position: absolute; inset-inline-start: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.steps-dev > li h4 { font-size: 16px; margin-bottom: 6px; padding-top: 3px; }
.steps-dev > li p { color: var(--muted); font-size: 14px; margin-bottom: 10px; }

/* grid children must be allowed to shrink (pre/table inside) */
.cols > *, .cols-even > *, .grid2 > *, .grid3 > *, .stack > * { min-width: 0; }
.main, .content { min-width: 0; }
@media (max-width: 700px) {
  .topbar .hide-sm { display: none; }
  .filters .field { min-width: 0; flex: 1 1 100%; }
  .filters .input { min-width: 0 !important; }
  .page-head .actions { width: 100%; }
  .seg { flex-wrap: wrap; }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; }
  dl.kv dd { margin-bottom: 8px; }
}

/* SFDA onboarding stepper */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 0 0 20px; padding: 0; list-style: none; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; color: var(--muted); }
.stepper li::before { content: ""; position: absolute; top: 15px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:last-child::before { display: none; }
.stepper li.done::before { background: var(--ok); }
.stepper .num-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); font-variant-numeric: tabular-nums; }
.stepper li.done .num-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper li.cur .num-dot { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 4px var(--ink-soft); }
.stepper li.cur .lbl { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .stepper .lbl { font-size: 11px; } }
.mini-steps { display: flex; align-items: center; gap: 4px; }
.mini-steps i { width: 16px; height: 6px; border-radius: 3px; background: var(--line); display: inline-block; }
.mini-steps i.done { background: var(--ok); }
.mini-steps i.cur { background: var(--amber); }
.mini-steps .small { margin-inline-start: 6px; white-space: nowrap; }
.step-card { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); margin-bottom: 14px; overflow: hidden; }
.step-card > header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.step-card > header h3 { margin: 0; font-size: 16px; flex: 1; }
.step-card > header .ref { font-size: 12px; color: var(--faint); }
.step-card.locked { opacity: .62; }
.step-card.locked > header { border-bottom: none; }
.step-card .body { padding: 16px 18px; }
.step-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: var(--gray-bg); color: var(--muted); flex: none; }
.step-card.done .step-no { background: var(--ok); color: #fff; }
.step-card.cur .step-no { background: var(--ink); color: #fff; }
.prod-on { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-panel); background: var(--ok-bg); color: var(--ok); font-weight: 600; border: 1px solid var(--ok); }
.mail-box { white-space: pre-wrap; font-size: 13px; line-height: 1.8; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); max-height: 320px; overflow: auto; }
.steps.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .steps.five { grid-template-columns: 1fr 1fr; row-gap: 28px; } }
@media (max-width: 600px) { .steps.five { grid-template-columns: 1fr; } }
.ref-note { display: inline-block; font-size: 11px; color: var(--faint); margin-inline-start: 4px; white-space: nowrap; }

/* ---------- bilingual: English (LTR) ---------- */
html[lang="en"] { --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
html[lang="en"] body { letter-spacing: 0; }
[dir="ltr"] .side.open { transform: none; }

.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); flex-shrink: 0; }
.lang-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; line-height: 1; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.lang-switch button[lang="ar"] { font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; }
.lang-switch button[lang="en"] { font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif; }
.lang-switch button.on { background: var(--ink); color: #fff; cursor: default; }
.lang-switch button:not(.on):hover { color: var(--text); }
.lang-switch button:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.auth-form { position: relative; }
.auth-lang { position: absolute; top: 18px; inset-inline-end: 20px; }
