/* אטלס הגוף: the atlas page (app shell). Tokens come from tokens.css. Phone first, desktop from 768 px. */

[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; }
.ic { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }

html, body.atlas { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.atlas {
  position: fixed; inset: 0;
  height: 100dvh;
  --top-h: 56px;
  --tabs-h: 56px;
  --chrome-top: calc(var(--top-h) + var(--tabs-h) + env(safe-area-inset-top));
  --panel-w: 360px;
  --cx: 50%;
  --cy: 46%;
  --sheet-peek: calc(76px + env(safe-area-inset-bottom));
  --sheet-h: var(--sheet-peek);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.safe-probe { position: fixed; left: 0; bottom: 0; width: 1px; height: env(safe-area-inset-bottom); visibility: hidden; pointer-events: none; }
body.atlas[data-snap="half"] { --sheet-h: 46dvh; }
body.atlas[data-snap="tall"] { --sheet-h: 82dvh; }

/* ---------- the world behind the body: each mode is its own atmosphere ---------- */
.world { position: fixed; inset: 0; z-index: 0; background: var(--ink); overflow: hidden; }
.world-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s var(--ease); }
.w-explore { background: linear-gradient(180deg, #070b16 0%, #060a13 55%, #0b1324 100%); }
.w-regions { background: linear-gradient(180deg, #08101e, #0a1322 70%, #0c1729); }
.w-regions::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(42% 52% at var(--cx) var(--cy), rgba(90, 209, 230, .10), transparent 72%);
}
.w-sides { background: linear-gradient(180deg, #080a18, #070913 70%, #0b0d1c); }
.w-quiz { background: linear-gradient(180deg, #05080f, #070c16 70%, #08140f); }
body[data-mode="explore"] .w-explore,
body[data-mode="regions"] .w-regions,
body[data-mode="sides"] .w-sides,
body[data-mode="quiz"] .w-quiz { opacity: 1; }
.world-word { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .7s var(--ease); }
.world-word.is-on { opacity: 1; }

.stage {
  position: fixed; inset: 0; z-index: 1;
  width: 100vw; height: 100dvh; display: block;
  touch-action: none; outline: none; cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.stage.is-dragging { cursor: grabbing; }
.stage.is-over { cursor: pointer; }

/* ---------- glass ---------- */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, rgba(26, 36, 60, .74), rgba(13, 19, 34, .80));
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--r-lg);
}
.glass::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--gloss);
}

/* ---------- top bar and tabs ---------- */
.topbar {
  position: fixed; z-index: 6; top: 0; left: 0; right: 0;
  padding: env(safe-area-inset-top) 12px 0;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: var(--top-h) var(--tabs-h); align-items: center;
  column-gap: 12px;
  background: linear-gradient(180deg, rgba(6, 10, 19, .92), rgba(6, 10, 19, .55) 70%, rgba(6, 10, 19, 0));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap);
  color: var(--text); text-decoration: none; justify-self: start; border-radius: var(--r-pill); padding-inline-end: 6px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--left);
  background: radial-gradient(70% 70% at 40% 30%, rgba(255, 77, 94, .30), rgba(255, 77, 94, .06));
  border: 1px solid rgba(255, 77, 94, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 4px 12px rgba(0, 0, 0, .35);
}
.brand-mark .ic { width: 20px; height: 20px; animation: beat 1s infinite; transform-origin: 50% 60%; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.01em; white-space: nowrap; }
.ecg { width: 72px; height: 22px; opacity: .9; }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  6% { transform: scale(1.16); }
  14% { transform: scale(1.02); }
  34% { transform: scale(1.10); }
  46% { transform: scale(1); }
}

.tabs {
  grid-column: 1 / -1; grid-row: 2;
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr);
  height: 50px; padding: 3px; border-radius: var(--r-pill);
  background: rgba(16, 24, 42, .66);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 30px rgba(0, 0, 0, .35);
}
.tab {
  position: relative; z-index: 1; border: 0; background: none; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; min-height: 44px;
  transition: color .3s var(--ease);
  white-space: nowrap; padding: 0 6px;
}
.tab[aria-selected="true"] { color: var(--text); }
.tab:hover { color: var(--text); }
.tab-glow {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: var(--tab-w, 25%); transform: translateX(var(--tab-x, 3px));
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, rgba(255, 77, 94, .34), rgba(255, 77, 94, .14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 14px rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 120, 135, .45);
  transition: transform .45s var(--ease), background .6s var(--ease), border-color .6s var(--ease);
  opacity: 0;
}
.tabs.is-placed .tab-glow { opacity: 1; }
body[data-mode="regions"] .tab-glow { background: linear-gradient(180deg, rgba(90, 209, 230, .30), rgba(90, 209, 230, .10)); border-color: rgba(90, 209, 230, .45); }
body[data-mode="sides"] .tab-glow { background: linear-gradient(90deg, rgba(90, 209, 230, .30), rgba(255, 77, 94, .30)); border-color: rgba(255, 255, 255, .28); }
body[data-mode="quiz"] .tab-glow { background: linear-gradient(180deg, rgba(111, 227, 165, .28), rgba(111, 227, 165, .10)); border-color: rgba(111, 227, 165, .45); }

.about-btn {
  min-height: var(--tap); padding: 0 16px; border-radius: var(--r-pill); cursor: pointer;
  background: rgba(16, 24, 42, .6); border: 1px solid var(--line); color: var(--text); font-weight: 500; font-size: 14.5px;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.about-btn:hover { border-color: var(--line-strong); }

/* ---------- the sheet (phone) that becomes two panels (desktop) ---------- */
.sheet {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
  height: 82dvh;
  transform: translateY(calc(82dvh - var(--sheet-h)));
  display: flex; flex-direction: column;
  transition: transform .5s var(--ease);
}
.sheet.is-dragging { transition: none; }
.sheet-grip { position: relative; flex: none; height: 76px; touch-action: none; }
.grip {
  position: absolute; inset: 0; width: 100%; border: 0; background: none; cursor: grab; border-radius: 26px 26px 0 0;
}
.grip span {
  position: absolute; top: 9px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px;
  background: rgba(243, 239, 230, .38);
}
.peek {
  position: absolute; left: 20px; right: 20px; top: 24px; margin: 0; pointer-events: none;
  font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1.3;
  display: flex; align-items: center; gap: 10px; min-height: 40px;
  overflow: hidden;
}
.peek .peek-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--left); }
.peek .peek-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.peek .peek-sub { color: var(--muted); font-family: var(--font-ui); font-weight: 500; font-size: 14px; white-space: nowrap; }
/* the scroll box is exactly the open part of the sheet (it grows and shrinks in step with the slide), so every row
   can be scrolled whole into view */
