/* ─────────────────────────────────────────────────────────
   Regulatory Intelligence — design tokens & base styles
   Aesthetic: Comply.now dark green (GRC platform)
   Arabic-first content, English chrome.
   ───────────────────────────────────────────────────────── */

:root {
  /* Type */
  --font-sans: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-arabic: "IBM Plex Sans Arabic", "Noto Naskh Arabic", "Cairo", "Segoe UI", sans-serif;

  /* Dark teal-green palette — comply.now */
  --ink-0:   #0a1210;   /* page bg */
  --ink-50:  #0d1713;
  --ink-100: #111f1a;
  --ink-150: #162721;
  --ink-200: #1c2e28;
  --ink-300: #2a4239;
  --ink-400: #3d6358;
  --ink-500: #5a8f80;
  --ink-600: #85bfad;
  --ink-700: #b0d9ce;
  --ink-800: #d4ede7;
  --ink-900: #eff7f4;

  /* Surfaces */
  --surface-1: #121a17;
  --surface-2: #161f1c;
  --surface-3: #1c2822;
  --border:    #253830;
  --border-strong: #2e4a40;

  /* Accent — emerald green (comply.now primary) */
  --accent: #10b981;
  --accent-soft: #0a2a1e;
  --accent-ink: #34d399;

  /* Semantic */
  --tone-mandatory: #f87171;
  --tone-mandatory-soft: #2a1515;
  --tone-conditional: #fbbf24;
  --tone-conditional-soft: #2a2010;
  --tone-recommended: #818cf8;
  --tone-recommended-soft: #1a1b35;
  --tone-prohibited: #f472b6;
  --tone-prohibited-soft: #2a1525;
  --tone-ok:       #34d399;
  --tone-ok-soft:  #0a2a1e;
  --tone-warn:     #fbbf24;
  --tone-warn-soft: #2a2010;

  /* Radii / shadows */
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 10px;
  --r-4: 14px;
  --shadow-sm: 0 1px 0 rgba(0,0,0,.20), 0 1px 2px rgba(0,0,0,.15);
  --shadow-md: 0 1px 2px rgba(0,0,0,.20), 0 8px 24px -12px rgba(0,18,12,.40);

  /* Density */
  --row-h: 44px;
  --header-h: 52px;
  --rail-w: 232px;
}

/* DENSITY MODES */
[data-density="compact"]      { --row-h: 36px; }
[data-density="comfortable"]  { --row-h: 56px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--ink-0);
  color: var(--ink-800);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color-scheme: dark;
}

/* Type rhythm */
.h-display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; }
.h-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-weight: 500;
}
.text-ar {
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-800);
  font-feature-settings: "kern", "liga", "calt";
}
.text-ar-sm { font-family: var(--font-arabic); direction: rtl; text-align: right; font-size: 13px; line-height: 1.7; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  font: 500 13px var(--font-sans);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-800);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(0.5px); }
.btn-ink { background: var(--ink-800); color: var(--ink-0); border-color: var(--ink-800); }
.btn-ink:hover { background: var(--ink-900); border-color: var(--ink-900); }
.btn-accent { background: var(--accent); color: #0a1210; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-200); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; gap: 5px; }
.btn-lg { height: 40px; padding: 0 16px; font-size: 14px; }

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  font: 500 11.5px var(--font-sans);
  background: var(--surface-2);
  color: var(--ink-600);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.chip-mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; }
.chip-strong { background: var(--ink-800); color: var(--ink-0); border-color: var(--ink-800); }
.chip-tone-mandatory   { color: var(--tone-mandatory);   background: var(--tone-mandatory-soft);   border-color: transparent; }
.chip-tone-conditional { color: var(--tone-conditional); background: var(--tone-conditional-soft); border-color: transparent; }
.chip-tone-recommended { color: var(--tone-recommended); background: var(--tone-recommended-soft); border-color: transparent; }
.chip-tone-prohibited  { color: var(--tone-prohibited);  background: var(--tone-prohibited-soft);  border-color: transparent; }
.chip-tone-ok          { color: var(--tone-ok);          background: var(--tone-ok-soft);          border-color: transparent; }
.chip-tone-warn        { color: var(--tone-warn);        background: var(--tone-warn-soft);        border-color: transparent; }

/* Input */
.input {
  width: 100%; height: 32px; padding: 0 10px;
  font: 400 13px var(--font-sans);
  color: var(--ink-800);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  outline: none;
  transition: border-color .12s, background .12s;
}
.input:focus { border-color: var(--accent); background: var(--surface-1); }
.input::placeholder { color: var(--ink-400); }

/* Card */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}

/* Scrollbar */
.scroll-y { overflow-y: auto; }
.scroll-y::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 999px; }
.scroll-y::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }
.scroll-y::-webkit-scrollbar-track { background: transparent; }
.scroll-x { overflow-x: auto; }
.scroll-x::-webkit-scrollbar { height: 0; }
.scroll-x { scrollbar-width: none; }

/* Helpers */
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-500); }
.faint { color: var(--ink-400); }
.strong { color: var(--ink-900); }
.divider { height: 1px; background: var(--border); width: 100%; }
.dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; }

/* Subtle striped placeholder for missing imagery */
.ph-stripe {
  background-image: repeating-linear-gradient(135deg, var(--ink-100) 0 8px, var(--surface-2) 8px 16px);
  border: 1px dashed var(--border-strong);
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}

/* Animations */
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.fade-up { animation: fade-up .28s ease both; }

/* Transitions */
.t-fast { transition: all .12s ease; }
.t-med  { transition: all .22s ease; }

/* Focus ring */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-2); }

/* Arabic article body table */
.ar-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-arabic);
  font-size: 13px;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
}
.ar-table th,
.ar-table td {
  padding: 7px 12px;
  border: 1px solid var(--border);
  color: var(--ink-800);
  white-space: nowrap;
}
.ar-table th {
  background: var(--surface-3);
  font-weight: 600;
  color: var(--ink-700);
  font-size: 12px;
}
.ar-table tbody tr:hover { background: var(--surface-2); }
.ar-table tbody tr:nth-child(even) { background: var(--ink-50); }
