/*!
 * saudi.html — السوق السعودي (page styles). Tokens only, both themes. Loaded after style.css.
 * hero · pulse + chart · heat / sectors / breadth / volume · stocks · related (TradingView) · news · guide · tools
 */

/* ---------- shared bits ---------- */
.sa-kv { display: grid; grid-template-columns: repeat(var(--kv-cols, 3), minmax(0, 1fr)); gap: 8px; margin: 0; }
.sa-kv > div { min-width: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.sa-kv dt { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); line-height: 1.45; }
.sa-kv dd { margin: 4px 0 0; font-family: var(--font-head); font-size: 17px; font-weight: 700; line-height: 1.3; }
.sa-kv dd small { display: block; margin-top: 2px; font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--text-3); }
.sa-kv dd .chg { font-family: var(--font-body); }
.sa-note { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--sp-4); font-size: 12.5px; line-height: 1.75; color: var(--text-3); }
.sa-note .icon { flex: none; margin-top: 4px; }
.sa-note--after { margin-top: var(--sp-3); }
.sa-skel-bar { height: 8px; margin: 6px 0 16px; }
.sa-inline-link { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: .25em; }
.sa-inline-link:hover { text-decoration-color: currentColor; }

/* ---------- hero ---------- */
.sa-hero__grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "top aside" "summary aside" "session aside" "nav aside";
  grid-template-rows: auto auto auto 1fr;
  align-items: start; gap: var(--sp-5) var(--sp-12);
}
.sa-hero__top { grid-area: top; min-width: 0; }
.sa-hero__aside { grid-area: aside; min-width: 0; }
.sa-hero__session { grid-area: session; min-width: 0; }
.sa-hero__summary { grid-area: summary; min-width: 0; }
.sa-summary { max-width: 62ch; padding-inline-start: 14px; border-inline-start: 3px solid var(--saudi); }
.sa-summary__k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--saudi-ink); line-height: 1.5; }
.sa-summary__t { margin-top: 4px; font-size: 15px; line-height: 1.9; color: var(--text-2); }
.sa-summary__t .skel { display: block; }
.sa-summary__t:has(.skel) { min-height: 57px; }
.sa-skel-short { width: 62%; }
.sa-summary__t b { color: var(--text); font-weight: 600; }
.sa-summary__t .chg { height: auto; }
.sa-hero__nav { grid-area: nav; min-width: 0; align-self: end; }
.sa-hero__title { font-size: var(--fs-hero); line-height: 1.22; letter-spacing: -.005em; }
.sa-hero .page-hero__lead { max-width: 46ch; }
.sa-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: var(--sp-5); }

.sa-tasi { box-shadow: var(--shadow-lg); }
.sa-tasi__code { display: inline-block; margin-inline-start: 6px; padding: 0 8px; border-radius: 8px; vertical-align: 3px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; line-height: 1.7; color: var(--on-vivid); background: color-mix(in srgb, var(--on-vivid) 16%, transparent); }
.sa-tasi .mcard__chart { height: 100px; }
.sa-tasi .mcard__body { padding-top: 2px; }
.sa-tasi .range { padding-top: 12px; }
/* the two ranges and the stats row keep their final height while saudi.js fills them (no shift of the hero) */
.sa-tasi__ranges { min-height: 159px; }
.sa-tasi__stats { --kv-cols: 3; margin-top: 16px; }
.sa-tasi__stats:empty { min-height: 69px; }
.sa-skel-px { display: inline-block; width: 210px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--on-vivid) 16%, transparent); }
.sa-skel-px::after { display: none; }
.sa-na-vivid { font-size: 22px; color: var(--on-vivid-2); }

.sa-session .status-card__name .icon { width: 14px; height: 14px; color: var(--text-3); }
.sa-session .status-card:not([data-status]) .status-card__state { color: var(--text); }

.sa-jump ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sa-jump a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 15px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 72%, transparent);
  font-size: 13.5px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.sa-jump a:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.sa-jump__n { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--saudi-ink); }
