/* ===== دفتر التحضير الإلكتروني – الأنماط ===== */
:root {
  --ink: #0B1B33; --ink-2: #2B3A55; --muted: #64748B; --line: #E2E8F3; --line-2: #CBD5E8;
  --bg: #F3F6FB; --card: #FFFFFF; --soft: #EEF3FC;
  --brand: #1E56D9; --brand-2: #0EA5C9; --brand-ink: #0F2E7A; --brand-soft: #E4ECFF;
  --amber: #D97706; --amber-soft: #FEF3C7; --rose: #E11D48; --rose-soft: #FFE4E8; --green: #15803D; --green-soft: #DCFCE7; --violet: #6D28D9; --violet-soft: #EDE9FE;
  --radius: 16px; --radius-s: 10px; --shadow: 0 1px 2px rgba(11,27,51,.05), 0 8px 24px -12px rgba(11,27,51,.15);
  --sidebar-w: 292px;
  --font-h: "Cairo", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-b: "IBM Plex Sans Arabic", "Cairo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-b); font-size: 15px; line-height: 1.7; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-h); line-height: 1.35; margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); }

/* ---- layout ---- */
.app { min-height: 100vh; }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); background: var(--card); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 18px; gap: 18px; z-index: 40; overflow-y: auto; }
.main { margin-inline-start: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; overflow-x: clip; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(243,246,251,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { font-family: var(--font-h); font-weight: 800; font-size: 20px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.view { padding: 24px 28px 60px; max-width: 1240px; width: 100%; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(11,27,51,.45); z-index: 35; }
.menu-btn { display: none; }

/* brand */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-title { font-family: var(--font-h); font-weight: 800; font-size: 17px; line-height: 1.2; }
.brand-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* nav */
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; transition: background .15s, color .15s; }
.nav a svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--soft); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav a.active svg { color: var(--brand); }
.nav .count { margin-inline-start: auto; font-size: 11.5px; background: var(--soft); color: var(--muted); padding: 1px 8px; border-radius: 999px; }
.nav a.active .count { background: #fff; color: var(--brand-ink); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.year-chip { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-family: var(--font-h); font-weight: 700; font-size: 13px; padding: 10px 14px; border-radius: 12px; text-align: center; }
.foot-note { color: var(--muted); font-size: 11.5px; line-height: 1.6; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 12.5px; border-radius: 10px; }
.icon-btn { border: 1px solid var(--line-2); background: #fff; border-radius: 12px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.week-chip { font-size: 12.5px; font-weight: 600; background: var(--green-soft); color: var(--green); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.week-chip.off { background: var(--soft); color: var(--muted); }

/* cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { font-size: 18px; }
.card-h .sub { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 32px 34px; color: #fff; background: radial-gradient(1200px 400px at 110% -20%, rgba(14,165,201,.55), transparent 60%), linear-gradient(135deg, #0F2E7A 0%, #1E56D9 60%, #1670D6 100%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px); background-size: 22px 22px; opacity: .55; mask-image: linear-gradient(to left, #000, transparent 70%); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { font-size: 13px; opacity: .85; font-weight: 500; letter-spacing: .2px; }
.hero h1 { color: #fff; font-size: 30px; margin: 6px 0 4px; }
.hero .lead { opacity: .9; font-size: 15px; max-width: 640px; }
.hero .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(6px); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.stat .n { font-family: var(--font-h); font-weight: 800; font-size: 28px; color: var(--brand-ink); line-height: 1; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.link { cursor: pointer; transition: transform .15s, border-color .15s; }
.stat.link:hover { transform: translateY(-2px); border-color: var(--brand); }

/* teacher card */
.teacher-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field input, .field textarea { border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.saved-hint { font-size: 12px; color: var(--green); font-weight: 600; opacity: 0; transition: opacity .2s; }
.saved-hint.show { opacity: 1; }

/* week card on home */
.week-now { border-inline-start: 4px solid var(--green); }
.week-now .kicker { color: var(--green); font-weight: 700; font-size: 12.5px; }

/* chips / filters */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: #fff; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { background: var(--soft); color: var(--brand-ink); font-family: var(--font-h); font-weight: 700; font-size: 13px; text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.now td { background: #F0FDF4; }
.tbl tr.now td:first-child { box-shadow: inset 4px 0 0 var(--green); }
[dir="rtl"] .tbl tr.now td:first-child { box-shadow: inset -4px 0 0 var(--green); }
.tbl .month { font-family: var(--font-h); font-weight: 700; color: var(--brand-ink); white-space: nowrap; }
.tbl .wk { font-family: var(--font-h); font-weight: 800; font-size: 18px; color: var(--ink); text-align: center; }
.tbl .date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.session { margin-bottom: 8px; }
.session:last-child { margin-bottom: 0; }
.session .s { font-weight: 700; color: var(--brand); font-size: 12.5px; }
.session ul { margin: 2px 0 0; padding-inline-start: 18px; }
.session li { margin: 1px 0; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.tag.exam { background: var(--amber-soft); color: var(--amber); }
.tag.holiday { background: var(--rose-soft); color: var(--rose); }
.tag.event { background: var(--violet-soft); color: var(--violet); }
.tag.final { background: var(--rose-soft); color: var(--rose); }
.tag.now { background: var(--green-soft); color: var(--green); }
.tag.read { background: var(--soft); color: var(--muted); }
.tag.t1 { background: var(--brand-soft); color: var(--brand-ink); }
.notes-list { margin: 0; padding-inline-start: 20px; color: var(--ink-2); }

/* lists / objectives */
.obj-list { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.obj-list li::marker { color: var(--brand); font-weight: 700; }

/* map table */
.map-tbl td { font-size: 12.8px; line-height: 1.6; min-width: 150px; }
.map-tbl td:first-child { font-family: var(--font-h); font-weight: 700; color: var(--brand-ink); min-width: 140px; }
.map-tbl ul { margin: 0; padding-inline-start: 16px; }

/* lessons layout */
.lessons { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.lesson-list { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; padding: 10px; }
.lesson-list .grp { font-family: var(--font-h); font-weight: 700; font-size: 12.5px; color: var(--muted); padding: 10px 10px 4px; }
.lesson-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-size: 13.5px; }
.lesson-list a:hover { background: var(--soft); }
.lesson-list a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.lesson-list .num { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--soft); color: var(--brand-ink); font-family: var(--font-h); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.lesson-list a.active .num { background: #fff; }
.lesson-list .wk-s { margin-inline-start: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }

/* prep page (ministry template) */
.prep { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.prep-head { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr .9fr .9fr 1.6fr; border-bottom: 1px solid var(--line-2); }
.prep-head > div { padding: 8px 12px; border-inline-end: 1px solid var(--line); }
.prep-head > div:last-child { border-inline-end: 0; }
.prep-head .k { font-family: var(--font-h); font-weight: 700; font-size: 12px; color: var(--brand-ink); background: var(--soft); margin: -8px -12px 6px; padding: 6px 12px; }
.prep-head input { width: 100%; border: 0; border-bottom: 1px dashed var(--line-2); padding: 4px 2px; background: transparent; outline: none; font-size: 13.5px; }
.prep-head input:focus { border-bottom-color: var(--brand); }
.prep-head .v { font-weight: 600; font-size: 13.5px; }
.prep-head .title-v { font-family: var(--font-h); font-weight: 800; font-size: 17px; color: var(--brand-ink); }
.prep-meta { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.prep-meta b { color: var(--brand); font-family: var(--font-h); }
.prep-meta ol { margin: 0; padding-inline-start: 22px; display: flex; flex-wrap: wrap; gap: 4px 26px; }
.prep-row { display: grid; align-items: stretch; border-bottom: 1px solid var(--line-2); }
.prep-row.four { grid-template-columns: 1.5fr 1fr 1fr 1.1fr; }
.prep-row.three { grid-template-columns: 1fr 1fr 1fr; border-bottom: 0; }
.prep-row.one { grid-template-columns: 1fr; }
.prep-row .pair { display: flex; flex-direction: column; min-width: 0; border-inline-end: 1px solid var(--line); }
.prep-row .pair:last-child { border-inline-end: 0; }
.prep-row .hd { flex: none; height: 50px; font-family: var(--font-h); font-weight: 700; font-size: 12.5px; line-height: 1.3; color: var(--brand-ink); background: var(--soft); border-bottom: 1px solid var(--line-2); text-align: center; display: flex; align-items: center; justify-content: center; padding: 4px 10px; }
.prep-row .hd.wide { height: 44px; font-size: 16px; letter-spacing: .3px; }
.prep-row .cell { flex: 1; padding: 10px 14px; font-size: 13px; line-height: 1.7; }
.prep-row .cell ul { margin: 0; padding-inline-start: 16px; }
.prep-row .content { font-size: 13.5px; padding: 14px 18px; }
.content p { margin: 0 0 6px; }
.content ul { margin: 0 0 6px; padding-inline-start: 20px; }
.content li { margin: 2px 0; }
.content b { color: var(--brand); }
.content .kw { color: var(--rose); }
.prep-foot { display: grid; grid-template-columns: 1.15fr 6.85fr; border-top: 1px solid var(--line-2); }
.prep-foot > div { padding: 10px 12px; font-size: 13px; }
.prep-foot .hd { font-family: var(--font-h); font-weight: 700; color: var(--brand-ink); background: var(--soft); border-inline-end: 1px solid var(--line); display: flex; align-items: center; }
.tf { display: flex; flex-direction: column; gap: 6px; }
.tf-row { display: flex; align-items: center; gap: 10px; }
.tf-row .q { flex: 1; }
.tf-row .ans { width: 34px; height: 26px; border: 1px solid var(--line-2); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--green); background: #fff; }
.tf-row .ans.no { color: var(--rose); }
.tf-row .ans.hidden { color: transparent; }
.mcq { margin: 8px 0 0; padding-inline-start: 20px; }
.mcq .opts { color: var(--ink-2); }
.mcq .opts .ok { color: var(--green); font-weight: 700; }
.sig { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; padding: 12px 16px; border-top: 1px solid var(--line); font-family: var(--font-h); font-weight: 700; font-size: 13px; color: var(--brand-ink); }
.sig span { flex: 1 1 120px; text-align: center; border-top: 1px dashed var(--line-2); padding-top: 6px; white-space: nowrap; }
.prep-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.prep-toolbar .l { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0; }
.gate { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; font-size: 12px; }
.gate svg { width: 100%; height: 56px; }
.gate table { margin: 6px auto 0; border-collapse: collapse; font-size: 11.5px; direction: ltr; }
.gate td, .gate th { border: 1px solid var(--line-2); padding: 1px 7px; }
.gate th { background: var(--soft); }
.notice { background: var(--amber-soft); color: #92400E; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; }

/* textbook accordion */
.unit { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.unit-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; user-select: none; }
.unit-h .n { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); font-family: var(--font-h); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.unit-h h3 { font-size: 15.5px; flex: 1; }
.unit-h .caret { transition: transform .2s; color: var(--muted); }
.unit.open .unit-h .caret { transform: rotate(180deg); }
.unit-b { display: none; border-top: 1px solid var(--line); }
.unit.open .unit-b { display: block; }
.unit-b table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.unit-b td { padding: 9px 18px; border-bottom: 1px solid var(--line); }
.unit-b tr:last-child td { border-bottom: 0; }
.unit-b td.code { font-family: var(--font-h); font-weight: 700; color: var(--brand); width: 60px; direction: ltr; text-align: center; }
.unit-b td.pg { color: var(--muted); white-space: nowrap; width: 150px; font-size: 12.5px; }
.unit-b td.act { width: 120px; text-align: end; }
.unit.off .unit-h { opacity: .7; }

/* platform */
.qgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.qcard.review { background: linear-gradient(180deg, #FFFBEB, #fff); }
.qcard .qh { display: flex; align-items: center; gap: 10px; }
.qcard .qn { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-family: var(--font-h); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.qcard.review .qn { background: linear-gradient(135deg, #D97706, #F59E0B); }
.qcard h3 { font-size: 15px; flex: 1; }
.qcard .qi { color: var(--muted); font-size: 12.8px; }
.qcard ol { margin: 0; padding-inline-start: 20px; font-size: 13px; }
.qcard ol li { margin: 1px 0; }
.qcard .wk-s { font-size: 11.5px; color: var(--brand-ink); background: var(--brand-soft); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }

/* timetable */
.tt { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tt th, .tt td { border: 1px solid var(--line-2); text-align: center; }
.tt th { background: var(--soft); font-family: var(--font-h); font-weight: 700; padding: 10px 6px; font-size: 13px; color: var(--brand-ink); }
.tt th.day { width: 90px; }
.tt td input { width: 100%; height: 48px; border: 0; text-align: center; background: transparent; outline: none; font-size: 13.5px; }
.tt td input:focus { background: var(--brand-soft); }

/* misc */
.empty { color: var(--muted); text-align: center; padding: 40px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.kbd { font-family: ui-monospace, monospace; font-size: 12px; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100; }
[dir="rtl"] .toast { transform: translateX(50%); }
.toast.show { opacity: 1; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .qgrid { grid-template-columns: repeat(2, 1fr); }
  .prep-head { grid-template-columns: repeat(3, 1fr); }
  .prep-head > div { border-bottom: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(100%); transition: transform .22s; }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .topbar-title { font-size: 17px; }
  .view { padding: 16px 16px 60px; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .lessons { grid-template-columns: minmax(0, 1fr); }
  .lesson-list { position: static; max-height: 300px; }
  .view { min-width: 0; }
  .teacher-form { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 24px; }
  .week-chip { display: none; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .qgrid { grid-template-columns: 1fr; }
  .prep-row.four, .prep-row.three { grid-template-columns: 1fr; }
  .prep-row .pair { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .prep-row .hd { height: auto; min-height: 40px; }
  .prep-head { grid-template-columns: 1fr 1fr; }
  #printBtn span { display: none; }
}

/* ---- print ---- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .scrim, .prep-toolbar, .lesson-list, .chips, .no-print, .toast { display: none !important; }
  .main { margin: 0; }
  .view { padding: 0; max-width: none; }
  .card, .prep, .table-wrap, .stat, .unit, .qcard { box-shadow: none; border-color: #999; }
  .card, .stat, .qcard, .prep-row, .prep-head, .prep-meta, .prep-foot, .sig, .tbl tr, .unit { break-inside: avoid; }
  .tbl thead { display: table-header-group; }
  .table-wrap { overflow: visible; }
  .lessons { grid-template-columns: 1fr; }
  .prep-row.four { grid-template-columns: 1.5fr 1fr 1fr 1.1fr; }
  .prep-row.three { grid-template-columns: 1fr 1fr 1fr; }
  .prep-row, .prep-row .pair, .prep-row .hd, .prep-head > div, .prep-foot > div, .prep-foot, .prep-head, .prep-meta, .sig { border-color: #999; }
  .prep-row .hd { height: 40px; }
  .prep-head { grid-template-columns: 1.1fr 1fr 1.2fr .9fr .9fr 1.6fr; }
  .prep-head input { border-bottom: 1px dotted #999; }
  .tbl th { position: static; }
  .tbl tr.now td { background: #fff; }
  .hero { background: #1E56D9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tf-row .ans.hidden { color: transparent !important; }
  .unit-b { display: block !important; }
  .print-page { break-after: page; }
}
