/* ============================================================================
   CHERT Economy — extensions to the shared CHERT site system (site.css / shell.css).
   Tokens only (chert-tokens.css); same motion, radii and surfaces as the sibling sites.
   ========================================================================== */

/* ---------- RTL: the sibling sites mirror the layout under dir="rtl" ---------- */
[dir="rtl"] .sx { text-align: right; }
[dir="rtl"] .sx-head { text-align: center; }
[dir="rtl"] .sx-node { text-align: right; }
[dir="rtl"] .sx-hero__field { -webkit-mask-image: linear-gradient(260deg, transparent 0%, black 62%); mask-image: linear-gradient(260deg, transparent 0%, black 62%); }
[dir="rtl"] .sx-tele { right: auto; left: 0; }
[dir="rtl"] .sx-life__controls .sx-iconbtn svg, [dir="rtl"] .sx-inspector__nav svg { transform: scaleX(-1); }

/* ---------- hero card: principle, not telemetry ---------- */
.ec-tele { width: calc(270 * var(--u)); }
.ec-tele .sx-tele__row + .sx-tele__row { margin-top: 4px; }
.ec-tele .sx-tele__value b { font-size: 24px; }
.ec-tele .sx-tele__foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--chert-dark-border); }

/* ---------- 12-stop wheel ---------- */
.ec-wheel .sx-stop { width: 50px; height: 50px; }
.ec-wheel .sx-wheel__t { font-size: 16px; max-width: 18ch; }
@media (max-width: 520px) { .ec-wheel .sx-stop { width: 38px; height: 38px; } .ec-wheel .sx-stop svg { width: 15px; height: 15px; } .ec-wheel .sx-wheel__t { font-size: 13px; } }

/* ---------- capability (brain) ---------- */
.ec-cap { position: relative; isolation: isolate; overflow: hidden; color: var(--chert-dark-text);
  background:
    radial-gradient(ellipse at 72% 30%, color-mix(in srgb, var(--chert-orange-deep) 20%, transparent), transparent 55%),
    radial-gradient(ellipse at 10% 100%, color-mix(in srgb, var(--chert-tan) 10%, transparent), transparent 50%),
    var(--chert-dark); }
[dir="rtl"] .ec-cap { background: radial-gradient(ellipse at 28% 30%, color-mix(in srgb, var(--chert-orange-deep) 20%, transparent), transparent 55%), var(--chert-dark); }
.ec-cap .sx-eyebrow { color: var(--chert-orange); }
.ec-cap__grid { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 1000px) { .ec-cap__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ec-cap__title { margin: 0 0 var(--space-5); font-size: clamp(36px, 5vw, 62px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; }
[lang="ar"] .ec-cap__title { line-height: 1.3; letter-spacing: normal; }
.ec-cap__title { background-image: linear-gradient(100deg, var(--chert-dark-text) 0%, var(--chert-dark-text) 40%, var(--chert-orange) 70%, var(--chert-tan) 100%);
  color: transparent; -webkit-background-clip: text; background-clip: text; }
.ec-cap__lead { max-width: 58ch; margin: 0 0 var(--space-6); font-size: var(--fs-lg); line-height: 1.7; color: var(--chert-dark-muted); }
.ec-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ec-steps li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--chert-dark-border);
  background: color-mix(in srgb, var(--chert-dark-surface) 70%, transparent); transition: border-color var(--dur-slow); }
.ec-steps li:hover { border-color: color-mix(in srgb, var(--chert-orange) 55%, transparent); }
.ec-steps b { display: block; font-size: 16px; }
.ec-steps span:not(.ec-step__icon) { font-size: 14px; color: var(--chert-dark-muted); }
.ec-step__icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--chert-orange);
  background: color-mix(in srgb, var(--chert-orange) 13%, transparent); }
