/*
VOICE: matter-of-fact school tool, like the real thing on the desk.
IDEA: a physical scientific calculator, body in ink blue, plain grey-green LCD like the real one.
PICTURE: the calculator itself, full screen on a phone, centered on desktop.
COLOUR and TYPE: ink blue body, marker yellow for SHIFT and the hot keys, paper keys; Assistant, wordmark in Varela Round (brand 58).
LAYOUT: phone = calculator fills the screen, no scroll. Desktop = short Hebrew side text + calculator.
*/
:root {
  /* ברירת מחדל = ערכי המצב הבהיר (מיתוג 6.12): דפדפן בלי prefers-color-scheme לא מקבל את הצהוב והקרם הישנים */
  --ink: #11204B; --ink2: #E0E4FF; --ink3: #2d4372; --deep: #F4F6FF;
  --yel: #51B3FC; --paper: #FFFFFF; --paper2: #E0E4FF;
  --focus: #1F6FDB; /* outline של פוקוס: 3:1 לפחות מול הרקע. כהה: #51B3FC */
  --lcd: #e4ead9; --lcdink: #17233d;
  color-scheme: light;

  /* calculator colour (skin): defaults = black, JS (src/skins.js) sets the chosen one */
  --c-body: #2a2a2c; --c-pad: #1f1f21; --c-fn: #3b3b3e; --c-fn-t: #ffffff; --c-round: #56565a; --c-num: #6f6f72; --c-num-t: #ffffff; --c-hot: #8cba45; --c-hot-t: #ffffff;
  --c-lab: #e6e6e6; --c-sl: #e0b33c; --c-al: #e8706a; --c-bl: #8ec5ea; --c-frame: #111111; --c-shade: #111111; --c-arrow: #f2f2f2; --c-lcd: #d6e4e2; --c-lcd-hi: #d0dfdc; --c-lcd-lo: #c9d8d5;
  /* skin: swap these to re-colour (question 30) */
  --shade: #0c152b; --arrow: #e3eaf7; --mkey-hi: #3e5689; --mkey-lo: #273c66; --fkey-hi: #3a5288; --fkey-lo: #263a63; --hot-hi: #ffe27a; --hot-lo: #f0bf1f; --edge: #33497a; --fkey-text: #f3f6fc; --lcd-hi: #dfe5d6; --lcd-lo: #d9dfcf; --ink-lo: #182644; --lcd-frame: #0f1a31;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--deep); color: #eef2fa; font: 16px/1.5 Assistant, system-ui, sans-serif;
  overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }

:root { --legH: 20px; --vh: calc(100dvh - var(--legH)); }
.page { height: var(--vh); display: flex; align-items: center; justify-content: center; gap: clamp(32px, 5vw, 96px); padding: 0; }
.side { display: none; }

/* ---------- calculator body ---------- */
.calc {
  position: relative; height: var(--vh); width: min(100vw, calc(var(--vh) * .56)); display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.06)), var(--c-body);
  container-type: size; overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.bar { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
.wm { display: inline-flex; align-items: center; min-height: 32px; }
#menubtn { width: 44px; height: 44px; border: 0; background: none; display: grid; place-content: center; gap: 4px; cursor: pointer; margin-left: -10px; position: relative; }
#menubtn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--c-lab); }
.shell { flex: 1; display: flex; flex-direction: column; padding: 0 3.2cqw max(10px, 2.4cqw); gap: 1.6cqh; min-height: 0; }

/* ---------- LCD ---------- */
.lcd {
  flex: 0 0 clamp(104px, 19cqh, 200px); border-radius: 6px; padding: 1cqh 3cqw 1.1cqh;
  background: linear-gradient(180deg, var(--c-lcd-hi), var(--c-lcd) 30%, var(--c-lcd-lo));
  color: var(--lcdink); display: flex; flex-direction: column;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.18), inset 0 0 0 1px rgba(0,0,0,.25), 0 0 0 5px var(--c-frame), 0 0 0 6px rgba(255,255,255,.12);
  margin: 6px 4px 2px; font-family: Assistant, sans-serif; overflow: hidden;
}
.lcd.off { background: #cfd5c4; }
.status { display: flex; gap: 1.4cqw; font: 700 clamp(9px, 2.7cqw, 12px)/1 Assistant, sans-serif; height: 1.3em; }
.status span { opacity: 0; }
.status span.on { opacity: .9; }
.lcdbody { flex: 1; display: flex; flex-direction: column; min-height: 0; font-size: clamp(18px, 6.4cqw, 30px); }
.in { flex: 1; white-space: nowrap; overflow: hidden; display: flex; align-items: center; padding-top: .1em; scrollbar-width: none; }
.in::-webkit-scrollbar { display: none; }
.out { text-align: right; font-size: 1.32em; font-weight: 600; white-space: nowrap; overflow: hidden; display: flex; justify-content: flex-end; align-items: center; min-height: 1.6em; }
.out.small { font-size: 1.05em; min-height: 1.4em; }
.out.in2 { justify-content: flex-start; font-size: 1em; font-weight: 400; }
.lbl { font-weight: 600; }
.ln { white-space: nowrap; }
.lim + * { margin-left: .05em; }
.pv { margin-left: .6em; opacity: .7; }
.cur { display: inline-block; width: 2px; height: 1.05em; background: var(--lcdink); vertical-align: middle; animation: blink 1s steps(1) infinite; margin: 0 -1px; }
@keyframes blink { 50% { opacity: 0; } }
.slot { display: inline-block; width: .55em; height: .7em; border: 1.5px dotted rgba(23,35,61,.55); vertical-align: middle; margin: 0 1px; }
sup { font-size: .62em; vertical-align: .75em; line-height: 0; }
sub { font-size: .62em; vertical-align: -.35em; line-height: 0; }
sup .fr, sup .sq { font-size: 1em; }
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .12em; font-size: .78em; line-height: 1.05; }
.fr .nu { padding: 0 .15em .08em; border-bottom: 1.5px solid currentColor; display: block; }
.fr .de { padding: .08em .15em 0; display: block; }
.out .fr { font-size: .8em; }
.mx { margin-right: .05em; }
.sq { display: inline-flex; align-items: stretch; margin: 0 .05em; }
.sq .rd { font-size: 1.05em; line-height: 1; transform: scaleY(1.12); transform-origin: bottom; margin-right: -.02em; }
.sq .ra { border-top: 1.5px solid currentColor; padding: .02em .1em 0; line-height: 1.05; }
.sq .ix { font-size: .5em; vertical-align: 1.3em; margin-right: -.45em; }
.ng { font-size: .8em; margin-right: .03em; }
.pc { font-weight: 700; font-size: .85em; margin: 0 .05em; }
.x10 { margin-left: .05em; }
.err { display: flex; flex-direction: column; justify-content: center; height: 100%; gap: .15em; font-size: .72em; }
.err b { font-size: 1.15em; }
.menu { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: .12em .5em; font-size: .62em; padding-top: .2em; line-height: 1.3; }
.menu.one { grid-template-columns: 1fr; }
.menu .mt { grid-column: 1 / -1; font-weight: 700; }
.menu .mi { white-space: nowrap; }
.grid { border-collapse: collapse; font-size: .58em; width: 100%; table-layout: fixed; }
.grid th, .grid td { border: 1px solid rgba(23,35,61,.35); padding: .06em .25em; text-align: right; white-space: nowrap; overflow: hidden; height: 1.35em; }
.grid th { font-weight: 700; text-align: center; }
.grid td:first-child, .grid th:first-child { width: 1.7em; text-align: center; font-size: .85em; }
.grid td.sel, .grid tr.sel td:not(:first-child) { background: var(--lcdink); color: var(--c-lcd); }

