/* =====================================================================
   TEMAI 7 | base.css  (owner: code-foundation)
   Reset, page ground and grain, layout helpers and every primitive of the Figma page
   "V7 · 02 Components — Primitives", one to one: .btn .icon-btn .kicker .tag-mono .chip .field .textarea .select
   .check .radio .switch .toast .hair .ruler .langswitch .section-head.
   Logical properties only (RTL first). Colours, space, radius and motion only from tokens.css.
   Contract and HTML for every class: docs/dev/v7-css-api.md
   ===================================================================== */

/* ---------- 1. reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + var(--space-12)); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--color-bg-base); color: var(--color-text-primary);
  font-family: var(--font-text); font-size: var(--fs-body-m); line-height: var(--lh-body-m); font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; position: relative;
}
html.i18n-pending body { visibility: hidden; animation: i18n-show 0s 1.5s forwards; }
@keyframes i18n-show { to { visibility: visible; } }
body.is-locked { overflow: hidden; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font: inherit; color: inherit; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
bdi { unicode-bidi: isolate; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: var(--color-selection); color: #fff; }

/* focus: 2px ring in text/primary, 3px away (2px on buttons), same radius family as Figma */
:focus { outline: none; }
:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: absolute; inset-inline-start: var(--space-12); top: -80px; z-index: 3000;
  background: var(--color-text-primary); color: var(--color-bg-base);
  padding: var(--space-12) var(--space-16); border-radius: var(--radius-md);
  font: 600 var(--fs-label-m)/var(--lh-label-m) var(--font-text); transition: top var(--dur-fast) var(--ease-out);
}
.skip:focus { top: var(--space-12); }

/* icons (sprite): 24 grid, 1.5 stroke, colour from the text colour. Same class as v6 (.ic, .ic--fill). */
.ic, .icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic--fill { stroke: none; fill: currentColor; }
.ic--steel { color: var(--color-metal-steel); }
.ic--sm { width: 16px; height: 16px; }
.ic--md { width: 20px; height: 20px; }
.ic--lg { width: 24px; height: 24px; }
[dir="rtl"] .ic--dir { transform: scaleX(-1); }        /* arrows that follow the reading direction (use #i-arrow-right / #i-chevron-right) */
[dir="ltr"] .ic--back { transform: scaleX(-1); }

/* ---------- 2. page ground and grain ---------- */
/* monochrome film grain over the page, about 3-4% (Grain/Film). Pure CSS data URI, no request. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 900; pointer-events: none; opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- 3. layout helpers ---------- */
/* .wrap = the content width: 1248 on desktop (Figma 1440 frame, margin 96), margin 20 on phones */
.wrap { width: 100%; max-width: calc(var(--content-max) + 2 * var(--page-margin)); margin-inline: auto; padding-inline: var(--page-margin); }
.wrap--bleed-end { max-width: none; padding-inline-end: 0; }          /* content that runs off the end edge (rails, stage) */
.grid { display: grid; grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr)); column-gap: var(--grid-gutter); }
.grid > * { min-width: 0; }
/* below desktop every cell is full width; spans apply from 1100px. Column 1 is the start side (right in Arabic). */
.col-1 { --cn: 1; } .col-2 { --cn: 2; } .col-3 { --cn: 3; } .col-4 { --cn: 4; } .col-5 { --cn: 5; } .col-6 { --cn: 6; }
.col-7 { --cn: 7; } .col-8 { --cn: 8; } .col-9 { --cn: 9; } .col-10 { --cn: 10; } .col-11 { --cn: 11; } .col-12 { --cn: 12; }
.col-start-1 { --cs: 1; } .col-start-2 { --cs: 2; } .col-start-3 { --cs: 3; } .col-start-4 { --cs: 4; } .col-start-5 { --cs: 5; } .col-start-6 { --cs: 6; }
.col-start-7 { --cs: 7; } .col-start-8 { --cs: 8; } .col-start-9 { --cs: 9; } .col-start-10 { --cs: 10; } .col-start-11 { --cs: 11; } .col-start-12 { --cs: 12; }
.grid > [class*="col-"] { grid-column: 1 / -1; }
@media (min-width: 1100px) { .grid > [class*="col-"] { grid-column: var(--cs, auto) / span var(--cn, 12); } }

