/* The tools and the guide: the calculator, the fee table, the guide's hub and articles, in English and in Arabic
   (their /ar/ twins). Loaded after style.css + landing.css; written direction-neutral (logical properties), so the
   Arabic pages load it as is, then ar.css. The `ar-` prefix is historical: these pages were Arabic only until
   2026-09-30. The cards they end with are in landing.css. */

/* header */
.ar-links{display:flex;gap:4px;margin-inline-start:18px}
.ar-back{margin-inline-start:auto}
/* three tool links + the back link + English: the back link drops «العودة إلى» where they would not fit */
@media (max-width:700px){ .ar-back-w{display:none} }
.ar-back-s{display:none}
@media (max-width:700px){ .ar-back-s{display:inline} }
@media (max-width:560px){ .ar-links .lp-navlink{padding-inline:8px;font-size:13px} .ar-links{margin-inline-start:6px} }
@media (max-width:480px){ .ar-links{display:none} }

/* page head */
.ar-hero{padding-top:56px}
.ar-head{max-width:760px;margin:0 0 30px}
.ar-head h1{font-size:clamp(28px,4.2vw,40px);font-weight:800;line-height:1.3;margin:10px 0 12px}
.ar-head h2{font-size:26px;font-weight:800;margin:0}
.ar-head .lead{font-size:17px;line-height:1.85;color:var(--muted);margin:0}
.ar-head-cta{margin:18px 0 0}
.ar-head .btn .ic{width:15px;height:15px}

/* the bridge to the free check (the Arabic landing's) */
.ar-bridge{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:6px 14px;margin:22px 0 0;padding:14px 16px;border:1px dashed var(--accent-line);border-radius:12px;background:color-mix(in srgb,var(--accent) 5%,var(--panel));color:var(--text);text-decoration:none;font-size:14.5px;line-height:1.8;max-width:900px}
.ar-bridge:hover{background:color-mix(in srgb,var(--accent) 9%,var(--panel))}
.ar-bridge b{color:var(--accent-ink)}

/* calculator */
.calc-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:var(--gap);align-items:start}
@media (max-width:900px){ .calc-grid{grid-template-columns:1fr} }
.calc-form{display:flex;flex-direction:column;gap:14px;padding:22px}
.fld{display:flex;flex-direction:column;gap:6px;margin:0;border:0;padding:0;min-width:0}
.fld[hidden]{display:none}
/* the dashboard's `.fld > span` (style.css) outranks a bare `.fld-l`: scope it to the form */
.calc-form .fld-l{font-size:14px;font-weight:700;color:var(--text);padding:0;margin:0}
.calc-form .fld-l em,.seg em{font-style:normal;font-weight:500;font-size:12.5px;color:var(--muted);margin-inline-start:6px}
.calc-form .fld-in{margin:0;display:flex;align-items:center;gap:8px;background:var(--panel2);border:1px solid var(--border2);border-radius:10px;padding:0 12px}
.fld-in:focus-within,.calc-form select:focus{border-color:var(--accent-line);box-shadow:0 0 0 3px var(--accent-soft)}
.fld-in input{flex:1;min-width:0;border:0;background:transparent;color:var(--text);font-size:16px;padding:11px 0;outline:none}
.fld-in b{font-size:13px;font-weight:600;color:var(--muted)}
.calc-form select{width:100%;background:var(--panel2);border:1px solid var(--border2);border-radius:10px;color:var(--text);font-size:16px;padding:10px 12px;outline:none}
.seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.seg label{position:relative;cursor:pointer}
.seg input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.seg span{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:52px;text-align:center;padding:8px 6px;border:1px solid var(--border2);border-radius:10px;background:var(--panel2);font-size:13.5px;font-weight:700;line-height:1.4}
.seg em{margin:0}
.seg input:checked + span{border-color:var(--accent);background:var(--accent-soft);color:var(--text);box-shadow:inset 0 0 0 1px var(--accent-line)}
.seg input:focus-visible + span{outline:2px solid var(--accent);outline-offset:2px}
@media (max-width:420px){ .seg{grid-template-columns:1fr} .seg span{min-height:44px} }
.chk{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:600;cursor:pointer}
.chk input{width:18px;height:18px;accent-color:var(--accent)}

.calc-out{padding:22px;position:sticky;top:84px}
@media (max-width:900px){ .calc-out{position:static} }
.calc-out h2{font-size:18px;font-weight:800;margin:0 0 12px}
.out{margin:0;display:flex;flex-direction:column}
.out > div{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--border)}
.out > div[hidden]{display:none}
.out dt{font-size:14px;color:var(--muted);line-height:1.6}
.out dd{margin:0;font-family:var(--font-mono);font-size:14.5px;font-weight:600;color:var(--text);white-space:nowrap}
.out .is-total dt,.out .is-key dt{color:var(--text);font-weight:700}
.out .is-key dd{font-size:18px;color:var(--accent-ink)}
.out .is-net dt{color:var(--text);font-weight:800}
.out .is-net dd{font-size:18px;color:var(--accent-ink)}
.out .is-net dd.is-loss{color:var(--danger)}
.out-note,.out-hint{margin:10px 0 0;font-size:13px;line-height:1.8;color:var(--muted)}
.out-hint{padding:10px 12px;border-radius:10px;background:var(--panel2)}
.out-hint[hidden]{display:none}
.out-notes{margin:12px 0 0;padding:10px 12px;border-radius:10px;border:1px solid color-mix(in srgb,var(--warn) 45%,transparent);background:color-mix(in srgb,var(--warn) 8%,transparent)}
.out-notes[hidden]{display:none}
.out-notes p{margin:0;font-size:13px;line-height:1.8}
.out-notes p + p{margin-top:6px}
.out-src{margin:14px 0 0;font-size:12.5px;line-height:1.8;color:var(--muted)}
.out-src a,.out-note a{color:var(--accent-ink)}

