/* MUTABIQ UI. Visual system from the MUTABIQ deck: navy hero and closing bands, a light canvas with
   white bordered cards, teal for evidence and progress, gold for the Arabic tagline and markers,
   IBM Plex Sans / Sans Arabic / Mono. */

:root {
  --navy: #0b2440;
  --navy-2: #14324f;
  --navy-3: #1d3f60;
  --canvas: #f4f7f6;
  --surface: #ffffff;
  --border: #d9e1e6;
  --ink: #14324f;
  --muted: #5e6e7e;
  --teal: #17b8a6;
  --teal-deep: #0b7a6e;
  --teal-tint: #e8f4f2;
  --teal-tint-2: #d6f2ee;
  --gold: #e3b04b;
  --on-dark: #e6eef5;
  --on-dark-muted: #c9d6e0;

  --st-supported-bg: #d6f2ee; --st-supported-fg: #0b6e63;
  --st-missing-bg: #fbebc8;   --st-missing-fg: #7a5410;
  --st-conflict-bg: #f9ddd6;  --st-conflict-fg: #9a3420;
  --st-verify-bg: #dce6f2;    --st-verify-fg: #2f5682;
  --st-na-bg: #e7ebee;        --st-na-fg: #4e5d6c;

  --sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --arabic: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

  --space-page: clamp(1rem, 4.5vw, 4.5rem);
  --measure: 76rem;
  --radius: 14px;
  --radius-lg: 18px;
  --gap: clamp(0.9rem, 1.8vw, 1.4rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.35rem, 1.2rem + 0.8vw, 1.85rem);
  --step-3: clamp(1.9rem, 1.45rem + 2vw, 3rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.8vw, 4.6rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 4.25rem;
  --shadow: 0 1px 2px rgb(11 36 64 / 0.05), 0 6px 18px rgb(11 36 64 / 0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--canvas); color: var(--ink); font: 400 var(--step-0)/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; color: var(--navy); font-weight: 700; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
h3 { font-weight: 600; letter-spacing: -0.005em; line-height: 1.25; }
p { margin: 0; }
a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--teal); color: var(--navy); }
[hidden] { display: none !important; }
code, .mono { font-family: var(--mono); }
code { font-size: 0.88em; background: var(--teal-tint); color: var(--navy); padding: 0.1em 0.4em; border-radius: 0.35em; }
[lang='ar'] { font-family: var(--arabic); }

.wrap { width: min(100% - 2 * var(--space-page), var(--measure)); margin-inline: auto; }
[id], .tabs, .results { scroll-margin-top: calc(var(--header-h) + 1rem); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--teal); color: var(--navy); padding: 0.6rem 1rem; border-radius: 0.6rem; font-weight: 600; }
.skip-link:focus { top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------------- brand + header */
.brand-mark { width: 2.1rem; height: 2.1rem; flex: none; }
.brand-mark.small { width: 1.35rem; height: 1.35rem; }
.mark-tile { fill: var(--navy-2); }
.mark-dot { fill: var(--gold); }
.mark-bar { fill: var(--on-dark); }
.mark-check { fill: none; stroke: var(--teal); stroke-width: 4.5; stroke-linecap: round; }
.site-header { position: sticky; top: 0; z-index: 30; background: var(--navy); border-bottom: 1px solid var(--navy-2); }
.header-row { min-height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--on-dark); }
.brand:hover { color: #fff; }
.wordmark, .wordmark-brand { font: 700 1.3rem/1 var(--arabic); letter-spacing: 0.02em; }
.wordmark-ar, .wordmark-sub { font: 500 1.1rem/1 var(--sans); color: var(--teal); padding-inline-start: 0.7rem; border-inline-start: 1px solid var(--navy-3); }
html[lang='en'] .wordmark-brand { font-family: var(--sans); letter-spacing: 0.08em; }
html[lang='en'] .wordmark-sub { font-family: var(--arabic); }
.site-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 0.8rem; }
.site-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 0.5rem 0.85rem; border-radius: 8px; text-decoration: none; color: var(--on-dark-muted); font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover { color: #fff; background: var(--navy-2); }
.site-nav a[aria-current='page'] { color: var(--navy); background: var(--teal); }
.lang-toggle { display: inline-flex; align-items: center; gap: 0.45rem; background: var(--navy-2); color: var(--teal); border: 1px solid var(--teal-deep); border-radius: 8px; padding: 0.42rem 0.85rem; font: 600 0.85rem var(--sans); cursor: pointer; transition: all 0.2s var(--ease); }
.lang-toggle:hover { background: var(--teal); color: var(--navy); border-color: var(--teal); }
.lang-globe { font-size: 0.95rem; line-height: 1; }
.motion-toggle { display: inline-flex; align-items: center; gap: 0.5rem; background: transparent; color: var(--on-dark-muted); border: 1px solid var(--navy-3); border-radius: 8px; padding: 0.42rem 0.75rem; font: 500 0.82rem var(--sans); cursor: pointer; }
.motion-toggle:hover { color: #fff; border-color: var(--on-dark-muted); }
.motion-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--teal); }
.motion-toggle[aria-pressed='true'] .motion-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--on-dark-muted); }
.menu-button { display: none; margin-inline-start: auto; align-items: center; gap: 0.6rem; background: var(--navy-2); color: var(--on-dark); border: 0; border-radius: 8px; padding: 0.55rem 0.9rem; font: 500 0.95rem var(--sans); cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 1.05rem; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform 0.2s var(--ease); }
.menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
.menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
.menu-button[aria-expanded='true'] .menu-icon { background: transparent; }
.menu-button[aria-expanded='true'] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-button[aria-expanded='true'] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