.ec-brain { position: relative; aspect-ratio: 1.15; width: 100%; max-width: 620px; margin-inline: auto; }
.ec-brain canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.ec-cap__sub { margin: var(--space-9) 0 var(--space-5); font-size: 15px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--chert-dark-muted); }
[lang="ar"] .ec-cap__sub { letter-spacing: normal; }
.ec-pcards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.ec-pcard { padding: 28px; border-radius: 20px; border: 1px solid var(--chert-dark-border); background: var(--chert-dark-surface); }
.ec-pcard .sx-pillar__icon { background: color-mix(in srgb, var(--chert-orange) 14%, transparent); }
.ec-pcard:last-child { border-color: var(--chert-orange); background: linear-gradient(150deg, color-mix(in srgb, var(--chert-orange) 22%, var(--chert-dark-surface)), var(--chert-dark-surface) 70%); }
.ec-pcard:last-child .sx-pillar__icon { background: var(--chert-orange); color: var(--chert-ink); }
.ec-pcard h3 { margin: 18px 0 8px; font-size: 24px; }
.ec-pcard h3 em { display: block; font-style: normal; font-weight: 500; font-size: 16px; color: var(--chert-orange); margin-top: 2px; }
.ec-pcard p { margin: 0; color: var(--chert-dark-muted); }
.ec-quote { margin: var(--space-8) auto 0; max-width: 34ch; text-align: center; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.35; font-weight: 700; letter-spacing: -.02em; }
[lang="ar"] .ec-quote { letter-spacing: normal; line-height: 1.6; }
.ec-quote::before { content: ""; display: block; width: 48px; height: 3px; margin: 0 auto 22px; border-radius: 3px; background: var(--chert-orange); }

/* ---------- China ---------- */
.ec-china { background: radial-gradient(color-mix(in srgb, var(--chert-tan) 38%, transparent) 1px, transparent 1px) 0 0 / 22px 22px, var(--chert-surface-alt); }
.ec-kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 18px; }
@media (max-width: 899px) { .ec-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ec-kpi { display: flex; flex-direction: column; padding: 22px; border-radius: 20px; border: 1px solid var(--chert-border); background: var(--chert-surface); }
.ec-kpi:first-child { background: var(--chert-ink); color: var(--chert-cream); border-color: var(--chert-ink); }
.ec-kpi dd { margin: 0; font-size: clamp(36px, 4vw, 52px); line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--chert-orange-deep); }
.ec-kpi:first-child dd { color: var(--chert-orange); }
.ec-kpi dd small { font-size: 16px; font-weight: 700; letter-spacing: 0; margin-inline-start: 6px; color: inherit; opacity: .8; }
.ec-kpi dt { margin-top: 10px; font-size: var(--fs-sm); color: var(--chert-muted); }
.ec-kpi:first-child dt { color: var(--chert-dark-muted); }
.ec-panel { padding: clamp(20px, 3vw, 32px); border-radius: 24px; border: 1px solid var(--chert-border); background: var(--chert-surface);
  box-shadow: 0 30px 60px -44px color-mix(in srgb, var(--chert-ink) 45%, transparent); }
.ec-panel + .ec-panel, .ec-china__grid { margin-top: 18px; }
.ec-panel__h { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 19px; }
.ec-panel__h svg { color: var(--chert-orange-deep); }
.ec-panel__h4 { margin: var(--space-6) 0 14px; font-size: 16px; }
.ec-panel__h4 small { font-weight: 500; color: var(--chert-muted); font-size: 13px; margin-inline-start: 6px; }
.ec-panel__note { margin: 12px 0 0; font-size: 13.5px; color: var(--chert-muted); }
.ec-china__grid { display: grid; gap: 18px; }
@media (min-width: 960px) { .ec-china__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } .ec-china__grid .ec-panel { margin: 0; } }

/* timeline */
.ec-tl { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(112px, 1fr); gap: 14px; overflow-x: auto;
  padding-bottom: 6px; scroll-snap-type: x mandatory; }
.ec-tl::before { content: ""; position: absolute; inset-inline: 0; top: 37px; height: 2px; background: linear-gradient(90deg, var(--chert-orange), var(--chert-tan), var(--chert-border)); }
[dir="rtl"] .ec-tl::before { background: linear-gradient(-90deg, var(--chert-orange), var(--chert-tan), var(--chert-border)); }
.ec-tl li { position: relative; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; padding-top: 0; }
.ec-tl__y { font-family: var(--font-mono); font-weight: 700; font-size: 15px; color: var(--chert-orange-deep); }
.ec-tl li::after { content: ""; order: 1; width: 14px; height: 14px; margin: 6px 0 10px; border-radius: 50%; background: var(--chert-surface); border: 3px solid var(--chert-orange-deep); }
.ec-tl li:last-child::after { background: var(--chert-orange); animation: sx-ping 1.6s ease-out infinite; }
.ec-tl b { order: 2; font-size: 14.5px; line-height: 1.3; }
.ec-tl li > span:last-child { order: 3; font-size: 13px; line-height: 1.45; color: var(--chert-muted); }

