/* تفقيط مفتوح — FastKiwi design language (light theme only). No external resources. */

@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/plex-arabic-arabic-400.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/plex-arabic-arabic-700.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/plex-arabic-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/plex-arabic-latin-700.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Components set their own display, which would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f5f9ef;
  --surface: #ffffff;
  --text: #14200f;
  --muted: #4a5a42;
  --border: #e2ead8;
  --border-strong: #c9d6bb;
  --brand: #4c9a1e;
  --brand-2: #0d9488;
  --brand-text: #2f6f10;
  --accent-text: #0f766e;
  --code-bg: #eef4e6;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #2f7d0f;
  --grad: linear-gradient(135deg, #3a7d14, #0f766e);
  --shadow: 0 1px 2px rgb(15 23 42 / .06), 0 8px 24px rgb(15 23 42 / .06);
  --radius: 14px;
  --max: 1120px;
  --font: "Plex Arabic", "Segoe UI", Tahoma, system-ui, -apple-system, "Noto Sans Arabic", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (max-width: 620px) { html { scroll-padding-top: 12px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.75 var(--font);
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--brand-text); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--code-bg); padding: .1em .4em; border-radius: 6px; unicode-bidi: isolate; }
kbd { display: inline-block; min-width: 1.9em; padding: .05rem .5rem; border: 1px solid var(--border-strong); border-bottom-width: 3px; border-radius: 7px; background: var(--surface); font: 700 .85rem/1.6 var(--mono); color: var(--text); text-align: center; direction: ltr; unicode-bidi: isolate; }
pre { direction: ltr; text-align: left; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; overflow-x: auto; margin: 0; line-height: 1.7; tab-size: 2; }
pre code { background: none; padding: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--text); color: var(--bg); padding: .5rem 1rem; border-radius: 8px; z-index: 10; text-decoration: none; font-weight: 700; }
.skip:focus { top: 1rem; color: var(--bg); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .wrap { padding-inline: 24px; } }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; min-height: 64px; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand small { color: var(--accent-text); font-weight: 700; font-size: 1rem; }
.product { display: flex; align-items: center; gap: .5rem; padding-inline-start: 1rem; border-inline-start: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; }
.product img { width: 28px; height: 28px; border-radius: 7px; }
.tool-nav { margin-inline-start: auto; }
.tool-nav ul { display: flex; gap: 2px; margin: 0; padding: 3px; list-style: none; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft); }
.tool-nav a { display: block; padding: .3rem .95rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 700; white-space: nowrap; }
.tool-nav a:hover { color: var(--text); }
.tool-nav a[aria-current="page"] { background: var(--surface); color: var(--brand-text); box-shadow: 0 1px 2px rgb(15 23 42 / .08), 0 2px 8px rgb(76 154 30 / .12); }
@media (max-width: 860px) { .product { display: none; } }
@media (max-width: 620px) {
  .site-header { position: static; }
  .site-header .wrap { padding-block: 10px; }
  .tool-nav { width: 100%; margin: 0; }
  .tool-nav li { flex: 1; }
  .tool-nav a { text-align: center; padding-inline: .4rem; font-size: .92rem; }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2rem, 5vw, 4rem) clamp(2rem, 5vw, 3.5rem);
  background:
    radial-gradient(700px 380px at 85% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    radial-gradient(600px 360px at 10% 70%, color-mix(in srgb, var(--brand-2) 12%, transparent), transparent 70%);
}
.hero .wrap { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (min-width: 980px) {
  .hero-tool .wrap { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  .hero-tool .intro { position: sticky; top: 96px; padding-top: 1.5rem; }
}
.eyebrow { display: inline-flex; gap: .5rem; align-items: center; font-size: .9rem; font-weight: 700; color: var(--accent-text); background: color-mix(in srgb, var(--brand-2) 12%, transparent); padding: .25rem .8rem; border-radius: 999px; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); letter-spacing: -.01em; margin-bottom: .4em; text-wrap: balance; }
.hero-page h1 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); }
.grad { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1rem + .35vw, 1.2rem); color: var(--muted); max-width: 38em; margin-bottom: 0; }
.checks { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.checks li { position: relative; padding-inline-start: 1.9rem; margin-bottom: .55rem; }
.checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .4em; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm4.7 7.2-5.4 6a1 1 0 0 1-1.4.1L5.3 11a1 1 0 1 1 1.4-1.4l1.8 1.7 4.7-5.3a1 1 0 0 1 1.5 1.2Z'/%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 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm4.7 7.2-5.4 6a1 1 0 0 1-1.4.1L5.3 11a1 1 0 1 1 1.4-1.4l1.8 1.7 4.7-5.3a1 1 0 0 1 1.5 1.2Z'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (max-width: 979px) { .hero-tool .checks { display: none; } }

/* ---------- Sections ---------- */

section { scroll-margin-top: 72px; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section.soft { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section-head { max-width: 44em; margin-bottom: 2rem; }
.section-head p { color: var(--muted); font-size: 1.07rem; margin: 0; }

.trust { padding: 1.4rem 0; border-block: 1px solid var(--border); background: var(--surface); }
.badges { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.badges li { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .95rem; }
.badges li::before { content: "✓"; color: var(--brand-text); font-weight: 700; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.3rem; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 1rem; }
.grid > .card + .card { margin-top: 0; }
.card h3 { display: flex; align-items: center; gap: .55rem; }
.card > p { color: var(--muted); font-size: .98rem; }
.card > p:last-child { margin-bottom: 0; }
.ico { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, transparent), color-mix(in srgb, var(--brand-2) 18%, transparent)); color: var(--brand-text); }
.ico svg { width: 20px; height: 20px; }
.card-title { margin: 0 0 1rem; font-size: 1.15rem; }

/* ---------- Forms ---------- */

.tool { padding: clamp(1rem, 3vw, 1.5rem); box-shadow: 0 1px 2px rgb(15 23 42 / .06), 0 18px 48px -18px rgb(47 111 16 / .28); }
.form-grid { display: grid; gap: 1rem 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.form-grid .span-all { grid-column: 1 / -1; }
.field { display: grid; gap: .35rem; align-content: start; min-width: 0; }
.field > label, fieldset > legend { font-weight: 700; font-size: .95rem; }
.hint { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.6; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset > legend { padding: 0; margin-bottom: .35rem; }

input[type="text"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: .6rem .85rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #6b7a63; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--border-strong)); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 12px;
}
select { cursor: pointer; }
optgroup { font-weight: 700; }
option { font-weight: 400; }
input.input-number { min-height: 60px; font-size: 1.6rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
textarea { min-height: 220px; resize: vertical; line-height: 1.65; font-family: var(--mono), var(--font); font-size: .98rem; }

.segmented { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); }
.segmented label { position: relative; flex: 1 1 0; min-width: max-content; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: .3rem .9rem; border-radius: 9px; text-align: center; color: var(--muted); font-weight: 700; line-height: 1.45; }
.segmented small { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--brand-text); box-shadow: 0 1px 2px rgb(15 23 42 / .08), 0 2px 8px rgb(76 154 30 / .14); }
.segmented input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.options { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px dashed var(--border-strong); }
.options-title { margin: 0 0 .8rem; font-size: 1rem; color: var(--muted); }

/* ---------- Buttons ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; padding: .6rem 1.2rem; border-radius: 12px; font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.3; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: filter .15s, border-color .15s, background-color .15s; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgb(76 154 30 / .28); }
.btn-primary:hover { filter: brightness(1.07); color: #fff; }
.btn-ghost { color: var(--text); background: var(--surface); border-color: color-mix(in srgb, var(--brand) 25%, var(--border)); }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.btn-sm { min-height: 40px; padding: .4rem .95rem; font-size: .95rem; border-radius: 10px; }
.btn-sm svg { width: 18px; height: 18px; }
.btn-chip { min-height: 34px; padding: .15rem .8rem; border-radius: 999px; font-size: .88rem; background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--brand-text); }
.btn-chip:hover { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }
.btn.is-done { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ---------- Result: a cheque-like panel ---------- */

.cheque {
  position: relative;
  margin-top: 1.1rem;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  border-radius: 12px;
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in srgb, var(--brand) 5%, transparent) 11px 12px),
    linear-gradient(180deg, #fbfdf8, #f3f8ec);
  overflow: hidden;
}
.cheque::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--grad); }
.cheque-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .85rem 1.2rem 0 1rem; padding-inline-start: 1.3rem; }
.cheque-head h2 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--accent-text); letter-spacing: .01em; }
.cheque-amount { display: inline-flex; align-items: baseline; gap: .45rem; padding: .1rem .75rem; border: 1.5px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: .82rem; color: var(--muted); }
.cheque-amount > span[dir] { color: var(--text); font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.cheque-body { padding: .5rem 1.2rem 1rem; padding-inline-start: 1.3rem; }
.result-text {
  margin: 0;
  min-height: 3.7em;
  padding-block: .35rem .55rem;
  border-bottom: 2px dotted var(--border-strong);
  font-size: clamp(1.25rem, 1.1rem + .7vw, 1.6rem);
  line-height: 1.85;
  font-weight: 700;
  color: var(--text);
}
.result-text.is-empty { color: var(--muted); font-weight: 400; font-size: 1.05rem; }
.result-text.is-error { color: var(--danger); font-size: 1.05rem; display: flex; gap: .6rem; align-items: flex-start; }
.result-text.is-error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-top: .15em; border-radius: 50%; background: var(--danger-soft); color: var(--danger); font-weight: 700; line-height: 1; }
.cheque-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .85rem; }
.status { margin: 0; font-size: .9rem; color: var(--muted); min-height: 1.4em; }
.status.is-ok { color: var(--ok); }