/* ------------------------------------------------------------------------- stage + transition cover */
.stage { position: relative; flex: 1; display: flex; flex-direction: column; }
.route { flex: 1; outline: none; padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.cover { position: fixed; inset: var(--header-h) 0 0 0; z-index: 20; overflow: hidden; }
.cover-sheet { position: absolute; inset: 0; border-radius: 22px 22px 0 0; transform: translateY(105%); }
.cover-back { background: var(--teal); }
.cover-front { background: var(--canvas); display: grid; place-content: center; justify-items: center; gap: 0.6rem; }
.cover-scene .guide { width: clamp(8.5rem, 20vw, 12.5rem); }
.cover-caption { font: 600 var(--step-1)/1.2 var(--sans); color: var(--navy); }

/* ------------------------------------------------------------------------- shared components */
.eyebrow { color: var(--teal-deep); font: 600 0.8rem/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.on-dark .eyebrow { color: var(--teal); }
.lede { color: var(--ink); font-size: var(--step-1); line-height: 1.55; max-width: 40rem; }
.muted { color: var(--muted); }
.section { margin-top: clamp(3.5rem, 7vw, 6rem); }
.section-head { display: grid; gap: 0.75rem; margin-bottom: clamp(1.4rem, 3vw, 2.2rem); max-width: 64rem; }
.section-head h2 { font-size: var(--step-3); }
.accent-text { color: var(--teal-deep); }
.on-dark .accent-text { color: var(--teal); }
.band-dark { background: var(--navy); color: var(--on-dark-muted); position: relative; overflow: hidden; }
.band-dark h1, .band-dark h2, .band-dark h3 { color: #f4f7f6; }
.band-dark .lede { color: var(--on-dark-muted); }
.tagline-ar { font: 500 clamp(1.25rem, 1.1rem + 0.7vw, 1.7rem)/1.4 var(--arabic); color: var(--gold); width: fit-content; } /* RTL text, but aligned with the LTR column like the deck */

.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.9rem; padding: 0.7rem 1.25rem; border-radius: 10px; border: 0; cursor: pointer; text-decoration: none; font: 600 0.98rem/1.2 var(--sans); transition: background 0.15s, box-shadow 0.15s, transform 0.15s var(--ease); }
.button-primary { background: var(--teal); color: var(--navy); }
.button-primary:hover { background: #14a593; color: var(--navy); }
.button-primary:active { transform: translateY(1px); }
.button-secondary { background: var(--surface); color: var(--navy); box-shadow: inset 0 0 0 1px var(--border); }
.button-secondary:hover { color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--teal); }
.on-dark .button-secondary { background: transparent; color: var(--on-dark); box-shadow: inset 0 0 0 1px rgb(201 214 224 / 0.45); }
.on-dark .button-secondary:hover { color: #fff; box-shadow: inset 0 0 0 1.5px var(--teal); }
.button[disabled] { opacity: 0.55; cursor: progress; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.6rem; border-radius: 7px; font: 500 0.8rem/1.3 var(--sans); background: var(--canvas); color: var(--ink); border: 1px solid var(--border); white-space: nowrap; }
.chip-teal { background: var(--teal-tint); color: var(--teal-deep); border-color: transparent; }
.chip-gold { background: #fbf4e4; color: var(--st-missing-fg); border-color: transparent; }
.chip-navy { background: var(--navy-2); color: var(--on-dark); border-color: var(--navy-3); }
.chip-dark-teal { background: var(--navy-2); color: var(--teal); border-color: transparent; }
.chip-dark-gold { background: var(--navy-2); color: var(--gold); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.status { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.22rem 0.6rem; border-radius: 7px; font: 600 0.8rem/1.3 var(--sans); white-space: nowrap; }
.status .mark { font-family: var(--mono); font-weight: 500; }
.status-supported { background: var(--st-supported-bg); color: var(--st-supported-fg); }
.status-missing { background: var(--st-missing-bg); color: var(--st-missing-fg); }
.status-conflict { background: var(--st-conflict-bg); color: var(--st-conflict-fg); }
.status-verify { background: var(--st-verify-bg); color: var(--st-verify-fg); }
.status-not_applicable { background: var(--st-na-bg); color: var(--st-na-fg); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1rem, 2vw, 1.4rem); box-shadow: var(--shadow); }
.card h3 { font-size: var(--step-1); }
.card p { color: var(--muted); }
.card-dark { background: var(--navy); border-color: var(--navy); color: var(--on-dark-muted); }
.card-dark h3 { color: #f4f7f6; }
.card-teal-edge { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal) inset, var(--shadow); }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.icon-tile { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 9px; background: var(--teal-tint); color: var(--teal-deep); flex: none; }
.icon-tile.dark { background: var(--navy); color: var(--teal); }
.icon { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-title { display: flex; align-items: center; gap: 0.7rem; }
.notice-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: center; background: #fbf4e4; border: 1px solid #f0dcae; color: var(--st-missing-fg); border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.93rem; }
.notice-bar strong { font-weight: 600; }
.service-status { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.service-status::before { content: ''; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--border); flex: none; }
.service-status[data-state='live']::before { background: var(--teal); }
.service-status[data-state='offline']::before { background: var(--gold); }

/* ------------------------------------------------------------------------- home: hero */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero-copy { display: grid; gap: clamp(1rem, 2vw, 1.4rem); align-content: start; }
.hero h1 { font-size: var(--step-4); line-height: 1.04; letter-spacing: -0.025em; }
.hero h1 .accent-text { display: block; }
.matching { width: 100%; max-width: 25rem; justify-self: end; }
.matching .m-bar { fill: rgb(201 214 224 / 0.26); }
.matching .m-dot { fill: rgb(201 214 224 / 0.32); }
.matching .m-dot.gold { fill: var(--gold); opacity: 0.85; }
.matching .m-link { fill: none; stroke: var(--teal); stroke-width: 7; stroke-linecap: round; opacity: 0.55; }
.matching .m-sep { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; opacity: 0.7; }

/* problem */
.problem { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.questions { display: grid; gap: 0.75rem; margin-top: 1.4rem; }
.questions li { display: flex; gap: 0.8rem; align-items: center; font-weight: 600; color: var(--navy); }
.questions .num { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 7px; background: var(--navy); color: #fff; font: 600 0.85rem var(--mono); flex: none; }
.hub { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); gap: 1.4rem 1.2rem; align-items: center; }
.hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hub-lines line { stroke: #98a4b0; stroke-width: 1.5; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.hub .card { position: relative; padding: 0.8rem 1rem; }
.hub .card h3 { font-size: 1rem; }
.hub .card p { font-size: 0.85rem; }
.hub .card.dashed { background: transparent; box-shadow: none; border-style: dashed; color: var(--muted); }
.hub-center { position: relative; justify-self: center; display: grid; place-items: center; gap: 0.3rem; width: clamp(7.5rem, 13vw, 9.5rem); aspect-ratio: 1; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 600; text-align: center; box-shadow: 0 10px 30px rgb(11 36 64 / 0.25); }
.hub-center .icon { width: 1.8rem; height: 1.8rem; stroke: #fff; }

/* solution */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.6rem; }
.step { position: relative; display: grid; gap: 0.6rem; align-content: start; }
.step-top { display: flex; justify-content: space-between; align-items: center; }
.step .n { font: 500 0.85rem var(--mono); color: var(--muted); }
.step h3 { font-size: 1.05rem; }
.step p { font-size: 0.9rem; }
.step:not(:last-child)::after { content: '→'; position: absolute; right: -1.25rem; top: 50%; transform: translateY(-50%); color: #98a4b0; font-size: 1rem; }
.step.is-final { background: var(--teal); border-color: var(--teal); }
.step.is-final h3, .step.is-final p, .step.is-final .n { color: var(--navy); }
.step.is-final .icon-tile { background: rgb(11 36 64 / 0.12); color: var(--navy); }
.engine-note { display: flex; gap: 0.6rem; align-items: center; margin-top: 1.1rem; color: var(--ink); }
.engine-note .icon { color: var(--teal-deep); }
.handoff { display: grid; grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1fr); gap: 1.2rem; align-items: center; margin-top: 1.8rem; }
.handoff .card { display: grid; gap: 0.8rem; }
.handoff-middle { display: grid; justify-items: center; gap: 0.25rem; color: var(--muted); font-size: 0.82rem; text-align: center; }
.handoff-middle .icon { width: 1.4rem; height: 1.4rem; }

/* inputs / outputs */
.io { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: clamp(1rem, 3vw, 2rem); align-items: center; }
.io-col { display: grid; gap: var(--gap); }
.io .card { display: grid; gap: 0.7rem; }
.io .card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.io .card-head h3 { display: flex; align-items: center; gap: 0.55rem; }
.io .card-head h3 .icon { color: var(--teal-deep); width: 1.3rem; height: 1.3rem; }
.io-engine { display: grid; justify-items: center; gap: 0.3rem; }
.io-engine .guide { width: clamp(7rem, 12vw, 9.5rem); }
.io-engine .arrow { color: #98a4b0; }
.small-note { font-size: 0.85rem; color: var(--muted); }

/* trust */
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.trust .card { display: grid; gap: 0.5rem; align-content: start; }
.trust h3 { font-size: 1.02rem; }
.trust p { font-size: 0.92rem; }

/* prototype status */
.status-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.status-board ul { margin: 0.4rem 0 0; padding-inline-start: 1.1rem; display: grid; gap: 0.45rem; color: var(--ink); }

/* closing */
.closing { margin-top: clamp(3.5rem, 7vw, 6rem); padding: clamp(3rem, 7vw, 5rem) 0; }
.route > .closing:last-child { margin-bottom: calc(-1 * clamp(3rem, 7vw, 5.5rem)); } /* meet the footer */
.closing-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.closing h2 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.9rem); line-height: 1.05; letter-spacing: -0.025em; }
.closing h2 .accent-text { display: block; }
.readiness-card { background: rgb(29 63 96 / 0.55); border: 1px solid var(--navy-3); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; display: grid; gap: 0.9rem; color: var(--on-dark); }
.readiness-card .rc-head { display: flex; align-items: center; gap: 0.6rem; font: 500 0.78rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-muted); }
.readiness-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.readiness-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.7rem; align-items: center; }
.readiness-list .bullet { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gold); }
.readiness-list .tick { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: rgb(23 184 166 / 0.16); color: var(--teal); font-size: 0.8rem; }
.readiness-list .tick.open { background: rgb(227 176 75 / 0.16); color: var(--gold); }
.progress { height: 0.45rem; border-radius: 99px; background: rgb(201 214 224 / 0.18); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #6fd6c9); border-radius: inherit; transition: width 0.4s var(--ease); }
.readiness-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; }
.readiness-foot strong { color: var(--gold); font-weight: 600; }

/* ------------------------------------------------------------------------- inner pages */
.page-band { padding: clamp(2.2rem, 5vw, 3.6rem) 0 clamp(4.5rem, 9vw, 6.5rem); }
.page-band-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: end; }
.page-band h1 { font-size: var(--step-3); margin-top: 0.5rem; }
.page-band .lede { margin-top: 0.8rem; }
.page-band .guide { width: clamp(7rem, 13vw, 10rem); }
.lift { margin-top: clamp(-3.5rem, -7vw, -2.5rem); position: relative; }
.page-head { padding-top: clamp(2.2rem, 5vw, 3.6rem); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: end; }
.page-head h1 { font-size: var(--step-3); margin-top: 0.5rem; }
.page-head .lede { margin-top: 0.8rem; }
.page-head .guide { width: clamp(7rem, 13vw, 10rem); }

/* assessment */
.assess { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.flow { display: grid; gap: 0.3rem; }
.flow .eyebrow { color: var(--muted); margin-bottom: 0.5rem; }
.flow ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.flow li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.7rem; align-items: center; padding: 0.55rem 0.6rem; border-radius: 9px; font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.flow li .num { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--navy); color: #fff; font: 600 0.8rem var(--mono); }
.flow li.is-current { background: var(--teal-tint); }
.flow li.is-current .num { background: var(--teal); color: var(--navy); }
.flow li.is-done .num { background: var(--teal-deep); }
.flow .guide { width: 100%; max-width: 9rem; margin: 0.8rem auto 0; }
.app-frame { padding: 0; overflow: hidden; }
.app-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); }
.app-bar h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 0.6rem; }
.app-bar .brand-mark { width: 1.6rem; height: 1.6rem; }
.app-bar .sample { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--st-missing-fg); }
.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tab { border: 0; background: var(--canvas); color: var(--muted); border-radius: 7px; padding: 0.3rem 0.65rem; font: 600 0.82rem var(--sans); cursor: pointer; }
.tab:hover { color: var(--navy); }
.tab[aria-selected='true'] { background: var(--navy); color: #fff; }
.tab-panel { padding: clamp(1rem, 2.4vw, 1.5rem); }
.tab-panel:focus-visible { outline-offset: -3px; }
.inputs { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(1rem, 3vw, 2rem); }
.inputs > div + div { border-inline-start: 1px solid var(--border); padding-inline-start: clamp(1rem, 3vw, 2rem); }
.field { display: grid; gap: 0.35rem; margin-top: 0.9rem; }
.field label, .field .label { font-size: 0.85rem; color: var(--muted); }
.field input, .field select { width: 100%; font: 400 0.95rem var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 0.6rem 0.75rem; }
.field input:focus, .field select:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.field input[readonly] { background: var(--canvas); }
.field-error { color: var(--st-conflict-fg); font-size: 0.85rem; }
.saved-company { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; background: var(--teal-tint); border-radius: 10px; padding: 0.7rem 0.9rem; font-weight: 600; color: var(--navy); margin-top: 0.5rem; }
.dropzone { border: 1.5px dashed var(--border); border-radius: 10px; padding: 0.8rem; display: grid; gap: 0.6rem; }
.dropzone .chip { font-family: var(--mono); font-size: 0.78rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { text-align: start; padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { color: var(--muted); font-weight: 400; }
.data-table td.value { font-weight: 600; color: var(--navy); }
.data-table td.src { font: 400 0.8rem var(--mono); color: var(--muted); white-space: nowrap; }
.data-table td.value input { font-weight: 500; min-width: 11rem; }
.data-table td.value .small-note, .data-table td.value .field-error { display: block; margin-top: 0.25rem; font-weight: 400; }
.ok-dot, .open-dot { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; font-size: 0.7rem; }
.ok-dot { background: var(--st-supported-bg); color: var(--st-supported-fg); }
.open-dot { background: var(--st-missing-bg); color: var(--st-missing-fg); }
.panel-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem; margin-top: 1.2rem; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.findings { display: grid; gap: 0.8rem; }
.finding { border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; display: grid; gap: 0.6rem; background: var(--surface); }
.finding-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: center; }
.finding-head h3 { font-size: 1rem; }
.finding dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 1rem; margin: 0; font-size: 0.9rem; }
.finding dt { color: var(--muted); }
.finding dd { margin: 0; }
.finding .src { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.form-preview th { width: 34%; }
.flag { color: var(--st-missing-fg); font-weight: 600; font-size: 0.82rem; }
.app-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(1rem, 3vw, 1.6rem); align-items: start; }
.app-columns h3 { font-size: 1rem; margin-bottom: 0.6rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.checklist li { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; font-size: 0.9rem; }
.app-readiness { margin-top: 1rem; }
.app-readiness .readiness-card { background: var(--navy); border-color: var(--navy); }

/* evidence search */
.search-form { margin-top: 1.4rem; display: grid; gap: 0.9rem; }
.search-form > label { font-weight: 600; color: var(--navy); }
.search-box { display: flex; gap: 0.7rem; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.45rem; box-shadow: var(--shadow); }
.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(23 184 166 / 0.18); }
.search-box textarea { flex: 1; min-height: 3rem; resize: vertical; border: 0; background: transparent; color: var(--ink); font: 400 1.05rem/1.5 var(--sans); padding: 0.5rem 0.7rem; }
.search-box textarea:focus { outline: none; }
.search-box textarea::placeholder { color: #7f8c99; }
.search-box .button { align-self: flex-end; }
.examples { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.examples > span { color: var(--muted); font-size: 0.88rem; margin-right: 0.2rem; }
.example { background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 0.35rem 0.75rem; font: 400 0.9rem var(--sans); cursor: pointer; text-align: start; }
.example[lang='ar'] { font-family: var(--arabic); }
.example:hover { border-color: var(--teal); color: var(--teal-deep); }
.options { color: var(--muted); }
.options summary { cursor: pointer; width: fit-content; font-weight: 600; }
.options-body { display: flex; flex-wrap: wrap; gap: 0.9rem 2rem; margin-top: 0.8rem; align-items: center; }
.options label { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; max-width: 100%; }
.options select { max-width: 100%; min-width: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 0.35rem 0.5rem; font: 400 0.92rem var(--sans); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--teal-deep); width: 1.05rem; height: 1.05rem; }

.results { margin-top: clamp(1.6rem, 4vw, 2.6rem); display: grid; gap: 1rem; }
.results-summary { color: var(--muted); }
.results-summary strong { color: var(--navy); font-weight: 600; }
.evidence-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.evidence { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1rem, 2.2vw, 1.4rem); display: grid; gap: 0.85rem; box-shadow: var(--shadow); border-inline-start: 4px solid var(--border); }
.evidence.is-context { margin-inline-start: clamp(0.8rem, 3vw, 2.2rem); background: #fbfcfc; border-inline-start-color: var(--teal-tint-2); box-shadow: none; }
.evidence.is-exact, .evidence:not(.is-context) { border-inline-start-color: var(--teal); }
.evidence-head { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: baseline; justify-content: space-between; }
.evidence-head h3 { font-size: 1.02rem; }
.evidence-head .where { color: var(--teal-deep); font: 600 0.95rem var(--mono); margin-inline-start: 0.5rem; }
.evidence-text { white-space: pre-line; font-size: 1.05rem; line-height: 1.85; color: var(--ink); max-width: 72ch; }
.evidence-text[lang='ar'] { font-family: var(--arabic); }
.evidence-text[lang='en'] { line-height: 1.65; }
.evidence-text[dir='rtl'] { margin-left: auto; }
.evidence-text.is-clamped { max-height: 12em; overflow: hidden; mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.evidence-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; color: var(--muted); font-size: 0.84rem; align-items: center; }
.evidence-meta .mono { font-size: 0.8rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--teal-deep); font: 600 0.88rem var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; justify-self: start; }
.caveats summary { cursor: pointer; color: var(--st-missing-fg); font-size: 0.88rem; font-weight: 600; width: fit-content; }
.caveats ul { margin: 0.5rem 0 0; padding-inline-start: 1.2rem; color: var(--muted); font-size: 0.9rem; display: grid; gap: 0.3rem; }
.caveats.card summary { color: var(--navy); }
.notice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.2rem; align-items: center; }
.notice .guide { width: 6rem; }
.notice h2 { font-size: var(--step-2); margin-bottom: 0.35rem; }
.notice p { color: var(--muted); }
.searching { display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.searching .guide { width: 5rem; }

/* knowledge base */
.pipeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.pipeline ol { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.pipeline li { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; padding: 0.55rem 0.7rem; border-radius: 9px; background: var(--canvas); font-size: 0.93rem; }
.source-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }
.source { display: flex; flex-direction: column; gap: 0.8rem; }
.source .ar-title { font: 600 1.2rem/1.6 var(--arabic); color: var(--navy); }
.source .en-title { font-weight: 600; color: var(--teal-deep); }
.source dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 1rem; margin: 0; font-size: 0.88rem; }
.source dt { color: var(--muted); }
.source dd { margin: 0; overflow-wrap: anywhere; }
.source .card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.uncovered { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.uncovered .card { background: transparent; box-shadow: none; border-style: dashed; }
.uncovered .card.trial { border-color: var(--gold); background: #fffaf0; }
.uncovered h3 { font-size: 1rem; }
.uncovered p { margin-top: 0.4rem; font-size: 0.92rem; }

/* not found */
.lost { display: grid; grid-template-columns: minmax(0, 1fr) minmax(9rem, 14rem); gap: 2rem; align-items: center; padding-top: clamp(3rem, 8vw, 6rem); }
.lost h1 { font-size: var(--step-3); margin-top: 0.5rem; }
.lost .lede { margin: 0.8rem 0 1.4rem; }
.lost .guide { width: 100%; }

/* ------------------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1.3rem 0; color: var(--muted); font-size: 0.86rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; align-items: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-brand strong { color: var(--navy); letter-spacing: 0.06em; }

/* ------------------------------------------------------------------------- the guide (SVG character) */
.guide { display: block; overflow: visible; --limb: var(--navy); }
.on-dark .guide { --limb: var(--on-dark); }
.guide .g-body { fill: var(--navy); }
.on-dark .guide .g-body { stroke: var(--navy-3); stroke-width: 3; }
.guide .g-dot { fill: var(--gold); }
.guide .g-eye { fill: #f4f7f6; transform-box: fill-box; transform-origin: 50% 50%; }
.guide .g-mouth { fill: none; stroke: var(--teal); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.guide .g-limb { fill: none; stroke: var(--limb); stroke-width: 5; stroke-linecap: round; }
.guide .g-hand { fill: var(--teal); stroke: var(--limb); stroke-width: 3; }
.guide .g-foot { fill: var(--limb); }
.guide .g-shadow { fill: var(--navy); opacity: 0.14; }
.guide .p-card { fill: #fff; stroke: var(--border); stroke-width: 2; }
.guide .p-bar-teal, .guide .p-bar-gold, .guide .p-bar-grey { stroke-width: 4; stroke-linecap: round; }
.guide .p-bar-teal { stroke: var(--teal); } .guide .p-bar-gold { stroke: var(--gold); } .guide .p-bar-grey { stroke: var(--border); }
.guide .p-handle { stroke: var(--limb); stroke-width: 5; stroke-linecap: round; }
.guide .p-lens { fill: rgb(23 184 166 / 0.16); stroke: var(--limb); stroke-width: 4.5; }
.guide .p-glint { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; }
.guide .p-stamp-grip { fill: var(--teal); stroke: var(--limb); stroke-width: 3; }
.guide .p-stamp-base { fill: var(--limb); }
.guide .p-check { fill: none; stroke: var(--teal-deep); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.guide .p-board { fill: var(--teal-tint); stroke: var(--border); stroke-width: 2; }
.guide .p-question { fill: none; stroke: var(--gold); stroke-width: 4.5; stroke-linecap: round; }
.guide .p-question-dot { fill: var(--gold); }
.guide .mirrored { transform: scaleX(-1); transform-origin: 120px 0; }
.guide .arm-near, .guide .arm-far, .guide .bob { transform-box: view-box; }
.guide .bob { transform-origin: 120px 200px; }
.guide .arm-near { transform-origin: 178px 120px; }
.guide .arm-far { transform-origin: 62px 120px; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.12); } }
@keyframes wave { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(10deg); } }
@keyframes sweep { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(10deg); } }
@keyframes press { 0%, 55%, 100% { transform: rotate(0deg) translateY(0); } 70%, 82% { transform: rotate(14deg) translateY(10px); } }
@keyframes check-in { 0%, 68% { stroke-dashoffset: 30; } 80%, 100% { stroke-dashoffset: 0; } }
@keyframes point { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-7deg); } }
@keyframes shrug { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes link-draw { 0%, 8% { stroke-dashoffset: var(--len); } 30%, 82% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: var(--len); } }