/* sections: padding makes the distance between two sections (96 phone, 128 tablet, 160 desktop) */
.section { padding-block: calc(var(--section-gap) / 2); position: relative; }
.section--ground { padding-block: calc(var(--section-gap) * 0.4); background: var(--color-bg-raised); }     /* alternating ground (bg/raised), or add data-mode="paper" */
.section--flush-top { padding-block-start: 0; }
.section--flush-bottom { padding-block-end: 0; }

/* ---------- 4. buttons (Button: Kind x Size x State) ---------- */
.btn {
  --btn-h: 56px; --btn-px: var(--space-32);
  --btn-bg: transparent; --btn-fg: var(--color-text-primary); --btn-bd: transparent;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8);
  min-height: var(--btn-h); padding-inline: var(--btn-px); padding-block: 0;
  border: 1px solid var(--btn-bd); border-radius: var(--radius-md);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-text); font-size: var(--fs-label-l); line-height: var(--lh-label-l); font-weight: var(--fw-label-l);
  text-align: center; white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn .ic { width: 20px; height: 20px; }
.btn:focus-visible, .btn.is-focus { outline: var(--focus-ring); outline-offset: 2px; }
.btn--l, .btn--lg, .btn--xl { --btn-h: 56px; --btn-px: var(--space-32); }
.btn--m { --btn-h: 48px; --btn-px: var(--space-24); }
.btn--s { --btn-h: 40px; --btn-px: var(--space-20); font-size: var(--fs-label-m); line-height: var(--lh-label-m); font-weight: var(--fw-label-m); }
.btn--s .ic { width: 18px; height: 18px; }
.btn--s::after { content: ""; position: absolute; inset-block: -2px; inset-inline: 0; }     /* 44px touch target */
.btn--block { display: flex; width: 100%; }

/* kinds */
.btn--primary { --btn-bg: var(--color-brand-red-fill); --btn-fg: var(--color-text-on-red); }
.btn--graphite { --btn-bg: var(--color-brand-graphite); --btn-fg: #f4f2ee; --btn-bd: rgba(255, 255, 255, 0.18); }       /* label is fixed light: graphite is the same in both modes */
.btn--outline, .btn--glass { --btn-bd: var(--color-line-strong); }
.btn--ghost { --btn-bg: transparent; }
.btn--wa { --btn-bg: var(--color-surface-1); --btn-bd: var(--color-line-strong); }
.btn--wa .ic { color: var(--color-channel-whatsapp); }
.btn--snap { --btn-bg: var(--color-brand-graphite); --btn-fg: #f4f2ee; --btn-bd: rgba(255, 255, 255, 0.18); }          /* v6 name, now the graphite kind */
.btn--danger { --btn-fg: var(--color-state-danger); --btn-bd: var(--color-state-danger); }

/* states: hover (pointer devices only), pressed, disabled. .is-hover / .is-pressed force a state (kit page, tests). */
.btn--primary.is-hover { --btn-bg: var(--color-brand-red); box-shadow: 0 0 28px rgba(230, 50, 59, 0.35); }
.btn--graphite.is-hover, .btn--wa.is-hover { --btn-bd: var(--color-metal-steel); }
.btn--wa.is-hover { --btn-bg: var(--color-surface-2); }
.btn--outline.is-hover, .btn--glass.is-hover { --btn-bg: var(--color-surface-2); --btn-bd: var(--color-metal-steel); }
.btn--ghost.is-hover { --btn-bg: var(--color-surface-2); }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--color-brand-red); box-shadow: 0 0 28px rgba(230, 50, 59, 0.35); }
  .btn--graphite:hover:not(:disabled):not([aria-disabled="true"]), .btn--wa:hover:not(:disabled):not([aria-disabled="true"]) { --btn-bd: var(--color-metal-steel); }
  .btn--wa:hover:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--color-surface-2); }
  .btn--outline:hover:not(:disabled):not([aria-disabled="true"]), .btn--glass:hover:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--color-surface-2); --btn-bd: var(--color-metal-steel); }
  .btn--ghost:hover:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--color-surface-2); }
}
.btn.is-pressed, .btn:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(0.98); }
.btn--primary.is-pressed, .btn--primary:active:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--color-brand-red-press); box-shadow: none; }
.btn--graphite.is-pressed, .btn--graphite:active:not(:disabled):not([aria-disabled="true"]) { --btn-bd: var(--color-brand-red); }
.btn--outline.is-pressed, .btn--outline:active:not(:disabled):not([aria-disabled="true"]),
.btn--glass.is-pressed, .btn--glass:active:not(:disabled):not([aria-disabled="true"]),
.btn--wa.is-pressed, .btn--wa:active:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--color-surface-3); --btn-bd: var(--color-metal-steel); }
.btn--ghost.is-pressed, .btn--ghost:active:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--color-surface-3); }
.btn:disabled, .btn[aria-disabled="true"], .btn.is-disabled { cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; --btn-fg: var(--color-text-muted); }
.btn--primary:disabled, .btn--primary[aria-disabled="true"], .btn--primary.is-disabled { --btn-bg: var(--color-surface-3); --btn-bd: transparent; }
.btn--graphite:disabled, .btn--graphite[aria-disabled="true"], .btn--graphite.is-disabled,
.btn--snap:disabled, .btn--wa:disabled, .btn--wa[aria-disabled="true"], .btn--wa.is-disabled { --btn-bg: var(--color-surface-2); --btn-bd: var(--color-line-hair); }
.btn--outline:disabled, .btn--outline[aria-disabled="true"], .btn--outline.is-disabled,
.btn--glass:disabled { --btn-bd: var(--color-line-hair); }
.btn--wa:disabled .ic, .btn--wa[aria-disabled="true"] .ic, .btn--wa.is-disabled .ic { color: var(--color-text-muted); }

