/* AL-HARAMEEN — mosque-board.css  («لوحة مسجدك» / "Your mosque board")
   The board is drawn in container units (cqi = 1% of the board's width), so the same
   markup is a 16:9 wall board on a computer, a stacked board on a phone, and a
   full-screen board on the mosque television. Every JS-filled value sits in a box whose
   size is fixed from the first paint (single lines, fixed rows): no layout shift. */

/* Latin text in Cairo: main.css's "Cairo Fallback" is about 9 % wider than Cairo for Latin
   letters (measured: 670 px against 616–623 px for one Spanish heading at 24 px), so a heading
   that fits one line in Cairo breaks onto two before the font arrives, and the page jumps when
   it does (CLS 0.14 seen at 694 px). A Latin-only fallback at the measured width keeps the line
   breaks. Not applied where the page sets its own heading face (ru: Rubik; ur, ps: Naskh). */
@font-face {
  font-family: "Cairo Fallback Latin"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 96.3%; ascent-override: 135.3%; descent-override: 59.3%; line-gap-override: 0%;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC;
}
html:not([lang="ru"]):not([lang="ur"]):not([lang="ps"]) .mb {
  --font-head: "Cairo", "Cairo Fallback Latin", "Cairo Fallback", "Segoe UI", Tahoma, sans-serif;
}
/* ---------- the board ---------- */
.mb-stage { position: relative; margin-top: 6px; }
.mb-board {
  container-type: inline-size; container-name: mbb;
  padding: 1.1%;
  border-radius: 18px;
  background: linear-gradient(160deg, #474c48 0%, #151917 30%, #262b28 62%, #0a0c0b 100%);
  box-shadow: 0 30px 60px rgba(7, 33, 21, .32), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -2px 0 rgba(0, 0, 0, .6);
}
.mb-in {
  --led-red: #FF3B2B; --led-green: #3DFF84; --led-amber: #FFB627; --led-white: #F4EFE0; --led-soft: #B9B3A2;
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9;
  display: grid; grid-template-rows: 15% minmax(0, 1fr) 10%;
  border-radius: 10px;
  color: var(--led-amber);
  font-family: var(--font-head);
  background:
    radial-gradient(circle, rgba(255, 255, 255, .05) 0 28%, transparent 31%) 0 0 / .6cqi .6cqi,
    radial-gradient(130% 100% at 50% -10%, #112319 0%, #050907 55%, #020303 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 0 4cqi rgba(0, 0, 0, .85);
}
.mb-in::after {                      /* the glass */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(112deg, rgba(255, 255, 255, .075) 0%, rgba(255, 255, 255, .02) 26%, transparent 27%);
}
.mb-in * { line-height: 1.15; }

/* seven-segment digits with their faint unlit segments behind */
.mb-seg {
  position: relative; display: inline-block; font-family: "DSEG7", ui-monospace, monospace; font-weight: 700;
  direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
/* the boxes never depend on the font's own metrics, so the arrival of DSEG7 (font-display:
   swap, after the first paint) moves nothing: one em tall, aligned by their tops */
.mb-in .mb-seg { line-height: 1; height: 1em; vertical-align: top; }
.mb-seg::before {
  content: attr(data-g); position: absolute; left: 0; top: 0; opacity: .085; text-shadow: none; pointer-events: none;
}
.mb-glow-r, .mb-hhmm, .mb-ss, .mb-iq .mb-dig { color: var(--led-red); text-shadow: 0 0 .06em #ff6a52, 0 0 .32em rgba(255, 50, 30, .55); }
.mb-adh .mb-dig, .mb-stt, .mb-dsm, .mb-jum .mb-dig { color: var(--led-green); text-shadow: 0 0 .06em #8dffb5, 0 0 .32em rgba(40, 255, 120, .45); }

/* top band */
.mb-top {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr); align-items: center;
  padding: 0 2.4cqi; border-bottom: .14cqi solid rgba(255, 182, 39, .2);
}
.mb-name {
  grid-column: 2; grid-row: 1;
  text-align: center; font-size: calc(3.7cqi * var(--fit, 1)); height: 4.6cqi; line-height: 4.6cqi; font-weight: 800; color: var(--led-amber);
  text-shadow: 0 0 .3em rgba(255, 182, 39, .55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb-date { display: block; min-width: 0; }
.mb-greg { grid-column: 1; grid-row: 1; text-align: start; }
.mb-hijri { grid-column: 3; grid-row: 1; text-align: end; }
.mb-date > .mb-dl { display: block; margin-bottom: .5cqi; }   /* full-width box: new text never moves it (CLS) */
.mb-dl { font-size: 1.8cqi; font-weight: 700; color: var(--led-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mb-dsm { font-size: 2.15cqi; }

/* middle: clock + status | table */
.mb-mid { display: grid; grid-template-columns: 42% 58%; min-height: 0; }
.mb-left {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2cqi;
  border-inline-end: .14cqi solid rgba(255, 255, 255, .06); padding: 1.2cqi;
}
.mb-clock { display: flex; align-items: flex-start; direction: ltr; gap: .8cqi; }
.mb-hhmm { font-size: 8.6cqi; }
.mb-secwrap { display: flex; flex-direction: column; align-items: flex-start; gap: .6cqi; padding-top: .4cqi; }
.mb-ss { font-size: 3.8cqi; }
.mb-apx { font-size: 2.2cqi; font-weight: 800; color: var(--led-red); min-height: 1.15em; }
.mb-status {
  width: 86%; text-align: center; border-radius: 1.2cqi; padding: 1.2cqi 1cqi 1.4cqi;
  border: .2cqi solid rgba(61, 255, 132, .35); background: rgba(61, 255, 132, .05);
}
.mb-stl { display: block; font-size: 2.1cqi; font-weight: 800; color: var(--led-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.15em; }
.mb-stt { font-size: 4.9cqi; margin-top: .7cqi; }
.mb-iqphase .mb-status { border-color: rgba(255, 59, 43, .6); background: rgba(255, 59, 43, .08); }
.mb-iqphase .mb-stl { color: #FFD9D3; }
.mb-iqphase .mb-stt { color: var(--led-red); text-shadow: 0 0 .06em #ff6a52, 0 0 .32em rgba(255, 50, 30, .6); animation: mb-blink 1s steps(1) infinite; }
.mb-place { font-size: 1.55cqi; color: var(--led-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 92%; text-align: center; font-weight: 700; }

.mb-table { display: grid; grid-template-rows: auto repeat(6, minmax(0, 1fr)); padding: 1cqi 2.2cqi 1cqi 1.6cqi; min-height: 0; }
html[dir="rtl"] .mb-table { padding: 1cqi 1.6cqi 1cqi 2.2cqi; }
.mb-th, .mb-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 1cqi; }
.mb-th { font-size: 1.55cqi; font-weight: 800; color: var(--led-soft); padding-bottom: .6cqi; }
.mb-th span:not(:first-child), .mb-t { text-align: center; justify-self: center; }
.mb-row { position: relative; border-top: .12cqi solid rgba(255, 255, 255, .07); border-radius: .8cqi; padding: 0 1cqi; }
.mb-pn { font-size: 2.95cqi; font-weight: 800; color: var(--led-amber); text-shadow: 0 0 .28em rgba(255, 182, 39, .4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-t { display: inline-flex; align-items: center; gap: .4cqi; direction: ltr; }
html[dir="rtl"] .mb-t .mb-ap { order: -1; }       /* RTL: the day period reads after the number, i.e. on its left */
.mb-t .mb-dig { font-size: 3.9cqi; }
.mb-ap { font-family: var(--font-head); font-size: 1.5cqi; font-weight: 800; color: var(--led-soft); unicode-bidi: plaintext; white-space: nowrap; }
.mb-row[data-i="1"] .mb-pn { color: var(--led-soft); text-shadow: none; font-size: 2.4cqi; }
/* 12-hour mode: the day period needs room beside the digits */
.mb-12 .mb-t .mb-dig { font-size: 3.2cqi; }
/* the day period's box exists before its word arrives, so writing it moves nothing */
.mb-12 .mb-t .mb-ap { display: inline-block; min-width: 2.3em; height: 1.2em; line-height: 1.2em; text-align: center; }
.mb-12 .mb-row[data-i="1"] .mb-adh .mb-dig { font-size: 3cqi; }
.mb-row[data-i="1"] .mb-adh .mb-dig { color: #DCD6C4; text-shadow: 0 0 .25em rgba(255, 255, 255, .2); font-size: 3.3cqi; }
.mb-row[data-i="1"] .mb-iq { visibility: hidden; }
.mb-row.is-next { background: rgba(255, 182, 39, .11); box-shadow: inset 0 0 0 .2cqi rgba(255, 182, 39, .65), 0 0 2cqi rgba(255, 182, 39, .15); }
.mb-row.is-next .mb-pn { color: #FFD36E; }
.mb-row.is-next::before, .mb-row.is-iq::before {
  content: ""; position: absolute; inset-inline-start: -.9cqi; top: 50%; width: 1cqi; height: 1cqi; margin-top: -.5cqi;
  border-radius: 50%; background: var(--led-amber); box-shadow: 0 0 1cqi var(--led-amber);
}
.mb-row.is-iq { background: rgba(255, 59, 43, .12); box-shadow: inset 0 0 0 .2cqi rgba(255, 59, 43, .7); }
.mb-row.is-iq::before { background: var(--led-red); box-shadow: 0 0 1cqi var(--led-red); }
.mb-row.is-iq .mb-iq .mb-dig { animation: mb-blink 1s steps(1) infinite; }
.mb-row.is-fri .mb-pn { color: #FFE08A; }
@keyframes mb-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .35; } }

/* bottom band */
.mb-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 2cqi;
  padding: 0 2.4cqi; border-top: .14cqi solid rgba(255, 182, 39, .2); min-width: 0;
}
.mb-jum { display: flex; align-items: center; gap: 1.2cqi; font-size: 2.1cqi; font-weight: 800; color: var(--led-amber); opacity: .72; min-width: 0; }
.mb-jum .mb-dig { font-size: 2.6cqi; }
.mb-jum.on { opacity: 1; text-shadow: 0 0 .3em rgba(255, 182, 39, .5); }
.mb-brand { font-family: var(--font-head); font-weight: 800; font-size: 1.5cqi; letter-spacing: .32em; color: rgba(244, 239, 224, .38); white-space: nowrap; direction: ltr; }

/* phones: the same board, stacked */
@container mbb (max-width: 620px) {
  .mb-in { aspect-ratio: auto; grid-template-rows: auto auto auto; }
  .mb-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 2cqi; padding: 3.4cqi 4cqi 3cqi; }
  .mb-name { grid-column: 1 / -1; grid-row: 1; font-size: calc(6.6cqi * var(--fit, 1)); height: 8cqi; line-height: 8cqi; }
  .mb-greg { grid-column: 1; grid-row: 2; }
  .mb-hijri { grid-column: 2; grid-row: 2; }
  .mb-dl { font-size: 3.7cqi; height: 1.2em; }
  .mb-dsm { font-size: 4.3cqi; height: 1.2em; }
  .mb-mid { grid-template-columns: minmax(0, 1fr); }
  .mb-left { border-inline-end: 0; border-bottom: .3cqi solid rgba(255, 255, 255, .06); padding: 4cqi 3cqi; gap: 3.6cqi; }
  .mb-hhmm { font-size: 19cqi; }
  .mb-ss { font-size: 8.4cqi; }
  .mb-apx { font-size: 4cqi; }
  .mb-status { width: 92%; padding: 2.4cqi 2cqi 2.8cqi; border-radius: 2.4cqi; border-width: .45cqi; }
  .mb-stl { font-size: 4.3cqi; }
  .mb-stt { font-size: 8.6cqi; margin-top: 1.4cqi; }
  .mb-place { font-size: 3.5cqi; height: 1.2em; }
  .mb-table { grid-template-rows: auto repeat(6, 11.5cqi); padding: 3cqi 4cqi 3.4cqi; }
  html[dir="rtl"] .mb-table { padding: 3cqi 4cqi 3.4cqi; }
  .mb-th { font-size: 3.5cqi; padding-bottom: 1.4cqi; }
  .mb-row { border-radius: 1.8cqi; padding: 0 2cqi; border-top-width: .25cqi; }
  .mb-pn { font-size: 5.3cqi; }
  .mb-row[data-i="1"] .mb-pn { font-size: 4.6cqi; }
  .mb-t .mb-dig { font-size: 6.6cqi; }
  .mb-row[data-i="1"] .mb-adh .mb-dig { font-size: 5.8cqi; }
  .mb-12 .mb-t .mb-dig, .mb-12 .mb-row[data-i="1"] .mb-adh .mb-dig { font-size: 5.3cqi; }
  .mb-ap { font-size: 3cqi; }
  .mb-row.is-next::before, .mb-row.is-iq::before { inset-inline-start: -2.4cqi; width: 2cqi; height: 2cqi; margin-top: -1cqi; }
  .mb-row.is-next { box-shadow: inset 0 0 0 .4cqi rgba(255, 182, 39, .65); }
  .mb-row.is-iq { box-shadow: inset 0 0 0 .4cqi rgba(255, 59, 43, .7); }
  .mb-foot { padding: 3cqi 4cqi; border-top-width: .3cqi; }
  .mb-jum { font-size: 4.2cqi; height: 1.3em; }
  .mb-jum .mb-dig { font-size: 5cqi; }
  .mb-brand { font-size: 3cqi; }
}

/* ---------- TV mode ---------- */
.mb-exit, .mb-fs { display: none; }
html.mb-tv-on, html.mb-tv-on body { overflow: hidden; }
.mb-stage.is-tv {
  position: fixed; inset: 0; z-index: 2147483000; margin: 0; background: #000;
  display: flex; align-items: center; justify-content: center; overflow: auto;
}
.mb-stage.is-tv .mb-board { width: min(100vw, 177.78vh); padding: 0; border-radius: 0; background: #000; box-shadow: none; margin: auto; }
.mb-stage.is-tv .mb-in { border-radius: 0; }
.mb-tvbar { display: none; }
.mb-stage.is-tv .mb-tvbar {
  display: flex; gap: 10px; align-items: center; position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 2; transition: opacity .3s;
}
.mb-stage.is-tv .mb-exit {
  display: block; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 20px; cursor: pointer;
}
.mb-stage.is-tv .mb-fs:not([hidden]) {
  display: block; padding: 11px 22px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4); background: rgba(14, 91, 56, .92);
  color: #fff; font: 800 16px var(--font-head); cursor: pointer;
}
.mb-stage.is-tv.mb-idle { cursor: none; }
.mb-stage.is-tv.mb-idle .mb-tvbar { opacity: 0; }
.mb-stage.is-tv .mb-tvbar:has(:focus-visible) { opacity: 1; }
.mb-stage.is-tv .mb-exit:focus-visible, .mb-stage.is-tv .mb-fs:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- actions under the board ---------- */
.mb-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.mb-wake { text-align: center; min-height: 1.6em; }
.mb-tvnote { text-align: center; max-width: 72ch; margin: 6px auto 0; }

/* ---------- settings ---------- */
.mb-setgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 30px; margin-top: 6px; }
.mb-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 16px; }
.mb-field:first-child { margin-top: 0; }
.mb-lbl { font-weight: 800; color: var(--green-900); font-family: var(--font-head); font-size: 15px; }
.mb-set input[type=text], .mb-set input[type=number], .mb-set input[type=time], .mb-set select, .mb-printbar select {
  font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--ink); min-height: 44px; min-width: 0;
}
.mb-set input:focus-visible, .mb-set select:focus-visible, .mb-printbar select:focus-visible {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(15, 122, 68, .18);
}
.mb-pick { min-height: 80px; }
.mb-cityline { font-size: 14.5px; color: var(--ink-soft); min-height: 1.7em; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .45em; }
.mb-cityline b { font-family: var(--font-head); color: var(--green-900); font-size: 16.5px; }
.mb-code, .mb-gmt { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--green-700); }
.mb-set h3 { font-size: 17px; color: var(--green-900); }
.mb-iqt { width: 100%; border-collapse: collapse; margin-top: 10px; table-layout: fixed; }
.mb-iqt thead th:first-child { width: 84px; }
.mb-iqt thead th:last-child { width: 78px; }
.mb-iqt th, .mb-iqt td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.mb-iqt thead th { font-size: 12.5px; color: var(--ink-faint); font-weight: 700; }
.mb-iqt tbody th { font-family: var(--font-head); color: var(--green-900); white-space: nowrap; }
.mb-iqin { display: flex; gap: 6px; flex-wrap: wrap; }
.mb-iqt select { flex: 1 1 150px; min-width: 0; max-width: 100%; }
.mb-iqt input[type=number] { width: 86px; flex: 0 0 86px; }
.mb-iqt input[type=time] { width: 128px; flex: 0 0 128px; }
.mb-iqt input[hidden] { display: none; }
.mb-today { font-family: var(--font-head); font-weight: 800; color: var(--green-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mb-today.warn { color: #B3261E; }
.mb-warn { display: block; font-size: 11.5px; color: #B3261E; min-height: 1.2em; line-height: 1.2; }
.mb-reset { margin-top: 14px; }
.mb-link { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.mb-linkrow { display: flex; gap: 8px; margin-top: 8px; }
.mb-linkrow input { flex: 1 1 auto; font-family: ui-monospace, Consolas, monospace !important; font-size: 13px !important; direction: ltr; }
.mb-linkrow .btn { white-space: nowrap; }

/* ---------- monthly timetable ---------- */
.mb-printbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.mb-printbar label { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--green-900); }
.mb-sheet { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-top: 16px; }
.mb-sheet-head { text-align: center; }
.mb-sheet-name { font: 800 22px/1.4 var(--font-head); color: var(--green-900); min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-sheet-sub { color: var(--ink-soft); font-size: 14px; min-height: 1.7em; }
.mb-sheet-scroll { overflow-x: auto; margin-top: 10px; min-height: 900px; }
.mb-month { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
.mb-month th, .mb-month td { border: 1px solid #DCD9CC; padding: 0 5px; text-align: center; white-space: nowrap; height: 26px; }
.mb-month thead th { background: var(--green-900); color: #fff; font-weight: 700; font-size: 12px; }
.mb-month thead tr:nth-child(2) th { background: var(--green-700); font-weight: 600; font-size: 11px; }
.mb-month td.t { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.mb-month td.q { color: #8C2B1F; font-weight: 700; }
.mb-month td.jm { text-decoration: underline dotted; }
.mb-month td.wd { color: var(--ink-soft); }
.mb-month td.n { font-weight: 800; color: var(--green-900); }
.mb-month td.hj { color: #7A5C12; }
.mb-month tr.fri td { background: #EEF5F0; font-weight: 700; }
.mb-month tr.ram td.hj { font-weight: 800; }
.mb-month tr.today td { background: #FFF4CF; }
.mb-sheet-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; min-height: 1.6em; }
.mb-sheet-foot { text-align: center; font-size: 12px; color: var(--ink-faint); margin-top: 6px; letter-spacing: .06em; direction: ltr; }

/* ---------- enter the settings on the board ---------- */
.mb-sum { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.mb-sum li { display: flex; flex-direction: column; gap: 2px; background: var(--green-100); border-radius: 12px; padding: 12px 14px; }
.mb-sum b { font-family: var(--font-head); color: var(--green-900); }
.mb-sv { color: var(--ink); font-weight: 700; min-height: 1.6em; }
.mb-models { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.mb-models span { font-size: 12.5px; font-weight: 700; color: var(--green-700); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--card); direction: ltr; }
.mb-kbbox { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.mb-kbsteps { margin: 8px 0 0; padding-inline-start: 22px; line-height: 1.85; color: var(--ink); }
.mb-kbnote { margin-top: 8px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.mb-kbpage { display: inline-block; margin-top: 8px; font-weight: 800; color: var(--green-700); font-family: var(--font-head); }
.mb-media { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.mb-media li { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.mb-media a { font-weight: 700; color: var(--green-700); }
.mb-media a:hover { text-decoration: underline; }
.mb-media .mb-yt { color: #B3261E; }
.mb-setup h3 { margin-top: 20px; font-size: 17px; color: var(--green-900); }

@media (max-width: 860px) {
  .mb-setgrid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 560px) {
  .mb-pick { min-height: 132px; }            /* the chooser wraps to two rows here */
  .mb-actions .btn { flex: 1 1 100%; }
  .mb-linkrow { flex-wrap: wrap; }
  .mb-linkrow .btn { flex: 1 1 100%; }
  .mb-iqt input[type=number] { width: 74px; flex-basis: 74px; }
  .mb-iqt select { flex-basis: 100%; }
  .mb-iqt thead th:first-child { width: 66px; }
  .mb-iqt thead th:last-child { width: 64px; }
  .mb-iqt th, .mb-iqt td { padding: 8px 3px; }
  .mb-sheet { padding: 12px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .mb-iqphase .mb-stt, .mb-row.is-iq .mb-iq .mb-dig { animation: none !important; }
  .mb-stage.is-tv .mb-tvbar { transition: none; }
}
@media (forced-colors: active) {
  .mb-row.is-next, .mb-row.is-iq { forced-color-adjust: none; outline: 3px solid Highlight; }
}

/* ---------- print: only the monthly sheet ---------- */
@media print {
  @page { size: A4 portrait; margin: 9mm; }
  html, body { background: #fff !important; }
  body > *:not(main) { display: none !important; }
  .mb > *:not(#mbPrintCard) { display: none !important; }
  #mbPrintCard { border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; background: #fff; }
  #mbPrintCard > *:not(.mb-sheet) { display: none !important; }
  .mb-sheet { border: 0; padding: 0; margin: 0; border-radius: 0; }
  .mb-sheet-scroll { overflow: visible; min-height: 0; margin-top: 3mm; }
  .mb-sheet-name { font-size: 15pt; white-space: normal; }
  .mb-sheet-sub { font-size: 9.5pt; color: #333; }
  .mb-month { min-width: 0; width: 100%; font-size: 8pt; line-height: 1.25; }
  .mb-month th, .mb-month td { height: auto; padding: 1.1mm .5mm; border-color: #777; }
  .mb-month thead th { background: #0B3D26 !important; color: #fff !important; }
  /* the A4 width, measured for all 12 languages in 12-hour mode (Reviewer 2): the screen header
     sizes (12/11 px, no wrap) and the page gutter made the table 25–105 px wider than the paper
     in ur, ru, so, es… — headers now wrap at print size and the gutter goes */
  .mb-month thead th { font-size: 7.5pt !important; white-space: normal; }
  .mb.wrap { padding-inline: 0 !important; max-width: none !important; margin-inline: 0 !important; }
  .mb-sheet-12 .mb-month td.t { font-size: 7pt; }      /* "06:16 a. m." ×11 columns (es, ru) */
  .mb-month thead tr:nth-child(2) th { background: #0E5B38 !important; }
  .mb-month tr.today td { background: none; }
  .mb-month tr.fri td { background: #E9F2EC !important; }
  .mb-sheet-note { font-size: 8pt; color: #333; margin-top: 2.5mm; }
  .mb-sheet-foot { font-size: 8pt; color: #555; margin-top: 1.5mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