@media (max-height: 700px) { .bar { height: 38px; } }
.lim { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; font-size: .62em; margin-right: .1em; }
.lim b { font-size: 1.7em; font-weight: 400; line-height: .9; }
.dx { margin-left: .15em; }
.fr.dd { font-size: .7em; }
.at sub { font-size: .55em; }
.sv { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05em; }
.sv b { font-weight: 600; }
.sv.sm { font-size: .8em; }

/* sales screen */
.upg[hidden] { display: none; }
.upg { position: absolute; inset: 0; z-index: 8; background: rgba(12,20,38,.94); display: grid; place-items: center; padding: 24px; }
.upgbox { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 22px 20px 18px; width: min(340px, 100%); text-align: right; box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 12px 32px rgba(0,0,0,.4); }
.upgbox .wm { color: var(--ink); margin: 0 0 10px; font-size: 20px; }
.upgbox h2 { font-size: 24px; line-height: 1.15; margin: 0 0 10px; }
.upgbox p { margin: 0 0 18px; font-size: 16px; line-height: 1.5; }
.b1, .b2 { display: block; width: 100%; min-height: 48px; border-radius: 10px; border: 0; font: 700 17px/1.2 Assistant, sans-serif; cursor: pointer; padding: 8px 12px; }
.b1 { background: #1F6FDB; color: #fff; } /* כפתור ראשי לפי ספר המותג (4.82:1). כהה: תכלת עם נייבי */
.b2 { background: transparent; color: var(--ink); margin-top: 8px; text-decoration: underline; }
.acts { display: grid; gap: 4px; margin: 14px 0 4px; }
.acts .b2 { border: 1.5px solid var(--ink); text-decoration: none; }

/* toast + menu */
.toast { position: absolute; left: 50%; top: 50px; transform: translate(-50%, -8px); background: var(--yel); color: var(--ink); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.3); z-index: 5; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sheet { position: fixed; inset: 0; z-index: 10; }
.scrim { position: absolute; inset: 0; background: rgba(8,14,28,.55); }
.panel { position: absolute; top: 0; bottom: 0; right: 0; width: min(340px, 88vw); background: var(--paper); color: var(--ink); padding: 8px 20px 24px; overflow-y: auto; box-shadow: -2px 0 12px rgba(0,0,0,.3); -webkit-user-select: text; user-select: text; }
.mhead { display: flex; justify-content: space-between; align-items: center; height: 52px; }
.mhead .wm { color: var(--ink); }
.x { width: 44px; height: 44px; border: 0; background: none; font-size: 18px; cursor: pointer; }
.row { display: flex; justify-content: space-between; align-items: center; min-height: 48px; border-bottom: 1px solid #ddd8c8; font-weight: 600; }
.row input { width: 22px; height: 22px; accent-color: var(--ink); }
.panel h3 { font-size: 16px; margin: 22px 0 4px; }
.panel p { margin: 0 0 6px; font-size: 15px; line-height: 1.5; }
.sr { position: fixed; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- desktop ---------- */
@media (min-width: 1000px) {
  body { background: radial-gradient(circle at 70% 30%, var(--ink2), var(--deep) 70%); }
  .calc { height: min(calc(var(--vh) - 32px), 900px); width: calc(min(calc(var(--vh) - 32px), 900px) * .52); border-radius: 26px; box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 2px 2px rgba(0,0,0,.2), 0 8px 18px rgba(0,0,0,.3), 0 24px 60px rgba(0,0,0,.45); padding: 6px 6px 10px; }
  .side { display: block; max-width: 380px; color: #dfe7f5; }
  .brand { margin: 0 0 18px; }
  .side h1 { font-size: clamp(28px, 2.6vw, 40px); line-height: 1.1; margin: 0 0 32px; color: #fff; text-wrap: balance; }
  .side h2 { font-size: 17px; margin: 0 0 8px; }
  .kbd { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 0; font-size: 15px; }
  .kbd dt { font-weight: 700; }
  .kbd dd { margin: 0; color: #b9c6de; }
  .draft { margin-top: 28px; font-size: 13px; color: #8fa0c0; }
}
@media (prefers-reduced-motion: reduce) { .key, .toast { transition: none; } .cur { animation: none; } }
/* colour picker in the menu */
.skins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; margin: 6px 0 4px; }
.sw { display: grid; justify-items: center; gap: 4px; min-height: 48px; min-width: 44px; font-size: 13px; cursor: pointer; text-align: center; line-height: 1.2; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw i { width: 40px; height: 40px; border-radius: 10px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset; position: relative; overflow: hidden; }
.sw i::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 18%; height: 30%; border-radius: 4px; background: var(--k); }
.sw input:checked + i { outline: 3px solid var(--ink); outline-offset: 2px; }
.sw input:focus-visible + i { outline: 3px dashed var(--ink); outline-offset: 2px; }
.fl { display: flex; gap: 8px; }
.fl a { flex: 1; min-height: 44px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 10px; color: var(--ink); font-weight: 700; text-decoration: none; }

/* ---------- face: traced from a straight-on photo of the real calculator (Noa 30.11, "חייב להיות זהה").
   Every size below is in photo pixels of a body 618 wide (1u = face width / 618), origin x=10 y=186 of the photo. ---------- */
@font-face { font-family: 'Mobo Keys'; src: url(fonts/roboto.woff2) format('woff2'); font-weight: 300 500; font-display: block; }
@font-face { font-family: 'Mobo Serif'; src: url(fonts/serif-x.woff2) format('woff2'); font-style: italic; font-display: block; }
@font-face { font-family: 'Mobo LCD'; src: url(fonts/pixelify.woff2) format('woff2'); font-weight: 400 700; font-display: block; }
@font-face { font-family: 'Mobo LCD'; src: url(fonts/lcd-paren.woff2) format('woff2'); font-weight: 400 700; unicode-range: U+0028-0029, U+0030-0039, U+005B-005D; size-adjust: 115%; font-display: block; }
.shell { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0; gap: 0; min-height: 0; container-type: size; }
.face { --u: calc(100cqw / 618); position: relative; width: min(100cqw, calc(100cqh * 618 / 1115)); aspect-ratio: 618 / 1115; flex: none; container-type: inline-size; font-family: 'Mobo Keys', Roboto, Assistant, sans-serif; }
.bezel { position: absolute; left: calc(45 * var(--u)); top: calc(8 * var(--u)); width: calc(528 * var(--u)); height: calc(234 * var(--u)); border-radius: calc(16 * var(--u)); background: var(--c-frame); box-shadow: 0 calc(1 * var(--u)) 0 rgba(255,255,255,.10), inset 0 calc(2 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.5); }
.lcd { position: absolute; left: calc(15 * var(--u)); top: calc(18 * var(--u)); width: calc(496 * var(--u)); height: calc(199 * var(--u)); margin: 0; border-radius: calc(7 * var(--u));
  padding: calc(14 * var(--u)) calc(18 * var(--u)) calc(10 * var(--u)); box-shadow: inset 0 calc(3 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.28), inset 0 0 0 calc(1 * var(--u)) rgba(0,0,0,.35);
  font-family: 'Mobo LCD', monospace; color: #111; }
.lcd .status { font: 700 calc(19 * var(--u)) / 1 'Mobo Keys', Roboto, sans-serif; height: calc(22 * var(--u)); gap: calc(14 * var(--u)); justify-content: flex-start; }
.lcdbody { font-size: calc(58 * var(--u)); font-weight: 400; line-height: 1; letter-spacing: .04em; }
.lcd .out { font-size: 1em; font-weight: 400; }
.lcd .out.small { font-size: .8em; }
.lcd .lbl, .lcd .grid th, .lcd .menu .mt { font-weight: 700; }

.keys { position: absolute; inset: 0; pointer-events: none; }
.kw, .pad { position: absolute; pointer-events: auto; left: calc(var(--cx) * var(--u)); top: calc(var(--cy) * var(--u)); width: calc(var(--cw) * var(--u)); height: calc(var(--ch) * var(--u)); cursor: pointer; }
.key { position: absolute; left: calc(var(--kx) * var(--u)); top: calc(var(--ky) * var(--u)); width: calc(var(--kw) * var(--u)); height: calc(var(--kh) * var(--u));
  border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0;
  border-radius: calc(10 * var(--u)); background: var(--c-fn); color: var(--c-fn-t);
  font: 350 calc(25.5 * var(--u)) / 1 'Mobo Keys', Roboto, sans-serif; letter-spacing: 0;
  box-shadow: 0 0 0 calc(1.6 * var(--u)) rgba(0,0,0,.75), inset 0 calc(2 * var(--u)) calc(1 * var(--u)) rgba(255,255,255,.16), inset 0 0 0 calc(3 * var(--u)) rgba(255,255,255,.07), 0 calc(3 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.45);
  transition: transform .06s ease-out; }
.key.down, .key:active { transform: translateY(calc(1.5 * var(--u))); }
.key:focus-visible, .ar:focus-visible { outline: 3px solid var(--c-sl); outline-offset: 2px; }
.kl { display: inline; line-height: 1; white-space: nowrap; }
.key sup { font-size: .62em; vertical-align: .6em; line-height: 0; }
.key sub { font-size: .62em; }
.key i { font-style: normal; }
.kf { display: inline-flex; flex-direction: column; align-items: center; line-height: .8; font-size: .78em; }
.kf b { font-weight: inherit; }
.kf b:first-child { border-bottom: calc(2 * var(--u)) solid currentColor; padding-bottom: calc(2 * var(--u)); }
.kf.sm { font-size: .78em; vertical-align: middle; }
.k-num .key { border-radius: calc(12 * var(--u)); background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0) 12%), var(--c-num); color: var(--c-num-t); font-weight: 300; font-size: calc(56 * var(--u));
  box-shadow: 0 0 0 calc(1.6 * var(--u)) rgba(0,0,0,.7), inset 0 calc(2 * var(--u)) calc(1 * var(--u)) rgba(255,255,255,.28), 0 calc(3 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.45); }
.k-num.r4 .key { background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.14)), var(--c-num); }
.k-num[data-k="mul"] .key, .k-num[data-k="div"] .key, .k-num[data-k="add"] .key, .k-num[data-k="sub"] .key, .k-num[data-k="eq"] .key { font-size: calc(50 * var(--u)); }
.k-num[data-k="e10"] .key { font-size: calc(36 * var(--u)); font-weight: 350; }
.k-num[data-k="ans"] .key { font-size: calc(38 * var(--u)); font-weight: 350; }
.k-hot .key { background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 15%), var(--c-hot); color: var(--c-hot-t); font-size: calc(38 * var(--u)); font-weight: 350; }

/* labels printed above the keys */
.lab { position: absolute; left: calc((var(--kx) - 3) * var(--u)); width: calc((var(--kw) + 6) * var(--u)); top: calc((var(--ky) - var(--lg) - 20) * var(--u)); height: calc(20 * var(--u));
  display: flex; justify-content: space-between; align-items: flex-end; white-space: nowrap; pointer-events: none;
  font: 400 calc(17.5 * var(--u)) / 1 'Mobo Keys', Roboto, sans-serif; color: var(--c-lab); }
.lab.one { justify-content: center; }
.lab .sl { color: var(--c-sl); }
.lab .al { color: var(--c-al); }
.lab .bl { color: var(--c-bl); }
.lab .il { color: var(--c-al); font-style: italic; font-weight: 500; }
.lab .wl { color: var(--c-lab); }
.lab .wl + .sl { margin-left: calc(5 * var(--u)); }
.lab sup { font-size: .7em; vertical-align: .55em; line-height: 0; }
.lab .kf.sm { font-size: .75em; }
.lab .kf b:first-child { border-bottom-width: calc(1.5 * var(--u)); padding-bottom: calc(1 * var(--u)); }
/* corner brackets around menu names and A to F, like the print on the real one */
.bk { position: relative; padding: 0 calc(7 * var(--u)); }
.bk::before, .bk::after { content: ''; position: absolute; bottom: calc(-3 * var(--u)); width: calc(4 * var(--u)); height: calc(10 * var(--u)); border-top: calc(1.6 * var(--u)) solid var(--bk, currentColor); }
.bk::before { left: 0; border-left: calc(1.6 * var(--u)) solid var(--bk, currentColor); }
.bk::after { right: 0; border-right: calc(1.6 * var(--u)) solid var(--bk, currentColor); }
.bk.b-bl { --bk: var(--c-bl); } .bk.b-pl { --bk: var(--c-pl, #9b7fe0); } .bk.b-lab { --bk: var(--c-lab); } .bk.b-sl { --bk: var(--c-sl); }

/* round SHIFT ALPHA MODE ON keys and the four arrow keys: brushed metal with concentric rings */
.k-mode .key, .ar::before { background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.10) 0 calc(.7 * var(--u)), rgba(0,0,0,.10) calc(.7 * var(--u)) calc(1.7 * var(--u))),
    conic-gradient(from 20deg, rgba(0,0,0,var(--sh1)), rgba(255,255,255,var(--sh2)) 22%, rgba(0,0,0,var(--sh1)) 45%, rgba(255,255,255,var(--sh2)) 72%, rgba(0,0,0,var(--sh1))),
    var(--c-round); }
.face { --sh1: .30; --sh2: .38; }
[data-skin="black"] .face, [data-skin="greyblue"] .face { --sh1: .38; --sh2: .55; }
.k-mode .key { border-radius: 50%; box-shadow: 0 0 0 calc(3 * var(--u)) rgba(0,0,0,.55), 0 calc(3 * var(--u)) calc(4 * var(--u)) rgba(0,0,0,.5); }
.k-mode .key::after { display: none; }
body.shift-on .k-shift .key { background: var(--c-sl); }
body.alpha-on .k-alpha .key { background: var(--c-al); }
.pad .base { position: absolute; left: 12.6%; top: 4.3%; width: 77.9%; height: 87.1%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0 30%, transparent 31%) 0 0 / calc(14 * var(--u)) calc(12 * var(--u)), var(--c-pad); opacity: .55; box-shadow: inset 0 0 calc(10 * var(--u)) rgba(0,0,0,.6); }
.ar { position: absolute; inset: 0; border: 0; background: none; cursor: pointer; padding: 0; z-index: 1; }
.ar::before { content: ''; position: absolute; box-shadow: 0 0 0 calc(1.5 * var(--u)) rgba(0,0,0,.6), 0 calc(3 * var(--u)) calc(4 * var(--u)) rgba(0,0,0,.5); }
.ar.up { clip-path: polygon(0 0, 100% 0, 50% 50%); } .ar.dn { clip-path: polygon(0 100%, 100% 100%, 50% 50%); }
.ar.lf { clip-path: polygon(0 0, 0 100%, 50% 50%); } .ar.rt { clip-path: polygon(100% 0, 100% 100%, 50% 50%); }
.ar.up::before { left: 38.9%; width: 22.6%; top: 0; height: 39.3%; border-radius: calc(12 * var(--u)) calc(12 * var(--u)) calc(8 * var(--u)) calc(8 * var(--u)); }
.ar.dn::before { left: 38.9%; width: 22.6%; top: 59.3%; height: 40.7%; border-radius: calc(8 * var(--u)) calc(8 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u)); }
.ar.lf::before { left: 0; width: 34.2%; top: 35.7%; height: 29.3%; border-radius: calc(12 * var(--u)) calc(8 * var(--u)) calc(8 * var(--u)) calc(12 * var(--u)); }
.ar.rt::before { left: 65.3%; width: 34.7%; top: 35.7%; height: 29.3%; border-radius: calc(8 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u)) calc(8 * var(--u)); }
.ar.down::before { transform: translateY(calc(1.5 * var(--u))); }
.lab > * { flex: none; }
.mx { font-family: 'Mobo Serif', 'Times New Roman', serif; font-style: italic; font-weight: 400; font-size: 1.12em; }
.key .mx { font-size: 1.22em; }
.key sup .mx { font-size: 1em; }
.dms { font-size: .8em; margin-right: .08em; }
.pad .base { background: radial-gradient(circle, rgba(255,255,255,.06) 0 30%, transparent 32%) 0 0 / calc(13 * var(--u)) calc(11 * var(--u)), rgba(0,0,0,.55); opacity: 1; }
.key .wide { font-size: 1.3em; line-height: .8; margin: 0 .04em; }
/* the short grooves under SHIFT ALPHA and MODE ON, like the print on the real body */
.k-shift::after, .kw[data-k="mode"]::after { content: ''; position: absolute; left: calc(55 * var(--u)); width: calc(56 * var(--u)); top: calc(84 * var(--u)); height: calc(1.6 * var(--u)); background: rgba(255,255,255,.22); border-radius: 1px; pointer-events: none; }
.kw[data-k="mode"]::after { left: calc(53 * var(--u)); width: calc(46 * var(--u)); }
/* the real display draws plain lines in the big font; fractions, roots, menus and tables need two rows, so they use a smaller size to fit */
.lcd { padding-top: calc(9 * var(--u)); padding-bottom: calc(6 * var(--u)); }
.lcdbody:has(.fr, .sq, .lim, .menu, .grid, .err, .sv, .lbl, sup) { font-size: calc(42 * var(--u)); }
.lcd .out { min-height: 1.2em; }
.lcd .out.small { min-height: 1.1em; }
/* QA 30.11 round 2: rows may spread into the gaps (never the keys) so every tap cell is at least 44px.
   --ux horizontal unit, --uy vertical unit, --u size unit = the smaller one. Keys and labels keep the photo's shape. */