/* ---------- Examples ---------- */

.examples { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); margin: 0; padding: 0; list-style: none; }
.examples p { margin: 0; }
.examples li { display: grid; gap: .35rem; align-content: start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; }
.examples .q { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; font-size: .92rem; color: var(--muted); }
.examples .q bdi, .examples .q > span[dir] { font-weight: 700; font-size: 1.05rem; color: var(--text); background: var(--code-bg); padding: .02rem .55rem; border-radius: 8px; font-variant-numeric: tabular-nums; }
.examples .q a { margin-inline-start: auto; font-size: .85rem; font-weight: 700; }
.examples .r { font-weight: 700; font-size: 1.1rem; color: var(--accent-text); line-height: 1.7; }
.examples .why { font-size: .88rem; color: var(--muted); }

/* ---------- FAQ ---------- */

.faq { max-width: 52em; }
.faq details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: .6rem; }
.faq details[open] { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.faq summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-radius: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-text); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 1.1rem 1rem; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Links to the other tools ---------- */

.more { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: 0; padding: 0; list-style: none; }
.more a { display: flex; gap: .9rem; align-items: flex-start; height: 100%; padding: 1.2rem 1.3rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.more a:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-2px); }
.more b { display: block; font-size: 1.08rem; }
.more span span { display: block; color: var(--muted); font-size: .95rem; }
.more span .go { margin-top: .45rem; color: var(--brand-text); font-weight: 700; font-size: .92rem; }