/* cost bars */
.ec-legend { display: flex; gap: 18px; margin: 14px 0 6px; font-size: 13px; color: var(--chert-muted); }
.ec-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -1px; }
.ec-legend .c, .ec-bar__c { background: var(--chert-ink); }
.ec-legend .l, .ec-bar__l { background: linear-gradient(90deg, var(--chert-orange-deep), var(--chert-orange)); }
.ec-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ec-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.ec-bar__label { font-size: 14px; font-weight: 600; }
.ec-bar__v { font-family: var(--font-mono); font-size: 12.5px; color: var(--chert-muted); white-space: nowrap; }
.ec-bar__v b { color: var(--chert-ink); }
.ec-bar { grid-column: 1 / -1; display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--chert-border); }
.ec-bar i { display: block; height: 100%; width: 0; transition: width 1.2s var(--ease); }
.ec-bars.is-in .ec-bar__c { width: var(--c); }
.ec-bars.is-in .ec-bar__l { width: calc(100% - var(--c)); transition-delay: .35s; }
.ec-singles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
@media (max-width: 560px) { .ec-singles { grid-template-columns: 1fr; } }
.ec-single { padding: 14px; border-radius: 14px; background: var(--chert-orange-tint); }
.ec-single b { display: block; font-size: 24px; font-weight: 800; color: var(--chert-orange-deep); }
.ec-single span { font-size: 12.5px; line-height: 1.4; color: var(--chert-ink); }

/* results */
.ec-res { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.ec-res__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 14.5px; font-weight: 600; }
.ec-res__top b { font-size: 26px; font-weight: 800; color: var(--chert-orange-deep); white-space: nowrap; }
.ec-res__top b small { font-size: 14px; color: var(--chert-muted); }
.ec-res > li > small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--chert-muted); }
.ec-prog { display: block; height: 10px; border-radius: 5px; background: repeating-linear-gradient(90deg, var(--chert-border) 0 6px, transparent 6px 9px); }
.ec-prog i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, var(--chert-orange-deep), var(--chert-orange)); transition: width 1.3s var(--ease); }
.ec-res.is-in .ec-prog i { width: var(--p); }

/* R&D columns */
.ec-cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; height: 220px; }
.ec-cols li { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-align: center; }
.ec-col { position: relative; width: 100%; max-width: 64px; height: 140px; display: flex; align-items: flex-end; }
.ec-col i { display: block; width: 100%; height: 0; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--chert-orange), var(--chert-orange-deep)); transition: height 1.2s var(--ease); }
.ec-cols li:last-child .ec-col i { background: repeating-linear-gradient(45deg, var(--chert-orange) 0 6px, color-mix(in srgb, var(--chert-orange) 60%, var(--chert-surface)) 6px 12px); }
.ec-cols.is-in .ec-col i { height: var(--h); }
.ec-cols b { margin-top: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.ec-cols small { font-size: 12px; color: var(--chert-orange-deep); font-weight: 700; }
.ec-cols li > span:last-child { font-family: var(--font-mono); font-size: 12px; color: var(--chert-muted); }

.ec-facts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 18px; }
.ec-fact { padding: 20px; border-radius: 18px; border: 1px solid var(--chert-border); background: var(--chert-surface); }
.ec-fact b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--chert-ink); }
.ec-fact span { font-size: 13.5px; color: var(--chert-muted); }
.ec-china__foot { max-width: 820px; margin: var(--space-7) auto 0; text-align: center !important; font-size: var(--fs-lg); line-height: 1.6; }
.ec-china__foot a { color: var(--chert-orange-deep); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* ---------- architecture: 7 categories ---------- */
@media (min-width: 1100px) {
  .ec-diagram { grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr) 200px;
    grid-template-areas: "infra onprem onprem hw" "infra shared shared hw" "infra rnd rnd hw" "infra edu club hw"; }
  .sx-layer--infra { grid-area: infra; } .sx-layer--onprem { grid-area: onprem; } .sx-layer--shared { grid-area: shared; }
  .sx-layer--rnd { grid-area: rnd; } .sx-layer--edu { grid-area: edu; } .sx-layer--club { grid-area: club; } .sx-layer--hw { grid-area: hw; }
  .sx-layer--edu, .sx-layer--club { display: block; }
  .sx-layer--edu .sx-layer__head, .sx-layer--club .sx-layer__head { margin-bottom: 12px; }
}
.ec-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-inline-start: 6px; border-radius: 10px; vertical-align: 1px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--chert-ink); background: var(--chert-tan); }
.ec-live { flex: none; width: 8px; height: 8px; margin-inline-start: auto; border-radius: 50%; background: var(--chert-success); animation: sx-blink 1.6s ease-in-out infinite; }
.ec-arch__note { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-size: 13.5px; color: var(--chert-dark-muted); }
.ec-arch__note .ec-live { margin: 0; }

