#m35sim h1,#m35sim h2,#m35sim h3,#m35sim p,#m35sim a,#m35sim span,#m35sim b,#m35sim strong,#m35sim small,#m35sim label,#m35sim li,#m35sim button,#m35sim input{font-family:inherit;text-transform:none;letter-spacing:normal;text-shadow:none;box-shadow:none}#m35sim h1,#m35sim h2,#m35sim h3,#m35sim p,#m35sim li{color:inherit;margin-top:0}#m35sim button{padding:0;border-radius:0;line-height:normal;min-width:0;min-height:0;background:none;border:0;color:inherit}#m35sim button:hover,#m35sim button:focus{background:none;color:inherit}#m35sim input[type=range]{-webkit-appearance:auto;appearance:auto;background:none;border:0;padding:0;border-radius:0}#m35sim img{max-width:none}
/* 12-tier tower simulation (owner: PAGE). Everything scoped under #m35sim; mobile first. */
@font-face { font-family: 'Heebo'; src: url(assets/heebo.woff2) format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; src: url(assets/heebo-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }


#m35sim {
  --bg: #F7F9F6; --stage: #D5DED8; --surface: #FFFFFF;
  --brand: #14532D; --btn: #15803D; --btn-h: #166534; --accent: #22C55E; --data: #0E7490; --data-soft: #E0F2F1;
  --ink: #0F172A; --body: #475569; --muted: #5D6C7E; --line: #DDE7E1;
  --r: 18px; --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .06);
  direction: rtl; text-align: right; color: var(--body); background: var(--bg);
  font-family: 'Heebo', 'Assistant', 'Arial Hebrew', Arial, sans-serif; font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
#m35sim *, #m35sim *::before, #m35sim *::after { box-sizing: border-box; }
#m35sim p, #m35sim h1, #m35sim h2, #m35sim ol, #m35sim ul, #m35sim figure { margin: 0; padding: 0; }
#m35sim [hidden] { display: none !important; }
#m35sim button { font: inherit; color: inherit; }
#m35sim :focus-visible { outline: 3px solid var(--btn); outline-offset: 2px; border-radius: 10px; }
#m35sim .sim-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- hero */
#m35sim .sim-hero { max-width: 1240px; margin: 0 auto; padding: 44px 16px 36px; }
#m35sim .sim-eyebrow { font-size: 14px; font-weight: 600; color: var(--btn); letter-spacing: .01em; margin-bottom: 10px; }
#m35sim .sim-h1, #m35sim .sim-h2 { text-wrap: balance; }
#m35sim .sim-h1 { font-size: 34px; line-height: 1.15; font-weight: 800; color: var(--ink); max-width: 15em; letter-spacing: -.01em; }
#m35sim .sim-hero-lead { font-size: 17px; margin-top: 14px; max-width: 40em; }
#m35sim .sim-toc { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; max-width: 760px; }
#m35sim .sim-toc a { display: flex; gap: 8px; align-items: baseline; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.3; min-height: 44px; }
#m35sim .sim-toc a span { color: var(--btn); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
#m35sim .sim-toc a:hover { border-color: #b9d3c3; }
#m35sim .sim-hero-note { margin-top: 16px; font-size: 14px; color: var(--muted); max-width: 46em; }

/* ---------- pinned sections */
#m35sim .sim-sec { position: relative; height: calc(var(--len, 6) * 100vh); height: calc(var(--len, 6) * 100svh); }
#m35sim .sim-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
#m35sim .sim-stage { position: relative; overflow: hidden; background: var(--stage); min-height: 0; touch-action: pan-y pinch-zoom; }
/* keyboard focus on the stage: the canvas covers the stage's own outline, so the ring is drawn on an overlay above
   the canvas and the stage overlays (inset, follows the stage's rounded corners) */
#m35sim .sim-stage:focus-visible { outline: none; }
#m35sim .sim-stage:focus-visible::after { content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  border-radius: inherit; box-shadow: inset 0 0 0 3px var(--btn), inset 0 0 0 5px rgba(255, 255, 255, .85); }
#m35sim .sim-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y pinch-zoom; }
#m35sim .sim-canvas.is-dragging { cursor: grabbing; }
#m35sim .sim-snap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
#m35sim .sim-stage.has-canvas .sim-snap { visibility: hidden; }
#m35sim .sim-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#m35sim .sim-loading { position: absolute; inset: auto 0 50% 0; text-align: center; color: var(--muted); font-size: 15px; }
#m35sim.sim-ready .sim-loading { display: none; }

