/* ==========================================================================
   حساب الأجرة المغرب — design system
   ========================================================================== */
:root {
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --bg: #f6f7f4;
  --bg-2: #eef1ec;
  --surface: #ffffff;
  --surface-2: #f9faf8;
  --ink: #14211d;
  --ink-2: #3f4d48;
  --muted: #6a7772;
  --line: #e2e7e2;
  --line-2: #d3dad4;
  --brand: #0b5d4b;
  --brand-2: #0f7a62;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1ec;
  --accent: #c98a17;
  --accent-soft: #fbf1dc;
  --danger: #b4412f;
  --focus: #1b8f72;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 27, .05), 0 8px 24px -12px rgba(16, 32, 27, .14);
  --shadow-lg: 0 2px 6px rgba(16, 32, 27, .06), 0 24px 48px -24px rgba(16, 32, 27, .28);
  --c1: #2f6fb0; --c2: #7b5cc4; --c3: #c98a17; --c4: #c2553f; --c5: #3a9c8a; --c6: #8a6f4d; --c7: #d06c9a; --c8: #5b6b7a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1412; --bg-2: #0f1a17; --surface: #121e1b; --surface-2: #16241f;
    --ink: #e7efeb; --ink-2: #c3cfca; --muted: #8b9a94; --line: #22322d; --line-2: #2c3f39;
    --brand: #35b394; --brand-2: #4cc7a8; --brand-ink: #052b22; --brand-soft: #143229;
    --accent: #e6ad45; --accent-soft: #2e2512; --focus: #5fd3b5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 30px 60px -30px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.75; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.7rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, .data-table td.num { font-variant-numeric: tabular-nums; direction: ltr; text-align: left; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -60px; background: var(--brand); color: var(--brand-ink); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 1rem; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 860px; margin-inline: auto; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-sub { margin-block: 3rem; }
.section-head { margin-bottom: 1.75rem; }
.section-head p { color: var(--muted); margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.i { width: 20px; height: 20px; flex: none; }
.i-sm { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; }

/* ---- header / footer ------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; color: var(--brand); }
.brand-text { display: grid; line-height: 1.2; }
.brand-text b { font-size: 1.05rem; }
.brand-text small { color: var(--muted); font-size: .75rem; }
.main-nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.main-nav a { color: var(--ink-2); text-decoration: none; padding: .45rem .8rem; border-radius: 999px; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.main-nav a:hover { background: var(--bg-2); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; padding-block: .5rem; min-height: 0; }
  .main-nav { width: 100%; margin-inline: -.4rem; }
  .brand-text small { display: none; }
}

.site-footer { margin-top: 4rem; background: var(--surface); border-top: 1px solid var(--line); padding-top: 2.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 2rem; }
.footer-title { font-size: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--brand); }
.brand-footer { margin-bottom: .75rem; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 1.2rem; margin-top: 2rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---- buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .98rem; padding: .7rem 1.2rem; border-radius: 12px; text-decoration: none;
  transition: background-color .15s, box-shadow .15s, transform .05s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.05rem; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { background: var(--brand-2); color: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand-soft) 70%, var(--brand) 12%); color: var(--brand); }

/* ---- hero -------------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(700px 360px at 0% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: grid; grid-template-columns: 1.25fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding-block: clamp(2.5rem, 7vw, 5rem); }
.eyebrow { display: inline-block; color: var(--brand); background: var(--brand-soft); font-weight: 600; font-size: .85rem; padding: .25rem .8rem; border-radius: 999px; }
.lead { font-size: clamp(1.02rem, .95rem + .35vw, 1.18rem); color: var(--ink-2); max-width: 62ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--ink-2); font-size: .92rem; }
.trust li { display: inline-flex; gap: .35rem; align-items: center; }
.trust .i { color: var(--brand); }
.hero-card { padding: 1.4rem; box-shadow: var(--shadow-lg); }
.hc-head { display: flex; gap: .6rem; align-items: center; font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.pill { background: var(--accent-soft); color: var(--accent); font-size: .78rem; padding: .1rem .6rem; border-radius: 999px; font-weight: 700; }
.hc-net { display: grid; margin: 1rem 0; padding: 1rem 1.1rem; background: var(--brand); color: var(--brand-ink); border-radius: 14px; }
.hc-net small { opacity: .85; }
.hc-net strong { font-size: 2.2rem; line-height: 1.2; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.hc-lines { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .3rem; font-size: .93rem; }
.hc-lines li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .3rem; }
.hc-lines b { font-variant-numeric: tabular-nums; direction: ltr; }
.hc-lines .neg b { color: var(--danger); }
.hc-link { font-weight: 600; text-decoration: none; }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } }

/* ---- ads ------------------------------------------------------------------------ */
.ad { display: block; text-align: center; margin: 1.5rem auto; overflow: hidden; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); letter-spacing: .05em; margin-bottom: .2rem; }
.ad-top { width: min(1200px, 100% - 32px); min-height: 108px; margin-block: 1rem .25rem; }
.ad-article { min-height: 120px; }
@media (max-width: 760px) { .ad-top { display: none; } }

/* ---- corps picker ------------------------------------------------------------ */
.hero-picker { padding: 1.1rem 1.2rem; margin: 1.5rem 0 1.25rem; box-shadow: var(--shadow-lg); }
.corps-picker label { display: block; font-weight: 700; margin-bottom: .5rem; }
.picker-row { display: flex; gap: .6rem; }
.picker-row .select { flex: 1; min-width: 0; }
.corps-picker select { font-size: 1.02rem; padding-block: .8rem; }
.js .corps-picker .btn { display: none; }
.switcher { margin: .25rem 0 .5rem; max-width: 520px; }
.corps-picker.compact { display: flex; align-items: center; gap: .6rem; }
.corps-picker.compact label { margin: 0; font-weight: 500; color: var(--muted); white-space: nowrap; }
.corps-picker.compact .picker-row { flex: 1; }
.corps-picker.compact select { padding-block: .5rem; font-size: .95rem; background: var(--surface); }
@media (max-width: 520px) { .picker-row { flex-direction: column; } }

/* Sector colours (dropdown, directory). */
.cat-education { --cat: #2f6fb0; } .cat-enseignement-superieur { --cat: #7b5cc4; } .cat-interministeriel { --cat: #0f7a62; }
.cat-sante { --cat: #cf3f5c; } .cat-interieur { --cat: #4a7a2c; } .cat-justice { --cat: #a0701c; }
.cat-prisons { --cat: #5b6b7a; } .cat-finances { --cat: #c4820f; } .cat-emploi { --cat: #1d8ca3; }
[class*="cat-"] { --cat-soft: color-mix(in srgb, var(--cat) 12%, transparent); }
@media (prefers-color-scheme: dark) {
  [class*="cat-"] { --cat-soft: color-mix(in srgb, var(--cat) 22%, transparent); }
}

/* Enhanced corps picker */
.js .corps-picker.enhanced .picker-row { display: none; }
.cp { position: relative; }
.cp-btn {
  width: 100%; display: flex; align-items: center; gap: .7rem; text-align: start; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: .65rem .9rem;
  transition: border-color .15s, box-shadow .15s;
}
.cp-btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line-2)); }
.cp-btn[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.cp-ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; flex: none; color: var(--cat, var(--brand)); background: var(--cat-soft, var(--brand-soft)); }
.cp-text { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.cp-val { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-text small { color: var(--cat, var(--muted)); font-size: .8rem; font-weight: 600; }
.cp-chev { width: 9px; height: 9px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-inline: .3rem .2rem; flex: none; }
.compact .cp-btn { padding: .4rem .7rem; background: var(--surface); }
.compact .cp-ico { width: 28px; height: 28px; padding: 5px; }

.cp-panel {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 70; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: min(70vh, 560px); min-width: min(100%, 420px);
}
.cp-head { display: none; }
.cp-search { padding: .7rem; border-bottom: 1px solid var(--line); }
.cp-search input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 10px; padding: .55rem .8rem;
}
.cp-search input:focus { outline: none; border-color: var(--brand); }
.cp-list { overflow-y: auto; overscroll-behavior: contain; padding: .35rem .45rem .6rem; }
.cp-group { margin-top: .35rem; }
.cp-gh {
  position: sticky; top: -.35rem; z-index: 1; display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; margin-bottom: .15rem;
  background: var(--surface); color: var(--cat); font-weight: 700; font-size: .88rem; border-bottom: 2px solid var(--cat-soft);
}
.cp-gh .i { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: var(--cat-soft); }
.cp-gh small { margin-inline-start: auto; background: var(--cat-soft); color: var(--cat); border-radius: 999px; padding: 0 .5rem; font-size: .72rem; }
.cp-opt {
  display: grid; padding: .5rem .7rem; margin-inline-start: .55rem; border-inline-start: 3px solid var(--cat-soft); border-radius: 0 10px 10px 0;
  color: var(--ink); text-decoration: none; line-height: 1.4;
}
.cp-opt small { color: var(--muted); font-size: .78rem; }
.cp-opt:hover, .cp-opt:focus { background: var(--cat-soft); border-inline-start-color: var(--cat); color: var(--ink); outline: none; }
.cp-opt[aria-selected="true"] { border-inline-start-color: var(--cat); font-weight: 600; }
.cp[hidden], .cp-panel[hidden], .cp-opt[hidden], .cp-group[hidden], .cp-empty[hidden] { display: none; }
.compact .cp { flex: 1; min-width: 0; }
.cp-empty { padding: 1rem; text-align: center; color: var(--muted); margin: 0; }
.cp-backdrop { display: none; }

@media (max-width: 640px) {
  .cp-panel {
    position: fixed; inset: auto 0 0 0; top: auto; max-height: 82vh; min-width: 0; border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom); animation: cp-up .2s ease-out;
  }
  .cp-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem .2rem; }
  .cp-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
  .cp-close { font: inherit; font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; padding: .2rem .5rem; }
  .cp-backdrop.show { display: block; position: fixed; inset: 0; z-index: 69; background: rgba(0, 0, 0, .45); }
  body.cp-open { overflow: hidden; }
}
@keyframes cp-up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }

.all-corps-grid h3 { color: var(--cat) !important; }
.all-corps-grid h3 .i { color: var(--cat) !important; background: var(--cat-soft); border-radius: 6px; padding: 2px; width: 20px; height: 20px; }
.all-corps-grid ul { border-inline-start: 2px solid var(--cat-soft); padding-inline-start: .7rem !important; }

.all-corps { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.all-corps > summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; list-style: none; color: var(--brand); }
.all-corps > summary::-webkit-details-marker { display: none; }
.all-corps > summary::before { content: "+"; display: inline-block; width: 1.4rem; font-weight: 700; }
.all-corps[open] > summary::before { content: "−"; }
.all-corps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem 2rem; padding: 0 1.2rem 1.2rem; }
.all-corps-grid h3 { font-size: .95rem; display: flex; align-items: center; gap: .4rem; margin-bottom: .4rem; color: var(--ink-2); }
.all-corps-grid h3 .i { color: var(--brand); }
.all-corps-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .15rem; }
.all-corps-grid a { text-decoration: none; font-size: .92rem; }
.all-corps-grid a:hover { text-decoration: underline; }

.band { background: var(--surface); border-block: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding-block: 2.5rem; }
.step .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-bottom: .6rem; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; display: grid; gap: .3rem; }
.fact b { font-size: 1.5rem; color: var(--brand); }
.fact span { color: var(--ink-2); font-size: .95rem; }
.more { margin-top: 1.25rem; font-weight: 600; }
@media (max-width: 820px) { .fact-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .fact-grid { grid-template-columns: 1fr; } }