/* ---------- programs ---------- */
@media (min-width: 1100px) { .ec-pillars4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ec-pillars4 .sx-pillar { display: flex; flex-direction: column; }
.ec-link { margin-top: auto; padding-top: 16px; font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--chert-orange-deep); text-decoration: none; }
.ec-link:hover { text-decoration: underline; }

/* ---------- books ---------- */
.ec-books { background: var(--chert-cream); }
.ec-books__grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }
.ec-book { display: flex; flex-direction: column; padding: 26px; border-radius: 24px; border: 1px solid var(--chert-border); background: var(--chert-surface);
  transition: translate var(--dur-slow) var(--ease), box-shadow var(--dur-slow), border-color var(--dur-slow), opacity .8s var(--ease), transform .8s var(--ease); }
.ec-book:hover { translate: 0 -4px; box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--chert-orange) 50%, var(--chert-border)); }
.ec-cover { perspective: 1200px; height: 300px; display: grid; place-items: center; margin: -6px -6px 22px; border-radius: 18px;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--chert-orange) 16%, transparent), transparent 65%), var(--chert-surface-alt); }
.ec-cover__face { position: relative; width: 176px; height: 252px; padding: 18px 16px; display: flex; flex-direction: column; overflow: hidden; border-radius: 3px 10px 10px 3px;
  transform: rotateY(-16deg) rotateX(3deg); transition: transform .8s var(--ease); color: var(--chert-dark-text);
  box-shadow: 18px 24px 40px -18px color-mix(in srgb, var(--chert-ink) 70%, transparent), inset 4px 0 0 rgba(255,255,255,.08), inset 10px 0 16px -8px rgba(0,0,0,.4); }
[dir="rtl"] .ec-cover__face { transform: rotateY(16deg) rotateX(3deg); border-radius: 10px 3px 3px 10px; }
.ec-book:hover .ec-cover__face { transform: rotateY(-4deg); }
[dir="rtl"] .ec-book:hover .ec-cover__face { transform: rotateY(4deg); }
.ec-cover--economy .ec-cover__face { background: linear-gradient(160deg, var(--chert-dark-surface), var(--chert-dark)); }
.ec-cover--china .ec-cover__face { background: linear-gradient(160deg, var(--chert-orange-deep), color-mix(in srgb, var(--chert-orange-deep) 55%, var(--chert-ink))); }
.ec-cover--simulator .ec-cover__face { background: linear-gradient(160deg, var(--chert-cream), var(--chert-tan)); color: var(--chert-ink); }
.ec-cover__art { position: absolute; inset: 0; pointer-events: none; }
.ec-cover--economy .ec-cover__art { background: repeating-linear-gradient(0deg, transparent 0 16px, color-mix(in srgb, var(--chert-orange) 14%, transparent) 16px 17px),
  radial-gradient(circle at 75% 25%, color-mix(in srgb, var(--chert-orange) 45%, transparent), transparent 45%); }