.sheet-scroll {
  flex: none; height: calc(var(--sheet-h) - 76px); min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 16px calc(52px + env(safe-area-inset-bottom));
  transition: height .5s var(--ease);
  scrollbar-width: thin; scrollbar-color: rgba(243, 239, 230, .2) transparent;
  /* the last visible line dissolves into the sheet's bottom edge instead of being sliced by it (or by Safari's
     toolbar on iOS); the box's own bottom padding still lets the final row scroll fully clear of the fade */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent);
}
.sheet.is-dragging .sheet-scroll { transition: none; }
body[data-snap="peek"] .sheet-scroll { visibility: hidden; }

/* ---------- panes ---------- */
.pane { padding: 4px 0 8px; }
.pane.is-entering { animation: paneIn .6s var(--ease) both; transform-origin: 50% 0; }
@keyframes paneIn {
  from { opacity: 0; transform: perspective(900px) rotateX(-9deg) translateZ(-60px); }
  to { opacity: 1; transform: none; }
}
.pane-head { margin-bottom: 16px; }
.eyebrow { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; color: var(--left); }
body[data-mode="regions"] .eyebrow { color: var(--right); }
body[data-mode="quiz"] .eyebrow { color: var(--ok); }
.pane-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 26px; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
.pane-lede { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.group-title { margin: 22px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .05em; color: var(--muted); }

/* search */
.search { position: relative; }
.search-box {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border-radius: var(--r-md); background: rgba(6, 10, 19, .55); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: rgba(90, 209, 230, .6); box-shadow: 0 0 0 4px rgba(90, 209, 230, .12); }
.search-box .ic { color: var(--muted); }
.search-box input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; padding: 12px 0; color: var(--text);
}
.search-box input::placeholder { color: #7d8aa0; }
.search-box input::-webkit-search-cancel-button { filter: invert(.8); }
.results {
  list-style: none; margin: 8px 0 0; padding: 6px; border-radius: var(--r-md);
  background: rgba(6, 10, 19, .7); border: 1px solid var(--line); max-height: 300px; overflow-y: auto;
}
.results li button, .row {
  width: 100%; min-height: 46px; display: flex; align-items: center; gap: 10px; text-align: start;
  padding: 7px 10px; border: 0; border-radius: 12px; background: none; cursor: pointer; color: var(--text);
}
.results li button:hover, .results li button[aria-selected="true"], .row:hover { background: rgba(255, 255, 255, .07); }
.res-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.res-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.res-en { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.res-empty { padding: 12px; color: var(--muted); font-size: 14px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }

/* layers */
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.layer {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 8px 6px 6px;
  border-radius: var(--r-md); background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06);
}
.layer-swatch { width: 30px; height: 30px; border-radius: 10px; flex: none; position: relative; overflow: hidden; }
.layer-swatch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%); }
.layer-name { flex: 1; font-weight: 600; font-size: 15.5px; }
.layer-count { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.switch {
  position: relative; width: 58px; height: var(--tap); border: 0; background: none; cursor: pointer; flex: none;
}
.switch::before {
  content: ""; position: absolute; inset: 7px 2px; border-radius: 15px; background: rgba(154, 167, 187, .22);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); transition: background .25s;
}
.switch::after {
  content: ""; position: absolute; top: 11px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: #dfe4ee; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .3s var(--ease);
}
.switch[aria-checked="true"]::before { background: var(--sw, var(--left)); }
.switch[aria-checked="true"]::after { transform: translateX(-26px); background: #fff; }
.switch.is-loading::after {
  background: none; border: 2.5px solid rgba(255, 255, 255, .85); border-top-color: transparent; box-shadow: none;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: translateX(-13px) rotate(360deg); } }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: var(--r-pill); background: rgba(6, 10, 19, .55); border: 1px solid var(--line); }
