/* Glyo site styles. Design system v2 (teal and amber) with page and calculator components.
   Light by default, dark through prefers-color-scheme or the viewer's [data-theme]. RTL-safe (logical properties). */
:root {
  --ink-900: #051f29;
  --navy: #0a3d4f;
  --teal: #11556c;
  --amber: #f6a33a;
  --amber-ink: #5f3a05;
  --amber-edge: #e5921f;

  --bg: #eef3f4;
  --surface: #ffffff;
  --sunk: #f7fafa;
  --text: #0a2c39;
  --muted: #5d747d;
  --border: #dce6e8;
  --border-2: #c7d5d8;
  --divider: #eef3f4;

  --ok-bg: #e6f6ee;   --ok-text: #106b45;   --ok-border: #bfe3d2;
  --err-bg: #fdecea;  --err-text: #a5271d;  --err-border: #f3c8c3;
  --warn-bg: #fdf3da; --warn-text: #8a5a06; --warn-border: #f0ddab;
  --info-bg: #e8f1f4; --info-text: #11556c; --info-border: #c3dbe2;

  --shadow-modal: 0 30px 70px rgba(5, 31, 41, .34);
  --shadow-card: 0 10px 30px rgba(5, 31, 41, .08);
  --focus-ring: 0 0 0 3px rgba(246, 163, 58, .35);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "DM Sans", "Readex Pro", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-arabic: "Readex Pro", "DM Sans", system-ui, sans-serif;

  --r-sm: 6px; --r-md: 10px; --r-lg: 12px; --r-xl: 14px; --r-2xl: 18px; --r-pill: 999px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #061e27; --teal: #8ecbdd; --amber-ink: #3a2403; --amber-edge: #b9761f;
    --bg: #072530; --surface: #0d3240; --sunk: #0a2b37; --text: #e6eff1; --muted: #96b0b8;
    --border: #1c4553; --border-2: #2a5c6e; --divider: #123244;
    --ok-bg: #0f3a2a;   --ok-text: #66d6a0;   --ok-border: #1d5a42;
    --err-bg: #3a1a17;  --err-text: #f29b90;  --err-border: #5c2621;
    --warn-bg: #3a2a0e; --warn-text: #f2c46b; --warn-border: #5c4416;
    --info-bg: #0f3444; --info-text: #8ecbdd; --info-border: #1f5567;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #061e27; --teal: #8ecbdd; --amber-ink: #3a2403; --amber-edge: #b9761f;
  --bg: #072530; --surface: #0d3240; --sunk: #0a2b37; --text: #e6eff1; --muted: #96b0b8;
  --border: #1c4553; --border-2: #2a5c6e; --divider: #123244;
  --ok-bg: #0f3a2a;   --ok-text: #66d6a0;   --ok-border: #1d5a42;
  --err-bg: #3a1a17;  --err-text: #f29b90;  --err-border: #5c2621;
  --warn-bg: #3a2a0e; --warn-text: #f2c46b; --warn-border: #5c4416;
  --info-bg: #0f3444; --info-text: #8ecbdd; --info-border: #1f5567;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* Language: Arabic swaps the type roles and drops letter-spacing (it breaks joined script) */
[dir="rtl"] { --font-display: var(--font-arabic); --font-mono: var(--font-arabic); --font-body: var(--font-arabic); }
[dir="ltr"] {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-body: "DM Sans", "Readex Pro", system-ui, sans-serif;
}
[dir="rtl"] * { letter-spacing: 0 !important; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* safety net: no stray element can make the whole page pan sideways */
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--amber-edge); }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
section[id] { scroll-margin-top: 72px; }
.wrap { max-width: 1160px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[dir="rtl"] h1 { line-height: 1.25; }
[dir="rtl"] h2 { line-height: 1.3; }

/* ---------- Buttons (pill, amber is the only CTA) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 24px; border-radius: var(--r-pill);
  border: 1px solid transparent; font-size: 15px; font-weight: 700; line-height: 1;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn--amber { background: var(--amber); border-color: var(--amber-edge); color: var(--amber-ink); }
.btn--amber:hover { background: var(--amber-edge); color: var(--amber-ink); }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.32); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn--line { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn--line:hover { background: var(--sunk); color: var(--text); }
.btn--sm { height: 34px; padding: 0 16px; font-size: 13.5px; }

.kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; white-space: nowrap;
  border: 1px solid var(--info-border); background: var(--info-bg); color: var(--info-text);
}
.badge--ok { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok-text); }
.badge--warn { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn-text); }
.badge--muted { border-color: var(--border); background: var(--sunk); color: var(--muted); }
.ph { background: var(--warn-bg); color: var(--warn-text); border-radius: 4px; padding: 0 4px; }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.08);
}
.hdr .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.brand:hover { color: #fff; }
.mark { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: none; }
.mark svg { width: 26px; height: 22px; }
.links { display: flex; gap: 2px; margin-inline-start: 20px; }
.links a { color: rgba(255,255,255,.75); padding: 8px 12px; border-radius: var(--r-md); font-size: 14px; }
.links a:hover, .links a[aria-current="page"] { background: rgba(255,255,255,.08); color: #fff; }
.hdr-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }

/* Light/dark toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.32); background: transparent; color: #fff;
  cursor: pointer; padding: 0; transition: background .12s, border-color .12s;
}
.theme-toggle:hover { background: rgba(255,255,255,.1); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Hero (home) ---------- */
.hero { background: var(--navy); color: #fff; padding-block: clamp(40px, 7vw, 84px) clamp(48px, 7vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero .kicker, .cta .kicker, .subhero .kicker { color: #f2c383; }
.hero h1 { font-size: clamp(42px, 6.4vw, 74px); line-height: 1.02; font-weight: 700; margin-top: 18px; }
[dir="rtl"] .hero h1 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.25; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: rgba(255,255,255,.82); max-width: 52ch; margin-top: 22px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.pills li { border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.85); border-radius: var(--r-pill); padding: 6px 13px; font-size: 13px; }

.sc { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-2xl); box-shadow: var(--shadow-modal); overflow: hidden; }
.sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.sc-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.sc-sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.sc-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--divider); }
.sc-l { font-size: 14.5px; }
.sc-s { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 1px; }
.sc-v { font-family: var(--font-mono); font-size: 15px; font-variant-numeric: tabular-nums; text-align: end; }
.sc-total { background: var(--sunk); }
.sc-total .sc-v { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.sc-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; }
.sc-note { font-size: 12.5px; color: var(--muted); padding: 0 22px 16px; }