/* ---------- Bulk ---------- */

.textarea-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: center; }
.file-btn { position: relative; }
.file-btn input[type="file"] { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.stack > * + * { margin-top: 1.25rem; }

.summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.counts { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.counts li { padding: .15rem .8rem; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); font-size: .92rem; }
.counts b { font-variant-numeric: tabular-nums; }
.counts .c-ok b { color: var(--ok); }
.counts .c-err b { color: var(--danger); }
.summary + .status { margin: -.4rem 0 .8rem; }
.summary + .status:empty { display: none; }

.table-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overscroll-behavior: contain; }
.results { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .97rem; }
.results th, .results td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.results thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-soft); color: var(--muted); font-size: .88rem; font-weight: 700; }
.results tbody tr:last-child td { border-bottom: 0; }
.results tbody tr:hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.results .c-idx { width: 4rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.results .c-in, .results .c-clean { width: 10rem; }
.results td.c-in, .results td.c-clean { font-family: var(--mono), var(--font); font-size: .9rem; }
.results td.c-text { font-weight: 700; line-height: 1.75; }
.results tr.is-error td.c-text { color: var(--danger); font-weight: 400; font-size: .92rem; }
.results .empty-row td { text-align: center; color: var(--muted); padding: 2rem 1rem; font-weight: 400; }
.render-note { margin: .6rem 0 0; font-size: .85rem; color: var(--muted); min-height: 1.3em; }

@media (max-width: 640px) {
  .table-wrap { max-height: none; overflow: visible; border: 0; background: none; }
  .results, .results tbody { display: block; }
  .results thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .results tbody tr { display: grid; grid-template-columns: auto 1fr 1fr; gap: 2px 10px; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .results tbody tr + tr { margin-top: .5rem; }
  .results td { display: block; width: auto !important; padding: 0; border: 0; }
  .results td.c-idx { font-weight: 700; }
  .results td.c-in::before { content: "المدخل: "; color: var(--muted); font-family: var(--font); font-size: .8rem; }
  .results td.c-clean::before { content: "بعد التنقية: "; color: var(--muted); font-family: var(--font); font-size: .8rem; }
  .results td.c-text { grid-column: 1 / -1; padding-top: .4rem; margin-top: .3rem; border-top: 1px dashed var(--border); }
  .results .empty-row { display: block; }
}

/* ---------- Excel / developer page ---------- */

.prose h2 { font-size: 1.3rem; }
.prose h3 { margin-top: 1.4rem; font-size: 1.05rem; }
.prose ol, .prose ul { margin: 0 0 1rem; padding-inline-start: 1.4em; }
.prose li + li { margin-top: .45rem; }
.prose li::marker { color: var(--brand-text); font-weight: 700; }

.steps { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: .8rem; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 2.6rem; margin: 0 !important; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: .1rem; width: 1.85rem; height: 1.85rem; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: .9rem; }

.formula { display: block; padding: .9rem 1rem; border: 1.5px dashed color-mix(in srgb, var(--brand) 55%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); font-family: var(--mono), var(--font); font-size: 1rem; direction: ltr; text-align: left; overflow-wrap: anywhere; margin-bottom: 1rem; }

.code-block { position: relative; margin: .75rem 0 1rem; }
.code-block pre { padding-top: 3rem; font-size: .9rem; }
.code-block .btn { position: absolute; top: .5rem; inset-inline-start: .5rem; }

.params-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; margin: .5rem 0 1rem; }
.params { width: 100%; border-collapse: collapse; font-size: .95rem; }
.params th, .params td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.params tbody tr:last-child > * { border-bottom: 0; }
.params thead th { background: var(--bg-soft); color: var(--muted); font-size: .88rem; }
.params td:first-child { width: 3.5rem; font-variant-numeric: tabular-nums; color: var(--brand-text); font-weight: 700; }
.params td:nth-child(2) { white-space: nowrap; font-weight: 700; }
@media (max-width: 640px) {
  .params th, .params td { padding: .55rem .6rem; }
  .params td:first-child { width: 2rem; }
  .params td:nth-child(2) { white-space: normal; width: 6.5rem; }
}

.download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; }
.download h2 { margin: 0 0 .2rem; font-size: 1.2rem; }
.download p { margin: 0; }
.download .ico { width: 48px; height: 48px; border-radius: 12px; }
.download .ico svg { width: 26px; height: 26px; }
.download-info { display: flex; gap: .9rem; align-items: center; }

.note { margin: 1rem 0 0; padding: .8rem 1rem; border-inline-start: 4px solid #d97706; border-radius: 8px; background: color-mix(in srgb, #f59e0b 10%, var(--surface)); font-size: .95rem; color: var(--text); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding-block: 2rem; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; }
.offline-badge { display: inline-flex; align-items: center; gap: .45rem; }
.offline-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.offline-badge.is-ready::before { background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.foot-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.results-section { padding-top: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); align-items: start; }
.params-card { margin-top: 1rem; }
.hero-cta { margin-block: 1.4rem .7rem; }
.example-out { padding: .6rem .9rem; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border); font-weight: 700; color: var(--accent-text); }
.form-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.form-grid .chips { align-self: end; min-height: 48px; }