/* overlays on the stage */
#m35sim .sim-badge { position: absolute; top: 12px; right: 12px; z-index: 3; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
#m35sim .sim-badge b { color: var(--data); font-weight: 800; }
#m35sim .sim-illus { position: absolute; bottom: 10px; right: 12px; z-index: 3; max-width: calc(100% - 164px); font-size: 12.5px; line-height: 1.35;
  color: var(--muted); background: rgba(255, 255, 255, .86); border-radius: 8px; padding: 4px 8px; }
#m35sim .sim-rot { position: absolute; bottom: 8px; left: 8px; z-index: 3; display: flex; gap: 6px; }
#m35sim .sim-rot button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .92);
  display: grid; place-items: center; cursor: pointer; color: var(--ink); padding: 0; }
#m35sim .sim-rot button:hover { background: #fff; border-color: #b9d3c3; }
/* end of the allowed turn in the cut-away sections (page.js): dimmed, still focusable */
#m35sim .sim-rot button[aria-disabled="true"] { opacity: .45; cursor: default; }
#m35sim .sim-rot button[aria-disabled="true"]:hover { background: rgba(255, 255, 255, .92); border-color: var(--line); }
#m35sim .sim-rot svg { width: 20px; height: 20px; }
#m35sim .sim-callouts { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
#m35sim .sim-callout { position: absolute; top: 0; left: 0; display: flex; align-items: center; gap: 6px; transform: translate(0, -50%);
  white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--ink); direction: ltr; transition: opacity .2s; }
#m35sim .sim-callout i { width: 10px; height: 10px; border-radius: 50%; background: var(--btn); box-shadow: 0 0 0 3px rgba(21, 128, 61, .22); flex: none; }
#m35sim .sim-callout span { direction: rtl; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; box-shadow: var(--shadow); }
#m35sim .sim-callout.flip { flex-direction: row-reverse; transform: translate(-100%, -50%); }
#m35sim .sim-callout.is-off { opacity: 0; }
#m35sim .sim-readout { position: absolute; top: 0; left: 0; z-index: 3; display: grid; grid-template-columns: auto; gap: 2px 12px; padding: 8px 12px;
  background: #0F172A; color: #E2E8F0; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; direction: ltr; text-align: left; }
#m35sim .sim-readout b { color: #5EEAD4; font-size: 18px; font-variant-numeric: tabular-nums; }
#m35sim .sim-readout small { grid-column: 1 / -1; direction: rtl; text-align: right; color: #CBD5E1; font-size: 12px; }

/* panel */
#m35sim .sim-panel { background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#m35sim .sim-kicker { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; display: none; }
#m35sim .sim-kicker b { color: var(--btn); }
#m35sim .sim-h2 { font-size: 20px; line-height: 1.25; font-weight: 800; color: var(--ink); }
#m35sim .sim-lead { display: none; }
#m35sim .sim-card { min-height: 96px; }
#m35sim .sim-card-title { font-size: 17px; font-weight: 700; color: var(--brand); line-height: 1.3; display: flex; gap: 8px; align-items: baseline; }
#m35sim .sim-card-title small { font-size: 13px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
#m35sim .sim-card-text { font-size: 16px; line-height: 1.5; color: var(--body); margin-top: 2px; }
#m35sim .sim-card-note, #m35sim .sim-steplist small { color: var(--muted); font-size: inherit; }
#m35sim .sim-steplist { list-style: none; display: grid; gap: 10px; }
#m35sim .sim-steplist b { display: block; color: var(--ink); }
#m35sim.sim-js .sim-steplist { display: none; }

#m35sim .sim-chips { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin: -4px -16px; padding: 6px 16px; }
#m35sim .sim-chips::-webkit-scrollbar { display: none; }
#m35sim .sim-chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; min-height: 36px; line-height: 1.2; }
#m35sim .sim-chip:hover { border-color: #b9d3c3; }
#m35sim .sim-chip[aria-current="step"] { background: var(--brand); border-color: var(--brand); color: #fff; }
#m35sim .sim-controls { display: flex; align-items: center; gap: 10px; }
#m35sim .sim-range { flex: 1; min-width: 0; display: flex; align-items: center; }
#m35sim .sim-range input { width: 100%; accent-color: var(--btn); height: 32px; margin: 0; cursor: pointer; }
#m35sim .sim-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 14px;
  font-weight: 600; cursor: pointer; min-height: 36px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