/* ---------- 5. icon button (Icon button: Size M 48 | S 40, Style Outline | Glass) ---------- */
.icon-btn {
  --ib: 48px; --ib-bg: transparent; --ib-bd: var(--color-line-strong); --ib-fg: var(--color-metal-steel);
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: var(--ib); height: var(--ib); flex: none; border: 1px solid var(--ib-bd); border-radius: var(--radius-md);
  background: var(--ib-bg); color: var(--ib-fg); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.icon-btn .ic { width: 24px; height: 24px; }
.icon-btn--s { --ib: 40px; }                                                    /* dense admin only; keeps a 44px hit area */
.icon-btn--s::after { content: ""; position: absolute; inset: -2px; }
.icon-btn:focus-visible, .icon-btn.is-focus { outline: var(--focus-ring); outline-offset: 3px; }
.icon-btn--glass { --ib-bg: var(--color-glass-fill); --ib-bd: var(--color-line-hair); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.icon-btn.is-hover { --ib-bg: var(--color-surface-2); --ib-bd: var(--color-metal-steel); --ib-fg: var(--color-text-primary); }
.icon-btn--glass.is-hover { --ib-bg: rgba(255, 255, 255, 0.12); --ib-bd: var(--color-line-strong); }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover:not(:disabled) { --ib-bg: var(--color-surface-2); --ib-bd: var(--color-metal-steel); --ib-fg: var(--color-text-primary); }
  .icon-btn--glass:hover:not(:disabled) { --ib-bg: rgba(255, 255, 255, 0.12); --ib-bd: var(--color-line-strong); }
}
.icon-btn.is-pressed, .icon-btn:active:not(:disabled) { --ib-bg: var(--color-surface-3); --ib-bd: var(--color-metal-steel); --ib-fg: var(--color-text-primary); transform: scale(0.98); }
.icon-btn--glass.is-pressed, .icon-btn--glass:active:not(:disabled) { --ib-bg: rgba(255, 255, 255, 0.03); }
.icon-btn:disabled { cursor: not-allowed; opacity: 0.45; }

/* ---------- 6. kicker (red bar + code + label) ---------- */
/* <p class="kicker"><span class="kicker__code">02 · SERVICES</span><span class="kicker__label">الخدمات</span></p>
   The bar is drawn by ::before, first in reading order: right in Arabic, left in English (so one markup serves both). */
.kicker { display: flex; align-items: center; gap: var(--space-12); font-size: var(--fs-label-m); line-height: var(--lh-label-m); font-weight: var(--fw-label-m); color: var(--color-text-primary); }
.kicker::before { content: ""; flex: none; width: 28px; height: 4px; border-radius: 1px; background: var(--color-brand-red); }
.kicker__code { font-family: var(--font-code); font-size: var(--fs-code-m); line-height: var(--lh-code-m); font-weight: 500; letter-spacing: var(--ls-code); text-transform: uppercase; color: var(--color-text-secondary); direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.kicker__label { font-family: var(--font-text); }
.kicker--short .kicker__code--long { display: none; }                         /* phone: use v7.hero.kicker.codeShort instead */

/* ---------- 7. mono tag (real codes only) ---------- */
.tag-mono {
  display: inline-flex; align-items: center; justify-content: center; padding: var(--space-4) var(--space-8);
  background: var(--color-surface-1); border: 1px solid var(--color-line-strong); border-radius: var(--radius-xs);
  font-family: var(--font-code); font-size: var(--fs-code-s); line-height: var(--lh-code-s); font-weight: 500;
  letter-spacing: var(--ls-code); text-transform: uppercase; color: var(--color-text-secondary); white-space: nowrap; direction: ltr; unicode-bidi: isolate;
}
.tag-mono--text { font-family: var(--font-text); font-size: var(--fs-label-s); line-height: var(--lh-label-s); letter-spacing: 0; text-transform: none; }
.tag-mono--red { background: var(--color-brand-red-soft); border-color: var(--color-brand-red); color: var(--color-brand-red); }

/* ---------- 8. chip (Filter, 44 high | Status, 28 high) ---------- */
.chip {
  --tone: var(--color-metal-steel); --tone-soft: var(--color-steel-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8);
  min-height: 44px; padding-inline: var(--space-20); border: 1px solid var(--color-line-strong); border-radius: var(--radius-pill);
  background: transparent; color: var(--color-text-secondary); white-space: nowrap; cursor: pointer;
  font-family: var(--font-text); font-size: var(--fs-label-m); line-height: var(--lh-label-m); font-weight: var(--fw-label-m);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.chip:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.chip[aria-pressed="true"], .chip[aria-selected="true"], .chip.is-selected { background: var(--color-brand-red-soft); border-color: var(--color-brand-red); color: var(--color-text-primary); }
@media (hover: hover) and (pointer: fine) { .chip:hover:not([aria-pressed="true"]):not([aria-selected="true"]):not(.is-selected) { border-color: var(--color-metal-steel); color: var(--color-text-primary); } }
.chip--status { min-height: 28px; padding-inline: var(--space-12); border-color: var(--color-line-hair); background: var(--tone-soft); color: var(--color-text-primary); cursor: default; font-size: var(--fs-label-s); line-height: var(--lh-label-s); font-weight: var(--fw-label-s); }
.chip--status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); flex: none; }
.chip--ok { --tone: var(--color-state-ok); --tone-soft: var(--color-state-ok-soft); }
.chip--warn { --tone: var(--color-state-warn); --tone-soft: var(--color-state-warn-soft); }
.chip--danger { --tone: var(--color-state-danger); --tone-soft: var(--color-state-danger-soft); }
.chip--info { --tone: var(--color-state-info); --tone-soft: var(--color-state-info-soft); }

/* ---------- 9. fields (Field, Textarea, Select: Empty | Focus | Filled | Error | Disabled, RTL | LTR) ---------- */
/* <label class="field"><span class="field__label">…</span><input …><span class="field__hint">…</span></label> */
.field { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-8); min-width: 0; }
.field__label { font-size: var(--fs-label-m); line-height: var(--lh-label-m); font-weight: var(--fw-label-m); color: var(--color-text-secondary); text-align: start; }
.field:focus-within .field__label { color: var(--color-text-primary); }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]), .field select, .field textarea, .input {
  display: block; width: 100%; height: 56px; padding: 0 var(--space-16);
  background: var(--color-surface-2); border: 1px solid var(--color-line-strong); border-radius: var(--radius-md);
  color: var(--color-text-primary); font-family: var(--font-text); font-size: var(--fs-body-m); line-height: 28px; font-weight: 400;
  text-align: start; text-overflow: ellipsis; caret-color: var(--color-brand-red); -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.field textarea, textarea.input { height: auto; min-height: 120px; padding-block: var(--space-16); resize: vertical; }
.field ::placeholder, .input::placeholder { color: var(--color-text-muted); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: var(--focus-ring); outline-offset: 3px; border-color: var(--color-metal-steel); }
.field__hint, .field__help, .field__err { display: flex; align-items: flex-start; gap: var(--space-8); font-size: var(--fs-body-s); line-height: var(--lh-body-s); color: var(--color-text-muted); }
.field__hint .ic, .field__err .ic { width: 16px; height: 16px; margin-block: 4px; }
.field__err, .field.is-error .field__hint, .field.is-error .field__help { color: var(--color-state-danger); }
.field.is-error input, .field.is-error select, .field.is-error textarea, .field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"], .input.is-error { border-color: var(--color-state-danger); }
.field.is-disabled .field__label, .field:has(:disabled) .field__label { color: var(--color-text-muted); }
.field input:disabled, .field select:disabled, .field textarea:disabled, .input:disabled { background: var(--color-surface-1); border-color: var(--color-line-hair); color: var(--color-text-muted); cursor: not-allowed; }
/* LTR variant: codes, numbers, VIN, phone, booking number inside an Arabic page */
.field--ltr, .field--ltr .field__label, .field--ltr .field__hint { direction: ltr; text-align: left; }
.field input[dir="ltr"], .field textarea[dir="ltr"], .input[dir="ltr"] { text-align: left; }
/* forced states for the kit page and tests */
.field.is-focus .input, .input.is-focus { border-color: var(--color-metal-steel); outline: var(--focus-ring); outline-offset: 3px; }
.field.is-focus .field__label { color: var(--color-text-primary); }
.field.is-focus .input--caret { background-image: linear-gradient(var(--color-brand-red), var(--color-brand-red)); background-repeat: no-repeat; background-size: 2px 22px; background-position: calc(100% - 16px) center; }
.field.is-error .input { border-color: var(--color-state-danger); }
.field.is-disabled .input { background: var(--color-surface-1); border-color: var(--color-line-hair); color: var(--color-text-muted); }

/* select: <span class="select"><select>…</select></span> inside .field. The chevron sits at the end of the line. */
.select { position: relative; display: block; }
.select select, .select .input { padding-inline-end: calc(var(--space-16) + 20px + var(--space-8)); cursor: pointer; }
.select::after {
  content: ""; position: absolute; inset-inline-end: var(--space-16); top: 50%; width: 20px; height: 20px; margin-top: -10px; pointer-events: none;
  background: var(--color-metal-steel);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.select:has(select:disabled)::after { background: var(--color-text-muted); }

/* ---------- 10. checkbox, radio, switch (44 high rows, 24px marks) ---------- */
/* <label class="check"><input type="checkbox"><span class="check__box"></span><span class="check__label">…</span></label>
   same shape for .radio (.radio__dot) and .switch (.switch__track). The input stays in the DOM for forms and keyboard. */
.check, .radio, .switch { display: inline-flex; align-items: center; gap: var(--space-12); min-height: var(--tap-min); cursor: pointer; font-size: var(--fs-body-m); line-height: var(--lh-body-m); color: var(--color-text-primary); }
.check input, .radio input, .switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.check__box { position: relative; flex: none; width: 24px; height: 24px; border: 1.5px solid var(--color-line-strong); border-radius: var(--radius-xs); background: var(--color-surface-2); transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.check__box::after {
  content: ""; position: absolute; inset: 3px; background: var(--color-text-on-red); opacity: 0; transform: scale(0.6); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.check input:checked + .check__box, .check.is-on .check__box { background: var(--color-brand-red-fill); border-color: var(--color-brand-red-fill); }
.check input:checked + .check__box::after, .check.is-on .check__box::after { opacity: 1; transform: none; }
.radio__dot { position: relative; flex: none; width: 24px; height: 24px; border: 1.5px solid var(--color-line-strong); border-radius: var(--radius-pill); background: var(--color-surface-2); transition: border-color var(--dur-fast) var(--ease-out), border-width var(--dur-fast) var(--ease-out); }
.radio__dot::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--color-brand-red); opacity: 0; transform: scale(0.4); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.radio input:checked + .radio__dot, .radio.is-on .radio__dot { border: 2px solid var(--color-brand-red); }
.radio input:checked + .radio__dot::after, .radio.is-on .radio__dot::after { opacity: 1; transform: none; inset: 4px; }
.switch__track { position: relative; flex: none; width: 44px; height: 26px; border: 1px solid var(--color-line-strong); border-radius: var(--radius-pill); background: var(--color-surface-3); transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
.switch__track::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-text-secondary); transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out); }
.switch input:checked + .switch__track, .switch.is-on .switch__track { background: var(--color-brand-red-fill); border-color: var(--color-brand-red-fill); }
.switch input:checked + .switch__track::after, .switch.is-on .switch__track::after { background: #fff; transform: translateX(18px); }
[dir="rtl"] .switch input:checked + .switch__track::after, [dir="rtl"] .switch.is-on .switch__track::after { transform: translateX(-18px); }
.check input:focus-visible + .check__box, .radio input:focus-visible + .radio__dot, .switch input:focus-visible + .switch__track { outline: var(--focus-ring); outline-offset: 3px; }
.check:has(input:disabled), .radio:has(input:disabled), .switch:has(input:disabled) { cursor: not-allowed; color: var(--color-text-muted); }
.check input:disabled + .check__box, .radio input:disabled + .radio__dot, .switch input:disabled + .switch__track { opacity: 0.5; }

/* ---------- 11. toast (Tone Ok | Danger | Info). #toast keeps the v6 script contract: textContent + .is-on ---------- */
/* <div class="toast toast--ok" role="status"><svg class="ic toast__icon">…</svg><div class="toast__text"><p class="toast__title">…</p><p class="toast__msg">…</p></div><button class="toast__close">…</button></div> */
.toast {
  --tone: var(--color-text-secondary); --tone-soft: transparent;
  position: relative; display: flex; align-items: flex-start; gap: var(--space-12); width: min(420px, 100%); padding: var(--space-16);
  background: var(--color-surface-2); border: 1px solid var(--color-line-strong); border-radius: var(--radius-md);
  box-shadow: var(--shadow-float); color: var(--color-text-primary); font-size: var(--fs-label-m); line-height: var(--lh-label-m); font-weight: var(--fw-label-m);
  isolation: isolate;
}
.toast::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: var(--tone-soft); }
.toast:empty { display: none; }
.toast--ok { --tone: var(--color-state-ok); --tone-soft: var(--color-state-ok-soft); }
.toast--danger { --tone: var(--color-state-danger); --tone-soft: var(--color-state-danger-soft); }
.toast--info { --tone: var(--color-state-info); --tone-soft: var(--color-state-info-soft); }
.toast__icon { width: 24px; height: 24px; color: var(--tone); }
.toast__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.toast__title { font-size: var(--fs-label-m); line-height: var(--lh-label-m); font-weight: var(--fw-label-m); color: var(--color-text-primary); }
.toast__msg { font-size: var(--fs-body-s); line-height: var(--lh-body-s); font-weight: 400; color: var(--color-text-secondary); }
.toast__close { flex: none; position: relative; width: 20px; height: 20px; color: var(--color-metal-steel); }
.toast__close::after { content: ""; position: absolute; inset: -12px; }
.toast__close .ic { width: 20px; height: 20px; }

/* ---------- 12. dividers: hairline and tick ruler ---------- */
.hair { display: block; width: 100%; height: 1px; border: 0; margin: 0; background: var(--color-line-hair); }
.hair--v { width: 1px; height: 100%; align-self: stretch; }
/* .ruler: 1px ticks every 8px, tall (12px, steel 60%) every 40px, optional labels every 80px. Pure CSS, any width. Always runs left to right like a scale. */
.ruler { position: relative; display: block; width: 100%; height: 12px; direction: ltr; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--color-metal-steel) 60%, transparent) 1px, transparent 1px),
    linear-gradient(to right, var(--color-line-strong) 1px, transparent 1px);
  background-size: 40px 12px, 8px 6px;
  background-position: left bottom, left bottom;
  background-repeat: repeat-x;
}
.ruler--labels { margin-block-end: 20px; }
.ruler--labels::after {
  content: "000       080       160       240       320       400       480       560       640       720       800       880       960       1040      1120      1200      1280      1360      1440      1520      1600      1680      1760";
  position: absolute; inset-inline: 0; top: calc(100% + 6px); overflow: hidden; white-space: pre;
  font-family: var(--font-code); font-size: var(--fs-code-s); line-height: 14px; font-weight: 500; letter-spacing: 1.4px; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text-muted) 40%, transparent);
}