@media (min-width: 1100px) {
  .sa-hero__nav { padding: 6px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 62%, transparent); }
  .sa-hero__nav ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .sa-hero__nav a { display: flex; border: 0; border-radius: 12px; background: transparent; padding: 0 12px; }
  .sa-hero__nav a:hover { background: var(--surface-2); border-color: transparent; }
}

/* ---------- 01 pulse + chart ---------- */
.sa-pulse__panel {
  background:
    radial-gradient(80% 55% at 95% 0%, color-mix(in srgb, var(--saudi) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--surface) 58%, transparent);
}
html[data-theme="light"] .sa-pulse__panel {
  background: radial-gradient(80% 55% at 95% 0%, color-mix(in srgb, var(--saudi) 11%, transparent), transparent 70%), var(--surface);
  box-shadow: var(--shadow);
}
.sa-chart { display: flex; flex-direction: column; }
.sa-chart [data-history] { --chart-h: 300px; }
.sa-chart__stats { --kv-cols: 4; margin-top: var(--sp-4); }
.sa-chart__stats dd { font-size: 16px; }
.sa-athigh { font-family: var(--font-body); font-size: 15px; font-weight: 700; color: var(--text); }

/* ---------- 02 heat / sectors / breadth / volume ---------- */
.sa-heat .heat { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sa-movers .movers { height: 100%; grid-template-columns: minmax(0, 1fr); }

.sa-sectors { display: flex; flex-direction: column; }
.sa-sectors__head { flex-wrap: wrap; align-items: flex-start; }
.sa-sectors__head .tile__sub { margin-top: 2px; }
.sa-sectors .segmented { flex: none; }
.sa-sectors .sa-note { margin-top: auto; padding-top: var(--sp-4); }
.sec { --sec-cols: minmax(150px, 1.1fr) minmax(110px, 1fr) 92px minmax(180px, 1.35fr); }
.sec__head, .sec__row { display: grid; grid-template-columns: var(--sec-cols); align-items: center; gap: 16px; }
.sec__head { padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-3); }
.sec__list { list-style: none; margin: 0; padding: 0; }
.sec__row { min-height: 56px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.sec__row:last-child { border-bottom: 0; }
.sec__id { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.sec__name {
  min-height: 30px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14.5px; font-weight: 700; line-height: 1.45; text-align: start;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text-3) 45%, transparent); text-underline-offset: .35em;
}
.sec__name:hover { text-decoration-color: currentColor; }
.sec__count { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.sec__only { display: none; }
.sec__bar { position: relative; height: 10px; border-radius: 6px; background: var(--surface-3); direction: ltr; }
.sec__bar::before { content: ""; position: absolute; left: 50%; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--border-strong); }
.sec__fill { position: absolute; top: 0; bottom: 0; min-width: 3px; border-radius: 6px; }
.sec__fill--up { left: 50%; background: var(--pos); }
.sec__fill--down { right: 50%; background: var(--neg); }
.sec__chg .chg { min-width: 84px; justify-content: center; }
.sec__ext { display: grid; gap: 1px; min-width: 0; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.sec__mv { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.sec__ext .sec__k { flex: none; color: var(--text-3); }
.sec__nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sec__mv .chg { flex: none; }
.sec__ext .chg { height: auto; }

.sa-breadth__counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; font-size: 14px; color: var(--text-2); }
.sa-breadth__counts b { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin-inline-end: 4px; }
.sa-breadth__bar { display: flex; gap: 3px; height: 12px; margin: 12px 0 16px; }
.sa-breadth__bar span { min-width: 6px; border-radius: 6px; }
.sa-breadth__bar .up { background: var(--pos); }
.sa-breadth__bar .down { background: var(--neg); }
.sa-breadth__bar .flat { background: var(--flat); }
.sa-hist { margin: 4px 0 16px; }
.sa-hist__title { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.sa-hist__bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 6px; height: 92px; direction: ltr; }
.sa-hist__col { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; text-align: center; }
.sa-hist__col b { font-size: 12px; font-weight: 700; color: var(--text-2); line-height: 1.5; }
.sa-hist__col i { display: block; min-height: 3px; border-radius: 6px 6px 3px 3px; background: var(--flat); }
.sa-hist__col--down i { background: var(--neg); }
.sa-hist__col--up i { background: var(--pos); }
.sa-hist__col--zero i { background: var(--surface-3); }
.sa-hist__axis { position: relative; height: 22px; margin-top: 6px; border-top: 1px solid var(--border-strong); direction: ltr; }
.sa-hist__axis span { position: absolute; top: 4px; transform: translateX(-50%); font-size: 12px; line-height: 1.4; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sa-rows { display: grid; gap: 0; margin: 0; }
.sa-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-top: 1px solid var(--border); }
.sa-rows dt { font-size: 13.5px; color: var(--text-2); }
.sa-rows dd { margin: 0; }

/* half-width tiles on tablets: let the subtitle drop under the title instead of squeezing both into two lines */
.sa-breadth .tile__head, .sa-volume .tile__head { flex-wrap: wrap; row-gap: 2px; }
.sa-breadth .tile__title, .sa-volume .tile__title { white-space: nowrap; }
.sa-vol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sa-vol li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 12px; }
.sa-vol__name { min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-vol__code { margin-inline-start: 8px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-3); }
.sa-vol__v { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.sa-vol__bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.sa-vol__bar i { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--text-2) 70%, transparent); }