#m35sim .sim-btn:hover { border-color: #b9d3c3; }
#m35sim .sim-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
#m35sim .sim-btn svg { width: 14px; height: 14px; }
#m35sim .sim-loop { background: var(--btn); border-color: var(--btn); color: #fff; }
#m35sim .sim-loop:hover { background: var(--btn-h); }
#m35sim .sim-loop[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
#m35sim .sim-loop:disabled { opacity: .45; cursor: not-allowed; }

/* flow: timer (only on the timer step: .is-on). Desktop keeps its space so nothing in the panel moves; on
   narrow screens page.js moves it onto the stage as an overlay, so the stage never changes size. */
#m35sim .sim-extra { display: grid; gap: 8px; }
#m35sim .sim-extra:not(.is-on) { visibility: hidden; }
#m35sim .sim-stage > .sim-extra { position: absolute; inset: auto 12px 56px 12px; z-index: 3; background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); }
#m35sim .sim-stage > .sim-extra:not(.is-on) { display: none; }
/* one compact row on the stage: bar + legend, button beside it */
#m35sim .sim-stage > .sim-extra { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 8px 10px; }
#m35sim .sim-stage > .sim-extra .sim-timer-legend { flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; }
#m35sim .sim-stage > .sim-extra .sim-loop { justify-self: end; padding: 6px 12px; }
#m35sim .sim-timer-bar { display: grid; grid-template-columns: 1fr 3fr; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); }
#m35sim .sim-timer-bar .on, #m35sim .sim-timer-legend i.on { background: var(--data); }
#m35sim .sim-timer-bar .off, #m35sim .sim-timer-legend i.off { background: #CBD8D0; }
#m35sim .sim-timer-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 4px; }
#m35sim .sim-timer-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 5px; vertical-align: -1px; }
#m35sim .sim-routine { font-size: 14px; color: var(--muted); }
#m35sim .sim-extra .sim-loop { justify-self: start; }

/* footer */
#m35sim .sim-foot { max-width: 1240px; margin: 0 auto; padding: 28px 16px 48px; font-size: 13px; color: var(--muted); display: grid; gap: 10px; }
#m35sim .sim-foot p { max-width: 62em; }
#m35sim .sim-foot .sim-foot-routine { font-size: 14px; color: var(--body); }

/* no WebGL: static pictures, no pinning (page.js also switches on .sim-static) */
#m35sim.sim-nogl .sim-rot, #m35sim.sim-nogl .sim-canvas, #m35sim.sim-nogl .sim-snap { display: none; }
#m35sim.sim-nogl .sim-illus, #m35sim.sim-nogl .sim-badge, #m35sim.sim-nogl .sim-pause, #m35sim.sim-nogl .sim-callouts,
#m35sim.sim-nogl .sim-readout { display: none !important; }

/* no JS, or the module never ran: no pinning, no empty stage, the step lists as plain text */
#m35sim.sim-boot .sim-sec, #m35sim.sim-failed .sim-sec { height: auto; }
#m35sim.sim-boot .sim-sticky, #m35sim.sim-failed .sim-sticky { position: relative; height: auto; display: block; }
#m35sim.sim-boot .sim-stage, #m35sim.sim-failed .sim-stage, #m35sim.sim-failed .sim-extra { display: none; }
#m35sim.sim-failed .sim-steplist { display: grid !important; }
#m35sim.sim-boot .sim-panel, #m35sim.sim-failed .sim-panel { padding: 24px 16px; }
#m35sim.sim-boot .sim-lead, #m35sim.sim-failed .sim-lead { display: block; }

/* static key frames (prefers-reduced-motion) */
#m35sim.sim-static .sim-sec { height: auto; }
#m35sim.sim-static .sim-sticky { position: relative; height: auto; grid-template-rows: auto auto; }
#m35sim.sim-static .sim-stage { height: 62vh; height: 62svh; min-height: 340px; max-height: 720px; }
#m35sim.sim-static .sim-sec + .sim-sec { border-top: 1px solid var(--line); }

/* ---------- small phones: keep the panel compact */
@media (max-width: 899px) {
  #m35sim .sim-extra .sim-routine { display: none; }      /* the routine is in the footer at every width */
  #m35sim .sim-extra { gap: 6px; }
  #m35sim .sim-card { min-height: 120px; }
}

