/* FixMyTech Arabic — light theme.
   One ground (cool paper), one ink (near-black green), one accent (deep green, actions only),
   one field (forest, for the hero strip and the footer). One family: IBM Plex Sans Arabic.
   Five type steps. No shadows, no gradients, no hairlines: surfaces are separated by tone. */

:root {
  --ground: #f1f4f2;
  --sheet: #ffffff;
  --tone: #e3e9e5;
  --ink: #0c1d18;
  --ink-2: #44564f;
  --accent: #087a55;
  --accent-press: #06603f;
  --accent-ink: #ffffff;
  --field: #0e2b22;
  --field-2: #163a2f;
  --field-ink: #eef5f1;
  --field-ink-2: #a9c3b8;
  --ok: #087a55;
  --warn: #9a5b00;
  --err: #b3261e;

  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;

  --step-display: clamp(2.35rem, 1.2rem + 4.6vw, 4.9rem);
  --step-title: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  --step-lead: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem);
  --step-body: 1.0625rem;
  --step-small: 0.9375rem;

  --margin: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --gap-section: clamp(88px, 10vw, 168px);
  --radius: 0;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-press); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { inset-inline-start: 8px; }

.frame { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--margin); }

/* ---------- Type ---------- */
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--step-display); line-height: 1.12; }
h2 { font-size: var(--step-title); }
h3 { font-size: var(--step-lead); line-height: 1.45; }
p { margin: 0 0 1em; }
.lead { font-size: var(--step-lead); line-height: 1.65; max-width: 40ch; }
.small { font-size: var(--step-small); color: var(--ink-2); }
.num, code.code { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
code.code { font-family: var(--font); font-weight: 700; background: var(--tone); padding: 0.05em 0.4em; }

/* ---------- Header ---------- */
.site-head { background: var(--field); color: var(--field-ink); }
.site-head .frame { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--field-ink); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.wordmark svg { width: 30px; height: 30px; }
.wordmark:hover { color: #fff; }
.site-nav { display: flex; gap: clamp(14px, 2.4vw, 30px); flex-wrap: wrap; }
.site-nav a { color: var(--field-ink); text-decoration: none; font-size: var(--step-small); padding-block: 6px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- Buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer; transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-press); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.quiet { background: var(--tone); color: var(--ink); }
.btn.quiet:hover { background: #d4ddd8; color: var(--ink); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: var(--step-small); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.chips legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--tone); color: var(--ink); font-weight: 700; transition: background-color .15s ease; }
.chip input:checked + span { background: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.chip:hover span { background: #d4ddd8; }
.chip input:checked:hover + span { background: var(--ink); }

.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 700; }
.field select, .field input[type="number"], .field input[type="text"] {
  font: inherit; min-height: 46px; padding: 0 12px; background: var(--sheet); color: var(--ink);
  border: 2px solid var(--tone); border-radius: var(--radius); width: 100%;
}
.field select:focus, .field input:focus { border-color: var(--accent); outline: none; }
input[type="range"] { accent-color: var(--accent); width: 100%; }

/* ---------- Tool ---------- */
.tool { background: var(--sheet); color: var(--ink); padding: clamp(18px, 3vw, 32px); }
.tool-options { display: grid; gap: 18px; margin-bottom: 20px; }
.tool-options.cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.drop {
  position: relative; display: grid; place-items: center; text-align: center; gap: 6px;
  min-height: 190px; padding: 24px; background: var(--ground); cursor: pointer;
  outline: 3px dashed #b9c7c0; outline-offset: -10px; transition: background-color .15s ease, outline-color .15s ease;
}
.drop:hover, .drop.is-over { background: var(--tone); outline-color: var(--accent); }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { font-size: var(--step-lead); }
.drop svg { width: 44px; height: 44px; color: var(--accent); }
.status { min-height: 1.75em; margin: 14px 0 0; font-weight: 500; }
.status.err { color: var(--err); }
.results { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.result { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--ground); padding: 10px; }
.result img, .result .thumb { width: 64px; height: 64px; object-fit: cover; background: var(--tone); }
.result .thumb { display: grid; place-items: center; font-weight: 700; color: var(--ink-2); font-size: .8rem; }
.result .name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.4; }
.result .meta { font-size: var(--step-small); color: var(--ink-2); }
.badge { display: inline-block; padding: 0 8px; font-weight: 700; font-size: var(--step-small); }
.badge.good { background: #d8eee4; color: #05553b; }
.badge.bad { background: #f6e6cc; color: #6b3f00; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.order { display: flex; gap: 4px; }
.order button { min-width: 40px; min-height: 40px; border: 0; background: var(--tone); font: inherit; font-weight: 700; cursor: pointer; }
.order button:hover { background: #d4ddd8; }
.noscript { background: #f6e6cc; padding: 12px 16px; margin-top: 12px; }

/* ---------- Hero (home + tool pages) ---------- */
.hero { background: var(--field); color: var(--field-ink); padding-block: clamp(40px, 6vw, 88px) clamp(48px, 7vw, 104px); }
.hero .frame { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.hero.tool-hero h1 { font-size: clamp(2rem, 1rem + 2.7vw, 3.5rem); line-height: 1.18; }
.hero h1 { color: #fff; }
.hero .lead { color: var(--field-ink); margin-top: 28px; }
.hero .facts { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 10px; font-size: var(--step-small); color: var(--field-ink-2); }
.hero .facts strong { color: #fff; }
.hero .crumbs a, .hero .crumbs { color: var(--field-ink-2); }

.crumbs { font-size: var(--step-small); margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li:not(:last-child)::after { content: "‹"; margin-inline-start: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- Sections ---------- */
main > section, .section { padding-block: var(--gap-section) 0; }
main > section:last-child { padding-bottom: var(--gap-section); }
.section-head { max-width: 46ch; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { margin-top: 14px; color: var(--ink); font-size: var(--step-lead); line-height: 1.6; }

/* Tool index: a ledger of large names, two columns of text, no cards. */
.ledger { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.ledger li { background: var(--sheet); }
.ledger a { display: grid; gap: 6px; padding: clamp(20px, 2.6vw, 32px); text-decoration: none; color: var(--ink); height: 100%; transition: background-color .15s ease; }
.ledger a:hover { background: var(--tone); color: var(--ink); }
.ledger .t { font-size: var(--step-lead); font-weight: 700; color: var(--accent); }
.ledger .d { color: var(--ink); }
.ledger .k { font-size: var(--step-small); color: var(--ink-2); }

/* Carrier codes table */
.codes { width: 100%; border-collapse: collapse; background: var(--sheet); font-size: var(--step-lead); }
.codes th, .codes td { text-align: start; padding: 18px clamp(12px, 2vw, 24px); }
.codes thead th { background: var(--ink); color: #fff; font-size: var(--step-small); font-weight: 700; }
.codes tbody tr:nth-child(even) { background: var(--ground); }
.codes td.code-cell { font-weight: 700; font-size: clamp(1.3rem, 1rem + 1vw, 1.8rem); }
.codes a.dial { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.codes a.dial:hover { text-decoration: underline; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.statement { font-size: clamp(1.35rem, 1rem + 1.3vw, 2.1rem); line-height: 1.5; font-weight: 500; max-width: 26ch; margin: 0; }
.plain-list { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 12px; }
.plain-list li::marker { color: var(--accent); }

.guides { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.guides a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 22px clamp(16px, 2.4vw, 28px); background: var(--sheet); color: var(--ink); text-decoration: none; transition: background-color .15s ease; }
.guides a:hover { background: var(--tone); color: var(--ink); }
.guides .t { font-weight: 700; font-size: var(--step-lead); display: block; }
.guides .d { color: var(--ink-2); display: block; font-size: var(--step-small); }
.guides .go { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* ---------- Article ---------- */
.article { padding-block: clamp(40px, 6vw, 80px) var(--gap-section); }
.article .frame { display: grid; grid-template-columns: minmax(0, 46rem) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.article h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); }
.prose { font-size: 1.125rem; }
.prose h2 { font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem); margin: 2.2em 0 0.7em; }
.prose h3 { margin: 1.6em 0 0.5em; }
.prose ol, .prose ul { padding-inline-start: 1.3em; display: grid; gap: 10px; margin: 0 0 1.2em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; background: var(--sheet); font-size: 1rem; }
.prose th, .prose td { text-align: start; padding: 12px 14px; vertical-align: top; }
.prose thead th { background: var(--ink); color: #fff; }
.prose tbody tr:nth-child(even) { background: var(--ground); }
.answer { background: var(--sheet); padding: clamp(18px, 2.6vw, 28px); margin: 28px 0 8px; font-size: var(--step-lead); line-height: 1.65; }
.answer p:last-child { margin: 0; }
.note { background: var(--tone); padding: 16px 20px; margin: 0 0 1.4em; }
.note p:last-child { margin: 0; }
.updated { color: var(--ink-2); font-size: var(--step-small); margin-top: 16px; }
.aside { position: sticky; top: 24px; display: grid; gap: 4px; }
.aside h2 { font-size: var(--step-lead); margin-bottom: 10px; }
.aside a { display: block; background: var(--sheet); padding: 14px 18px; text-decoration: none; color: var(--ink); font-weight: 500; transition: background-color .15s ease; }
.aside a:hover { background: var(--tone); color: var(--ink); }

.faq { display: grid; gap: 4px; }
.faq details { background: var(--sheet); }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 1.3em; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq .a { padding: 0 22px 18px; }
.faq .a p:last-child { margin: 0; }

/* ---------- Footer ---------- */
.site-foot { background: var(--field); color: var(--field-ink); padding-block: clamp(56px, 7vw, 96px) 32px; }
.site-foot .name { font-size: clamp(2.6rem, 1rem + 7vw, 7rem); font-weight: 700; line-height: 1; color: #fff; margin: 0 0 clamp(28px, 4vw, 48px); letter-spacing: -0.02em; }
.site-foot .cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
.site-foot h2 { font-size: 1rem; color: #fff; margin-bottom: 10px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-foot a { color: var(--field-ink); text-decoration: none; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.site-foot .fine { margin-top: 40px; color: var(--field-ink-2); font-size: var(--step-small); }

/* ---------- Motion ---------- */
.rise { opacity: 0; transform: translateY(22px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
.rise.in { opacity: 1; transform: none; }
.no-js .rise { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}

/* ---------- Phone ---------- */
@media (max-width: 900px) {
  .hero .frame, .split, .article .frame { grid-template-columns: 1fr; }
  .aside { position: static; }
  .site-foot .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .ledger { grid-template-columns: 1fr; }
  .site-foot .cols { grid-template-columns: 1fr; }
  .result { grid-template-columns: 52px 1fr; }
  .result img, .result .thumb { width: 52px; height: 52px; }
  .result .btn { grid-column: 1 / -1; }
  .guides a { grid-template-columns: 1fr; }
  .codes { font-size: 1rem; }
  .codes th, .codes td { padding: 14px 10px; }
}