.ec-cover--china .ec-cover__art { background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,.1) 18px 19px), radial-gradient(circle at 30% 25%, rgba(255,255,255,.3), transparent 45%); }
.ec-cover--simulator .ec-cover__art { background: linear-gradient(transparent 58%, var(--chert-orange) 58% 60%, transparent 60%), repeating-linear-gradient(0deg, transparent 0 20px, rgba(26,26,24,.07) 20px 21px); }
.ec-cover__face img { position: relative; width: 26px; height: 26px; }
.ec-cover__face h4 { position: relative; margin: auto 0 8px; font-size: 21px; line-height: 1.12; font-weight: 800; }
.ec-cover__face p { position: relative; margin: 0 0 12px; font-size: 10.5px; line-height: 1.4; opacity: .8; }
.ec-cover__face span { position: relative; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
[lang="ar"] .ec-cover__face span { letter-spacing: normal; font-size: 11px; }
.ec-book__body { display: flex; flex-direction: column; flex: 1; }
.ec-book__body .sx-eyebrow { margin-bottom: 8px; }
.ec-book__body h3 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; }
.ec-book__sub { margin: 0 0 12px; font-weight: 600; color: var(--chert-muted); font-size: 15px; }
.ec-book__body > p:not(.sx-eyebrow):not(.ec-book__sub) { margin: 0 0 16px; color: var(--chert-ink); font-size: 15px; line-height: 1.6; }
.ec-book__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: auto 0 16px; padding-top: 14px; border-top: 1px solid var(--chert-border);
  font-size: 13px; color: var(--chert-muted); }
.ec-book__langs { font-weight: 700; color: var(--chert-orange-deep); }
.ec-book .sx-btn-ghost { align-self: flex-start; }

/* ---------- evidence ---------- */
.ec-evidence { background: var(--chert-cream); }
.ec-evls { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-bottom: var(--space-7); }
.ec-evl { padding: 22px; border-radius: 18px; border: 1px solid var(--chert-border); background: var(--chert-surface); }
.ec-evl p { margin: 14px 0 0; font-size: 14.5px; color: var(--chert-muted); }
.ec-tag { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; border: 1px solid currentColor; }
.ec-tag--0 { color: var(--chert-success); } .ec-tag--1 { color: color-mix(in srgb, var(--chert-tan) 60%, var(--chert-ink)); }
.ec-tag--2 { color: var(--chert-info); } .ec-tag--3 { color: var(--chert-orange-deep); }
.ec-ev2 { display: grid; gap: var(--space-7); }
@media (min-width: 900px) { .ec-ev2 { grid-template-columns: 1.4fr 1fr; } }
.ec-ev2 h3 { margin: 0 0 16px; font-size: 22px; }
.ec-hyp { list-style: none; margin: 0; padding: 0; }
.ec-hyp li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--chert-border); }
.ec-hyp li span { font-family: var(--font-mono); font-weight: 700; color: var(--chert-orange-deep); }
.ec-launch { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: l; }
.ec-launch li { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--chert-surface); border: 1px solid var(--chert-border); font-weight: 600; }
.ec-launch li span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--chert-ink); color: var(--chert-orange); font-family: var(--font-mono); font-size: 13px; }
.ec-launch li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 34px; bottom: -11px; width: 2px; height: 12px; background: var(--chert-orange-deep); }