/* ---------- desktop */
@media (min-width: 900px) {
  #m35sim .sim-hero { padding: 96px 32px 72px; }
  #m35sim .sim-h1 { font-size: 56px; }
  #m35sim .sim-hero-lead { font-size: 19px; }
  #m35sim .sim-toc { grid-template-columns: repeat(4, 1fr); max-width: none; }
  #m35sim .sim-sticky { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
    gap: 32px; padding: 24px 32px; max-width: 1440px; margin: 0 auto; }
  #m35sim .sim-panel { grid-column: 1; grid-row: 1; align-self: center; border: 0; background: transparent; padding: 0; gap: 14px; }
  #m35sim .sim-stage { grid-column: 2; grid-row: 1; border-radius: 24px; border: 1px solid var(--line); }
  #m35sim .sim-stage:focus-visible { border-radius: 24px; }
  #m35sim .sim-kicker { display: block; }
  #m35sim .sim-h2 { font-size: 38px; line-height: 1.12; }
  #m35sim .sim-lead { display: block; font-size: 17px; }
  #m35sim .sim-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); min-height: 150px; }
  #m35sim .sim-card-title { font-size: 21px; }
  #m35sim .sim-card-text { font-size: 17px; margin-top: 4px; }
  #m35sim .sim-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  #m35sim .sim-badge { top: 16px; right: 16px; font-size: 16px; }
  #m35sim .sim-illus { bottom: 14px; right: 16px; font-size: 13px; }
  #m35sim .sim-rot { bottom: 12px; left: 12px; }
  #m35sim.sim-static .sim-sticky { padding: 48px 32px; }
  #m35sim.sim-static .sim-stage { height: 76vh; }
  #m35sim .sim-foot { padding: 40px 32px 72px; }
}
@media (min-width: 1280px) {
  #m35sim .sim-sticky { grid-template-columns: 420px minmax(0, 1fr); gap: 48px; padding: 28px 48px; }
}

/* ---------- phones held sideways (short and wide, e.g. 844 x 390, 932 x 430): stage and panel side by side like
   on desktop, with a compact panel (no lead, smaller heading, one row of chips, the timer stays in the panel:
   page.js placeExtras). After the desktop block, so it also wins on wide phones (>= 900 px). */
@media (max-height: 520px) and (orientation: landscape) {
  #m35sim .sim-sticky { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); grid-template-rows: minmax(0, 1fr);
    gap: 0; padding: 0; max-width: none; margin: 0; }
  #m35sim .sim-panel { grid-column: 1; grid-row: 1; align-self: stretch; justify-content: center; min-height: 0; gap: 6px;
    overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 0; border-left: 1px solid var(--line);
    padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) 14px; }
  #m35sim .sim-panel > * { flex-shrink: 0; }              /* a long card scrolls the panel, never overlaps the chips */
  #m35sim .sim-stage { grid-column: 2; grid-row: 1; border: 0; border-radius: 0; }
  #m35sim .sim-stage:focus-visible { border-radius: 0; }
  #m35sim .sim-kicker, #m35sim .sim-lead { display: none; }
  #m35sim .sim-h2 { font-size: 18px; line-height: 1.2; }
  #m35sim .sim-card { min-height: 108px; background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  #m35sim .sim-card-title { font-size: 16px; }
  #m35sim .sim-card-text { font-size: 14.5px; line-height: 1.45; margin-top: 2px; }
  #m35sim .sim-chips { flex-wrap: nowrap; overflow-x: auto; margin: -4px -14px; padding: 4px 14px; }
  #m35sim .sim-chip { min-height: 34px; padding: 5px 11px; font-size: 13.5px; }
  #m35sim .sim-btn { min-height: 34px; }
  #m35sim .sim-range input { height: 28px; }
  /* timer in the panel: bar + legend, the button beside them (one row) */
  #m35sim .sim-panel > .sim-extra { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; }
  #m35sim .sim-extra .sim-routine { display: none; }
  #m35sim .sim-timer-legend { flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; }
  #m35sim .sim-extra .sim-loop { justify-self: end; padding: 5px 12px; }
  #m35sim .sim-badge { top: 10px; right: 10px; font-size: 14px; padding: 4px 12px; }
  #m35sim .sim-illus { bottom: 8px; right: 10px; font-size: 12px; max-width: calc(100% - 150px); }
  #m35sim .sim-rot { bottom: 8px; left: max(8px, env(safe-area-inset-left)); }
  #m35sim .sim-rot button { width: 36px; height: 36px; }
  #m35sim.sim-static .sim-sticky { padding: 0; grid-template-rows: auto; }
  #m35sim.sim-static .sim-stage { height: 92vh; height: 92svh; min-height: 260px; max-height: none; }
  #m35sim .sim-hero { padding: 28px 24px; }
  #m35sim .sim-foot { padding: 24px 24px 36px; }
}

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

body:has(#m35sim){background:#F7F9F6}