.motion-on .guide .bob { animation: bob 3.6s ease-in-out infinite; }
.motion-on .guide .g-eye { animation: blink 5.2s ease-in-out infinite; }
.motion-on .guide.pose-wave .arm-near { animation: wave 2.4s var(--ease) infinite; }
.motion-on .guide.pose-search .arm-near { animation: sweep 2.8s ease-in-out infinite; }
.motion-on .guide.pose-stamp .arm-near { animation: press 2.6s var(--ease) infinite; }
.guide.pose-stamp .p-check { stroke-dasharray: 30; }
.motion-on .guide.pose-stamp .p-check { animation: check-in 2.6s var(--ease) infinite; }
.motion-on .guide.pose-shelf .arm-far { animation: point 2.4s ease-in-out infinite; }
.motion-on .guide.pose-shrug .arm-near, .motion-on .guide.pose-shrug .arm-far { animation: shrug 2s ease-in-out infinite; }
.motion-on .guide.is-quiet .bob, .motion-on .guide.is-quiet .arm-near, .motion-on .guide.is-quiet .arm-far { animation: none; }
/* Hero: requirements (grey bars) get matched to evidence (teal links), row by row. */
.matching .m-link { stroke-dasharray: var(--len); stroke-dashoffset: 0; }
.motion-on .matching .m-link { animation: link-draw 7s var(--ease) infinite; animation-delay: var(--delay); }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.motion-on .enter > * { animation: rise 0.55s var(--ease) both; }
.motion-on .enter > :nth-child(2) { animation-delay: 0.05s; }
.motion-on .enter > :nth-child(3) { animation-delay: 0.1s; }
.motion-on .enter > :nth-child(n + 4) { animation-delay: 0.15s; }

