/* حاسبتك / Hasibatak: blue glass on a grid, light and dark */

/* ---------- theme tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #070D1F; --text: #FFFFFF; --muted: #D5DEFA;
  --header: rgba(7, 13, 31, .62); --glass: rgba(39, 78, 196, .22); --border: rgba(170, 195, 255, .28);
  --strong: rgba(31, 71, 200, .92); --strong-border: rgba(170, 195, 255, .45);
  --chip: rgba(255, 255, 255, .08); --chip-border: rgba(190, 210, 255, .30);
  --input: rgba(5, 10, 26, .55); --selected: rgba(79, 123, 255, .22);
  --grid: rgba(150, 178, 255, .07); --dot: rgba(150, 178, 255, .20); --streak: rgba(150, 178, 255, .10);
  --orb: rgba(64, 104, 255, .26); --orb2: rgba(242, 140, 40, .10);
  --key: rgba(39, 78, 196, .35); --key-text: #FFFFFF;
  --card-shadow: 0 24px 48px -28px rgba(0, 0, 0, .8); --hero-shadow: 0 40px 80px -30px rgba(40, 80, 255, .55);
  --footer: #050A18; --footer-text: #C9D2EC; --accent-text: #FFC387; --error: #FFA597;
  --on: #1F47C8; --orange: #F28C28; --on-orange: #1A1206; --gold: #FFD9A8;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #EDF2FF; --text: #0F1A3A; --muted: #34415F;
  --header: rgba(255, 255, 255, .72); --glass: rgba(255, 255, 255, .62); --border: rgba(31, 71, 200, .16);
  --strong: rgba(31, 71, 200, .95); --strong-border: rgba(255, 255, 255, .6);
  --chip: rgba(255, 255, 255, .78); --chip-border: rgba(31, 71, 200, .20);
  --input: rgba(255, 255, 255, .96); --selected: rgba(31, 71, 200, .12);
  --grid: rgba(31, 71, 200, .07); --dot: rgba(31, 71, 200, .16); --streak: rgba(31, 71, 200, .10);
  --orb: rgba(64, 104, 255, .18); --orb2: rgba(242, 140, 40, .12);
  --key: rgba(255, 255, 255, .78); --key-text: #1F47C8;
  --card-shadow: 0 24px 48px -30px rgba(31, 71, 200, .45); --hero-shadow: 0 40px 80px -34px rgba(31, 71, 200, .45);
  --footer: #0F1A3A; --footer-text: #E3E8F5; --accent-text: #9A4A06; --error: #B3261E;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #EDF2FF; --text: #0F1A3A; --muted: #34415F;
    --header: rgba(255, 255, 255, .72); --glass: rgba(255, 255, 255, .62); --border: rgba(31, 71, 200, .16);
    --strong: rgba(31, 71, 200, .95); --chip: rgba(255, 255, 255, .78); --chip-border: rgba(31, 71, 200, .20);
    --input: rgba(255, 255, 255, .96); --selected: rgba(31, 71, 200, .12);
    --grid: rgba(31, 71, 200, .07); --dot: rgba(31, 71, 200, .16); --streak: rgba(31, 71, 200, .10);
    --orb: rgba(64, 104, 255, .18); --orb2: rgba(242, 140, 40, .12); --key: rgba(255, 255, 255, .78); --key-text: #1F47C8;
    --footer: #0F1A3A; --footer-text: #E3E8F5; --accent-text: #9A4A06; --error: #B3261E; color-scheme: light;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font-family: var(--font); font-size: 17px; line-height: var(--lh);
  background-color: var(--bg);
  background-image:
    linear-gradient(118deg, transparent 0 31%, var(--streak) 31% 31.15%, transparent 31.15% 63%, var(--streak) 63% 63.12%, transparent 63.12%),
    radial-gradient(900px 560px at 18% 8%, var(--orb), transparent 62%),
    radial-gradient(760px 520px at 92% 70%, var(--orb2), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: auto, auto, auto, 72px 72px, 72px 72px, 18px 18px;
  background-attachment: fixed;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.glass, .panel, .statement, .tool-card, .site-head, .q-panel, .box, .example, .content details, .related a, .table-wrap, .chip-link, .lang-chip {
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
}
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0; }
h1 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 800; }
h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 30; background: var(--header); border-bottom: 1px solid var(--border); }
.site-head .wrap { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; background: var(--on); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 21px; font-weight: 800; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); flex: none; line-height: 1; }
.brand-name { font-family: var(--display); font-size: 25px; font-weight: 800; line-height: 1; }
.head-end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-nav { display: flex; gap: 2px; flex-wrap: wrap; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 20px; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--chip); }
.icon-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text); cursor: pointer; padding: 0; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .sun { display: block; } [data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .theme-btn .sun { display: block; } :root:not([data-theme]) .theme-btn .moon { display: none; } }

.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 8px; border-radius: 22px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text); font-size: 15px; }
.lang-menu summary::-webkit-details-marker { display: none; }
.flag { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: block; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); background: #FFFFFF; }
.flag svg { width: 100%; height: 100%; display: block; }
.flag-sm { width: 24px; height: 16px; border-radius: 3px; }
.chev { width: 14px; height: 14px; flex: none; }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 40; list-style: none; margin: 0; padding: 6px; width: 250px; max-height: 70vh; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .5); }
.lang-menu li a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 10px; border-radius: 10px; text-decoration: none; font-size: 15px; line-height: 1.4; }
.lang-menu li a:hover { background: var(--chip); }
.lang-menu li a[aria-current="true"] { background: var(--selected); font-weight: 600; }
.lang-menu li a span.en { margin-inline-start: auto; font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) {
  .head-end { display: contents; }
  .brand { margin-inline-end: auto; }
  .brand-name { font-size: 22px; }
  .site-head .wrap { gap: 8px; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .site-nav a { white-space: nowrap; }
}

.lang-suggest { background: var(--strong); color: #FFFFFF; font-size: 15px; }
.lang-suggest .wrap { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; flex-wrap: wrap; }
.lang-suggest a { color: #FFFFFF; font-weight: 600; text-decoration: underline; }
.lang-suggest button { background: none; border: 0; color: #FFFFFF; cursor: pointer; font-size: 22px; line-height: 1; padding: 4px 8px; }

/* ---------- shared bits ---------- */
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 17px; background: var(--chip); border: 1px solid var(--chip-border); font-size: 14px; }
.chip .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--orange); display: block; }
.box { background: var(--glass); border: 1px solid var(--border); border-radius: 24px; padding: 26px 28px; box-shadow: var(--card-shadow); }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 18px; background: var(--chip); border: 1px solid var(--chip-border); }
.seg button { min-height: 42px; padding: 0 16px; border-radius: 14px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--on); color: #FFFFFF; }
.seg-full { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 24px; border-radius: 16px; border: 0; background: var(--orange); color: var(--on-orange); font-family: var(--display); font-size: 19px; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { filter: brightness(1.06); }
.btn-quiet { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .12); color: #FFFFFF; font: inherit; font-size: 15px; cursor: pointer; }
input[type="text"], input[type="date"], input[type="number"], select {
  width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--chip-border); background: var(--input); color: var(--text);
  font: inherit; font-size: 18px; padding: 0 14px;
}
input.num-in, input[type="number"] { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
[dir="rtl"] input.num-in, [dir="rtl"] input[type="number"] { text-align: right; }
input:focus, select:focus { outline: none; border-color: #4F7BFF; box-shadow: 0 0 0 3px rgba(79, 123, 255, .3); }
input[aria-invalid="true"] { border-color: var(--error); }
select option { background: var(--bg); color: var(--text); }
.error { color: var(--error); font-size: 14.5px; margin: 8px 0 0; min-height: 1em; }

/* ---------- homepage ---------- */
.hero { position: relative; padding: 48px 0 44px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 48px; align-items: center; }
.hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; }
.hero-text .chip { align-self: flex-start; }
.hero-text .lead { font-size: 18px; line-height: 1.8; color: var(--muted); max-width: 42ch; margin: 0; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15.5px; }
.ticks li { display: flex; gap: 10px; align-items: center; }
.ticks svg { width: 18px; height: 18px; flex: none; color: var(--orange); }
.key { position: absolute; z-index: 0; display: flex; align-items: center; justify-content: center; border-radius: 18px; background: var(--key); border: 1px solid var(--border); color: var(--key-text); font-weight: 600; box-shadow: var(--card-shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); pointer-events: none; user-select: none; }
.key-1 { top: 16px; inset-inline-start: 47%; width: 62px; height: 62px; font-size: 30px; transform: rotate(-12deg); }
.key-2 { bottom: 8px; inset-inline-start: 45%; width: 54px; height: 54px; font-size: 26px; transform: rotate(14deg); }
.key-3 { top: 14px; inset-inline-end: -16px; width: 46px; height: 46px; font-size: 24px; background: var(--orange); color: var(--on-orange); border: 0; transform: rotate(10deg); box-shadow: 0 16px 30px -12px rgba(242, 140, 40, .8); }
.key-4 { bottom: -10px; inset-inline-end: 30px; width: 70px; height: 70px; font-size: 32px; transform: rotate(-8deg); filter: blur(1.5px); opacity: .8; }
@media (max-width: 1000px) { .key { display: none; } }
.q-panel { position: relative; z-index: 1; background: var(--glass); border: 1px solid var(--border); border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--hero-shadow); }
.q-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 5px; border-radius: 18px; background: var(--chip); border: 1px solid var(--chip-border); }
.q-tabs button { min-height: 46px; border-radius: 14px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; padding: 4px 6px; line-height: 1.3; }
.q-tabs button[aria-selected="true"] { background: var(--on); color: #FFFFFF; }
.q-pane { display: flex; flex-direction: column; gap: 14px; }
.q-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .q-row { grid-template-columns: 1fr; } .q-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.q-field { display: flex; flex-direction: column; gap: 6px; }
.q-field label, .q-field .lbl { font-size: 14px; color: var(--muted); }
.q-field input { font-size: 20px; min-height: 54px; border-radius: 16px; }
.q-out { border-radius: 20px; padding: 18px 20px; background: var(--strong); color: #FFFFFF; display: flex; flex-direction: column; gap: 6px; min-height: 128px; }
.q-out .k { font-size: 14px; color: #D7E0FF; }
.q-out .big { font-family: var(--display); font-size: clamp(34px, 4vw, 48px); font-weight: 800; line-height: 1.1; color: var(--gold); }
.q-out .big .cur { font-size: 18px; font-weight: 700; }
.q-out .words { font-size: 21px; font-weight: 600; line-height: 1.8; color: var(--gold); font-family: "Noto Sans Arabic", "IBM Plex Sans Arabic", sans-serif; }
.q-out .note { font-size: 13.5px; color: #D7E0FF; }

.sec { padding: 0 0 28px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sec-head h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; }
.sec-head span { font-size: 15px; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 18px; }
.tool-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 16px; padding: 22px; background: var(--glass); border: 1px solid var(--border); border-radius: 26px; text-decoration: none; box-shadow: var(--card-shadow); transition: transform .2s ease, border-color .2s ease; }
.tool-card:hover { transform: translateY(-3px); border-color: rgba(79, 123, 255, .6); }
.tool-card::before { content: ""; position: absolute; inset-inline-start: -30px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(closest-side, var(--glow, rgba(79, 123, 255, .45)), transparent); }
.tool-card > * { position: relative; }
.tool-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tool-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--on); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 10px 24px -10px rgba(31, 71, 200, .9); }
.tool-icon svg { width: 27px; height: 27px; }
.tool-icon.orange { background: var(--orange); box-shadow: 0 10px 24px -10px rgba(242, 140, 40, .9); }
.tool-icon.ink { background: #0F1A3A; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 10px 24px -10px rgba(0, 0, 0, .8); }
.badge { font-size: 12.5px; padding: 5px 10px; border-radius: 12px; background: rgba(242, 140, 40, .18); color: var(--accent-text); font-weight: 600; }
.tool-name { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.3; }
.tool-desc { font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.tool-sample { margin-top: auto; padding: 12px 14px; border-radius: 16px; background: var(--chip); border: 1px dashed var(--chip-border); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tool-sample .s-k { font-size: 13px; color: var(--muted); }
.tool-sample .s-v { font-family: var(--display); font-size: 20px; font-weight: 800; }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 12px; margin-top: 14px; }
.soon { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; border: 1px dashed var(--chip-border); color: var(--muted); }
.soon .s-icon { width: 36px; height: 36px; border-radius: 11px; border: 1px dashed var(--chip-border); display: flex; align-items: center; justify-content: center; flex: none; font-family: var(--display); font-weight: 700; }
.soon strong { display: block; color: var(--text); font-weight: 600; }
.soon span { font-size: 13px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); border-radius: 26px; overflow: hidden; border: 1px solid var(--border); background: var(--glass); }
.step { padding: 26px; display: flex; flex-direction: column; gap: 8px; border-inline-end: 1px solid var(--border); }
.step:last-child { border-inline-end: 0; }
.step .n { font-family: var(--display); font-size: 44px; font-weight: 800; line-height: 1; color: var(--orange); }
.step strong { font-family: var(--display); font-size: 21px; font-weight: 700; }
.step span { font-size: 15px; line-height: 1.8; color: var(--muted); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.chip-link, .lang-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 22px; background: var(--chip); border: 1px solid var(--chip-border); text-decoration: none; font-size: 15px; }
.chip-link:hover, .lang-chip:hover { border-color: #4F7BFF; }
.lang-chip { padding: 0 14px 0 10px; }
.langs-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 28px; align-items: center; }
.langs-box p { margin: 8px 0 0; color: var(--muted); line-height: 1.8; }

/* ---------- tool pages ---------- */
.intro { padding: 26px 0 20px; display: flex; flex-direction: column; gap: 10px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.intro .lead { font-size: 18px; color: var(--muted); max-width: 62ch; margin: 0; line-height: 1.75; }
.law-ref { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 14px; border-radius: 17px; background: var(--chip); border: 1px solid var(--chip-border); font-size: 14px; line-height: 1.5; }
.law-ref::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--orange); flex: none; }
.calc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 24px; align-items: start; padding-bottom: 28px; }
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; } }
.panel { background: var(--glass); border: 1px solid var(--border); border-radius: 24px; padding: 26px; box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 4px; }
fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 12px; font-family: var(--display); font-size: 20px; font-weight: 700; }
.field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: var(--muted); }
.hint { display: block; font-size: 14px; color: var(--muted); line-height: 1.7; margin-top: 4px; }
.hint a { color: var(--text); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.row-date { grid-template-columns: minmax(70px, .8fr) minmax(150px, 2fr) minmax(90px, 1fr); }
@media (max-width: 600px) { .row-date { grid-template-columns: 1fr 1fr; } .row-date .field:nth-child(2) { grid-column: span 2; order: -1; } }
.panel .seg { margin-bottom: 14px; align-self: flex-start; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--chip); border: 1px solid var(--chip-border); cursor: pointer; }
.choice input { width: 20px; height: 20px; margin-top: 4px; accent-color: #1F47C8; flex: none; }
.choice strong { display: block; font-weight: 600; font-size: 16px; }
.choice span span { font-size: 14px; color: var(--muted); line-height: 1.6; }
.choice:has(input:checked) { background: var(--selected); border: 1.5px solid #4F7BFF; }
.panel .btn { margin-top: 6px; }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: center; font-size: 15.5px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: #1F47C8; }

.statement { position: sticky; top: 92px; background: var(--strong); border: 1px solid var(--strong-border); border-radius: 24px; padding: 24px; color: #FFFFFF; box-shadow: var(--hero-shadow); }
@media (max-width: 900px) { .statement { position: static; } }
.statement-title { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 0 0 2px; }
.statement-sub { font-size: 14px; color: #D7E0FF; margin: 0 0 12px; }
.statement .empty { color: #D7E0FF; font-size: 15px; padding: 16px 0; margin: 0; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px dashed rgba(255, 255, 255, .3); font-size: 15.5px; }
.lines li .k { color: #D7E0FF; }
.lines li .v { font-weight: 600; text-align: end; }
.lines li.minus .v { color: #FFC7BE; }
.total { margin-top: 12px; padding: 16px 18px; border-radius: 18px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.total .k { font-weight: 600; }
.total .v { font-family: var(--display); font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; line-height: 1.05; color: var(--gold); }
.total .v.date-v { font-size: clamp(22px, 2.6vw, 28px); }
.total .cur { font-size: 17px; font-weight: 700; }
.basis { font-size: 13.5px; color: #D7E0FF; margin: 12px 0 0; line-height: 1.8; }
.statement-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.words-out { font-size: clamp(21px, 2.6vw, 26px); line-height: 1.9; font-weight: 600; color: var(--gold); margin: 0; min-height: 96px; overflow-wrap: anywhere; }
.words-out.muted { color: #D7E0FF; font-weight: 400; font-size: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .total.flash { animation: flash .6s ease-out; }
  @keyframes flash { from { box-shadow: 0 0 0 5px rgba(255, 217, 168, .55); } to { box-shadow: 0 0 0 0 transparent; } }
}

/* article content under each calculator */
.content { padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; }
.content > h2 { margin-top: 14px; }
.content > p, .content > ul, .content > ol, .content > blockquote { max-width: 72ch; margin: 0; line-height: 1.85; }
.content ul, .content ol { padding-inline-start: 22px; }
.content li { margin-bottom: 6px; }
.content blockquote { padding: 14px 18px; border-radius: 16px; background: var(--chip); border: 1px solid var(--chip-border); }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--chip-border); background: var(--glass); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; min-width: 520px; }
th, td { text-align: start; padding: 12px 16px; border-top: 1px solid var(--chip-border); vertical-align: top; }
thead th { border-top: 0; background: var(--chip); font-weight: 600; }
.example { background: var(--glass); border: 1px solid var(--border); border-radius: 20px; padding: 18px 22px; max-width: 820px; }
.example h3 { font-size: 19px; margin-bottom: 6px; }
.example p { margin: 0; line-height: 1.8; color: var(--muted); }
.example strong { color: var(--text); }
.content details { background: var(--glass); border: 1px solid var(--border); border-radius: 16px; padding: 0 18px; max-width: 900px; }
.content summary { cursor: pointer; padding: 15px 0; font-weight: 600; font-size: 16px; }
.content details[open] summary { border-bottom: 1px solid var(--chip-border); margin-bottom: 12px; }
.content details p { color: var(--muted); line-height: 1.8; }
.related { display: flex; flex-direction: column; gap: 12px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.related a { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; border-radius: 20px; background: var(--glass); border: 1px solid var(--border); text-decoration: none; font-weight: 600; }
.related a span { font-weight: 400; font-size: 14px; color: var(--muted); }
.note, .translated-note { font-size: 14px; color: var(--muted); border-top: 1px solid var(--chip-border); padding-top: 14px; max-width: 900px; line-height: 1.8; }
.translated-note { border-top: 0; padding-top: 0; }
.note a, .translated-note a { color: var(--text); }
.ad-slot { display: none; }

/* simple pages (about, privacy, contact) */
.content.simple { max-width: 860px; }
.content.simple .lead { font-size: 18px; color: var(--muted); }

/* ---------- footer ---------- */
.site-foot { background: var(--footer); color: var(--footer-text); margin-top: 24px; }
.site-foot .wrap { padding-block: 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 15px; }
.site-foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-foot a { color: var(--footer-text); }

@media print {
  body { background: #FFFFFF !important; color: #000000; }
  .site-head, .site-foot, form, .content, .intro .crumbs, .statement-actions, .ad-slot, .lang-suggest { display: none !important; }
  .calc { display: block; }
  .statement { position: static; background: #FFFFFF; color: #000000; border: 1px solid #999999; box-shadow: none; }
  .lines li .k, .basis, .statement-sub { color: #333333; }
  .total .v { color: #000000; }
}
@media (min-width: 1000px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-grid > .tool-card:last-child:nth-child(3n + 2) { grid-column: span 2; }
  .tool-grid > .tool-card:last-child:nth-child(3n + 1) { grid-column: span 3; }
}
.hint + .field { margin-top: 14px; }
.row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 480px) { .row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.offer { padding: 6px 0 10px; border-bottom: 1px dashed rgba(255, 255, 255, .28); }
.offer:last-of-type { border-bottom: 0; }
.offer-head { margin: 8px 0 2px; display: flex; align-items: center; gap: 8px; }
.offer-head .badge { background: var(--gold); color: #3A2400; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.offer.best .offer-head strong { color: var(--gold); }
.offer-in legend { font-size: 17px; }
.mid-src { display: block; margin-top: 6px; }
.mid-src a { color: inherit; }
.mid-reset { margin-top: 8px; min-height: 36px; font-size: 14px; }
.conv { margin-top: 24px; }
.conv h2 { margin: 0 0 6px; font-size: 22px; }
.conv .row { margin-top: 12px; }
#conv-out .lines { margin-top: 12px; }
#conv-out .empty { margin: 12px 0 0; color: var(--muted); }
.quick { margin: 4px 0 14px; }
.quick-title { margin: 0 0 8px; font-weight: 700; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip-btn { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { border-color: #4F7BFF; }
.site-link { margin: 6px 0 0; font-size: 14px; }
.site-link a { color: #2F5BEA; font-weight: 600; }
[data-theme="dark"] .site-link a { color: #9DB5FF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-link a { color: #9DB5FF; } }
#conv-out .lines li { border-bottom-color: var(--border); font-size: 16px; }
#conv-out .lines li .k { color: var(--muted); }
#conv-out .lines li .v { color: var(--text); font-size: 18px; }
#conv-out .lines li:first-child .v { color: var(--on); font-size: 22px; }
[data-theme="dark"] #conv-out .lines li:first-child .v { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #conv-out .lines li:first-child .v { color: var(--gold); } }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-sub { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.total.due .v { font-size: 26px; }
.due-hijri { margin-top: 6px; }
.progress { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .22); overflow: hidden; margin: 14px 0 4px; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.chip-btn[aria-pressed="true"] { background: var(--on); border-color: var(--on); color: #FFFFFF; }
.sched table { font-size: 14px; }
.statement .sched { margin-top: 8px; max-height: 420px; overflow: auto; border-radius: 12px; }
.statement .sched table { background: rgba(255, 255, 255, .08); color: #FFFFFF; }
.statement .sched th, .statement .sched td { border-color: rgba(255, 255, 255, .18); color: #FFFFFF; background: transparent; padding: 7px 8px; }
.work-panel { margin-top: 24px; }
.work-panel h2 { margin: 0 0 6px; font-size: 22px; }
#work-out .lines li { border-bottom-color: var(--border); }
#work-out .lines li .k { color: var(--muted); }
#work-out .lines li .v { color: var(--text); }
#work-out .lines li:last-child .v { color: var(--on); font-size: 22px; }
#work-out .empty { color: var(--muted); }
.statement .table-wrap.sched { background: rgba(10, 30, 110, .25); border-color: rgba(255, 255, 255, .2); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.statement .sched thead th { background: rgba(255, 255, 255, .12); }
.statement .sched table { min-width: 0; background: transparent; }
[dir="rtl"] .sched td[dir="ltr"] { text-align: right; }