.seg-btn {
  min-height: 44px; min-width: 52px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: none; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.seg-btn[aria-pressed="true"], .seg-btn[aria-checked="true"] { background: rgba(243, 239, 230, .14); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.seg-wide { display: grid; width: 100%; margin: 16px 0 4px; }
.seg-wide .seg-btn { min-height: 44px; font-size: 15px; }

/* ---------- info card ---------- */
.card { padding: 18px 18px 20px; }
.card::after {
  content: ""; position: absolute; inset-block: 18px; inset-inline-start: 0; width: 3px; border-radius: 3px;
  background: var(--side-c, var(--bone));
}
.card[data-side="L"] { --side-c: var(--left); }
.card[data-side="R"] { --side-c: var(--right); }
.card[data-side="C"] { --side-c: var(--bone); }
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 11px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; line-height: 1.3; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
}
.chip .ic { width: 13px; height: 13px; }
.chip-side-L { color: #ffd6da; background: var(--left-soft); border-color: rgba(255, 77, 94, .45); }
.chip-side-L .ic { color: var(--left); }
.chip-side-R { color: #d5f6fb; background: var(--right-soft); border-color: rgba(90, 209, 230, .45); }
.chip-side-C { color: var(--bone); background: rgba(233, 226, 208, .09); border-color: rgba(233, 226, 208, .3); }
.icon-btn {
  width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text);
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.card-close { margin-top: -6px; margin-inline-end: -6px; }
.card-title {
  margin: 12px 0 2px; font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1.1; letter-spacing: -.02em;
  overflow-wrap: anywhere; text-wrap: balance;
}
.card-latin { margin: 4px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.card-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 6px; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); font-size: 14px; font-weight: 600;
  transition: background .2s, border-color .2s, transform .15s;
}
.act .ic { width: 20px; height: 20px; color: var(--right); }
.act:hover { background: rgba(255, 255, 255, .1); border-color: var(--line-strong); }
.act:active { transform: scale(.97); }
.card-body h3 { margin: 18px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .05em; color: var(--muted); }
.card-body p { margin: 0; font-size: 15.5px; line-height: 1.62; text-wrap: pretty; }
.card-body ul { margin: 0; padding: 0 18px 0 0; }
.card-body li { margin: 0 0 6px; font-size: 15px; line-height: 1.55; }
.card-body li::marker { color: var(--left); }
.fact {
  margin-top: 18px; padding: 12px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.55;
  background: linear-gradient(135deg, rgba(255, 77, 94, .12), rgba(90, 209, 230, .08)); border: 1px solid rgba(255, 255, 255, .1);
}
.fact b { display: block; font-size: 12.5px; letter-spacing: .05em; color: var(--left); font-weight: 600; margin-bottom: 2px; }
.card-note { margin-top: 14px !important; font-size: 13px !important; color: var(--muted); }

/* ---------- regions ---------- */
.region-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.region-chip {
  min-height: 48px; padding: 6px 4px; border-radius: 14px; cursor: pointer; font-weight: 600; font-size: 14.5px; line-height: 1.2;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text);
  transition: background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.region-chip:hover { border-color: rgba(90, 209, 230, .5); }
.region-chip[aria-pressed="true"] { background: var(--bone); color: var(--ink); border-color: var(--bone); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.region-detail:empty { display: none; }
.region-detail { margin-top: 18px; }
.region-name { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 24px; line-height: 1.15; }
.region-blurb { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.quad-toggle { margin-top: 14px; width: 100%; }
.quads { margin-top: 12px; }
.quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; direction: ltr; }
.quad-btn {
  min-height: 64px; padding: 8px; border-radius: 14px; cursor: pointer; direction: rtl; text-align: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text); font-weight: 600; font-size: 14px; line-height: 1.3;
}
.quad-btn small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 11.5px; color: var(--muted); direction: ltr; margin-top: 2px; }
.quad-btn[data-side="L"] { border-color: rgba(255, 77, 94, .35); }
.quad-btn[data-side="R"] { border-color: rgba(90, 209, 230, .35); }
.quad-btn[aria-pressed="true"][data-side="L"] { background: var(--left-soft); border-color: var(--left); }
.quad-btn[aria-pressed="true"][data-side="R"] { background: var(--right-soft); border-color: var(--right); }
.quad-caption { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.quad-info { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.quad-info h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.quad-info p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--text); }
.quad-also { margin: 10px 0 0; padding: 0 18px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.quad-also li { margin-bottom: 4px; }
.quad-clinical { padding-top: 8px; border-top: 1px solid var(--line); }
.organ-list { display: flex; flex-wrap: wrap; gap: 6px; }
.organ-chip {
  min-height: 44px; padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text);
}
.organ-chip:hover, .organ-chip[aria-pressed="true"] { border-color: var(--line-strong); background: rgba(255, 255, 255, .12); }
.sys-group { margin-top: 16px; }
.sys-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.sys-title .count { font-family: var(--font-mono); font-weight: 400; font-size: 12px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { min-height: 44px; font-size: 15px; }
.row[aria-pressed="true"] { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px var(--line-strong); }
.row .row-name { flex: 1; min-width: 0; line-height: 1.35; }
.row .row-off { font-size: 12px; color: var(--muted); white-space: nowrap; }
.num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink); background: var(--bone);
}
.side-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.side-dot-L { background: var(--left); }
.side-dot-R { background: var(--right); }
.side-dot-C { background: var(--bone); }
.more-btn { margin-top: 6px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--right); cursor: pointer; font-size: 14px; font-weight: 600; border-radius: 10px; }