/* ------------------------------------------------------------------------- responsive */
@media (max-width: 68rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step:nth-child(3)::after { display: none; }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 58rem) {
  .menu-button { display: inline-flex; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0.8rem; padding: 0.9rem var(--space-page) 1.2rem; background: var(--navy); border-bottom: 1px solid var(--navy-2); }
  .site-nav:not(.is-open) { display: none; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 0.75rem 0.9rem; }
  .motion-toggle { align-self: flex-start; }
  /* minmax(0, 1fr), not 1fr: a bare 1fr column grows to its content's min-content width. */
  .hero-grid, .problem, .closing-grid, .assess, .inputs, .app-columns, .pipeline { grid-template-columns: minmax(0, 1fr); }
  .inputs > div + div { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--border); padding-top: 1rem; }
  .matching { max-width: 22rem; justify-self: start; }
  .handoff, .io, .status-board { grid-template-columns: minmax(0, 1fr); }
  .io-engine .guide { width: 6.5rem; }
  .io-engine .arrow { transform: rotate(90deg); }
  .flow .guide { display: none; }
  .page-band-grid > .guide, .page-head > .guide { display: none; }
}
@media (max-width: 40rem) {
  .wordmark-ar { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  .step::after { display: none; }
  .trust { grid-template-columns: minmax(0, 1fr); }
  .hub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-lines { display: none; }
  .hub-center { grid-column: 1 / -1; order: -1; width: 7rem; }
  .search-box { flex-direction: column; }
  .search-box .button { align-self: stretch; }
  .finding dl, .source dl { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .finding dd { margin-bottom: 0.4rem; }
  .notice { grid-template-columns: minmax(0, 1fr); }
  /* Tables become stacked rows: field name, then value and source; the state mark sits on the right. */
  .data-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
  .data-table thead tr { display: none; }
  .data-table th, .data-table td { border: 0; padding: 0.05rem 0; grid-column: 1; }
  .data-table td.src { white-space: normal; }
  .data-table:not(.form-preview) td:last-child { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .data-table td.value input { min-width: 0; width: 100%; }
  .flow { display: none; } /* the step tabs already show progress on small screens */
  .lost { grid-template-columns: minmax(0, 1fr); }
  .lost .guide { max-width: 9rem; order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------------- RTL Layout & Arabic Typography */
html[dir='rtl'] {
  --sans: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
}
html[dir='rtl'] body {
  font-family: var(--arabic);
}
html[dir='rtl'] h1,
html[dir='rtl'] h2,
html[dir='rtl'] h3 {
  letter-spacing: normal;
  font-family: var(--arabic);
}
html[dir='rtl'] .eyebrow {
  letter-spacing: 0.04em;
}
html[dir='rtl'] .skip-link {
  left: auto;
  right: 1rem;
}
html[dir='rtl'] .tagline-ar {
  width: auto;
}
html[dir='rtl'] .button .icon-arrow,
html[dir='rtl'] .button-primary svg,
html[dir='rtl'] .actions a.button-primary svg {
  transform: scaleX(-1);
}
html[dir='rtl'] .io-engine .arrow {
  transform: scaleX(-1);
}
html[dir='rtl'] .inputs > div + div {
  border-inline-start: 1px solid var(--border);
  padding-inline-start: 2rem;
}
html[dir='rtl'] .findings dd.src {
  text-align: start;
}

/* ------------------------------------------------------------------------- 2-Stage Inputs & TRC Form Styles */
.inputs-2stage {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.stage-card {
  padding: 1.5rem;
  border-radius: var(--radius, 12px);
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
}
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.stage-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--step-0, 1.1rem);
  color: var(--navy, #0b2440);
}
.stage-badge .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--teal, #008080);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
}
.company-profile-preview {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.cpp-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cpp-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
}
.cpp-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem 1.2rem;
  padding: 1rem;
  background: var(--bg-alt, #f8fafc);
  border-radius: 8px;
  font-size: 0.92rem;
}
.meta-label {
  color: var(--muted, #64748b);
  margin-inline-end: 0.3rem;
  font-weight: 500;
}
.company-edit-form {
  padding: 0.5rem 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem 1.2rem;
}
.form-full {
  grid-column: 1 / -1;
}
.button-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.88rem;
}
.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.8rem;
}
@media (max-width: 58rem) {
  .stage-grid {
    grid-template-columns: 1fr;
  }
}
.input-action-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.input-action-group input {
  flex: 1;
}
.input-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.input-inline input {
  text-align: center;
  font-weight: 600;
}

/* Official TRC Form (Annex 1) Styles */
.trc-form-container {
  padding: 2rem;
  background: #ffffff;
  border: 2px solid var(--navy-2, #1b3a5b);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.trc-form-header {
  border-bottom: 2px solid var(--navy, #0b2440);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
}
.trc-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.trc-official-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy, #0b2440);
  margin: 0 0 0.4rem 0;
}
.trc-form-section {
  margin-bottom: 1.5rem;
}
.trc-sec-title {
  background: var(--navy, #0b2440);
  color: #ffffff;
  padding: 0.45rem 0.8rem;
  font-size: 0.95rem;
  margin: 0 0 0.5rem 0;
  border-radius: 4px;
}
.trc-checkbox-row {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}
.trc-chk {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}
.trc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}
.trc-table th,
.trc-table td {
  border: 1px solid #cbd5e1;
  padding: 0.55rem 0.75rem;
  text-align: start;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .trc-form-container { padding: 1rem; }
  .trc-table th, .trc-table td { padding: 0.45rem 0.5rem; }
}
.trc-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: var(--navy, #0b2440);
}
.trc-fees-box {
  background: #f8fafc;
  border: 1px dashed var(--teal, #008080);
  padding: 1rem;
  border-radius: 6px;
}
.fees-summary-grid {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 1.05rem;
}
.badge-total {
  background: var(--teal, #008080);
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}
@media print {
  .site-header, .site-footer, .flow, .tabs, .app-bar, .panel-foot { display: none !important; }
  .trc-form-container { border: none !important; box-shadow: none !important; padding: 0 !important; }
}



/* Draft marking on the pre-filled application: visible on screen and in print. */
.draft-stamp { margin: 0.8rem 0 0; padding: 0.55rem 0.8rem; border: 1.5px dashed var(--st-missing-fg); border-radius: 8px; background: var(--st-missing-bg); color: var(--st-missing-fg); font-weight: 600; font-size: 0.88rem; }
@media print {
  .draft-stamp { border-color: #000; background: none; color: #000; }
  .trc-form-container::before { content: 'DRAFT · مسودة'; position: fixed; top: 40%; left: 0; right: 0; text-align: center; font: 700 64px/1 var(--sans); color: rgb(0 0 0 / 0.08); transform: rotate(-24deg); pointer-events: none; }
}