/* ---------- 13. language switch (both segments visible; the active one carries the red bar) ---------- */
/* <button class="langswitch" id="langBtn" type="button"><span class="langswitch__seg" data-lang="ar">AR</span><span class="langswitch__seg" data-lang="en">EN</span></button>
   The active segment follows <html lang> by itself. .is-on forces it (kit page). */
.langswitch { display: inline-flex; align-items: center; gap: var(--space-4); height: 44px; padding: 0 var(--space-4); border: 1px solid var(--color-line-strong); border-radius: var(--radius-pill); background: transparent; cursor: pointer; }
.langswitch:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.langswitch__seg { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 36px; border-radius: var(--radius-pill);
  font-family: var(--font-code); font-size: var(--fs-code-m); line-height: var(--lh-code-m); font-weight: 500; letter-spacing: var(--ls-code); text-transform: uppercase; color: var(--color-text-muted); direction: ltr; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
html:lang(ar) .langswitch__seg[data-lang="ar"], html:lang(en) .langswitch__seg[data-lang="en"], .langswitch__seg.is-on { background: var(--color-surface-3); color: var(--color-text-primary); }
html:lang(ar) .langswitch__seg[data-lang="ar"]::after, html:lang(en) .langswitch__seg[data-lang="en"]::after, .langswitch__seg.is-on::after { content: ""; position: absolute; bottom: 5px; inset-inline-start: 50%; width: 16px; height: 2px; margin-inline-start: -8px; border-radius: 1px; background: var(--color-brand-red); }
[dir="rtl"] .langswitch__seg.is-on::after, [dir="rtl"] html:lang(ar) .langswitch__seg[data-lang="ar"]::after { margin-inline-start: 0; margin-inline-end: -8px; }

/* ---------- 14. section header (kicker, title, lead, optional link) ---------- */
/* Desktop 600 wide on columns 1-5, phone 350. Start-aligned: right in Arabic. */
.section-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-24); max-width: 600px; }
.section-head--wide { max-width: none; }
.section-head__title { font-family: var(--font-display); font-size: var(--fs-display-l); line-height: var(--lh-display-l); font-weight: var(--fw-display-l); color: var(--color-text-primary); text-wrap: balance; }
:lang(en) .section-head__title { letter-spacing: var(--ls-latin-display); }
.section-head__lead { max-width: 62ch; font-size: var(--fs-body-l); line-height: var(--lh-body-l); color: var(--color-text-secondary); text-wrap: pretty; }
.section-head__link { display: inline-flex; align-items: center; gap: var(--space-8); min-height: var(--tap-min); font-size: var(--fs-label-l); line-height: var(--lh-label-l); font-weight: var(--fw-label-l); color: var(--color-text-primary); }
.section-head__link .ic { width: 20px; height: 20px; transition: transform var(--dur-base) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .section-head__link:hover .ic { transform: translateX(4px); }
  [dir="rtl"] .section-head__link:hover .ic { transform: translateX(-4px) scaleX(-1); }
}