/* ---------- join ---------- */
.ec-join { text-align: start !important; }
.ec-join__grid { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 980px) { .ec-join__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.ec-join .sx-eyebrow { color: var(--chert-orange); }
.ec-join__text h2 { margin: 0 0 var(--space-4); }
.ec-join__text p { margin: 0 0 var(--space-6) !important; max-width: 54ch; line-height: 1.7; }
.ec-form { display: grid; gap: 16px; padding: clamp(22px, 3vw, 34px); border-radius: 24px; text-align: start;
  border: 1px solid var(--chert-dark-border); background: color-mix(in srgb, var(--chert-dark-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow-modal); }
.ec-form__row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.ec-form label, .ec-form fieldset { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ec-form .label { color: var(--chert-dark-muted); font-size: 13px; font-weight: 600; padding: 0; margin: 0 0 2px; }
.ec-form .input { width: 100%; background: var(--chert-dark); border: 1px solid var(--chert-dark-border); color: var(--chert-dark-text); border-radius: 12px; padding: 12px 14px; font: inherit; }
.ec-form .input:focus { outline: none; border-color: var(--chert-orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chert-orange) 25%, transparent); }
.ec-form .input.is-err { border-color: var(--chert-error); }
.ec-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ec-pill { position: relative; display: inline-block !important; }
.ec-pill input { position: absolute; opacity: 0; pointer-events: none; }
.ec-pill span { display: inline-block; padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--chert-dark-border); font-size: 13.5px; font-weight: 600;
  color: var(--chert-dark-muted); cursor: pointer; transition: border-color var(--dur-base), background-color var(--dur-base), color var(--dur-base); }
.ec-pill span:hover { border-color: var(--chert-orange); }
.ec-pill input:checked + span { background: var(--chert-orange); border-color: var(--chert-orange); color: var(--chert-ink); }
.ec-pill input:focus-visible + span { outline: 2px solid var(--chert-orange); outline-offset: 2px; }
.ec-form .btn { justify-self: start; }
.ec-form__ok { margin: 0 !important; font-size: 14px; color: var(--chert-success) !important; min-height: 1em; }

/* RTL: the shared skip-link parks at left:-9999px, which becomes scrollable overflow under dir=rtl */
[dir="rtl"] .skip-link { left: auto; right: 0; border-radius: 0 0 0 var(--radius-sm); transform: translateY(-120%); }
[dir="rtl"] .skip-link:focus { transform: none; }
.ec-short { display: none; }
@media (max-width: 560px) { .ec-long { display: none; } .ec-short { display: inline; } }

/* ---------- books: real cover pages ---------- */
.ec-cover { height: 340px; }
.ec-cover__img { width: auto; height: 290px; border-radius: 3px 8px 8px 3px; transform: rotateY(-14deg) rotateX(3deg); transition: transform .8s var(--ease);
  box-shadow: 18px 24px 40px -18px color-mix(in srgb, var(--chert-ink) 70%, transparent), inset 4px 0 0 rgba(255,255,255,.1); }
[dir="rtl"] .ec-cover__img { transform: rotateY(14deg) rotateX(3deg); border-radius: 8px 3px 3px 8px; }
.ec-book:hover .ec-cover__img { transform: rotateY(-3deg) scale(1.02); }
[dir="rtl"] .ec-book:hover .ec-cover__img { transform: rotateY(3deg) scale(1.02); }
.ec-books__grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
@media (min-width: 1100px) { .ec-books__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ec-book { grid-column: span 2; } .ec-book:nth-child(4) { grid-column: 2 / span 2; } }
.ec-book__meta span:first-child { font-weight: 600; color: var(--chert-ink); }

/* ---------- sovereignty (banner adapted from chertos.com) ---------- */
.ec-sov { position: relative; color: var(--chert-dark-text); background: var(--chert-dark); }
.ec-sov__banner { position: relative; isolation: isolate; overflow: hidden; min-height: min(92vh, 860px); display: flex; align-items: center; }
.ec-sov__media { position: absolute; inset: 0; z-index: -3; }
.ec-sov__media img { position: absolute; right: 0; top: 50%; height: 86%; width: auto; max-width: none; translate: 0 -50%; will-change: transform;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%), linear-gradient(180deg, transparent 0%, #000 16%, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0%, #000 28%), linear-gradient(180deg, transparent 0%, #000 16%, #000 80%, transparent 100%);
  mask-composite: intersect; }
[dir="rtl"] .ec-sov__media img { right: auto; left: 0; transform: scaleX(-1); }
@media (max-width: 899px) { .ec-sov__media img { width: 140%; height: auto; right: -20%; top: 0; translate: none; opacity: .6; } [dir="rtl"] .ec-sov__media img { left: -20%; } }
.ec-sov__scrim { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--chert-dark) 0%, color-mix(in srgb, var(--chert-dark) 88%, transparent) 30%, transparent 62%),
              linear-gradient(0deg, var(--chert-dark) 0%, transparent 28%), linear-gradient(180deg, var(--chert-dark) 0%, transparent 18%),
              radial-gradient(ellipse at 70% 40%, color-mix(in srgb, var(--chert-orange-deep) 12%, transparent), transparent 60%); }