/* Coverage strip */
.strip { background: var(--surface); border-bottom: 1px solid var(--border); }
.strip .wrap { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.strip .c { padding: 18px 16px; border-inline-end: 1px solid var(--border); }
.strip .c:first-child { border-inline-start: 1px solid var(--border); }
.strip .c b { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.strip .c span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.strip--4 .wrap { grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; }
.strip--4 .c { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.strip--4 .c b { font-size: 22px; }
.strip--4 .c span { font-size: 12.5px; }

/* ---------- Sections ---------- */
.sec { padding-block: clamp(56px, 8vw, 104px); }
.sec--surface { background: var(--surface); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.sec-head h2 { font-size: clamp(28px, 3.8vw, 44px); line-height: 1.1; font-weight: 700; margin-top: 14px; }
.sec-sub { color: var(--muted); font-size: 17px; max-width: 60ch; }

.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); }
.flow > div { position: relative; padding: 26px; border-inline-end: 1px solid var(--border); }
.flow > div:last-child { border-inline-end: none; }
.flow > div:not(:last-child)::after {
  content: "\2192"; position: absolute; top: 22px; inset-inline-end: -13px; z-index: 1;
  width: 26px; height: 26px; border-radius: var(--r-pill); background: var(--amber); color: var(--amber-ink);
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
[dir="rtl"] .flow > div:not(:last-child)::after { content: "\2190"; }
.step-n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.flow h3, .cover h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.flow h3 { margin-top: 10px; }
.flow p, .cover p { font-size: 15px; color: var(--muted); margin-top: 8px; }
.cover { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; margin-top: 24px; }
.cover > div { background: var(--surface); padding: 24px; }
.cover-label { margin-top: 28px; }
.cover--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Two dark feature cards (home: "built for the GCC" / "runs at any scale") */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.duo-card { background: var(--navy); color: #fff; border-radius: var(--r-xl); padding: clamp(24px, 3vw, 34px); }
.duo-card .ico { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.24); color: #fff; margin-bottom: 16px; }
.duo-card h3 { color: #fff; font-size: 20px; font-weight: 600; }
.duo-card p { color: rgba(255,255,255,.78); font-size: 14.5px; margin-top: 10px; }

/* Full-bleed navy banner with a short message and a link (home: security summary) */
.banner { background: var(--navy); color: #fff; padding-block: clamp(48px, 7vw, 76px); }
.banner .wrap { display: flex; gap: 40px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.banner h2 { color: #fff; font-size: clamp(23px, 2.8vw, 29px); line-height: 1.25; }
.banner p { color: rgba(255,255,255,.8); font-size: 15.5px; margin-top: 12px; max-width: 60ch; }

.rows { border-bottom: 1px solid var(--border); }
.row { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); padding-block: 28px; border-top: 1px solid var(--border); }
.row h3 { font-size: 22px; font-weight: 600; }
.row p { font-size: 16px; color: var(--muted); max-width: 58ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.tags li { font-family: var(--font-mono); font-size: 11.5px; padding: 5px 11px; border-radius: var(--r-pill); background: var(--sunk); border: 1px solid var(--border); color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 3vw, 32px); }
.steps li { border-top: 1px solid var(--border-2); padding-top: 18px; }
.steps .n { font-family: var(--font-display); font-size: 44px; font-weight: 700; line-height: 1; color: var(--teal); }
.steps h3 { font-size: 19px; font-weight: 600; margin-top: 16px; }
.steps p { font-size: 15px; color: var(--muted); margin-top: 8px; }

/* Calculator teasers (home) */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 24px; color: var(--text); transition: border-color .12s, transform .12s; }
.tool:hover { border-color: var(--amber-edge); color: var(--text); transform: translateY(-2px); }
.tool .ico { margin-bottom: 4px; }
.tool h3 { font-size: 20px; font-weight: 600; }
.tool p { font-size: 15px; color: var(--muted); flex: 1; }
.tool .go { font-weight: 700; font-size: 14px; color: var(--teal); }
.sec--surface .tool { background: var(--bg); }
.sec--surface .paper { background: var(--bg); }

.sec-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.ico { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-text); display: grid; place-items: center; }
.ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.points h3 { font-size: 18px; font-weight: 600; margin-top: 14px; }
.points p { font-size: 15px; color: var(--muted); margin-top: 6px; }
.audit { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.audit-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--sunk); }
.audit-head b { font-family: var(--font-display); font-size: 16px; }
.tbl-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.audit table { width: 100%; border-collapse: collapse; min-width: 400px; }
.audit th { padding: 10px 18px; text-align: start; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.audit td { padding: 13px 18px; font-size: 14px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.audit tr:last-child td { border-bottom: none; }
.audit .t, .audit .h, .audit .who { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.audit .t, .audit .h { white-space: nowrap; }
.audit .who { margin-top: 2px; }
.audit .badge { height: 20px; font-size: 11px; margin-inline-start: 6px; }

.papers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.paper { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-card); }
.paper .letterhead { margin-top: 12px; border: 1px dashed var(--border-2); border-radius: var(--r-md); padding: 12px 14px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align: center; }
.paper h3 { font-size: 22px; font-weight: 700; margin-top: 24px; }
.paper .ref { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.paper p { font-size: 16px; line-height: 1.85; margin-top: 18px; }
.paper .sig { margin-top: 36px; width: 60%; border-top: 1px solid var(--text); padding-top: 8px; font-size: 13px; color: var(--muted); }
.paper .sample { position: absolute; top: 12px; inset-inline-end: 14px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Contact ---------- */
.cta { background: var(--navy); color: #fff; padding-block: clamp(56px, 8vw, 96px); }
.cta .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.cta h2 { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.08; font-weight: 700; margin-top: 14px; }
.cta .lead { margin-top: 18px; max-width: 46ch; }
.checks { display: grid; gap: 14px; margin-top: 28px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,.9); font-size: 16px; }
.checks li::before { content: "\2713"; flex: none; width: 22px; height: 22px; border-radius: var(--r-pill); background: rgba(246,163,58,.2); color: #f6c47e; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 2px; }
.form-card { background: var(--surface); color: var(--text); border-radius: var(--r-2xl); box-shadow: var(--shadow-modal); padding: clamp(20px, 3vw, 32px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.field { min-width: 0; }
.field.span2 { grid-column: 1 / -1; }
.field > label, .lbl { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font-size: 15px;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--amber-edge); box-shadow: var(--focus-ring); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--err-text); }
.input:disabled { background: var(--sunk); color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--err-text); margin-top: 5px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.consent input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--amber-edge); flex: none; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 20px; }
.form-foot .fine { font-size: 12.5px; color: var(--muted); }
.notice { border: 1px solid var(--info-border); background: var(--info-bg); color: var(--text); border-radius: var(--r-xl); padding: 18px 20px; }
.notice h3 { font-size: 20px; font-weight: 700; }
.notice p { margin-top: 8px; font-size: 15px; }
.notice pre { margin: 14px 0 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
[dir="rtl"] .notice pre { direction: ltr; text-align: left; }
.notice .btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.notice--ok { border-color: var(--ok-border); background: var(--ok-bg); }

/* ---------- Footer ---------- */
.ftr { background: var(--ink-900); color: rgba(255,255,255,.7); padding-block: 48px 32px; font-size: 14px; }
.ftr .top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.ftr .brand { font-size: 18px; }
.ftr h4 { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 12px; }
.ftr ul { display: grid; gap: 8px; }
.ftr a { color: rgba(255,255,255,.78); }
.ftr a:hover { color: #fff; }
.ftr .tag { margin-top: 12px; max-width: 34ch; }
.ftr .fine { margin-top: 36px; font-size: 12.5px; color: rgba(255,255,255,.5); border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- Sub-page hero (calculators, legal) ---------- */
.subhero { background: var(--navy); color: #fff; padding-block: clamp(28px, 4vw, 48px) clamp(32px, 5vw, 56px); }
.crumbs { font-size: 13px; color: rgba(255,255,255,.65); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: rgba(255,255,255,.8); }
.crumbs a:hover { color: #fff; }
.subhero h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.06; font-weight: 700; margin-top: 18px; }
.subhero .lead { margin-top: 14px; font-size: clamp(16px, 1.4vw, 18px); max-width: 64ch; }
.subhero--split .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }

/* ---------- Calculators ---------- */
.calc-main { padding-block: clamp(24px, 4vw, 40px) clamp(56px, 8vw, 96px); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.panel-body { padding: 20px; display: grid; gap: 16px; }
.calc-form { position: sticky; top: calc(72px + env(safe-area-inset-top, 0px)); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.money { position: relative; }
.money .input { padding-inline-end: 52px; font-family: var(--font-mono); font-size: 14px; }
.money .cur { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); pointer-events: none; }
.money.is-off .input { background: var(--sunk); color: var(--muted); }
.off-tag { font-size: 12px; color: var(--muted); margin-top: 5px; }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { position: relative; }
.chip-toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chip-toggle span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--border-2); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--muted); }
.chip-toggle input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-toggle input:focus-visible + span { box-shadow: var(--focus-ring); }
.rules-line { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

.results { display: grid; gap: 20px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tiles.t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 16px 18px; min-width: 0; }
.tile .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.tile .v.sm { font-size: 19px; line-height: 1.25; }
.tile .s { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.tile--main { background: var(--navy); border-color: var(--navy); color: #fff; }
.tile--main .k, .tile--main .s { color: rgba(255,255,255,.7); }
.tile--amber { background: var(--amber); border-color: var(--amber-edge); color: var(--amber-ink); }
.tile--amber .k, .tile--amber .s { color: var(--amber-ink); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 10px 16px; text-align: start; white-space: nowrap; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: var(--sunk); border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px 16px; font-size: 14.5px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: end; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.num { text-align: end; }
.tbl tfoot td { font-weight: 700; background: var(--sunk); border-top: 1px solid var(--border); border-bottom: none; }
.tbl .sub { font-size: 12px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.tbl .strong td { font-weight: 700; background: var(--sunk); }

.callout { min-width: 0; display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--info-border); background: var(--info-bg); border-radius: var(--r-xl); padding: 14px 16px; font-size: 14.5px; }
.callout::before { content: "i"; flex: none; width: 22px; height: 22px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--info-border); color: var(--info-text); display: grid; place-items: center; font: 700 12px var(--font-mono); margin-top: 1px; }
.callout--warn { border-color: var(--warn-border); background: var(--warn-bg); }
.callout--warn::before { content: "!"; border-color: var(--warn-border); color: var(--warn-text); }
.callout--err { border-color: var(--err-border); background: var(--err-bg); }
.callout--err::before { content: "!"; border-color: var(--err-border); color: var(--err-text); }
.callout ul { display: grid; gap: 6px; }
.callout ul li { padding-inline-start: 0; }
.stack { display: grid; gap: 10px; }
.disclaimer { font-size: 13px; color: var(--muted); }

/* Leave calendar */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; padding: 20px; }
.cal-month h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-days .wd { font-family: var(--font-mono); font-size: 9.5px; text-align: center; color: var(--muted); padding-bottom: 2px; }
.cal-days .d { aspect-ratio: 1; max-height: 32px; display: grid; place-items: center; font-size: 12px; border-radius: 6px; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.d.out { color: var(--muted); opacity: .45; }
.d.work { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); font-weight: 700; }
.d.off { background: var(--sunk); border-color: var(--border); color: var(--muted); background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--border) 4px 5px); }
.d.hol { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0 20px 18px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 16px; height: 16px; border-radius: 5px; border: 1px solid transparent; display: inline-block; }
.legend .work { background: var(--info-bg); border-color: var(--info-border); }
.legend .off { background: var(--sunk); border-color: var(--border-2); }
.legend .hol { background: var(--warn-bg); border-color: var(--warn-border); }

/* Hub */
.hub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hub .tool { padding: 28px; }
.hub .tool h2 { font-size: 22px; font-weight: 600; }
.cov-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.cov { width: 100%; border-collapse: collapse; min-width: 640px; }
.cov th { padding: 10px 16px; text-align: start; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: var(--sunk); border-bottom: 1px solid var(--border); }
.cov td { padding: 12px 16px; font-size: 14.5px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.cov tr:last-child td { border-bottom: none; }
.cov .mono { font-size: 12.5px; color: var(--muted); }

/* Grid containers must not grow to fit a wide table: children shrink, tables scroll inside their wrap.
   (calculators.html uses <div class="wrap" style="display:grid"> whose implicit auto column blew out.) */
.calc-main > .wrap { grid-template-columns: minmax(0, 1fr); }
.hub > *, .tools > *, .results > *, .calc-grid > * { min-width: 0; }

/* ---------- Legal pages ---------- */
.legal { padding-block: clamp(32px, 5vw, 64px) clamp(56px, 8vw, 96px); }
.legal .wrap { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.toc { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); display: grid; gap: 2px; font-size: 14px; }
.toc a { color: var(--muted); padding: 6px 10px; border-radius: var(--r-md); }
.toc a:hover { background: var(--surface); color: var(--text); }
.prose { max-width: 72ch; }
.prose section + section { margin-top: 36px; }
.prose h2 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.prose p { color: var(--text); margin-top: 12px; }
.prose ul { display: grid; gap: 8px; margin-top: 12px; padding-inline-start: 20px; list-style: disc; }
.prose .meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.draft-note { margin-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .links { display: none; }
  .hero .wrap, .sec-head, .sec-grid, .cta .wrap, .papers, .legal .wrap, .duo, .banner .wrap, .subhero--split .wrap { grid-template-columns: 1fr; }
  .banner .wrap { display: grid; }
  .sec-head { align-items: start; }
  .flow { grid-template-columns: 1fr; }
  .flow > div { border-inline-end: none; border-bottom: 1px solid var(--border); }
  .flow > div:last-child { border-bottom: none; }
  .flow > div:not(:last-child)::after { display: none; }
  .cover, .cover--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 1fr; gap: 12px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools, .hub { grid-template-columns: 1fr; }
  .strip .wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip--4 .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip .c { border-bottom: 1px solid var(--border); }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-form { position: static; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftr .top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
}
@media (max-width: 600px) {
  .cover, .cover--4, .steps, .points, .form-grid, .two, .tiles.t3 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .brand span:last-child { display: none; }
  .ftr .brand span:last-child { display: inline; }
  .paper { padding: 22px; }
  .strip .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftr .top { grid-template-columns: 1fr; }
  .hdr .btn--sm { padding: 0 12px; }
  .cal-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 14px; }
  /* Coverage table becomes stacked rows: country + body on one line, law below */
  .cov { min-width: 0; }
  .cov thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cov tbody, .cov tr { display: block; }
  .cov tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--divider); }
  .cov tr:last-child { border-bottom: none; }
  .cov td { display: block; padding: 0; border: none; }
  .cov td:first-child { font-weight: 700; }
  .cov td:nth-child(2) { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); text-align: end; align-self: center; }
  .cov td:nth-child(3) { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
  .panel-head { padding: 14px 16px; }
  .hub .tool { padding: 22px; }
  .callout { padding: 14px; }
}
@media (max-width: 420px) {
  .hdr .wrap { gap: 8px; }
  .hdr-actions { gap: 6px; }
  .hdr-actions .btn--amber { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