/* ---------- 15. reveal on scroll (script: ui-core.js adds .in once) ---------- */
/* <div class="rv" style="--rd:.12s">…</div>   variants: data-rv="fade" | "mask" | "line"   (--rd = delay, use multiples of 70ms) */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease-out) var(--rd, 0s), transform var(--dur-slow) var(--ease-out) var(--rd, 0s); }
.js .rv.in { opacity: 1; transform: none; }
.js .rv[data-rv="fade"] { transform: none; }
.js .rv[data-rv="mask"] { transform: translateY(16px); clip-path: inset(0 0 100% 0); transition: opacity var(--dur-slow) var(--ease-out) var(--rd, 0s), transform var(--dur-slow) var(--ease-out) var(--rd, 0s), clip-path var(--dur-slow) var(--ease-out) var(--rd, 0s); }
.js .rv[data-rv="mask"].in { clip-path: inset(0 0 -20% 0); }
.js .rv[data-rv="line"] { opacity: 1; transform: scaleX(0); transform-origin: right; }
[dir="ltr"] .js .rv[data-rv="line"] { transform-origin: left; }
.js .rv[data-rv="line"].in { transform: none; }

/* ---------- 16. v6 class names scripts still print, kept as the new names ---------- */
/* .btn--glass = outline, .btn--xl/.btn--lg = L, .btn--snap = graphite, .field__help/.field__err = hint (see v7-css-api.md) */

/* ---------- 17. reduced motion: no slides, no counters; 120ms opacity changes only ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; scroll-behavior: auto !important; transition-duration: 120ms !important; transition-delay: 0s !important; }
  .js .rv, .js .rv[data-rv] { transform: none !important; clip-path: none !important; transition: opacity 120ms linear !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; scroll-behavior: auto !important; transition-duration: 120ms !important; transition-delay: 0s !important; }
html.reduce-motion .rv, html.reduce-motion .rv[data-rv] { transform: none !important; clip-path: none !important; transition: opacity 120ms linear !important; }

.nowrap { white-space: nowrap; }