.ec-sov__overlay > * { max-width: min(560px, 46%); }
@media (max-width: 899px) { .ec-sov__overlay > * { max-width: none; } .ec-sov__banner { align-items: flex-end; } }
[dir="rtl"] .ec-sov__scrim { background: linear-gradient(270deg, var(--chert-dark) 0%, color-mix(in srgb, var(--chert-dark) 88%, transparent) 30%, transparent 62%),
              linear-gradient(0deg, var(--chert-dark) 0%, transparent 28%), linear-gradient(180deg, var(--chert-dark) 0%, transparent 18%); }
@media (max-width: 899px) { .ec-sov__scrim, [dir="rtl"] .ec-sov__scrim { background: linear-gradient(0deg, var(--chert-dark) 5%, color-mix(in srgb, var(--chert-dark) 55%, transparent) 60%, var(--chert-dark) 100%); } }
/* clouds come and go: soft banks drifting across the mountain */
.ec-sov__clouds { position: absolute; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.ec-sov__clouds span { position: absolute; width: 70vw; height: 34vh; border-radius: 50%; filter: blur(38px); opacity: .55;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--chert-tan) 70%, transparent), transparent 70%);
  animation: ec-drift 46s linear infinite; }
.ec-sov__clouds span:nth-child(1) { top: 52%; left: -70vw; }
.ec-sov__clouds span:nth-child(2) { top: 18%; left: -70vw; height: 26vh; opacity: .35; animation-duration: 64s; animation-delay: -22s; }
.ec-sov__clouds span:nth-child(3) { top: 70%; left: -70vw; height: 22vh; opacity: .45; animation-duration: 38s; animation-delay: -30s; }
@keyframes ec-drift { from { transform: translateX(0); } to { transform: translateX(240vw); } }
.ec-sov__overlay { position: relative; padding-block: var(--space-9); }
.ec-sov .sx-eyebrow { color: var(--chert-orange); }
.ec-sov__title { margin: 0 0 var(--space-5); max-width: 12ch; font-size: clamp(42px, 6.6vw, 92px); line-height: .98; letter-spacing: -.04em; font-weight: 800; }
[lang="ar"] .ec-sov__title { line-height: 1.3; letter-spacing: normal; max-width: 14ch; }
.ec-sov__title span { display: block; font-weight: 500; color: color-mix(in srgb, var(--chert-dark-text) 72%, transparent); font-size: .62em; letter-spacing: -.02em; margin-bottom: .1em; }
.ec-sov__title b { display: block; color: transparent; -webkit-background-clip: text; background-clip: text; background-size: 200% 100%;
  background-image: linear-gradient(100deg, var(--chert-cream) 0%, var(--chert-tan) 40%, var(--chert-orange) 80%); animation: sx-shimmer 8s ease-in-out infinite alternate; }
.ec-sov__title b::after { content: ""; display: block; width: 3.2em; height: .09em; margin-top: .14em; border-radius: .1em;
  background: linear-gradient(90deg, var(--chert-orange), transparent); }
[dir="rtl"] .ec-sov__title b::after { background: linear-gradient(-90deg, var(--chert-orange), transparent); }
.ec-sov__lead { max-width: 52ch; margin: 0; font-size: var(--fs-lg); line-height: 1.7; color: var(--chert-dark-muted); }
.ec-sov__body { padding-bottom: var(--space-9); }
.ec-svls { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin-top: calc(-1 * var(--space-7)); position: relative; }
.ec-svl { position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 20px; border: 1px solid var(--chert-dark-border);
  background: color-mix(in srgb, var(--chert-dark-surface) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color var(--dur-slow), translate var(--dur-slow) var(--ease), opacity .8s var(--ease), transform .8s var(--ease); }
.ec-svl:hover { border-color: color-mix(in srgb, var(--chert-orange) 55%, transparent); translate: 0 -4px; }
.ec-svl__n { position: absolute; top: 20px; inset-inline-end: 22px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--chert-dark-muted); }
.ec-svl h3 { margin: 16px 0 8px; font-size: 19px; }
.ec-svl p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--chert-dark-muted); }
.ec-svchips { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 0; list-style: none; }
.ec-svchip { display: inline-flex; padding: 4px 11px; border-radius: var(--radius-pill); border: 1px solid var(--chert-dark-border); background: var(--chert-dark);
  color: var(--chert-dark-text); text-decoration: none; font-size: 12.5px; font-weight: 600; transition: border-color var(--dur-base), color var(--dur-base); }
