/* EdenFolio board v2 – calm, RTL, logical properties only. Gold is a mark/fill, never small text.
   Fonts: Frank Ruhl Libre (headings) / Heebo (body) when installed, else system fonts (the CSP allows no external hosts). */
@font-face { font-family: "Frank Ruhl Libre"; font-weight: 700; font-display: swap; src: url(/fonts/FrankRuhlLibre_700Bold.ttf) format("truetype"); }
@font-face { font-family: Heebo; font-weight: 400; font-display: swap; src: url(/fonts/Heebo_400Regular.ttf) format("truetype"); }
@font-face { font-family: Heebo; font-weight: 500; font-display: swap; src: url(/fonts/Heebo_500Medium.ttf) format("truetype"); }
@font-face { font-family: Heebo; font-weight: 700; font-display: swap; src: url(/fonts/Heebo_700Bold.ttf) format("truetype"); }
:root {
  --forest: #0F3D2E; --sage: #A7B895; --gold: #D4B06A; --ivory: #FAF7EE; --olive: #2B2B26;
  --card: #FFFFFF; --line: #E6E1D2; --muted: #6B6A60; --stone: #E9E5DA; --stone-text: #5E5B50; --brick: #A4553F;
  --sage-bg: #E8EDE1; --shadow: 0 4px 16px rgba(15, 61, 46, .11);
  --serif: "Frank Ruhl Libre", "Times New Roman", "Arial Hebrew", serif;
  --sans: Heebo, -apple-system, BlinkMacSystemFont, "SF Hebrew", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* nothing may push the page sideways (owner, 16.11.2026): text breaks inside its box, flex children may shrink; clip is the last net */
html, body { overflow-x: clip; }
main, main * { min-width: 0; }
main { overflow-wrap: anywhere; }
body { margin: 0; background: var(--ivory); color: var(--olive); font: 16px/1.5 var(--sans); padding-block: calc(56px + env(safe-area-inset-top)) calc(64px + env(safe-area-inset-bottom)); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font: 13px ui-monospace, Menlo, monospace; background: var(--stone); padding: 1px 5px; border-radius: 5px; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
.top { position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 5; display: flex; align-items: center; gap: 4px; padding: env(safe-area-inset-top) 8px 0; height: calc(52px + env(safe-area-inset-top)); background: var(--ivory); border-block-end: 1px solid var(--line); }
.top h1 { flex: 1; margin: 0; font: 700 22px var(--serif); color: var(--forest); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 6px; }
.icon { min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 22px; color: var(--forest); border-radius: 12px; }
main { padding: 14px 14px 24px; max-width: 640px; margin-inline: auto; }
.tabs { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 5; display: flex; background: var(--card); border-block-start: 1px solid var(--line); padding-block-end: env(safe-area-inset-bottom); }
.tabs a { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); text-decoration: none; font-size: 12px; position: relative; }
.tabs a span.g { font-size: 20px; line-height: 1; }
.tabs a[aria-current="page"] { color: var(--forest); font-weight: 700; }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; inset-block-start: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.badge { position: absolute; inset-block-start: 6px; inset-inline-start: calc(50% + 8px); min-width: 18px; height: 18px; padding-inline: 5px; border-radius: 9px; background: var(--forest); color: var(--ivory); font-size: 12px; line-height: 18px; text-align: center; }
.card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; margin-block-end: 12px; }
.card h2, h2.sec { font: 700 19px/1.35 var(--serif); color: var(--forest); margin: 0 0 8px; overflow-wrap: anywhere; }
h2.sec { margin: 20px 4px 10px; font-size: 17px; }
.muted { color: var(--muted); font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 8px; }
.chip { display: inline-block; min-height: 26px; line-height: 26px; padding: 0 10px; border-radius: 13px; background: var(--stone); color: var(--stone-text); font-size: 13px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.chip.wrap { white-space: normal; line-height: 1.4; padding-block: 3px; overflow-wrap: anywhere; } /* the detail view shows a long branch in full */
.chip.sage { background: var(--sage-bg); color: var(--forest); }
.chip.rec { background: var(--forest); color: var(--ivory); }
.btn { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--forest); background: var(--card); color: var(--forest); font-weight: 600; }
.btn.primary { background: var(--forest); color: var(--ivory); }
.btn.quiet { border-color: var(--line); color: var(--stone-text); }
.row { display: flex; gap: 10px; margin-block-start: 12px; }
.row .btn { flex: 1; }
.opt { display: block; width: 100%; min-height: 52px; margin-block-start: 8px; padding: 10px 14px; text-align: start; border-radius: 14px; border: 1.5px solid var(--line); background: var(--ivory); overflow-wrap: anywhere; }
.opt[aria-pressed="true"] { border-color: var(--forest); background: var(--sage-bg); box-shadow: inset 0 0 0 1px var(--forest); }
.opt .chip { margin-inline-start: 8px; }
input[type=text], input[type=search], textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); margin-block-start: 8px; }
textarea { min-height: 76px; resize: vertical; }
.item { display: block; text-decoration: none; color: inherit; }
.item h3 { margin: 0 0 4px; font: 600 16px/1.4 var(--sans); overflow-wrap: anywhere; }
.seg { display: flex; background: var(--stone); border-radius: 14px; padding: 3px; gap: 2px; }
.seg button { flex: 1; min-height: 44px; border: 0; background: none; border-radius: 11px; font-size: 13.5px; color: var(--stone-text); padding: 0 2px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--forest); font-weight: 700; box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; font: 18px var(--serif); }
.strip { display: flex; gap: 10px; }
.strip a { flex: 1; text-decoration: none; color: inherit; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 10px 14px; min-height: 56px; }
.strip b { display: block; color: var(--forest); font-size: 15px; }
.big { text-align: center; padding: 22px 16px; }
.big .lvl { font: 700 34px var(--serif); color: var(--forest); }
.big.busy .lvl { color: var(--stone-text); }
.big.danger .lvl { color: var(--brick); }
.bar { position: relative; height: 12px; border-radius: 6px; background: var(--stone); margin-block: 6px 4px; }
.bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 6px; background: var(--sage); }
.bar i.hi { background: var(--forest); }
.bar u { position: absolute; inset-block: -4px; width: 3px; background: var(--gold); border-radius: 2px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding-block: 6px; border-block-end: 1px solid var(--line); }
.kv:last-child { border: 0; }
.kv > span { overflow-wrap: anywhere; }
.kv b { font-weight: 600; text-align: end; overflow-wrap: anywhere; flex-shrink: 0; max-width: 60%; }
.chart { display: flex; direction: ltr; align-items: flex-end; gap: 6px; height: 120px; margin-block-start: 8px; }
.chart div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 12px; color: var(--muted); }
.chart i { width: 100%; border-radius: 5px 5px 0 0; background: var(--sage); min-height: 2px; }
.cm { padding-block: 8px; border-block-end: 1px solid var(--line); overflow-wrap: anywhere; }
.cm:last-of-type { border: 0; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; }
.day { margin: 18px 4px 6px; font: 700 15px var(--serif); color: var(--forest); }
.ev { background: var(--card); border-radius: 14px; padding: 10px 14px; margin-block-end: 8px; display: block; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.copy { direction: ltr; unicode-bidi: isolate; word-break: break-all; font: 13px ui-monospace, Menlo, monospace; background: var(--stone); padding: 8px; border-radius: 10px; margin-block: 8px; }
#toast { position: fixed; inset-inline: 16px; inset-block-end: calc(76px + env(safe-area-inset-bottom)); z-index: 9; background: var(--olive); color: var(--ivory); padding: 12px 16px; border-radius: 14px; text-align: center; }
.n { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.big.old .lvl { color: var(--stone-text); font-size: 24px; }
.chip.key { background: none; border: 1px solid var(--line); min-height: 22px; font: 12px ui-monospace, Menlo, monospace; direction: ltr; margin-inline-end: 6px; }
/* collapsible section (Figma: "Board/Section header", page "לוח v2 · נראות"): title at the start, one summary line that
   truncates, a chevron at the end; closed = down, open = up; the whole header row is the 44px+ tap target */
.fold { padding-block: 4px; }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 52px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { margin: 0; flex-shrink: 0; max-width: 60%; }
.fold > summary .sum { flex: 1; min-width: 0; text-align: end; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fold > summary .chev { flex-shrink: 0; width: 32px; height: 32px; border-radius: 16px; background: var(--sage-bg); display: grid; place-items: center; color: var(--forest); transition: transform .2s ease; }
.fold > summary .chev svg { width: 20px; height: 20px; }
.fold[open] > summary .chev { transform: rotate(180deg); }
.fold > summary:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 12px; }
.fold > .in { padding-block: 4px 12px; }
.fold .strip a { background: var(--ivory); box-shadow: none; }
.fold .big { padding: 6px 0 2px; }
h2.sec { display: flex; align-items: center; gap: 8px; }
h2.sec .chip { font: 600 12px var(--sans); min-height: 22px; line-height: 22px; padding: 0 8px; }
.model { margin-block: 10px; }
.model .kv { border: 0; padding: 0; }
@media (prefers-reduced-motion: reduce) { .fold > summary .chev { transition: none; } }