/* ---------- sides ---------- */
.rule p { margin: 0; }
.rule-1 { font-size: 16px; line-height: 1.55; font-weight: 600; }
.rule-2 {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 12px !important; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 77, 94, .18), rgba(255, 77, 94, .05)); border: 1px solid rgba(255, 77, 94, .35);
  font-size: 15.5px; line-height: 1.5;
}
.rule-2 .ic { color: var(--left); margin-top: 3px; animation: beat 1s infinite; }
.rule-3 { margin-top: 12px !important; color: var(--muted); font-size: 15px; line-height: 1.55; }
.side-lists { display: grid; gap: 14px; margin-top: 18px; }
.side-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.side-group[data-side="L"] h3 { color: #ffb3bb; }
.side-group[data-side="R"] h3 { color: #a9ecf6; }
.side-group[data-side="C"] h3 { color: var(--bone); }
.side-group[data-side="L"] .organ-chip { border-color: rgba(255, 77, 94, .35); }
.side-group[data-side="L"] .organ-chip[aria-pressed="true"] { background: var(--left-soft); border-color: var(--left); }
.side-group[data-side="R"] .organ-chip { border-color: rgba(90, 209, 230, .35); }
.side-group[data-side="R"] .organ-chip[aria-pressed="true"] { background: var(--right-soft); border-color: var(--right); }
.side-note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-strong); }
.side-note b { font-family: var(--font-display); font-weight: 800; font-size: 17px; display: block; margin-bottom: 2px; }
.side-note p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.55; }
.terms { display: grid; gap: 2px; margin: 0; }
.term { display: grid; grid-template-columns: 1fr; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.term dt { font-weight: 700; font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.term dt .latin { font-weight: 400; font-size: 12px; color: var(--muted); }
.term dd { margin: 2px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---------- quiz ---------- */
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quiz-count { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--ok); }
.quiz-dots { display: flex; gap: 5px; direction: rtl; }
.quiz-dots i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.quiz-dots i.is-now { background: var(--text); }
.quiz-dots i.is-ok { background: var(--ok); }
.quiz-dots i.is-no { background: var(--warn); }
.quiz-q { margin: 14px 0 0; font-family: var(--font-display); font-weight: 900; font-size: 25px; line-height: 1.2; text-wrap: balance; }
.quiz-q em { font-style: normal; color: var(--ok); }
.quiz-help { margin: 8px 0 0; font-size: 14.5px; color: var(--muted); }
.quiz-answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.answer {
  min-height: 54px; border-radius: 14px; cursor: pointer; font-weight: 700; font-size: 15.5px; color: var(--text);
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .05);
}
.answer[data-a="L"] { border-color: rgba(255, 77, 94, .5); }
.answer[data-a="R"] { border-color: rgba(90, 209, 230, .5); }
.answer:disabled { cursor: default; opacity: .55; }
.answer.is-right { opacity: 1; background: rgba(111, 227, 165, .16); border-color: var(--ok); }
.answer.is-wrong { opacity: 1; background: rgba(255, 180, 84, .14); border-color: var(--warn); }
.feedback { margin-top: 16px; padding: 14px; border-radius: 16px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .05); animation: paneIn .45s var(--ease) both; }
.feedback.is-ok { border-color: rgba(111, 227, 165, .6); background: rgba(111, 227, 165, .10); }
.feedback.is-no { border-color: rgba(255, 180, 84, .6); background: rgba(255, 180, 84, .09); }
.feedback strong { display: block; font-family: var(--font-display); font-weight: 900; font-size: 20px; }
.feedback.is-ok strong { color: var(--ok); }
.feedback.is-no strong { color: var(--warn); }
.feedback p { margin: 6px 0 0; font-size: 15px; line-height: 1.55; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; cursor: pointer;
  border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .07); color: var(--text); font-weight: 700; font-size: 15.5px;
}
.btn-primary {
  border-color: rgba(255, 140, 150, .6); color: #fff;
  background: linear-gradient(180deg, #cf2b40, #ad1d30); box-shadow: 0 10px 26px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-ok { border-color: rgba(111, 227, 165, .6); color: #04120b; background: linear-gradient(180deg, #8ff0bd, #4fd18f); box-shadow: 0 10px 26px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.score { text-align: center; padding: 8px 0; }
.score-ring { width: 150px; height: 150px; margin: 6px auto 0; display: block; }
.score-ring .track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 9; }
.score-ring .val { fill: none; stroke: var(--ok); stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.2s var(--ease); }
.score-ring text { fill: var(--text); font-family: var(--font-display); font-weight: 900; font-size: 34px; text-anchor: middle; dominant-baseline: central; }
.score h2 { margin: 10px 0 4px; font-family: var(--font-display); font-weight: 900; font-size: 26px; }
.score p { margin: 0; color: var(--muted); font-size: 15px; }
.score .btn { margin-top: 18px; min-width: 160px; }
.recap { list-style: none; margin: 18px 0 0; padding: 0; text-align: start; display: grid; gap: 4px; }
.recap li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.recap .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.recap .mark.ok { background: rgba(111, 227, 165, .2); color: var(--ok); }
.recap .mark.no { background: rgba(255, 180, 84, .18); color: var(--warn); }

/* ---------- floating instruments ---------- */
.floaters { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.floaters > * { pointer-events: auto; position: absolute; }
.compass {
  width: 64px; height: 64px; border-radius: 50%; padding: 3px;
  top: calc(var(--chrome-top) + 10px); left: 12px;
}
.compass svg { width: 100%; height: 100%; display: block; overflow: visible; }
.c-ring { fill: rgba(6, 10, 19, .35); stroke: rgba(255, 255, 255, .16); stroke-width: 1.2; }
.c-ticks line { stroke: rgba(255, 255, 255, .28); stroke-width: 1.2; }
.c-half-l { fill: rgba(255, 77, 94, .16); }
.c-half-r { fill: rgba(90, 209, 230, .13); }
.c-mid { stroke: rgba(243, 239, 230, .3); stroke-width: .8; stroke-dasharray: 2 2.5; }
.c-torso { fill: rgba(243, 239, 230, .22); stroke: rgba(243, 239, 230, .55); stroke-width: 1; }
.c-head { fill: rgba(243, 239, 230, .3); stroke: rgba(243, 239, 230, .7); stroke-width: 1; }
.c-nose { fill: rgba(243, 239, 230, .75); }
.c-l, .c-r { font-family: var(--font-display); font-weight: 900; font-size: 19px; text-anchor: middle; dominant-baseline: central; }
.c-l { fill: var(--left); }
.c-r { fill: var(--right); }
.c-heart { color: var(--left); fill: var(--left); }

.views {
  display: flex; flex-direction: row; gap: 2px; padding: 4px; border-radius: var(--r-pill);
  bottom: 10px; left: 50%; transform: translate(-50%, calc(-1 * var(--sheet-h)));
  transition: transform .5s var(--ease), opacity .3s var(--ease), visibility .3s;
}
.sheet.is-dragging ~ .floaters .views { transition: none; }
.view-btn {
  min-height: var(--tap); min-width: 0; padding: 0 11px; border: 0; border-radius: var(--r-pill); background: none; cursor: pointer;
  color: var(--text); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.view-btn:hover { background: rgba(255, 255, 255, .09); }
.view-btn.is-on { background: rgba(243, 239, 230, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.view-btn[data-view="left"].is-on { color: #ffc4ca; }
.view-btn[data-view="right"].is-on { color: #bdf1f9; }
body[data-snap="tall"] .views, body[data-snap="tall"] .compass { opacity: 0; visibility: hidden; }
body[data-snap="half"] .views { opacity: 0; visibility: hidden; }

.hidden-chip {
  top: calc(var(--chrome-top) + 10px); left: 50%; transform: translateX(-50%);
  min-height: var(--tap); padding: 0 18px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap;
  font-weight: 600; font-size: 14px; color: var(--text); border-color: rgba(255, 180, 84, .45);
  box-shadow: var(--shadow);
}
.hidden-chip b { color: var(--warn); font-weight: 700; }
.hidden-chip .chip-name { display: inline-block; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.hint {
  margin: 0; left: 50%; transform: translateX(-50%); bottom: calc(var(--sheet-h) + 68px);
  padding: 9px 16px; border-radius: var(--r-pill); white-space: nowrap; pointer-events: none !important;
  font-size: 13.5px; color: var(--text); background: rgba(6, 10, 19, .66); border: 1px solid var(--line);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  animation: hintIn .8s var(--ease) both .4s;
  transition: opacity .5s var(--ease);
}
.hint.is-out { opacity: 0; }
body:not([data-mode="explore"]) .hint { display: none; }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- marks on the body: tags, labels, pins ---------- */
.marks { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.leaders line { stroke: rgba(243, 239, 230, .55); stroke-width: 1; }
.leaders circle { fill: var(--bone); stroke: rgba(6, 10, 19, .8); stroke-width: 1.5; }
.leaders circle.halo { fill: none; stroke: rgba(243, 239, 230, .35); stroke-width: 1; }
.leaders .is-sel line, .leaders line.is-sel { stroke: var(--text); stroke-width: 1.5; }
.marks-layer { position: absolute; inset: 0; }
.mlabel {
  position: absolute; top: 0; left: 0; width: 168px; padding: 6px 10px; border-radius: 12px; pointer-events: auto; cursor: pointer;
  background: rgba(10, 16, 30, .72); border: 1px solid var(--line); color: var(--text); text-align: start;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity .35s var(--ease), border-color .2s;
  font-size: 14px; font-weight: 600; line-height: 1.25;
  display: flex; align-items: flex-start; gap: 8px;
}
.mlabel .num { width: 20px; height: 20px; font-size: 11px; margin-top: 1px; }
.mlabel-text { min-width: 0; }
.mlabel.is-placed { transition: transform .45s var(--ease), opacity .35s var(--ease), border-color .2s; }
.mlabel:hover, .mlabel.is-sel { border-color: var(--line-strong); background: rgba(22, 30, 50, .86); }
.mlabel .latin { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.pin {
  position: absolute; top: 0; left: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--ink); background: var(--bone); box-shadow: 0 0 0 3px rgba(6, 10, 19, .55), 0 3px 8px rgba(0, 0, 0, .45);
}
.pin.is-sel { background: var(--left); color: #fff; box-shadow: 0 0 0 3px rgba(6, 10, 19, .7), 0 3px 8px rgba(0, 0, 0, .45); }
.side-tag {
  position: absolute; top: 0; left: 0; display: none; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 14px; border-radius: var(--r-pill); font-family: var(--font-display); font-weight: 800; font-size: 15px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  will-change: transform;
}
.side-tag .ic { width: 15px; height: 15px; animation: beat 1s infinite; }
.side-tag-l { color: #fff; background: rgba(255, 77, 94, .30); border: 1px solid rgba(255, 77, 94, .8); box-shadow: 0 8px 22px rgba(0, 0, 0, .45); }
.side-tag-l .ic { color: #ff8b97; }
.side-tag-r { color: #fff; background: rgba(90, 209, 230, .24); border: 1px solid rgba(90, 209, 230, .8); box-shadow: 0 8px 22px rgba(0, 0, 0, .45); }
.side-tag.is-on { display: inline-flex; }
/* the heart callout: the side tags' pill, lit from inside like the heart under it */
.side-tag-heart {
  padding: 6px 13px; font-size: 14.5px; color: #fff;
  background: linear-gradient(180deg, rgba(255, 77, 94, .62), rgba(170, 18, 42, .55));
  border: 1px solid rgba(255, 160, 170, .95);
  box-shadow: 0 0 22px rgba(255, 60, 82, .55), 0 8px 22px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.side-tag-heart .ic { color: #fff; }
.tag-lead { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; visibility: hidden; }
.tag-lead line { stroke: rgba(255, 150, 162, .95); stroke-width: 1.6; }
.tag-lead circle { fill: #ff4d5e; stroke: #fff; stroke-width: 1.4; }
.tag-lead circle.halo { fill: none; stroke: rgba(255, 90, 110, .85); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: leadPulse 1s infinite; }
@keyframes leadPulse {
  0% { transform: scale(.5); opacity: .95; }
  55% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
body.is-still .side-tag .ic, body.is-still .tag-lead .halo { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .side-tag .ic, .tag-lead .halo { animation: none; }
}
.leaders .pin-lead { stroke: rgba(243, 239, 230, .7); stroke-width: 1.2; }
.leaders .pin-dot { fill: var(--bone); stroke: rgba(6, 10, 19, .8); stroke-width: 1; }
.hover-tag {
  position: fixed; z-index: 7; top: 0; left: 0; pointer-events: none; opacity: 0; transition: opacity .15s;
  padding: 6px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  background: rgba(6, 10, 19, .84); border: 1px solid var(--line-strong); color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.hover-tag.is-on { opacity: 1; }

/* ---------- loading, faults, about ---------- */
.loader {
  position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; background: radial-gradient(50% 40% at 50% 45%, #121b30, var(--ink) 70%);
  transition: opacity .9s var(--ease), visibility .9s;
}
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; }
.loader-inner { display: grid; justify-items: center; gap: 6px; width: min(340px, 84vw); }
.loader-heart { width: 44px; height: 44px; color: var(--left); animation: beat 1s infinite; }
.loader-line { width: 100%; height: 60px; overflow: visible; }
.loader-line path {
  fill: none; stroke: var(--left); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 90 500; animation: trace 1s linear infinite;
}
@keyframes trace { from { stroke-dashoffset: 590; } to { stroke-dashoffset: 0; } }
.loader-pct { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 54px; line-height: 1; font-variant-numeric: tabular-nums; direction: ltr; }
.loader-pct small { font-size: 22px; color: var(--muted); margin-inline-start: 2px; }
.loader-label { margin: 0; color: var(--muted); font-size: 15px; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .loader-line path { stroke-dasharray: none; }
}

.fault { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: rgba(6, 10, 19, .78); }
.fault-card { max-width: 420px; padding: 28px 24px; text-align: center; display: grid; justify-items: center; gap: 4px; }
.fault-ic { width: 40px; height: 40px; color: var(--left); opacity: .8; }
.fault h2 { margin: 8px 0 0; font-family: var(--font-display); font-weight: 900; font-size: 24px; line-height: 1.2; }
.fault p { margin: 6px 0 16px; color: var(--muted); font-size: 15.5px; line-height: 1.55; }

.about {
  width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto;
  padding: 26px 24px 22px; color: var(--text); margin: auto;
}
.about::backdrop { background: rgba(4, 7, 14, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.about[open] { animation: paneIn .5s var(--ease) both; }
.about-close { position: absolute; top: 12px; left: 12px; margin: 0; }
.about h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 900; font-size: 30px; }
.about p { margin: 0 0 12px; font-size: 15.5px; line-height: 1.6; }
.about-note { color: var(--bone); }
.about-warn { padding: 12px 14px; border-radius: 14px; background: rgba(255, 180, 84, .10); border: 1px solid rgba(255, 180, 84, .4); }
.about-credit { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.about-credit p { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; overflow-wrap: anywhere; }
.about-credit .latin { font-size: 12px; line-height: 1.5; text-align: left; }
.about-credit .credit-split > * { display: block; }
.about a { color: var(--right); text-underline-offset: 3px; }
.about-by { margin-top: 14px !important; font-weight: 600; }
.about-by a { display: inline-flex; align-items: center; min-height: var(--tap); }
.noscript { position: fixed; inset: auto 16px 16px; z-index: 11; padding: 14px; border-radius: 14px; background: var(--panel-solid); }

:focus-visible { outline: 2px solid var(--right); outline-offset: 2px; }
.tab:focus-visible, .seg-btn:focus-visible, .view-btn:focus-visible { outline-offset: -2px; }

/* ---------- phone fine-tuning ---------- */
@media (max-width: 767.98px) {
  /* the sheet is the phone's one glass surface; the card and the panel inside it stay flat */
  .sheet {
    border-radius: 26px 26px 0 0;
    background: linear-gradient(180deg, rgba(22, 31, 52, .90), rgba(10, 15, 28, .94));
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  }
  .brand-name { font-size: 18px; }
  .card { padding: 4px 2px 18px; }
  .card::after { display: none; }
  .card-title { font-size: 26px; }
  .card + .panel { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
  .panel { padding: 0 2px; }
  .pane-title { font-size: 23px; }
  .quiz-q { font-size: 22px; }
  .region-chip { font-size: 14px; }
  /* the score fits the half sheet: ring beside the result, "שוב" right under them, the recap below */
  .score { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; text-align: start; padding: 2px 0 8px; }
  .score-ring { grid-row: 1 / span 2; width: 104px; height: 104px; margin: 0; }
  .score h2 { margin: 0; font-size: 20px; line-height: 1.25; align-self: end; text-wrap: balance; }
  .score p { margin-top: 4px; font-size: 14.5px; line-height: 1.45; align-self: start; }
  .score .btn { grid-column: 1 / -1; width: 100%; margin-top: 14px; }
  .score .recap { grid-column: 1 / -1; }
}
@media (max-width: 374.98px) {
  .ecg { display: none; }
  .tab { font-size: 13.5px; }
  .view-btn { padding: 0 7px; font-size: 13px; }
  .region-chips { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- desktop: panels on both sides, the body between them ---------- */
@media (min-width: 768px) {
  body.atlas { --top-h: 72px; --tabs-h: 0px; --panel-w: 300px; --gap: 16px; }
  .topbar {
    grid-template-columns: 1fr auto 1fr; grid-template-rows: var(--top-h); padding: 0 20px;
    background: linear-gradient(180deg, rgba(6, 10, 19, .85), rgba(6, 10, 19, 0));
  }
  .tabs { grid-column: 2; grid-row: 1; width: 440px; height: 50px; }
  .tab { font-size: 15px; }
  .about-btn { justify-self: end; }
  .ecg { width: 96px; height: 26px; }

  .sheet, .sheet-scroll { display: contents; }
  .sheet-scroll { -webkit-mask-image: none; mask-image: none; }
  body[data-snap] .sheet-scroll { visibility: visible; }
  .sheet-grip { display: none; }
  .card, .panel {
    position: fixed; z-index: 5; top: calc(var(--top-h) + 8px); width: var(--panel-w);
    max-height: calc(100dvh - var(--top-h) - 8px - var(--gap)); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: rgba(243, 239, 230, .2) transparent;
  }
  .card, .panel {
    isolation: isolate;
    background: linear-gradient(180deg, rgba(26, 36, 60, .74), rgba(13, 19, 34, .80));
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--r-lg);
  }
  .card::before, .panel::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: var(--gloss);
  }
  .panel { right: var(--gap); padding: 22px 20px 20px; }
  .card { left: var(--gap); padding: 20px 20px 22px; }
  .card.is-shown { animation: cardIn .55s var(--ease) both; }
  @keyframes cardIn { from { opacity: 0; transform: perspective(1000px) rotateY(14deg) translateZ(-50px); } to { opacity: 1; transform: none; } }
  .card::after { inset-block: 22px; }

  body.atlas { --free-l: var(--gap); --free-r: calc(var(--panel-w) + 2 * var(--gap)); }
  body.atlas.has-card { --free-l: calc(var(--panel-w) + 2 * var(--gap)); }
  .views {
    top: auto; bottom: var(--gap); left: 50%; width: max-content;
    transform: translateX(calc(-50% + (var(--free-l) - var(--free-r)) / 2));
    transition: transform .5s var(--ease);
  }
  .view-btn { border-radius: var(--r-pill); padding: 0 14px; font-size: 14px; }
  body[data-snap] .views { opacity: 1; visibility: visible; }
  body[data-snap] .compass { opacity: 1; visibility: visible; }
  .compass { top: calc(var(--top-h) + 10px); left: 0; transform: translateX(var(--free-l)); width: 84px; height: 84px; padding: 4px; transition: transform .5s var(--ease); }
  .hidden-chip { top: auto; bottom: calc(var(--gap) + 64px); left: calc((100vw + var(--free-l) - var(--free-r)) / 2); }
  .hint { top: auto; bottom: calc(var(--gap) + 64px); left: calc((100vw + var(--free-l) - var(--free-r)) / 2); }
}
@media (min-width: 1024px) {
  body.atlas { --panel-w: 360px; --gap: 18px; }
  .tabs { width: 480px; }
  .panel { padding: 24px 22px 22px; }
  .card-title { font-size: 32px; }
}
@media (min-width: 768px) and (max-width: 1279.98px) {
  .view-btn { padding: 0 10px; font-size: 13.5px; }
}
/* tablets and small laptops: the card takes the panel's column while it is open, so the body keeps its room */
@media (min-width: 768px) and (max-width: 1279.98px) {
  .card { left: auto; right: var(--gap); z-index: 6; }
  body.atlas.has-card { --free-l: var(--gap); }
  body.has-card .panel { visibility: hidden; }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  .compass { width: 72px; height: 72px; }
  .hint { white-space: normal; text-align: center; max-width: calc(100vw - var(--free-l) - var(--free-r) - 16px); }
}

/* English pages (dir=ltr, follow-up of task 9074): the few rules written for right to left. The desktop panel and
   card keep their sides in both languages, since the 3D view's free area (computeInsets) is measured that way. */
[dir="ltr"] .switch::after { right: auto; left: 6px; }
[dir="ltr"] .switch[aria-checked="true"]::after { transform: translateX(26px); }
[dir="ltr"] .switch.is-loading::after { animation-name: spin-ltr; }
@keyframes spin-ltr { to { transform: translateX(13px) rotate(360deg); } }
[dir="ltr"] .quad-btn, [dir="ltr"] .quiz-dots { direction: ltr; }
[dir="ltr"] .about-close { left: auto; right: 12px; }

/* language switch beside אודות / About (follow-up of task 9074) */
.top-end { display: inline-flex; align-items: center; gap: 8px; justify-self: end; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); padding: 0 12px;
  text-decoration: none; font-family: var(--font-ui); font-weight: 600; letter-spacing: .02em; }