.face { --H: 1115; --oy: 0; --ux: calc(100cqw / 618); --uy: calc(100cqh / var(--H)); --u: min(var(--ux), var(--uy));
  width: 100cqw; aspect-ratio: auto; height: min(100cqh, max(calc(100cqw * var(--H) / 618), calc(44.5px * var(--H) / 74))); container-type: size; }
@media (max-height: 700px) { .bar { height: 34px; } .face { --H: 1058; --oy: 8; } }
.bezel { left: calc(309 * var(--ux) - 264 * var(--u)); top: calc((8 - var(--oy)) * var(--uy)); }
.kw { left: calc(var(--cx) * var(--ux)); top: calc((var(--cy) - var(--oy)) * var(--uy)); width: calc(var(--cw) * var(--ux)); height: calc(var(--ch) * var(--uy)); }
.pad { left: calc((var(--cx) + var(--cw) / 2) * var(--ux) - var(--cw) / 2 * var(--u)); top: calc((var(--cy) + var(--ch) / 2 - var(--oy)) * var(--uy) - var(--ch) / 2 * var(--u)); width: calc(var(--cw) * var(--u)); height: calc(var(--ch) * var(--u)); }
.kw .key { left: calc((var(--cw) * var(--ux) - var(--kw) * var(--u)) / 2); top: calc((var(--ch) * var(--uy) - var(--ch) * var(--u)) / 2 + var(--ky) * var(--u)); }
.kw .lab { left: calc((var(--cw) * var(--ux) - var(--kw) * var(--u)) / 2 - var(--lw, 0) * var(--u)); width: calc((var(--kw) + 2 * var(--lw, 0)) * var(--u)); top: calc((var(--ch) * var(--uy) - var(--ch) * var(--u)) / 2 + (var(--ky) - var(--lg) - 20) * var(--u)); padding: 0 calc(var(--lp, 0) * var(--u)) 0 calc(var(--lpl, 0) * var(--u)); }
.kw[data-k="dot"] { --lw: 6; }
.kw[data-k="dot"] .lab { justify-content: center; gap: calc(6 * var(--u)); }
.kw[data-k="e10"] { --lpl: 6; --lp: 26; }
/* the dark bar under each pair of round keys, with its light lower edge */
.k-shift::before, .kw[data-k="mode"]::before { content: ''; position: absolute; left: calc(var(--cw) * var(--ux) / 2 - 4 * var(--u)); width: calc(81 * var(--ux) + 8 * var(--u)); top: calc((var(--ch) * var(--uy) - var(--ch) * var(--u)) / 2 + (var(--ky) + 6) * var(--u)); height: calc(42 * var(--u)); border-radius: calc(21 * var(--u)); background: rgba(0,0,0,.5); box-shadow: 0 calc(1.6 * var(--u)) 0 rgba(255,255,255,.2); pointer-events: none; }
.kw[data-k="mode"]::before { width: calc(82.5 * var(--ux) + 8 * var(--u)); }
.k-shift::after, .kw[data-k="mode"]::after { display: none; }
.kw.k-mode .key { z-index: 1; }
/* cross base: reaches past the arrow keys, rounded outer ends left and right */
.pad .base { left: -3%; top: 31%; width: 106%; height: 38%; border-radius: calc(26 * var(--u)); }
.pad .base::before { content: ''; position: absolute; left: 14%; right: 14%; top: -72%; bottom: -72%; border-radius: 46%; background: inherit; }
.key .wide { font-size: 1em; line-height: 1; margin: 0 -.02em; letter-spacing: 0; }
/* display: same height and weight as the photo */
.lcdbody { font-size: calc(52 * var(--u)); letter-spacing: .03em; color: #262626; }
.lcd .status { position: relative; display: block; }
.lcd .status span { position: absolute; top: 0; }
/* QA round 2, item 7: on the device the right-hand labels of these rows sit a little inside the key edge */
.kw:is([data-k="sq"], [data-k="pow"], [data-k="log"], [data-k="ln"], [data-k="eng"], [data-k="rp"], [data-k="sd"], [data-k="mplus"]) { --lp: 4.5; --lpl: 2; }
.kw[data-k="e10"] { --lpl: 3; --lp: 29; }
@media (max-height: 700px) { .shell { padding-bottom: 4px; } .bar { height: 30px; } }
@media (max-width: 999px) { .calc { width: min(100vw, max(calc(var(--vh) * .56), 430px)); } }
/* very short viewports (phone browser with toolbars): no inner scroll (Noa's rule). The display shrinks to two lines,
   the top bar goes away (menu icon beside the display), the keys keep the photo's layout and a 44px tap cell. */
.kw { top: calc((var(--cy) - var(--oy)) * var(--uy) + var(--sh, 0px)); }
.pad { top: calc((var(--cy) + var(--ch) / 2 - var(--oy)) * var(--uy) + var(--sh, 0px) - var(--ch) / 2 * var(--u)); }
.face { --uy: calc((100cqh - var(--sh, 0px)) / var(--H)); }
@media (max-height: 660px) {
  /* first-open spec O4: the toast covers only the status and input rows of the display, never the result row */
  .toast { top: calc(env(safe-area-inset-top) + 6px); padding: 6px 12px; font-size: 13px; }
  /* known exception: 320x568 (first-generation small phone) gets 41.4px in the SHIFT/ALPHA row, a width limit (QA decision 30.11) */
  .bar { height: 0; padding: 0; position: static; }
  .bar .wm { display: none; }
  #menubtn { position: absolute; z-index: 3; top: 14px; left: 2px; margin: 0; }
  #sharex { position: absolute; z-index: 3; top: 60px; left: 2px; }
  .shell { padding-bottom: 4px; }
  /* the empty band between the round keys and the CALC row is cut by 20 photo px; the display gets the room */
  .face { --H: 774; --oy: 270; --sh: 76px; height: 100cqh; }
  .kw:not(.k-mode) { --cut: 20; }
  .kw { top: calc((var(--cy) - var(--oy) - var(--cut, 0)) * var(--uy) + var(--sh, 0px)); }
  .bezel { left: 46px; right: 8px; width: auto; top: 3px; height: 71px; border-radius: 8px; }
  .lcd { left: 4px; top: 4px; right: 4px; bottom: 4px; width: auto; height: auto; padding: 1px 8px; border-radius: 4px; }
  .lcd .status { position: absolute; left: 8px; right: 8px; top: 2px; font-size: 9px; height: 0; }
  .lcdbody { font-size: 19px; padding-top: 6px; }
  .lcdbody:has(.fr, .sq, .lim, sup, .err, .sv, .lbl) { font-size: 16px; }
  .lcdbody:has(.menu, .grid) { font-size: 15px; }
  .lcd .fr { font-size: .8em; }
}

/* ---------- automatic dark mode (Noa 30.11): follows the device setting. The calculator body, keys and display keep
   their real colours (Q16, Q40); only the page around it, the menu, the sales screen and messages change.
   Palette = final brand tokens Q51 (13א+13ב), /mnt/project-files/branding/rebrand/v13/final-51/mobo-tokens.css. ---------- */
:root { --d-bg: #070F26; --d-surface: #11204B; --d-surface2: #16285A; --d-text: #EAF1FF; --d-mute: #AFC0E6; --d-line: #2A3B6E; --d-accent: #51B3FC; --d-on-accent: #11204B; --d-hi: #BDA1F6; }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --paper: var(--d-surface); --ink: var(--d-text); --yel: var(--d-accent); --deep: var(--d-bg); --ink2: var(--d-surface2); --focus: #51B3FC; }
  body { color: var(--d-text); }
  .scrim { background: rgba(2, 6, 18, .7); }
  .panel { box-shadow: -1px 0 0 var(--d-line); }
  .row { border-bottom-color: var(--d-line); }
  .row input { accent-color: var(--d-accent); }
  .panel p { color: var(--d-mute); }
  .b1, .toast { background: var(--d-accent); color: var(--d-on-accent); box-shadow: none; }
  .b2 { color: var(--d-text); }
  .acts .b2, .fl a { border-color: var(--d-accent); color: var(--d-text); }
  .sw i { box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset; }
  .sw input:checked + i { outline-color: var(--d-accent); }
  .sw input:focus-visible + i { outline-color: var(--d-accent); }
  .upg { background: rgba(4, 9, 24, .94); }
  .upgbox { box-shadow: 0 0 0 1px var(--d-line); }
  .upgbox .wm, .mhead .wm { color: var(--d-text); }
  .side { color: var(--d-text); }
  .side h1 { color: #fff; }
  .kbd dd { color: var(--d-mute); }
  .draft { color: var(--d-mute); }
}
@media (prefers-color-scheme: dark) and (min-width: 1000px) {
  body { background: radial-gradient(circle at 70% 30%, var(--d-surface2), var(--d-bg) 70%); }
  .brand { color: var(--d-accent); }
}

/* light mode frame in the Q51 brand colours (menu, sales screen, desktop page). Calculator body unchanged. */
@media (prefers-color-scheme: light) {
  :root { --paper: #FFFFFF; --ink: #11204B; --yel: #51B3FC; --deep: #F4F6FF; --ink2: #E0E4FF; }
  .b1 { background: #1F6FDB; color: #fff; box-shadow: none; }
  .toast { color: #11204B; }
  .row { border-bottom-color: #B3D9FD; }
  .panel p { color: #4A5A85; }
  .upg { background: rgba(17, 32, 75, .88); }
}
@media (prefers-color-scheme: light) and (min-width: 1000px) {
  body { background: #F4F6FF; color: #11204B; }
  .side { color: #11204B; } .side h1 { color: #11204B; } .kbd dd, .draft { color: #4A5A85; } .brand { color: #11204B; }
}
/* sales screen list */
.upgl { margin: 0 0 18px; padding: 0 18px 0 0; font-size: 16px; line-height: 1.45; }
.upgl li { margin: 0 0 6px; }
.upgl li::marker { color: var(--acc, currentColor); }
/* sales screen: closing is as visible as buying (legal rules for minors) */
.upgbox .b2 { border: 1.5px solid currentColor; text-decoration: none; margin-top: 10px; }
.upgbox p.upgl span { display: block; }
.upgbox p.upgl { padding: 0; }

/* ---------- R2 install invitation: a bar under the calculator, never over the keys ---------- */
body.inst-on .calc { height: calc(var(--vh) - var(--instH, 0px)); }
body.inst-on .page { height: calc(var(--vh) - var(--instH, 0px)); }
@media (min-width: 1000px) { body.inst-on .calc { height: min(calc(var(--vh) - 32px - var(--instH, 0px)), 900px); width: calc(min(calc(var(--vh) - 32px - var(--instH, 0px)), 900px) * .52); } }
.instbar { position: fixed; left: 0; right: 0; bottom: var(--legH); z-index: 30;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: #fff; color: #1a1a1a; border-top: 1px solid #d0d4dc;
  font-family: Assistant, sans-serif; box-shadow: 0 -4px 14px rgba(0,0,0,.18); }
.instbar[hidden] { display: none; }
.instin { position: relative; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding-left: 26px; }
.insttx { flex: 1; min-width: 0; }
.instmsg span { display: block; }
.instbar p { margin: 0; text-wrap: balance; }
.instt { font: 700 15px/1.3 Assistant, sans-serif; }
.instmsg { font: 400 13.5px/1.35 Assistant, sans-serif; color: #3a3f47; }
.instb { display: flex; flex-direction: column; gap: 6px; flex: none; }
.instb button { font: 700 14px/1.2 Assistant, sans-serif; min-height: 36px; padding: 6px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.ib1 { background: #1f4fd1; color: #fff; border: 0; }
.ib2 { background: transparent; color: #1a1a1a; border: 1.5px solid currentColor; }
.instx { position: absolute; left: -6px; top: -2px; width: 28px; height: 28px; border: 0; background: transparent; color: #3a3f47; font-size: 16px; cursor: pointer; border-radius: 6px; }
.instbar button:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }
@media (prefers-color-scheme: dark) {
  .instbar { background: #1e2127; color: #eef1f6; border-top-color: #3a3f47; }
  .instmsg, .instx { color: #c9ced8; }
  .ib1 { background: #5b8cff; color: #0b1020; }
  .ib2 { color: #eef1f6; }
}

/* first-open spec O2: a dot on the menu button until the menu is opened once (no animation) */
#menubtn.dot::after { content: ""; position: absolute; top: 8px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--yel); box-shadow: 0 0 0 2px var(--c-body, #222); }
.side .side-g { font-size: 17px; margin: 24px 0 8px; }
.side-gl { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 15px; }
.side-gl a { color: inherit; font-weight: 600; white-space: nowrap; text-underline-offset: 3px; }
.fl.gl { display: grid; grid-template-columns: 1fr 1fr; }
.fl.gl a { white-space: nowrap; padding: 0 6px; }
main.calc:focus { outline: none; }
/* S1 (product 1.12): outside black, round keys and arrows are matte in the body's tone like the original:
   almost no metal, frame and SHIFT-ALPHA / MODE-ON bars in --c-shade, arrow base in --c-pad */
html:not([data-skin="black"]) .face { --sh1: .05; --sh2: .05; }
html:not([data-skin="black"]) .k-mode .key { background: var(--c-round); box-shadow: 0 0 0 calc(3 * var(--u)) var(--c-shade), 0 calc(3 * var(--u)) calc(4 * var(--u)) rgba(0,0,0,.25); }
html:not([data-skin="black"]) .ar::before { background: var(--c-round); box-shadow: 0 0 0 calc(1.5 * var(--u)) var(--c-shade), 0 calc(3 * var(--u)) calc(4 * var(--u)) rgba(0,0,0,.25); }
html:not([data-skin="black"]) .pad .base { background: var(--c-pad); box-shadow: none; }
html:not([data-skin="black"]) .k-shift::after, html:not([data-skin="black"]) .kw[data-k="mode"]::after { background: var(--c-shade); }
html:not([data-skin="black"]) body.shift-on .k-shift .key { background: var(--c-sl); }
html:not([data-skin="black"]) body.alpha-on .k-alpha .key { background: var(--c-al); }
/* T2 (product 1.12): tablets in portrait (760 to 999) get the phone layout, centred, keeping the calculator's proportions */
@media (min-width: 760px) and (max-width: 999px) { .calc { width: min(calc(100vw - 48px), calc(var(--vh) * .56)); } }
/* T9 (product 1.12): on short screens the toast sits at the bottom of the calculator, so it never hides the status row (D, Math) */
@media (max-height: 660px) { .toast { top: auto; bottom: calc(env(safe-area-inset-bottom) + 8px); transform: translate(-50%, 8px); } .toast.show { transform: translate(-50%, 0); } }
/* מצב התצוגה (10.12): שורת הסיכום בתפריט */
#prevbox { border: 1px dashed var(--line, #ccd); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
#prevbox h3 { margin-top: 0; }
#prevbox #prevsum { font-size: 14px; line-height: 1.6; margin: 0 0 8px; padding-inline-start: 18px; }
#prevbox .prevnote { font-size: 13px; opacity: .8; margin: 6px 0 0; }

/* install steps under the menu button (dev 6.12) */
.insthelp { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: #EAF4FF; color: var(--ink); font-size: 15px; text-wrap: pretty; }
.insthelp p { margin: 0 0 6px; } .insthelp p:last-child { margin: 0; }
@media (prefers-color-scheme: dark) { .insthelp { background: #1B2A44; color: #E8EEF8; } .insthelp a { color: #9CC8FF; } }
/* קנייה ושחזור של הגרסה בלי פרסומות (שאלה 80) */
.upgform label { display: block; font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.upgform input { width: 100%; box-sizing: border-box; font: inherit; font-size: 17px; min-height: 48px; padding: 8px 12px; border: 1.5px solid currentColor; border-radius: 10px; background: transparent; color: inherit; margin: 0 0 8px; text-align: left; }
.upgform .help { font-size: 14px; line-height: 1.45; margin: 0 0 12px; }
.upgform .help.links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 12px 0 0; }
.upgform .msg { font-weight: 700; font-size: 15px; margin: 0 0 12px; }
.upgform p.small { font-size: 15px; }
.upgform h2:focus { outline: none; }
.lnk { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.upgbox a { color: inherit; }
.upgform .help, .upgform p.small span { text-wrap: pretty; }
.upgform .msg, .upgform h2 { text-wrap: balance; }
.upgform .b1 { margin-bottom: 12px; }
#restcodebox { margin-top: 4px; }

/* צמיחה G1: כפתור שליחת התרגיל בסרגל העליון, מחוץ לגוף המחשבון. מופיע רק אחרי = */
.bact { display: flex; align-items: center; gap: 4px; }
.shx { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--c-lab); cursor: pointer; }
.shx[hidden] { display: none; }
.shx:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.toast.long { white-space: normal; width: max-content; max-width: min(92vw, 420px); text-align: center; text-wrap: balance; }
#expline { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#expline[hidden] { display: none; }
#exptxt { text-wrap: balance; }

/* 84 א (נועה 6.12): שורת קישורים קבועה מתחת למחשבון, "ביטול עסקה" מובלט לפי §14ט(ב). המחשבון מתכווץ בגובה הזה */
.legrow { position: fixed; left: 0; right: 0; bottom: 0; height: var(--legH); z-index: 5; display: flex; align-items: center; justify-content: center; gap: 18px;
  font: 12px/20px Assistant, system-ui, sans-serif; background: var(--deep); color: #eef2fa; }
.legrow a { color: inherit; opacity: .85; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; padding: 0 4px; }
.legrow a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (min-width: 1000px) { .legrow { background: transparent; color: inherit; } }
@media print { .legrow { display: none; } }
/* ניסוי 9 (צמיחה 6.12): שורת שליחה. פס דק מתחת למחשבון (המחשבון מתקצר כמו בפס ההתקנה), לא חלונית */
.shareprompt { position: fixed; left: 0; right: 0; bottom: var(--legH); z-index: 30; padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: #fff; color: #11204B; border-top: 1px solid #d0d4dc; font-family: Assistant, sans-serif; box-shadow: 0 -4px 14px rgba(0,0,0,.18); }
.shareprompt[hidden] { display: none; }
.shpin { position: relative; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding-left: 30px; }
.shpt { flex: 1; margin: 0; font: 700 15px/1.3 Assistant, sans-serif; }
.shareprompt .ib1 { font: 700 14px/1.2 Assistant, sans-serif; min-height: 44px; padding: 6px 16px; border-radius: 10px; cursor: pointer; background: #1F6FDB; color: #fff; border: 0; }
.shareprompt .instx { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; left: -12px; }
.shareprompt button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .shareprompt { background: #11204B; color: #EAF1FF; border-top-color: #2A3B6E; } .shareprompt .ib1 { background: #51B3FC; color: #11204B; } .shareprompt .instx { color: #AFC0E6; } }
@media print { .shareprompt { display: none !important; } }
.upgbox p.upgl span[hidden] { display: none; }
/* 86 ב: שתי תיבות הסכמה במסך המייל, לא מסומנות מראש, לא חוסמות */
.chk { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 6px 0; font-size: 14px; line-height: 1.4; text-align: right; cursor: pointer; text-wrap: pretty; }
.chk input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #2F7DEB; }
.upgbox p.upgl span, .chk span { text-wrap: balance; }
.upgbox p.upgl span#paycanceltxt { display: inline; }
.upgform label.chk { display: flex; font-weight: 400; font-size: 14px; margin: 0; min-height: 0; padding: 4px 0; }
.upgform .chk input { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 2px 0 0; border: 0; flex: none; }
.upg { overflow-y: auto; overscroll-behavior: contain; }
.upg { place-items: start center; } .upg > .upgbox { margin-block: auto; } /* מרכז, ובמסך נמוך גולל בלי לחתוך את הראש */
/* N5 (נגישות 1.4.4, 6.12): במחשב עם הגדלה (חלון נמוך) המחשבון לא מתכווץ מתחת לגודל רגיל, והדף נגלל לגובה. בטלפון (מגע) בלי שינוי */
@media (hover: hover) and (pointer: fine) and (max-height: 560px) {
  body { overflow-y: auto; }
  .page { height: auto; min-height: var(--vh); padding: 8px 0 calc(var(--legH) + 8px); }
  .calc { height: min(900px, calc(100vw / .56)); width: calc(min(900px, calc(100vw / .56)) * .56); flex: none; }
  .page { padding-bottom: 8px; } .legrow { position: static; }
}
/* QA 6.12: במחשב עם חלון נמוך (1366x768 בדפדפן) העמודה בצד גבוהה מהמסך והלוגו נחתך למעלה. מצמצמים רווחים בלבד */
@media (min-width: 1000px) and (max-height: 760px) {
  .brand { margin-bottom: 10px; } .side h1 { font-size: 28px; margin-bottom: 18px; }
  .kbd { gap: 1px 18px; font-size: 14px; } .side .side-g { margin: 14px 0 6px; } .side-gl { gap: 3px 18px; } .draft { margin-top: 14px; }
}

/* טיפ להיום בתפריט (תוכן 6.12) */
.tipcard { position: relative; margin: 6px 0 4px; padding: 10px 12px 10px 40px; border-radius: 12px; background: var(--ink2); color: var(--ink); }
.tipcard[hidden] { display: none; }
.panel .tipcard p { margin: 0 0 4px; font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.panel .tipcard p.tipt { text-wrap: balance; }
.panel .tipcard p:last-child { margin: 0; }
.tipk { font-weight: 700; }
.tipcard bdi { white-space: nowrap; }
.tipx { position: absolute; left: 0; top: 0; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; font-size: 16px; cursor: pointer; border-radius: 10px; }
.tipx:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
@media (prefers-color-scheme: dark) { .tipcard { background: var(--d-surface2); color: var(--d-text); } }