/* ---------- 03 stocks ---------- */
.sa-filter-bar { display: grid; gap: 8px; margin-bottom: var(--sp-4); }
.sa-filter .fchip { min-height: 44px; }
.sa-filter-status { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.6; }
.sa-filter-status:focus { outline: none; }
.sa-stocks .table caption.sa-cap { padding: 16px 18px 14px; font-weight: 400; }
.sa-cap__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.sa-cap__t { font-family: var(--font-head); font-size: 17px; font-weight: 700; line-height: 1.5; }
.sa-cap__meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
/* touch: style.css gives section actions, breadcrumbs, chips, sort buttons and quote links their 44px targets */
@media (pointer: coarse) {
  .sec__name { min-height: 44px; }
}

/* ---------- 04 related (TradingView) ---------- */
.sa-rel__item { margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sa-rel__cap { padding-inline: 4px; }
.sa-rel__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-family: var(--font-head); font-size: 17px; font-weight: 700; line-height: 1.5; }
.sa-rel__title [lang="en"]:not(.sa-rel__sym) { font-family: var(--font-head); }
.sa-rel__sym { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-3); }
.sa-rel__cap p { margin-top: 6px; font-size: 14px; line-height: 1.85; color: var(--text-2); }

/* ---------- 05 news ---------- */
.sa-news > [data-news] { display: flex; flex-direction: column; min-width: 0; }
.sa-news > [data-news] > * { flex: 1 1 auto; }
.sa-news .news-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.sa-news__more { display: none; margin-top: var(--gap); }