/* ---- page head / breadcrumbs ---------------------------------------------- */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 1.25rem 0 .5rem; font-size: .88rem; color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: "‹"; margin-inline-start: .35rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }
.page-head { margin-block: .5rem 1.75rem; }
.page-head .lead { margin-bottom: 0; }

/* ---- simulator layout ------------------------------------------------------ */
.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.5rem; align-items: start; }
/* Sticky, internally scrollable result panel on wide screens only; scroll chains to the page. */
.sim-result { position: sticky; top: 84px; padding: 1.25rem; max-height: calc(100vh - 100px); overflow: auto; }
.result-title { font-size: 1rem; color: var(--muted); font-weight: 600; margin-bottom: .75rem; }
@media (max-width: 980px), (pointer: coarse) {
  .sim-layout { grid-template-columns: 1fr; }
  .sim-result { position: static; max-height: none; overflow: visible; }
}

.sim-form { padding: .5rem 1.25rem 1.25rem; }
.form-group { padding-block: 1.1rem; border-bottom: 1px solid var(--line); }
.form-group:last-child { border-bottom: 0; }
.form-group > header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.form-group h3 { margin: 0; font-size: 1.02rem; }
.form-group header p { margin: 0; color: var(--muted); font-size: .85rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.field { min-width: 0; margin: 0; border: 0; padding: 0; grid-column: 1 / -1; }
.field.toggle, [data-group="location"] .field, .field[data-key="Enfant"] { grid-column: auto; }
.field[data-key="Commune"] { grid-column: 1 / -1; }
.field > label, .field > legend { display: block; font-weight: 500; font-size: .9rem; color: var(--ink-2); margin-bottom: .35rem; padding: 0; }
.select { position: relative; }
.select::after {
  content: ""; position: absolute; inset-inline-end: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
select {
  width: 100%; appearance: none; -webkit-appearance: none; font: inherit; font-size: .98rem; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .65rem .9rem; padding-inline-end: 2.4rem;
  transition: border-color .15s, box-shadow .15s, background-color .15s; text-overflow: ellipsis;
}
select:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line-2)); }
select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); background: var(--surface); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: .4rem 1.2rem; border-radius: 9px; font-weight: 600; font-size: .92rem; color: var(--ink-2); transition: background-color .15s, color .15s; }
.seg input:checked + span { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.form-actions { display: flex; gap: .75rem; padding-top: 1rem; flex-wrap: wrap; }
.js .form-actions .btn-primary { display: none; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }

/* ---- payslip ------------------------------------------------------------- */
.payslip { transition: opacity .2s; }
.is-loading .payslip { opacity: .55; }
.net-hero {
  border-radius: 14px; padding: 1.1rem 1.25rem; color: #fff;
  background: linear-gradient(135deg, #0b5d4b 0%, #0f7a62 60%, #13917a 100%);
  box-shadow: 0 12px 30px -16px rgba(11, 93, 75, .8);
}
.net-label { opacity: .9; font-weight: 500; }
.net-value { display: flex; align-items: baseline; gap: .5rem; direction: ltr; justify-content: flex-end; }
.net-amount { font-size: clamp(2.1rem, 1.6rem + 2vw, 2.9rem); line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.net-value .cur { font-size: 1rem; opacity: .9; direction: rtl; }
.net-sub { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; font-size: .9rem; opacity: .92; margin-top: .3rem; }
.net-sub b { font-variant-numeric: tabular-nums; }

.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 1.1rem 0 .6rem; background: var(--bg-2); gap: 2px; }
.stack span { display: block; height: 100%; }
.seg-net { background: var(--brand); }
.seg-c1 { background: var(--c1); } .seg-c2 { background: var(--c2); } .seg-c3 { background: var(--c3); } .seg-c4 { background: var(--c4); }
.seg-c5 { background: var(--c5); } .seg-c6 { background: var(--c6); } .seg-c7 { background: var(--c7); } .seg-c8 { background: var(--c8); }
.legend { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { font-weight: 600; font-variant-numeric: tabular-nums; }

.ps-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.ps-summary span { background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2); border-radius: 8px; padding: .15rem .6rem; font-size: .82rem; }
.ps-tables { display: grid; gap: 1rem; }
.ps-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ps-table caption { text-align: start; font-weight: 700; padding-bottom: .4rem; }
.ps-table caption small { color: var(--muted); font-weight: 400; }
.ps-table th { text-align: start; font-weight: 400; color: var(--ink-2); padding: .45rem 0; border-bottom: 1px solid var(--line); }
.ps-table td { padding: .45rem 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.ps-table tfoot th, .ps-table tfoot td { font-weight: 700; color: var(--ink); border-bottom: 0; border-top: 2px solid var(--line-2); }
.ps-deductions td { color: var(--danger); }
.ps-deductions tfoot td { color: var(--danger); }
.ps-totals { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 1.1rem 0; }
.ps-totals div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; }
.ps-totals dt { font-size: .8rem; color: var(--muted); }
.ps-totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.ps-totals .em { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.ps-totals .em dd { color: var(--brand); }
.ps-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.ps-note { margin: 1rem 0 0; }

.mobile-net { display: none; }
@media (max-width: 980px) {
  .mobile-net.show {
    display: flex; position: fixed; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40; align-items: center; gap: .75rem;
    background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: 14px; box-shadow: var(--shadow-lg);
  }
  .mobile-net b { font-size: 1.2rem; direction: ltr; font-variant-numeric: tabular-nums; margin-inline-end: auto; }
  .mobile-net a { color: var(--bg); font-weight: 600; }
}

/* ---- tables / content ------------------------------------------------------ */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.data-table th, .data-table td { padding: .6rem .85rem; border-bottom: 1px solid var(--line); text-align: start; }
.data-table thead th { background: var(--surface-2); font-weight: 600; color: var(--ink-2); position: sticky; top: 0; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .em { color: var(--brand); font-weight: 700; }
.data-table tr.total td { font-weight: 700; }
.data-table tr.neg td.num { color: var(--danger); }
.grade-table { margin-bottom: .75rem; }
.grade-table summary { cursor: pointer; font-weight: 600; padding: .65rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; list-style: none; }
.grade-table summary::-webkit-details-marker { display: none; }
.grade-table summary::before { content: "+"; display: inline-block; width: 1.3rem; color: var(--brand); font-weight: 700; }
.grade-table[open] summary::before { content: "−"; }
.grade-table[open] summary { border-radius: 12px 12px 0 0; border-bottom-color: transparent; }
.grade-table[open] .table-scroll { border-radius: 0 0 12px 12px; }

.faq { margin-top: 3rem; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; }
.faq-item summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand); font-weight: 700; font-size: 1.2rem; line-height: 1; }
.faq-item[open] summary::after { content: "−"; }
.faq-a { padding: 0 1.1rem .9rem; color: var(--ink-2); }
.faq-a p:last-child { margin-bottom: 0; }

.related .chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips a { display: inline-block; padding: .4rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-size: .92rem; }
.chips a:hover { border-color: var(--brand); color: var(--brand); }

.article h2 { margin-top: 2.2rem; }
.article ul { padding-inline-start: 1.2rem; }
.article li { margin-bottom: .4rem; }
.formula { direction: rtl; background: var(--accent-soft); border-inline-start: 4px solid var(--accent); padding: .9rem 1.1rem; border-radius: 10px; font-weight: 700; font-size: 1.05rem; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.2rem; margin-bottom: 1rem; }
.toc ol { margin: 0; padding-inline-start: 1.2rem; columns: 2; column-gap: 2rem; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 60;
  background: var(--ink); color: var(--bg); padding: .65rem 1.1rem; border-radius: 10px; font-weight: 500; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- print: an official-looking payslip -------------------------------------- */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #222; --muted: #555; --line: #ccc; --line-2: #999; --brand: #0b5d4b; --brand-soft: #eef6f3; }
  body { background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .breadcrumbs, .page-head .lead, .sim-main, .section-sub, .faq, .no-print, .skip-link, .mobile-net, .legend, .stack { display: none !important; }
  .sim-layout { display: block; }
  .sim-result { position: static; box-shadow: none; border: 1px solid #999; max-height: none; overflow: visible; }
  .net-hero { background: #fff !important; color: #000; border: 2px solid #0b5d4b; box-shadow: none; }
  .page-head h1 { font-size: 16pt; }
}
