/* ספר קצין משא"ן ע"צ – אתר ידע. Colours sampled from the book PDF. */
@font-face { font-family: "Assistant"; font-weight: 400; font-display: swap; src: url("fonts/assistant-hebrew-400-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Assistant"; font-weight: 400; font-display: swap; src: url("fonts/assistant-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Assistant"; font-weight: 600; font-display: swap; src: url("fonts/assistant-hebrew-600-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Assistant"; font-weight: 600; font-display: swap; src: url("fonts/assistant-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Assistant"; font-weight: 800; font-display: swap; src: url("fonts/assistant-hebrew-800-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Assistant"; font-weight: 800; font-display: swap; src: url("fonts/assistant-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --navy: #0A4A7A;      /* book cover / header band */
  --navy-dark: #073656;
  --orange: #FFB75C;    /* book accent */
  --orange-dark: #9A5A00; /* orange tone dark enough for text on white */
  --ink: #1B2430;
  --muted: #5A6675;
  --line: #D9E1EA;
  --soft: #F3F6F9;
  --bg: #FFFFFF;
  --focus: #FFB75C;
  --side-w: 21rem;
  --font: "Assistant", "Segoe UI", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-padding-top: 6.5rem; }
body { margin: 0; font-family: var(--font); font-weight: 400; color: var(--ink); background: var(--bg); line-height: 1.75; font-size: 1.0625rem; -webkit-text-size-adjust: 100%; }
strong, b { font-weight: 800; }
a { color: var(--navy); }
a:hover { color: var(--navy-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--navy); color: #fff; padding: .6rem 1rem; z-index: 100; border-radius: 0 0 6px 6px; }
.skip:focus { top: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; cursor: pointer; }

/* ---------- header (mirrors the book's running header) ---------- */
.top { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem; max-width: 100rem; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; flex: 0 1 auto; min-width: 0; }
.brand img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.brand .band { position: relative; background: var(--navy); color: #fff; font-weight: 800; font-size: 1.35rem; line-height: 1; padding: .55rem 1rem .55rem 2.6rem; white-space: nowrap; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.brand .band::after { content: ""; position: absolute; inset-inline-end: -1px; top: 0; bottom: 0; width: 1.9rem; background: var(--orange); clip-path: polygon(45% 0, 100% 0, 55% 100%, 0 100%); }
.search { flex: 1 1 26rem; max-width: 40rem; position: relative; margin-inline-start: auto; }
.search input { width: 100%; font: inherit; font-size: 1.05rem; padding: .6rem 2.8rem .6rem .9rem; border: 2px solid var(--navy); border-radius: 999px; background: #fff; color: var(--ink); }
.search input::placeholder { color: #6B7785; }
.search .ico { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); width: 1.2rem; height: 1.2rem; pointer-events: none; }
.menu-btn { display: none; background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: .5rem .8rem; font-weight: 600; }
.top-links { display: flex; gap: .25rem; }
.top-links a { text-decoration: none; padding: .45rem .7rem; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.top-links a:hover, .top-links a[aria-current="page"] { background: var(--soft); }

/* search results dropdown */
.sres { position: absolute; inset-inline: 0; top: calc(100% + .4rem); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(10, 40, 70, .18); max-height: min(70vh, 36rem); overflow: auto; display: none; z-index: 60; }
.sres.open { display: block; }
.sres .hd { padding: .55rem .9rem; font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: .5rem; }
.sres a.r { display: block; padding: .65rem .9rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--soft); }
.sres a.r:hover, .sres a.r:focus, .sres a.r.act { background: #EEF4FA; outline: none; }
.r .where { font-size: .82rem; color: var(--muted); display: block; }
.r .ttl { font-weight: 800; color: var(--navy); display: block; }
.r .snip { font-size: .95rem; display: block; }
.r .kind { display: inline-block; font-size: .75rem; background: var(--orange); color: #3A2300; border-radius: 999px; padding: 0 .5rem; margin-inline-end: .35rem; font-weight: 800; }
mark { background: #FFE2B0; color: inherit; padding: 0 .1em; border-radius: 2px; }

/* ---------- layout ---------- */
.wrap { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); max-width: 100rem; margin: 0 auto; }
.side { position: sticky; top: 4.6rem; height: calc(100vh - 4.6rem); overflow: auto; border-inline-end: 1px solid var(--line); padding: 1rem .5rem 3rem 1rem; background: #FBFCFD; }
.side h2 { font-size: 1rem; margin: .2rem .5rem .6rem; color: var(--muted); }
.toc, .toc ol { list-style: none; margin: 0; padding: 0; }
.toc > li { margin-bottom: .15rem; }
.toc .ch { display: flex; align-items: flex-start; gap: .35rem; width: 100%; text-align: start; background: none; border: 0; padding: .45rem .5rem; border-radius: 8px; color: var(--navy); font-weight: 800; line-height: 1.35; }
.toc .ch:hover { background: #EEF4FA; }
.toc .ch .chev { flex: none; transition: transform .15s; display: inline-block; width: 1em; text-align: center; }
.toc .ch[aria-expanded="true"] .chev { transform: rotate(-90deg); }
.toc ol { display: none; padding-inline-start: 1.3rem; margin: .1rem 0 .5rem; }
.toc .ch[aria-expanded="true"] + ol { display: block; }
.toc ol a { display: flex; gap: .4rem; padding: .3rem .5rem; border-radius: 6px; text-decoration: none; color: var(--ink); line-height: 1.35; font-size: .97rem; }
.toc ol a .n { color: var(--muted); min-width: 1.5em; }
.toc ol a:hover { background: #EEF4FA; }
.toc ol a[aria-current="page"] { background: var(--navy); color: #fff; }
.toc ol a[aria-current="page"] .n { color: #CFE0EE; }
.toc .extra a { font-weight: 600; color: var(--navy); }
.scrim { display: none; }
main { min-width: 0; padding: 1.5rem clamp(1rem, 3vw, 3rem) 4rem; }
.content { max-width: 54rem; }

/* ---------- subchapter page ---------- */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .5rem; }
.crumbs a { color: var(--muted); }
h1.sub-title { font-size: clamp(1.6rem, 3.2vw, 2.2rem); line-height: 1.3; margin: .2rem 0 .8rem; color: var(--navy); }
h1.sub-title .num { color: var(--orange-dark); margin-inline-end: .35em; }
h1.sub-title a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.toc-name { color: var(--muted); font-size: .95rem; margin: -.4rem 0 .8rem; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .6rem 1.2rem; background: var(--soft); border-inline-start: 5px solid var(--orange); border-radius: 10px; padding: .9rem 1.1rem; margin: 0 0 1rem; font-size: .97rem; }
.meta dt { color: var(--muted); font-size: .85rem; }
.meta dd { margin: 0; font-weight: 600; }
.meta .pol { display: inline-block; direction: ltr; unicode-bidi: isolate; font-weight: 800; }
.meta .pending { color: var(--muted); font-weight: 400; }
.meta .raw { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); white-space: pre-line; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.btn { display: inline-flex; align-items: center; gap: .35rem; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); border-radius: 999px; padding: .35rem .9rem; font-weight: 600; text-decoration: none; font-size: .95rem; }
.btn:hover { background: #EEF4FA; }
.btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.inmenu { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; margin: 0 0 1.6rem; }
.inmenu h2 { font-size: .95rem; margin: 0 0 .4rem; color: var(--muted); }
.inmenu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.inmenu li a { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; background: var(--soft); border-radius: 999px; padding: .25rem .75rem .25rem .6rem; font-weight: 600; font-size: .95rem; }
.inmenu li a:hover { background: #E1ECF6; }
.inmenu li a img { width: 1.4rem; height: 1.4rem; }
.inmenu li.sub a { background: #fff; border: 1px dashed var(--line); font-weight: 400; }

section.cat { margin: 2rem 0 0; }
.cat-h { display: flex; align-items: center; gap: .7rem; margin: 0 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--orange); font-size: 1.35rem; color: var(--navy); line-height: 1.3; }
.cat-h img { width: 2.4rem; height: 2.4rem; flex: none; }
.cat-h .t { text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.anchor-link { margin-inline-start: auto; font-size: .85rem; font-weight: 400; color: var(--muted); text-decoration: none; opacity: 0; border: 0; background: none; padding: .2rem .4rem; border-radius: 6px; }
.cat-h:hover .anchor-link, .anchor-link:focus { opacity: 1; }
h3.item-h { font-size: 1.15rem; color: var(--navy); margin: 1.6rem 0 .6rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }

.p { margin: 0 0 .55rem; overflow-wrap: anywhere; }
.p.ac { text-align: center; }
.p.al { text-align: left; }
.p.bd { border: 1px solid var(--line); padding: .4rem .6rem; border-radius: 6px; }
.p { margin-inline-start: calc(var(--ind, 0) * 1em); }
.p.li { display: grid; grid-template-columns: minmax(var(--hang, 1.5em), auto) minmax(0, 1fr); column-gap: .25em; }
.p.li .lbl { text-align: start; font-weight: inherit; }
.p.li .lbl.bul { color: var(--navy); }
.p.li .lbl-pic { width: 1.3em; height: 1.3em; margin-top: .25em; }
.tab { display: inline-block; width: 1.5em; }
.fn { font-size: .9em; color: var(--muted); }
a.mil { text-decoration-style: dotted; }
.box { border: 1px solid var(--line); background: #FBFCFD; border-radius: 10px; padding: .7rem 1rem; margin: .6rem 0 1rem; }
img.pic { max-width: 100%; height: auto; vertical-align: middle; }
img.pic.zoomable { display: block; margin: .6rem auto; cursor: zoom-in; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
img.pic.inl { display: inline-block; margin: .2rem; }
img.pic.sym { display: inline; height: 1.3em; width: auto; vertical-align: -.25em; }
.pic-missing { display: block; border: 1px dashed #C9A15A; background: #FFF8EC; color: #6A4A00; padding: .6rem .8rem; border-radius: 8px; font-size: .95rem; }

/* tables */
.tbl { margin: .8rem 0 1.2rem; }
.tbl-tools { display: flex; gap: .4rem; justify-content: flex-end; margin-bottom: .25rem; }
.tbl-tools button { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: .85rem; padding: .15rem .55rem; color: var(--navy); }
.tbl-scroll { overflow-x: auto; border: 1px solid #C8D3DF; border-radius: 8px; }
.tbl-scroll:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; background: #fff; }
.tbl-scroll.wide table { min-width: 44rem; }
th, td { border: 1px solid #C8D3DF; padding: .4rem .55rem; vertical-align: top; text-align: start; }
th { background: #E7EEF5; color: var(--ink); font-weight: 800; }
td .p, th .p { margin: 0 0 .25rem; }
td .p:last-child, th .p:last-child { margin-bottom: 0; }

/* materials */
.mat { border: 1px solid var(--line); border-radius: 12px; margin: 1rem 0 1.4rem; overflow: hidden; }
.mat > header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; background: var(--soft); padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.mat > header h3 { margin: 0; font-size: 1.1rem; color: var(--navy); }
.mat .kind { font-size: .8rem; background: var(--orange); color: #3A2300; padding: .05rem .55rem; border-radius: 999px; font-weight: 800; }
.mat .mat-actions { margin-inline-start: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.mat .body { padding: .8rem 1rem; }
.pdfview { display: grid; gap: .8rem; background: #E9EDF2; padding: .8rem; border-radius: 8px; }
.pdfview img.pdfpage { width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.review-note { font-size: .85rem; color: #6A4A00; background: #FFF8EC; border: 1px solid #F0D9A8; border-radius: 6px; padding: .3rem .6rem; }

/* pager, footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 3rem 0 0; }
.pager a { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; text-decoration: none; display: block; }
.pager a:hover { background: var(--soft); }
.pager .dir { font-size: .85rem; color: var(--muted); display: block; }
.pager .next { text-align: end; }
footer.foot { border-top: 4px solid var(--orange); background: var(--navy); color: #fff; padding: 1.2rem 1rem; text-align: center; font-weight: 600; }
footer.foot a { color: #fff; }

/* home */
.hero { background: var(--navy); color: #fff; border-radius: 16px; padding: 2rem clamp(1rem, 4vw, 2.5rem); position: relative; overflow: hidden; margin-bottom: 1.5rem; }
.hero::before { content: ""; position: absolute; inset-inline-end: -3rem; top: -2rem; width: 12rem; height: 9rem; background: var(--orange); clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%); opacity: .95; }
.hero h1 { margin: 0 0 .4rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; color: var(--orange); position: relative; }
.hero p { margin: 0; max-width: 40rem; position: relative; }
.hero .dist { margin-top: .8rem; font-size: .95rem; color: #DDE8F2; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .9rem; margin: 1rem 0 2rem; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; text-decoration: none; color: var(--ink); display: block; background: #fff; }
.card:hover { border-color: var(--navy); box-shadow: 0 6px 18px rgba(10, 74, 122, .12); }
.card .k { color: var(--orange-dark); font-weight: 800; font-size: .9rem; }
.card .t { color: var(--navy); font-weight: 800; font-size: 1.12rem; display: block; line-height: 1.35; }
.card .c { color: var(--muted); font-size: .9rem; }
.panel { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
.panel h2 { margin: 0 0 .6rem; font-size: 1.2rem; color: var(--navy); }
.empty-note { color: var(--muted); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: .45rem 0; border-bottom: 1px solid var(--soft); }

/* glossary / repository */
.letters { display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0 1.2rem; }
.letters a { min-width: 2.2rem; text-align: center; padding: .2rem .4rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 800; }
.gl-term { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.gl-term h3 { margin: 0 0 .2rem; font-size: 1.12rem; color: var(--navy); }
.gl-def { margin: .25rem 0; }
.gl-src { font-size: .88rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 1rem; }
.filters input[type=search] { font: inherit; padding: .45rem .8rem; border: 1.5px solid var(--navy); border-radius: 999px; min-width: min(100%, 20rem); }
.chip { border: 1.5px solid var(--navy); background: #fff; color: var(--navy); border-radius: 999px; padding: .25rem .8rem; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* dialog (table zoom / image zoom) */
dialog.zoom { width: min(96vw, 110rem); max-height: 92vh; border: 0; border-radius: 12px; padding: 0; }
dialog.zoom::backdrop { background: rgba(5, 25, 45, .65); }
dialog.zoom .zh { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: .5rem .8rem; background: var(--navy); color: #fff; z-index: 2; }
dialog.zoom .zh button { background: #fff; color: var(--navy); border: 0; border-radius: 6px; padding: .2rem .7rem; font-weight: 800; }
dialog.zoom .zb { padding: 1rem; overflow: auto; max-height: calc(92vh - 3rem); }
dialog.zoom .zb table { font-size: 1.05rem; }
dialog.zoom .zb img { max-width: none; width: auto; }
.toast { position: fixed; bottom: 1.2rem; inset-inline-start: 50%; transform: translateX(50%); background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 999px; z-index: 90; font-size: .95rem; }
.hit { background: #FFE2B0; transition: background 2s; }

/* ---------- responsive ---------- */
@media (max-width: 64rem) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(88vw, 24rem); height: 100vh; z-index: 70; display: none; box-shadow: 0 0 40px rgba(0,0,0,.25); padding-top: 1rem; }
  .side.open { display: block; }
  .menu-btn { display: inline-block; }
  .scrim { position: fixed; inset: 0; background: rgba(5, 25, 45, .45); z-index: 65; display: none; }
  .scrim.open { display: block; }
  .top-links { display: none; }
}
@media (max-width: 40rem) {
  .top-in { flex-wrap: wrap; gap: .5rem; }
  .brand .band { font-size: 1.05rem; padding-inline-start: 2rem; }
  .brand img { width: 40px; height: 40px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  html { scroll-padding-top: 8.5rem; }
  .side { top: 0; }
  .pager { grid-template-columns: 1fr; }
  .p { margin-inline-start: calc(var(--ind, 0) * .55em); }
  body { font-size: 1.0625rem; }
}

/* ---------- print ---------- */
@page { size: A4; margin: 14mm 12mm; }
@media print {
  .top, .side, .scrim, .actions, .inmenu, .pager, .tbl-tools, .anchor-link, .mat-actions, .menu-btn, .skip, footer.foot, .no-print { display: none !important; }
  .wrap { display: block; }
  main { padding: 0; }
  .content { max-width: none; }
  body { font-size: 11pt; line-height: 1.55; color: #000; }
  a { color: #000; text-decoration: none; }
  .meta { break-inside: avoid; }
  .tbl-scroll { overflow: visible; border: 0; }
  .tbl-scroll.wide table { min-width: 0; font-size: 8.5pt; }
  table { font-size: 9.5pt; }
  tr, img, .p.li { break-inside: avoid; }
  thead { display: table-header-group; }
  .cat-h { break-after: avoid; }
  img.pic.zoomable { max-height: 240mm; }
  .pdfview { background: none; padding: 0; gap: 0; }
  .pdfview img.pdfpage { box-shadow: none; break-after: page; max-height: 265mm; width: auto; max-width: 100%; margin: 0 auto; display: block; }
  body.print-one > *:not(.print-target) { display: none !important; }
}

/* פתח דבר: one section per part of the opening, readable on desktop and phone */
.intro-secs { display: grid; gap: 1.4rem; }
.intro-sec { border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem clamp(1rem, 4vw, 2rem) 1.4rem; background: #fff; scroll-margin-top: 6.5rem; }
.intro-sec > h2 { margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 3px solid var(--orange); color: var(--navy); font-size: 1.3rem; }
.intro-sec.letter p { max-width: 48rem; }
.intro-sec.letter p { margin: 0 0 .9rem; }
.intro-sec .intro-sig { margin-top: 1.4rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.intro-sec .intro-sig p { margin: 0 0 .15rem; }
.intro-sec .intro-sig img { max-height: 3.5rem; width: auto; }
.intro-cover { margin: 0; text-align: center; }
.intro-cover img { width: min(100%, 26rem); height: auto; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.intro-legend { list-style: none; margin: .4rem 0 1.2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .6rem; }
.intro-legend li { display: flex; align-items: center; gap: .7rem; background: var(--soft); border-radius: 10px; padding: .5rem .8rem; font-weight: 600; }
.intro-legend img { width: 2.6rem; height: 2.6rem; flex: none; }
.intro-sec table { width: 100%; }
@media (max-width: 40rem) { .intro-sec { padding: 1rem .9rem 1.2rem; } .intro-sec > h2 { font-size: 1.15rem; } }
@media print { .intro-sec { border: 0; padding: 0; break-inside: auto; } }

/* chapter learning module link */
.lomda { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; background: #FFF6E8; border: 1.5px solid var(--orange); border-radius: 12px; padding: .7rem 1rem; margin: 0 0 1rem; }
.lomda-k { font-weight: 800; color: var(--orange-dark); }
.lomda-btn { background: var(--navy); color: #fff; border-color: var(--navy); }
.lomda-btn:hover { background: var(--navy-dark); color: #fff; }
.lomda-note { font-size: .88rem; color: var(--muted); }
@media print { .lomda { display: none; } }


/* ---------- arrows: brand orange (#FFB75C) on a navy chip, so they stay visible on white ---------- */
.arr { display: inline-flex; align-items: center; justify-content: center; min-width: 1.2em; height: 1.2em; padding: 0 .15em; line-height: 1; font-weight: 800; color: #FFB75C; background: var(--navy); border-radius: .3em; vertical-align: .05em; font-size: .95em; }
.toc .ch .chev.arr { width: 1.35em; height: 1.35em; margin-top: .05em; }
.pager .dir .arr { margin: 0 .1em; }
.crumbs .arr { font-size: .85em; margin: 0 .15em; }

/* ---------- categories: the heading (original icon + title) opens and closes only its own content ---------- */
.cat-h .cat-tog { display: flex; align-items: center; gap: .7rem; flex: 0 1 auto; min-width: 0; background: none; border: 0; padding: .1rem .2rem; margin: -.1rem -.2rem; color: inherit; font: inherit; font-weight: inherit; text-align: start; border-radius: 8px; cursor: pointer; }
.cat-h .cat-tog:hover { background: #EEF4FA; }
.cat-h .cat-tog .chev { width: 1.5rem; height: 1.5rem; font-size: 1.05rem; flex: none; transform: rotate(-90deg); transition: transform .15s; }
.cat-h .cat-tog[aria-expanded="false"] .chev { transform: none; }
.cat-h .cat-tog[aria-expanded="false"] { opacity: .92; }
.cat-tog:focus-visible, .to-top:focus-visible, .toc .ch:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; box-shadow: 0 0 0 6px #FFB75C; }
.cat-body[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .cat-h .cat-tog .chev, .toc .ch .chev { transition: none; } }

/* ---------- back to the top of the page: fixed, same corner on desktop and phone ----------
   The page keeps a free strip on that side (main padding), so the button never covers text or controls. */
.to-top { position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: 50; width: 2.75rem; height: 2.75rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #FFB75C; background: var(--navy); box-shadow: 0 4px 14px rgba(5, 25, 45, .3); padding: 0; }
.to-top[hidden] { display: none; }
.to-top svg { width: 1.45rem; height: 1.45rem; }
.to-top:hover { background: var(--navy-dark); }
main { padding-inline-end: max(clamp(1rem, 3vw, 3rem), 4.5rem); }
@media (max-width: 40rem) {
  .to-top { inset-inline-end: .4rem; bottom: .6rem; width: 2.6rem; height: 2.6rem; }
  main { padding-inline-end: 3.25rem; }
}

@media print {
  .cat-body[hidden] { display: block !important; }
  .cat-h .cat-tog .chev, .to-top { display: none !important; }
  .cat-h .cat-tog { padding: 0; margin: 0; }
  main { padding: 0 !important; }
}
footer.foot { padding-inline: 3.5rem; }
/* drawn chevron (points to the reading direction when closed, down when open) */
.chev.arr svg { width: 72%; height: 72%; display: block; }
.toc .ch .chev.arr, .cat-h .cat-tog .chev { padding: 0; }
.toc .ch .chev.arr { width: 1.3em; height: 1.3em; border-radius: .3em; }
.cat-h .cat-tog .chev { width: 1.55rem; height: 1.55rem; border-radius: .4rem; }
.intro-sec.proposal { border: 2px dashed var(--orange-dark); }
.intro-draft { margin: 0 0 1rem; }
/* "עדכון תוכן" table in פתח דבר: number and date on one line */
#updates td:nth-child(1), #updates td:nth-child(2) { white-space: nowrap; }

/* glossary terms inside the book text: a quiet dotted underline; the definition opens in a small bubble */
.gl-ref { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help; text-decoration: underline dotted var(--orange-dark); text-decoration-thickness: 2px; text-underline-offset: .25em; }
.gl-ref:hover, .gl-ref[aria-expanded="true"] { background: #FFF6E8; border-radius: 3px; }
.gl-ref:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; box-shadow: 0 0 0 6px #FFB75C; }
.gl-pop { position: fixed; z-index: 80; display: block; background: #fff; border: 1.5px solid var(--navy); border-top: 4px solid var(--orange); border-radius: 10px; box-shadow: 0 10px 28px rgba(5, 25, 45, .25); padding: .6rem .8rem; font-size: .95rem; line-height: 1.6; text-align: start; }
.gl-pop .gl-pop-h { display: block; color: var(--navy); margin-bottom: .2rem; }
.gl-pop .gl-pop-d { display: block; }
.gl-pop .gl-pop-a { display: inline-block; margin-top: .35rem; font-weight: 600; }
/* glossary page: aliases, the main definition first, other contexts after */
.gl-alias { margin: -.2rem 0 .3rem; color: var(--muted); font-size: .9rem; }
.gl-var { margin: .5rem 0 0; font-weight: 700; color: var(--navy); font-size: .92rem; }
.gl-more { border-inline-start: 3px solid var(--line); padding-inline-start: .8rem; margin-top: .6rem; }
.gl-ctx { margin: 0 0 .2rem; font-size: .85rem; font-weight: 700; color: var(--muted); }
.letters a.wide { width: auto; padding: 0 .6rem; }
@media print { .gl-ref { text-decoration: none; } .gl-pop { display: none !important; } }

/* ---------- phone layout (28.10.2026) ---------- */
.inmenu details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem; }
.inmenu details > summary::-webkit-details-marker { display: none; }
.inmenu details > summary h2 { margin: 0; }
.inmenu details > summary::after { content: "‹"; display: inline-flex; align-items: center; justify-content: center; width: 1.3em; height: 1.3em; border-radius: .3em; background: var(--navy); color: #FFB75C; font-weight: 800; transform: rotate(-90deg); transition: transform .15s; }
.inmenu details:not([open]) > summary::after { transform: none; }
.inmenu details[open] > summary { margin-bottom: .4rem; }
.mat-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.mat-links .btn.small { padding: .15rem .7rem; font-size: .88rem; white-space: nowrap; }
.filters select { font: inherit; padding: .45rem .7rem; border: 1.5px solid var(--navy); border-radius: 999px; background: #fff; color: var(--ink); max-width: 100%; }
@media (max-width: 40rem) {
  /* header: logo and menu on one row, search under them */
  .top-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand menu" "search search"; gap: .45rem .5rem; padding: .45rem .75rem .55rem; }
  .brand { grid-area: brand; }
  .menu-btn { grid-area: menu; justify-self: end; padding: .45rem .7rem; }
  .search { grid-area: search; margin: 0; width: 100%; max-width: none; }
  html { scroll-padding-top: 7.5rem; }
  /* even side margins; the back-to-top button moves into the header row, so it never covers text */
  main { padding-inline: 1rem !important; }
  .top-in { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "brand top menu" "search search search"; }
  .to-top { position: static; grid-area: top; width: 2.4rem; height: 2.4rem; box-shadow: none; }
  .to-top[hidden] { display: flex; visibility: hidden; }
  /* home: the orange shape no longer sits behind the title */
  .hero::before { inset-inline-end: -2.5rem; top: auto; bottom: -1.5rem; width: 7rem; height: 4.5rem; opacity: .9; }
  .hero { padding: 1.4rem 1.1rem 2.4rem; }
  .filters select, .filters input[type=search] { width: 100%; }
}