/* ---------- 06 guide: trading day ---------- */
.sa-day { padding: clamp(18px, 2.6vw, 32px); }
.sa-day__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.sa-day__title { font-family: var(--font-head); font-size: clamp(20px, .8vw + 15px, 26px); font-weight: 700; line-height: 1.4; }
.sa-day__sub { margin-top: 4px; font-size: 14px; color: var(--text-3); line-height: 1.6; }
.sa-day__now {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; font-weight: 600; line-height: 1.5; color: var(--text);
}
.sa-day__now-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--sc, var(--text-3)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc, var(--text-3)) 22%, transparent); }
.sa-day__fig { margin: var(--sp-6) 0 0; }
.sa-day__svg { position: relative; min-height: 88px; }
.sa-day__svg svg { display: block; width: 100%; height: auto; overflow: visible; }
.sa-day__fig .figure__caption { margin-top: 6px; }
.sa-ph { fill: var(--surface-3); }
.sa-ph--auction { fill: color-mix(in srgb, var(--warn) 26%, var(--surface)); }
.sa-ph--tal { fill: color-mix(in srgb, var(--warn) 13%, var(--surface)); }
.sa-ph--open { fill: color-mix(in srgb, var(--saudi) 30%, var(--surface)); }
.sa-ph.is-now { stroke: var(--text); stroke-width: 2; }
.sa-ph-n { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
.sa-ph-nt { font-family: var(--font-num); font-size: 12px; font-weight: 700; fill: var(--text); }
.sa-ph-label { font-family: var(--font-body); font-size: 13.5px; font-weight: 600; fill: var(--text); }
.sa-ph-dur { font-weight: 500; fill: var(--text-2); }
.sa-ph-time { font-family: var(--font-num); font-size: 12.5px; font-weight: 500; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.sa-ph-tick { stroke: var(--border-strong); stroke-width: 1.5; }
.sa-now-line { stroke: var(--text); stroke-width: 2; }
.sa-now-pill { fill: var(--brand); }
.sa-now-text { font-family: var(--font-body); font-size: 12px; font-weight: 700; fill: var(--brand-ink); }

.sa-phases { list-style: none; margin: var(--sp-4) 0 0; padding: 0; display: grid; grid-template-columns: 16fr 36fr 16fr 16fr 16fr; gap: 4px; }
.sa-phase { --ph: var(--border-strong); min-width: 0; padding: 12px 10px 6px; border-top: 3px solid var(--ph); border-radius: 2px; }
.sa-phase--auction { --ph: var(--warn); }
.sa-phase--open { --ph: var(--saudi); }
.sa-phase--tal { --ph: color-mix(in srgb, var(--warn) 55%, var(--surface)); }
.sa-phase.is-now { background: linear-gradient(to bottom, color-mix(in srgb, var(--ph) 14%, transparent), transparent 85%); }
.sa-phase__name { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.sa-phase__n { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 700; color: var(--text); }
.sa-phase__time { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.sa-phase__desc { margin-top: 4px; font-size: 13px; line-height: 1.75; color: var(--text-3); }

.sa-day__foot { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 28px; margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.sa-week { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sa-week li {
  display: grid; place-items: center; min-width: 62px; height: 38px; padding: 0 8px; border-radius: 11px;
  border: 1px dashed var(--border-strong); font-size: 13px; font-weight: 600; color: var(--text-3);
}
.sa-week li.is-on { border: 1px solid transparent; background: var(--saudi-soft); color: var(--saudi-ink); }
.sa-week li.is-today { box-shadow: 0 0 0 2px var(--text); }
.sa-week__short { display: none; }
.sa-day__facts { font-size: 14px; line-height: 1.85; color: var(--text-2); }
.sa-day__facts b { color: var(--text); font-weight: 600; }

/* ---------- 06 guide: key numbers ---------- */
.sa-keys { list-style: none; margin: var(--sp-6) 0 var(--sp-8); padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.sa-keys li { min-width: 0; }
.sa-key {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; height: 100%; min-height: 44px; padding: 16px 16px 14px;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); text-align: start;
  transition: transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.sa-key::before { content: ""; position: absolute; top: 16px; inset-inline-end: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--saudi); box-shadow: 0 0 0 3px var(--saudi-soft); }
.sa-key:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.sa-key__v { font-family: var(--font-head); font-size: 28px; font-weight: 800; line-height: 1.25; }
.sa-key__l { margin-top: 2px; font-size: 13.5px; font-weight: 600; line-height: 1.5; color: var(--text-2); }
.sa-key__s { font-size: 12px; line-height: 1.5; color: var(--text-3); }

/* ---------- 06 guide: tabs + panels ---------- */
.sa-guide__tabs { max-width: 100%; }
/* A panel is the one anchor that is not a heading: when the browser itself scrolls to it (#guide-… on load,
   back/forward) it must stop with the tab bar still visible above it, so the panel's margin is the bar's
   height plus the gap (--sa-tabs-h, kept current by saudi.js) on top of the shared html scroll-padding. */
.sa-panel { scroll-margin-top: var(--sa-tabs-h, 70px); margin-top: var(--sp-4); padding: clamp(18px, 2.6vw, 32px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.sa-panel__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--sp-8) var(--sp-10); align-items: start; }
.sa-panel__grid--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sa-panel__main, .sa-panel__side { display: grid; gap: var(--sp-5); min-width: 0; }
.sa-panel__main > *, .sa-panel__side > * { min-width: 0; }
.sa-panel__title { font-family: var(--font-head); font-size: clamp(20px, .8vw + 15px, 26px); font-weight: 700; line-height: 1.4; }
.sa-panel__lead { margin-top: -8px; font-size: 16px; line-height: 1.9; color: var(--text-2); max-width: 64ch; }
.sa-panel__lead b { color: var(--text); font-weight: 600; }
.sa-panel__link { min-height: 44px; margin-top: var(--sp-4); }
.sa-callout { margin: var(--sp-6) 0 0; }
.sa-more { margin-top: var(--sp-5); }
.sa-panel__side .sa-more { margin-top: 0; }
.sa-asof, .sa-who { font-size: 13px; line-height: 1.85; color: var(--text-3); }
.sa-who { font-size: 14px; color: var(--text-2); }
.sa-who b { color: var(--text); }
.sa-live { padding: 12px 16px; border-radius: var(--radius); border-inline-start: 3px solid var(--saudi); background: var(--saudi-soft); font-size: 14.5px; line-height: 1.85; color: var(--text); }
.sa-live:empty { display: none; }

.sa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sa-list li { position: relative; padding-inline-start: 14px; font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.sa-list li::before { content: ""; position: absolute; inset-inline-start: 0; top: .75em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent, var(--text-3)); }
.sa-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sa-facts li { position: relative; padding-inline-start: 18px; font-size: 14.5px; line-height: 1.85; color: var(--text-2); }
.sa-facts li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .78em; width: 7px; height: 7px; border-radius: 50%; background: var(--saudi); }
.sa-facts b { color: var(--text); font-weight: 700; }
.sa-facts--tight li { font-size: 13.5px; line-height: 1.8; }

.sa-mkts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sa-mk { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 2fr); align-items: start; gap: 6px 20px; min-width: 0; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.sa-mk__head { min-width: 0; }
.sa-mk__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 14.5px; font-weight: 700; line-height: 1.5; }
.sa-mk__title .dot { align-self: center; }
.sa-mk__big { margin-top: 2px; font-family: var(--font-head); font-size: 22px; font-weight: 700; line-height: 1.3; }

.sa-fig { margin: 0; min-width: 0; }
.sa-fig .figure__frame { display: grid; place-items: center; }
.sa-fig svg { max-width: 420px; }
.sa-fig .ill-text { font-size: 16px; }
/* the company counts are the figure's headline numbers (beat .sa-fig .ill-text's 16px) */
.sa-fig .sa-ill-big { font-family: var(--font-head); font-size: 30px; font-weight: 700; }
.sa-fig .sa-ill-big--sm { font-size: 25px; }
.sa-ill-main { fill: var(--saudi-soft); stroke: var(--saudi); stroke-width: 2; }
.sa-ill-nomu { fill: var(--economy-soft); stroke: var(--economy); stroke-width: 2; }
.sa-ill-mt30 { fill: var(--surface); stroke: var(--text-2); stroke-width: 1.6; stroke-dasharray: 5 4; }
.sa-ill-node { fill: var(--surface); stroke: var(--border-strong); stroke-width: 2; }
.sa-ill-node--on { fill: var(--saudi-soft); stroke: var(--saudi); }
.sa-fig .sa-ill-t { font-family: var(--font-num); font-size: 16px; }
.sa-ill-link, .sa-ill-head { fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sa-ill-skip { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 3 4; }
.sa-ill-track { fill: var(--surface-3); }
.sa-ill-cap { fill: var(--saudi-soft); stroke: var(--saudi); stroke-width: 1.5; }
.sa-ill-one { fill: var(--saudi); }
.sa-ill-tick { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 3 3; }
.sa-ill-bracket { fill: none; stroke: var(--text-2); stroke-width: 1.5; }

/* price band tool */
.sa-band { padding: 18px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.sa-band__title { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 700; line-height: 1.5; }
.sa-band__title .icon { color: var(--saudi-ink); }
.sa-band__form { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.sa-band .select, .sa-band .input-group { background-color: var(--surface); }
.sa-band__viz { margin-top: 22px; }
.sa-band__track { position: relative; height: 14px; border-radius: 8px; direction: ltr; background: linear-gradient(to right, var(--neg-soft), var(--surface-3) 50%, var(--pos-soft)); }
.sa-band__zone { position: absolute; inset: 0; border-radius: inherit; border: 1px solid var(--border); }
.sa-band__mid { position: absolute; left: 50%; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text-2); }
.sa-band__dot { position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.sa-band__ends { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; direction: ltr; }
.sa-band__end { display: grid; justify-items: start; direction: rtl; text-align: start; line-height: 1.4; }
.sa-band__end:last-child { justify-items: end; }
.sa-band__end--mid { justify-items: center; }
.sa-band__end b { font-size: 15px; font-weight: 700; }
.sa-band__end small { font-size: 12px; color: var(--text-3); }
.sa-band__out { margin-top: 14px; font-size: 14px; line-height: 1.85; color: var(--text-2); }
.sa-band__out b { color: var(--text); }
.sa-band .field__hint { margin-top: 8px; }
.sa-ticks tr.is-hit > * { background: var(--saudi-soft); }
.sa-ticks tr.is-hit th { box-shadow: inset -3px 0 0 var(--saudi); }
.sa-hit { display: inline-block; margin-inline-start: 8px; padding: 0 8px; border-radius: var(--radius-pill); border: 1px solid color-mix(in srgb, var(--saudi) 45%, transparent); font-size: 12px; font-weight: 700; line-height: 1.6; color: var(--saudi-ink); }
.sa-limits td { color: var(--text-2); font-size: 14px; }

/* settlement / foreign */
.sa-ba { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.sa-ba__col { padding: 14px 16px; border-radius: var(--radius-lg); border: 1px dashed var(--border-strong); background: var(--surface-2); font-size: 14px; line-height: 1.8; color: var(--text-3); }
.sa-ba__col--now { border: 1px solid color-mix(in srgb, var(--saudi) 40%, transparent); background: var(--saudi-soft); color: var(--text); }
.sa-ba__k { margin-bottom: 4px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.sa-ba__col--now .sa-ba__k { color: var(--saudi-ink); }
.sa-ba__arrow { display: grid; place-items: center; color: var(--text-3); }

/* derivatives */
.sa-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sa-spec { min-width: 0; padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-2); }
.sa-spec--small { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.sa-spec--small .sa-spec__note { margin-top: 0; }
.sa-spec__since { font-size: 12px; font-weight: 700; color: var(--saudi-ink); line-height: 1.6; }
.sa-spec__title { margin-top: 2px; font-size: 16px; font-weight: 700; line-height: 1.5; }
.sa-spec__title small { margin-inline-start: 4px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-3); }
.sa-spec__dl { display: grid; margin: 10px 0 0; }
.sa-spec__dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border-strong); font-size: 13.5px; line-height: 1.6; }
.sa-spec__dl > div:last-child { border-bottom: 0; }
.sa-spec__dl dt { flex: none; color: var(--text-3); }
.sa-spec__dl dd { margin: 0; font-weight: 600; text-align: end; }
.sa-spec__note { margin-top: 10px; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.sa-cal .figure__frame { display: block; text-align: center; }
.sa-cal__month { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--text); }
.sa-cal__svg { max-width: 300px; margin: 10px auto 0; min-height: 200px; }
.sa-cal__svg svg { width: 100%; height: auto; max-width: none; }
.sa-cal__out { margin-top: 10px; font-size: 14px; line-height: 1.75; color: var(--text-2); }
.sa-cal__out b { color: var(--text); }
.sa-cal-wd { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--text-3); }
.sa-cal-d { font-family: var(--font-num); font-size: 13.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.sa-cal-d--off { fill: var(--text-3); }
.sa-cal-d--thu, .sa-cal-wd--thu { fill: var(--text); font-weight: 700; }
.sa-cal-d--exp { fill: var(--saudi-ink); font-weight: 700; }
.sa-cal-ring { fill: var(--saudi-soft); stroke: var(--saudi); stroke-width: 2; }
.sa-cal-today { fill: var(--text); }

/* how to start */
.sa-steps { margin: 0; }
.sa-before { display: grid; gap: 8px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.sa-before__title { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; font-size: 14.5px; font-weight: 700; }
.sa-before__link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.sa-before__link:hover { border-color: var(--border-strong); }
.sa-before__link .icon { width: 16px; height: 16px; color: var(--text-3); transition: transform var(--t-med) var(--ease-spring); }
.sa-before__link:hover .icon { transform: translateX(-4px); }

.sa-sources { display: flex; gap: 10px; margin-top: var(--sp-6); padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; line-height: 1.95; color: var(--text-3); }
.sa-sources .icon { flex: none; margin-top: 6px; }
.sa-sources b { color: var(--text-2); }
.sa-sources a { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: .25em; }
.sa-sources a:hover { text-decoration-color: currentColor; }

/* ---------- responsive ---------- */
@media (max-width: 1279px) {
  .sa-keys { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sec__k--only { display: none; }
  .sec { --sec-cols: minmax(140px, 1fr) minmax(90px, .8fr) 88px minmax(160px, 1.3fr); }
}
@media (max-width: 1099px) {
  .sa-hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "aside" "summary" "session" "nav"; grid-template-rows: none; gap: var(--sp-5); }
  .sa-hero .page-hero__lead { max-width: 60ch; }
  .sa-movers .movers { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
  .sa-news .news-list { grid-template-columns: minmax(0, 1fr); }
  .sa-phases { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sa-phase { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(0, 2fr); gap: 2px 16px; padding: 12px 14px; border-top: 0; border-inline-start: 3px solid var(--ph); border-bottom: 1px solid var(--border); border-radius: 0; }
  .sa-phase:last-child { border-bottom: 0; }
  .sa-phase.is-now { background: color-mix(in srgb, var(--ph) 10%, transparent); }
  .sa-phase__time, .sa-phase__desc { margin-top: 0; }
  .sa-phase__time { grid-column: 1; }
  .sa-phase__desc { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .sa-day__foot { grid-template-columns: minmax(0, 1fr); }
  .sa-panel__grid, .sa-panel__grid--even { grid-template-columns: minmax(0, 1fr); }
  /* one column: interleave the two columns' children so the before/after sits right under the lead */
  .sa-panel__grid--flow { row-gap: var(--sp-5); }
  .sa-panel__grid--flow > .sa-panel__main, .sa-panel__grid--flow > .sa-panel__side { display: contents; }
  .sa-panel__grid--flow .sa-ba { order: 1; }
  .sa-panel__grid--flow .sa-facts { order: 2; }
  .sa-panel__grid--flow .sa-fig { order: 3; }
}
@media (min-width: 700px) and (max-width: 1099px) {
  /* the shared .mcard sits head | body here; give the narrow body stacked rows instead of three boxes */
  .sa-tasi__stats { --kv-cols: 1; gap: 6px; }
  .sa-tasi__stats:empty { min-height: 132px; }
  .sa-tasi__stats > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; }
  .sa-tasi__stats dd { margin: 0; font-size: 16px; }
  .sa-heat .heat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 560px) and (max-width: 899px) {
  /* stocks table: drop the absolute change and the 40-session line so the rest fits without sideways scrolling */
  .sa-stocks .table-wrap > .table { min-width: 0; }
  .sa-stocks .quotes-table th:nth-child(3), .sa-stocks .quotes-table td:nth-child(3),
  .sa-stocks .quotes-table th:nth-child(5), .sa-stocks .quotes-table td:nth-child(5) { display: none; }
  .sa-stocks .quote-name { min-width: 150px; }
  .sa-stocks .table th, .sa-stocks .table td { padding-inline: 12px; }
  .sa-hide-md { display: none; }
}
@media (max-width: 899px) {
  .sa-guide__tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .sa-guide__tabs .tabs__tab { padding: 6px 10px; white-space: normal; line-height: 1.35; }
}
@media (max-width: 699px) {
  .sa-hero__title { font-size: clamp(34px, 10vw, 42px); }
  .sa-hero__meta { margin-top: var(--sp-4); gap: 8px 12px; }
  .sa-tasi__stats { gap: 6px; margin-top: 14px; }
  .sa-tasi__stats:empty { min-height: 64px; }
  .sa-kv > div { padding: 8px 10px; }
  .sa-kv dd { font-size: 15px; }
  .sa-jump ul { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 4px; scroll-padding-inline: var(--gutter); }
  .sa-jump ul::-webkit-scrollbar { display: none; }
  .sa-jump li { flex: none; }

  .sa-pulse__panel .qt:nth-child(n+6) { display: none; }
  .sa-chart [data-history] { --chart-h: 220px; }
  .sa-chart__stats { --kv-cols: 2; }

  .sa-heat .heat { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .sa-heat .heat__tile { min-height: 60px; padding: 8px 8px 7px; gap: 2px; border-radius: 11px; }
  .sa-heat .heat__sector, .sa-heat .heat__px { display: none; }
  .sa-heat .heat__name { font-size: 12.5px; }
  .sa-heat .heat__pct { font-size: 14px; }
  .sa-heat .heat-legend { flex-wrap: nowrap; gap: 8px; }
  .sa-heat .heat-legend > span:not(.heat-legend__bar) { flex: none; white-space: nowrap; }
  .sa-heat .heat-legend__bar { flex: 1 1 auto; width: auto; min-width: 40px; }

  .sa-sectors__head .segmented { width: 100%; }
  .sa-sectors__head .segmented > button { flex: 1; }
  .sec__head { display: none; }
  .sec__row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id chg" "bar bar" "ext ext"; gap: 8px 12px; padding: 12px 0; }
  .sec__id { grid-area: id; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
  .sec__name { min-height: 44px; }
  .sec__chg { grid-area: chg; }
  .sec__bar { grid-area: bar; }
  .sec__ext { grid-area: ext; }
  .sec__only { display: inline; }
  .sec__row[data-n="1"] { grid-template-areas: "id chg" "bar bar"; }
  .sec__row[data-n="1"] .sec__ext { display: none; }

  .sa-filter { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; }
  .sa-filter::-webkit-scrollbar { display: none; }
  .sa-filter .fchip { flex: none; }

  .sa-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: var(--sp-6); }
  .sa-key { padding: 14px 14px 12px; }
  .sa-key__v { font-size: 24px; }
  .sa-day__head { flex-direction: column; }
  .sa-day__now { width: 100%; border-radius: var(--radius); }
  .sa-day__svg { min-height: 82px; }
  /* news on phones: the lead story and the five latest headlines, then one link to the full list */
  .sa-news > .sa-news__list { display: none; }
  .sa-news__more { display: flex; }
  .sa-phase { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
  .sa-phase__desc { grid-column: 1; grid-row: auto; }
  .sa-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .sa-week li { min-width: 0; height: 36px; padding: 0 2px; font-size: 12px; border-radius: 9px; }
  .sa-week__full { display: none; }
  .sa-week__short { display: inline; }
  .sa-panel { padding: 16px 14px; }
  .sa-panel .figure__frame { padding: 10px 8px; }
  .sa-specs, .sa-band__form, .sa-mk { grid-template-columns: minmax(0, 1fr); }
  .sa-ba { grid-template-columns: minmax(0, 1fr); }
  .sa-ba__arrow { transform: rotate(-90deg); }
}
@media (max-width: 559px) {
  .sa-guide__tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* stocks table: name · price · change % on phones (sorting still works) */
  .sa-stocks .table-wrap > .table { min-width: 0; }
  .sa-stocks .quotes-table th:nth-child(3), .sa-stocks .quotes-table td:nth-child(3),
  .sa-stocks .quotes-table th:nth-child(5), .sa-stocks .quotes-table td:nth-child(5),
  .sa-stocks .quotes-table th:nth-child(6), .sa-stocks .quotes-table td:nth-child(6),
  .sa-stocks .quotes-table th:nth-child(7), .sa-stocks .quotes-table td:nth-child(7) { display: none; }
  .sa-stocks .quote-name { min-width: 0; }
  .sa-stocks .quote-name__badge { display: none; }
  .sa-stocks .table th, .sa-stocks .table td { padding-inline: 10px; }
  .sa-stocks .table caption.sa-cap { padding: 14px 12px 12px; }
  .sa-hide-md, .sa-hide-phone { display: none; }
}