/* fee reference */
.ar-note{max-width:900px;padding:14px 16px;margin:0 0 8px}
.ar-note p{margin:0;font-size:14.5px;line-height:1.8}
.ar-h2{font-size:22px;font-weight:800;margin:40px 0 8px;scroll-margin-top:84px}
.ar-p{max-width:760px;margin:0 0 14px;font-size:15px;line-height:1.9;color:var(--muted)}
.ar-table-wrap{max-width:900px;overflow-x:auto;border:1px solid var(--border);border-radius:12px;background:var(--panel)}
.ar-table{width:100%;border-collapse:collapse;font-size:14px}
.ar-table th{background:var(--panel2);text-align:start;font-weight:700;padding:10px 14px;border-bottom:1px solid var(--border2);white-space:nowrap}
.ar-table td{padding:9px 14px;border-bottom:1px solid var(--border);line-height:1.6;white-space:normal}
.ar-table tr:last-child td{border-bottom:0}
.ar-table tbody tr:nth-child(even) td{background:var(--table-stripe)}
.ar-table tr.is-first td{border-top:1px solid var(--border2)}
.ar-table sup{color:var(--warn);font-weight:700;margin-inline-start:2px}
@media (max-width:560px){ .ar-table{font-size:13px} .ar-table th{white-space:normal} .ar-table th,.ar-table td{padding:8px 10px} }
/* the English amounts (E£19.50) run wider than the Arabic: at 320px the four-column FBA table overflowed by 6px */
@media (max-width:400px){ .ar-table th,.ar-table td{padding:8px 7px} }
.ar-foot{max-width:900px;margin:10px 0 0;font-size:13px;line-height:1.8;color:var(--muted)}
.ar-src{max-width:900px;margin-top:34px}

/* FAQ: the landing's component, right-to-left */
.ar-faq{padding-top:20px}
.ar-faq .faq-list{max-width:860px}
.ar-faq .faq summary{text-align:start}
.ar-faq .faq p{line-height:1.9}

/* the guide (الدليل): the hub and its articles */
.ar-head-cta{display:flex;flex-wrap:wrap;gap:10px}
.ar-crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 0 16px;font-size:13.5px;color:var(--muted)}
.ar-crumbs a{color:var(--muted);text-decoration:none}
.ar-crumbs a:hover{color:var(--accent-ink)}
.ar-crumbs [aria-current]{color:var(--text)}
.ar-byline{margin:14px 0 0;font-size:13px;color:var(--muted)}
.ar-prose{max-width:760px}
.ar-prose > p,.ar-prose > ul > li,.ar-prose > ol > li{font-size:16px;color:var(--text)}
.ar-prose > p{margin:0 0 14px}
.ar-prose > ul,.ar-prose > ol{margin:0 0 16px;padding-inline-start:22px}
.ar-prose li + li{margin-top:6px}
.ar-prose a,.ar-more-list a{color:var(--accent-ink)}
.ar-prose code{font-family:var(--font-mono);font-size:13.5px;padding:1px 6px;border-radius:6px;background:var(--panel2);border:1px solid var(--border);overflow-wrap:anywhere}
/* a foot note under a table inside an article stays a foot note (`.ar-prose > p` would outrank it) */
.ar-prose > p.ar-foot{font-size:13px;color:var(--muted);margin:10px 0 16px}
/* the sheet article's formulas table: the formulas keep to one line where they fit */
.ar-sheet code{font-size:12.5px;white-space:nowrap}
.ar-ex{padding:16px 18px;margin:4px 0 18px}
.ar-ex-tag{display:inline-block;margin:0 0 8px;padding:2px 10px;border-radius:999px;background:var(--accent-soft);color:var(--accent-ink);font-size:12px;font-weight:800}
.ar-ex > p{margin:0;font-size:15px}
.ar-ex > ol{margin:0;padding-inline-start:22px}
.ar-ex > ol > li{font-size:15px}
.ar-ex > ol > li + li{margin-top:6px}
.ar-ex .out-note{margin-top:10px}
.ar-guide-n{font-family:var(--font-mono);font-size:13px;font-weight:600;color:var(--accent-ink)}
.ar-article-faq{padding-top:0}
.ar-more-list{margin:0;padding-inline-start:22px}
.ar-more-list li{font-size:15.5px}
.ar-more-list li + li{margin-top:6px}

/* English: the currency sign goes before the amount (E£350); Arabic keeps جنيه after it */
html[lang="en"] .fld-in .cur{order:-1}
/* English: the site's display serif for the heads, and Latin leading (the rules above were set for Cairo) */
html[lang="en"] .ar-head h1{font-family:var(--font-display);font-weight:600;letter-spacing:-.02em;line-height:1.15}
html[lang="en"] .ar-head h2,html[lang="en"] .ar-h2,html[lang="en"] .calc-out h2{font-family:var(--font-display);font-weight:600;letter-spacing:-.01em}
html[lang="en"] :is(.ar-head .lead,.ar-p,.ar-bridge,.out-note,.out-hint,.out-notes p,.ar-note p,.ar-foot,.out-src,.ar-faq .faq p){line-height:1.65}
html[lang="en"] .ar-prose > p,html[lang="en"] .ar-prose li{line-height:1.7}