.ec-svchip:hover { border-color: var(--chert-orange); color: var(--chert-orange); }
.ec-cmp { margin-top: var(--space-6); padding: clamp(22px, 3vw, 36px); border-radius: 24px; border: 1px solid var(--chert-dark-border);
  background: linear-gradient(150deg, color-mix(in srgb, var(--chert-orange-deep) 12%, var(--chert-dark-surface)), var(--chert-dark-surface) 60%); }
.ec-cmp h3 { margin: 0 0 18px; font-size: clamp(22px, 2.4vw, 28px); }
.ec-cmp__head, .ec-cmp li { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: center; gap: 10px; }
.ec-cmp__head { padding: 0 16px 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--chert-dark-muted); }
[lang="ar"] .ec-cmp__head { letter-spacing: normal; font-size: 13px; }
.ec-cmp__head span { display: inline-flex; align-items: center; gap: 8px; }
.ec-cmp__head span:last-child { color: var(--chert-orange); }
.ec-cmp ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ec-cmp li { padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--chert-dark) 70%, transparent); border: 1px solid var(--chert-dark-border); }
.ec-cmp__c { color: var(--chert-dark-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--chert-dark-muted) 45%, transparent); }
.ec-cmp__arrow { text-align: center; color: var(--chert-orange); font-weight: 700; }
.ec-cmp__m { font-weight: 700; color: var(--chert-dark-text); }
.ec-cmp__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--chert-dark-border); }
.ec-cmp__cta p { margin: 0; font-size: clamp(18px, 2vw, 24px); font-weight: 800; letter-spacing: -.02em; }
[lang="ar"] .ec-cmp__cta p { letter-spacing: normal; }
@media (max-width: 560px) { .ec-cmp__head, .ec-cmp li { grid-template-columns: 1fr; gap: 4px; } .ec-cmp__arrow, .ec-cmp__head span:nth-child(2) { display: none; } .ec-cmp__head { display: none; } }
.ec-sov__overlay { width: 100%; }
@media (min-width: 900px) {
  .ec-sov__media img { right: -7%; height: 82%; }
  [dir="rtl"] .ec-sov__media img { right: auto; left: -7%; }
  .ec-sov__overlay > * { max-width: min(520px, 41%); }
  .ec-sov__lead { text-shadow: 0 1px 12px var(--chert-dark); }
}
@media (min-width: 900px) { .ec-sov__overlay > .ec-sov__title { max-width: 720px; font-size: clamp(40px, 5.4vw, 80px); } }

/* inspector: open the system's own website */
.ec-visit { grid-column: 1; justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 16px; border-radius: var(--radius-pill);
  background: var(--chert-orange); color: var(--chert-ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 700;
  transition: background-color var(--dur-base), transform var(--dur-base); }
.ec-visit:hover { background: var(--chert-orange-deep); transform: translateY(-1px); }
.ec-visit b { font-family: var(--font-mono); font-weight: 700; }
.ec-visit[hidden] { display: none; }

/* inspector end column: visit button (+ journey arrows) balanced against the text */
.ec-side { grid-column: 2; grid-row: 1 / span 4; align-self: center; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; padding-inline-start: 24px;
  border-inline-start: 1px solid var(--chert-dark-border); min-height: 64px; justify-content: center; }
.ec-side:not(:has(> :not([hidden]))) { display: none; }
.ec-side .ec-visit { margin: 0; white-space: nowrap; }
.ec-side .sx-inspector__nav { grid-column: auto; grid-row: auto; align-self: auto; }
@media (max-width: 639px) {
  .ec-side { grid-column: 1 / -1; grid-row: auto; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap;
    margin-top: 10px; padding: 10px 0 0; border-inline-start: 0; border-top: 1px solid var(--chert-dark-border); min-height: 0; }
}
