/* בית עלמא - mobile-first shell + brief + dispatcher.
   Nordic theme-sky. Reuses tokens.css variables. Larger, high-contrast type
   for fast, comfortable reading on the phone. */

/* theme-sky maps the generic accent vars to the sky palette */
.theme-sky {
  --acc: var(--sky);
  --acc-l: var(--sky-l);
  --acc-d: var(--sky-d);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--txt); }
body {
  font-family: var(--font-he), system-ui, sans-serif;
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: 720px; margin: 0 auto;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- header strip ---------- */
.strip {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px calc(12px);
  padding-top: calc(12px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { height: 30px; width: auto; display: block; mix-blend-mode: multiply; }
.dist-sec + .dist-sec { margin-top: 24px; }
.brand .title { font-weight: 600; font-size: 1.05rem; color: var(--txt-x); }
.chips { display: flex; gap: 8px; }
.chip {
  font-size: .8rem; font-weight: 500; color: var(--txt-m);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-f); padding: 6px 14px; min-height: 34px;
  display: inline-flex; align-items: center;
}
.chip.clickable { cursor: pointer; }
.chip.ok { background: var(--ok-l); border-color: var(--ok); color: var(--ok-d); }

/* ---------- content / pages ---------- */
.content { padding: 8px 16px 24px; }
.page { display: none; }
.page.active { display: block; }
.pad { padding: 24px 4px; }

h1 { font-weight: 300; font-size: 2rem; letter-spacing: -.02em; line-height: 1.1; color: var(--txt-x); }
h1 strong { font-weight: 600; }
h2 { font-weight: 600; font-size: 1.1rem; color: var(--txt-x); margin-bottom: 2px; }
h3 { font-size: 1rem; font-weight: 600; color: var(--txt-x); }
.over { font-size: .66rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--acc-d); }
.muted { color: var(--txt-m); }
.hint { color: var(--txt-s); font-size: .85rem; margin-top: 8px; }
.err-msg { color: var(--err-d); font-weight: 500; }

/* ---------- brief ---------- */
.brief-head {
  display: flex; align-items: flex-start; gap: 16px; justify-content: space-between;
  padding: 18px 0 16px; border-bottom: 1px solid var(--border);
}
.brief-head img { height: 38px; width: auto; flex: 0 0 auto; margin-top: 4px; }
.hgreet { flex: 1; }
.pulse { margin-top: 10px; font-size: .88rem; color: var(--txt-m); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pulse b { color: var(--txt-x); font-weight: 600; }

section { margin-top: 26px; }
.shead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.shead .line { flex: 1; height: 1px; background: var(--border); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-l); padding: 15px 17px; box-shadow: var(--sh-s); margin-bottom: 11px;
}
.card.empty { text-align: center; color: var(--txt-m); padding: 28px 18px; }
.card.past { opacity: .55; }   /* 25/10/2026 (ע6): אירוע-יומן שזמן-הסיום שלו עבר */
.row { display: flex; gap: 13px; align-items: baseline; }
.row .when { flex: 0 0 92px; font-weight: 600; color: var(--acc-d); font-size: .92rem; }
.row .what { flex: 1; }
.tag { display: inline-block; font-size: .68rem; font-weight: 600; padding: 2px 9px; border-radius: var(--r-f); vertical-align: middle; }
.tag.asap { background: var(--err-l); color: var(--err-d); }
.tag.trig { background: var(--acc-l); color: var(--acc-d); font-weight: 500; }
.trig-line { margin-top: 6px; }

.num { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.num:last-child { border-bottom: 0; }
.num .n { flex: 0 0 26px; height: 26px; border-radius: var(--r-f); background: var(--acc-l); color: var(--acc-d); font-weight: 600; font-size: .85rem; display: flex; align-items: center; justify-content: center; }
.num .b { flex: 1; }

.phead { font-weight: 600; color: var(--txt-x); margin-bottom: 8px; }
.facts { list-style: none; margin: 0 0 4px; padding: 0; }
.facts li { font-size: .92rem; color: var(--txt); padding: 4px 0; border-bottom: 1px dotted var(--border); }
.facts li:last-child { border-bottom: 0; }
details { border-top: 1px solid var(--border); }
details summary { cursor: pointer; list-style: none; padding: 9px 0 7px; font-size: .85rem; font-weight: 600; color: var(--acc-d); display: flex; align-items: center; gap: 7px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; font-weight: 700; width: 12px; display: inline-block; }
details[open] summary::before { content: "\2212"; }
details .dtxt, details ul { padding: 0 0 10px; font-size: .9rem; color: var(--txt-m); }
details ul { list-style: none; }
details ul li { padding: 3px 0; }

.dd { display: grid; grid-template-columns: 1fr; gap: 11px; }
.dd .col { border-radius: var(--r-l); padding: 14px 16px; border: 1px solid var(--border); }
.dd .do { background: var(--ok-l); border-color: #bfe0cf; }
.dd .dont { background: var(--err-l); border-color: #ecc9c0; }
.dd h3 { margin-bottom: 8px; }
.dd li { list-style: none; font-size: .92rem; padding: 5px 0; display: flex; gap: 8px; align-items: flex-start; }
.dd .mk { flex: 0 0 auto; font-weight: 700; }
.dd .do .mk { color: var(--ok-d); }
.dd .dont .mk { color: var(--err-d); }

.disc { font-family: var(--font-di), serif; font-size: 1.5rem; font-weight: 300; color: var(--txt-m); text-align: center; margin: 30px 0 0; }
.demo-banner { margin: 12px 0 0; padding: 8px 14px; border-radius: var(--r-m); background: var(--wrn-l); color: var(--wrn-d); font-size: .85rem; font-weight: 500; text-align: center; }
/* truth-stamp (19/06 fix): quiet timestamp when fresh, loud red banner when stale */
.brief-stamp { margin: 10px 0 0; font-size: .8rem; color: var(--txt-m); text-align: center; display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: center; align-items: center; }
.brief-stamp.stale { padding: 9px 14px; border-radius: var(--r-m); background: var(--err-l); color: var(--err-d); font-weight: 600; }
.brief-stamp .bs-msg { font-weight: 500; opacity: .92; }
/* budget banner: amber at 80%, red when credit is exhausted */
.brief-budget { margin: 10px 0 0; padding: 9px 14px; border-radius: var(--r-m); font-size: .85rem; font-weight: 600; text-align: center; }
.brief-budget.warn { background: var(--wrn-l); color: var(--wrn-d); }
.brief-budget.out { background: var(--err-l); color: var(--err-d); }
/* budget alert (your-control model, 30/06): a slow, unmissable pulse (1.15s - a
   gentle opacity breathe, NOT a harsh strobe) so the 80% warning grabs attention
   on the cockpit instead of hiding in a log file. Mirrored as a header chip
   (.chip.budget) that shows on EVERY tab, so you catch it and top up in time. */
@keyframes budget-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .38; } }
.brief-budget.warn, .brief-budget.out { animation: budget-pulse 1.15s ease-in-out infinite; font-weight: 700; }
.chip.budget { animation: budget-pulse 1.15s ease-in-out infinite; cursor: pointer; font-weight: 600; }
.chip.budget.warn { background: var(--wrn-l); border-color: var(--wrn); color: var(--wrn-d); }
.chip.budget.out { background: var(--err-l); border-color: var(--err); color: var(--err-d); }

/* brief -> threads CTA */
.cta-card { width: 100%; display: flex; align-items: center; gap: 14px; cursor: pointer; text-align: start; font: inherit; }
.cta-card .cta-num { flex: 0 0 auto; min-width: 38px; height: 38px; border-radius: var(--r-f); background: var(--acc); color: #fff; font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; }
.cta-card .cta-txt { flex: 1; font-weight: 500; color: var(--txt-x); }
.cta-card .cta-arrow { flex: 0 0 auto; color: var(--acc-d); font-size: 1.3rem; }
.cta-card:active { background: var(--surface-2); }

/* ---------- dispatcher ---------- */
.thr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 18px 0 8px; }
.thr-count { font-size: .85rem; color: var(--txt-m); }
.thr-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 2px 14px; box-shadow: var(--sh-s); }
.thr { padding: 6px 0; border-bottom: 1px solid var(--border); }
.thr:last-child { border-bottom: 0; }

/* tap-to-open header row */
.thr-head-row {
  width: 100%; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  background: none; border: 0; cursor: pointer; font: inherit; color: inherit;
  text-align: start; padding: 9px 0; min-height: 48px;
}
.thr-head-row .kind { flex: 0 0 auto; font-size: .68rem; font-weight: 600; color: var(--acc-d); background: var(--acc-l); border-radius: var(--r-f); padding: 3px 10px; }
.thr-head-row .time { flex: 0 0 auto; font-size: .75rem; color: var(--txt-s); }
.thr-head-row .sens { flex: 0 0 auto; font-size: .64rem; font-weight: 600; color: var(--err-d); background: var(--err-l); border: 1px solid var(--err); border-radius: var(--r-f); padding: 2px 9px; }
.thr-head-row .sum { flex: 1 1 100%; min-width: 150px; font-size: .96rem; color: var(--txt); }
.thr-head-row .chev { flex: 0 0 auto; color: var(--acc-d); font-size: .9rem; }

/* the full triage form */
.thr-form { display: none; padding: 6px 0 16px; }
.thr-form.open { display: block; }
.thr-text { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 16px; }
.thr-body { margin-top: 10px; font-size: .94rem; line-height: 1.6; color: var(--txt-m); white-space: pre-wrap; }
.thr-text .chips { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.thr-text .chips .chip { font-size: .64rem; padding: 2px 8px; min-height: 0; }

.tform-row { margin-bottom: 15px; }
.tform-row .lbl { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--txt-s); margin-bottom: 7px; }

.pills { display: flex; gap: 7px; flex-wrap: wrap; }
.pill {
  font: inherit; font-size: .85rem; cursor: pointer;
  padding: 8px 14px; min-height: 40px; border-radius: var(--r-f);
  border: 1px solid var(--border-s); background: var(--bg); color: var(--txt);
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.pill.mini { font-size: .78rem; padding: 6px 11px; min-height: 0; margin-top: 7px; }
.pill.sel { background: var(--acc); color: #fff; border-color: var(--acc); font-weight: 600; }
.pill[data-v="p1"].sel { background: var(--err); border-color: var(--err); }
.pill[data-v="p2"].sel { background: var(--wrn); border-color: var(--wrn); color: var(--txt-x); }
.pill[data-v="p3"].sel { background: var(--txt-s); border-color: var(--txt-s); }

.thr-form select, .tag-in {
  width: 100%; font: inherit; font-size: .92rem; color: var(--txt);
  border: 1px solid var(--border-s); background: var(--bg); border-radius: var(--r-s);
  padding: 11px 12px; min-height: 44px;
}
.ta-remark {
  width: 100%; font: inherit; font-size: .96rem; line-height: 1.6; color: var(--txt);
  border: 1px solid var(--border-s); background: var(--bg); border-radius: var(--r-m);
  padding: 11px 13px; min-height: 84px; resize: vertical;
}
.thr-form select:focus, .tag-in:focus, .ta-remark:focus { outline: none; border-color: var(--acc); }

.iconbtn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; cursor: pointer;
  font-size: .8rem; font-weight: 500; padding: 7px 13px; min-height: 38px;
  border: 1px solid var(--border-s); background: var(--bg); color: var(--txt-m); border-radius: var(--r-f);
  transition: background var(--t-base), color var(--t-base);
}
.iconbtn.on { background: var(--err); color: #fff; border-color: var(--err); }
.rec-row { margin-top: 8px; }

.commit {
  width: 100%; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  background: var(--acc); color: #fff; border: 0; border-radius: var(--r-m);
  padding: 14px; min-height: 50px; margin-top: 6px; transition: background var(--t-base);
}
.commit:hover { background: var(--acc-d); }
.commit:disabled { opacity: .6; cursor: default; }

.thr .locked-tag { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--ok-d); background: var(--ok-l); border: 1px solid var(--ok); border-radius: var(--r-f); padding: 5px 12px; margin: 0 0 9px; }
.thr.locked { opacity: .62; }
.thr.locked .sum { text-decoration: line-through; }
.thr.just-locked { animation: flash .9s ease; }
@keyframes flash { from { background: var(--ok-l); } to { background: transparent; } }

/* ---------- login gate ---------- */
.gate { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 40px 20px; }
.gate img { height: 56px; margin-bottom: 6px; }
.gate-h1 { font-size: 1.9rem; }
.gate .muted { max-width: 320px; margin: 4px 0 18px; }
.btn-primary { font-family: inherit; font-size: 1.05rem; font-weight: 600; background: var(--txt-x); color: var(--bg); border: 0; border-radius: var(--r-s); padding: 14px 28px; cursor: pointer; min-height: 48px; transition: background var(--t-base); }
.btn-primary:hover { background: var(--acc-d); }
.btn-ghost { font-family: inherit; font-size: .95rem; font-weight: 500; background: transparent; color: var(--txt-m); border: 0; padding: 10px; margin-top: 4px; cursor: pointer; }
.btn-ghost:hover { color: var(--acc-d); }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 720px; margin: 0 auto;
  display: flex; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; cursor: pointer; padding: 10px 4px 8px;
  color: var(--txt-s); font-family: inherit; font-size: .72rem; font-weight: 500;
  min-height: 56px; transition: color var(--t-base);
}
.nav-btn svg { width: 24px; height: 24px; fill: currentColor; }
.nav-btn.active { color: var(--acc-d); }
.nav-btn.disabled { opacity: .4; cursor: default; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 50;
  background: var(--txt-x); color: var(--bg); font-size: .9rem; font-weight: 500;
  padding: 12px 20px; border-radius: var(--r-f); box-shadow: var(--sh-m);
  opacity: 0; pointer-events: none; transition: opacity var(--t-base), transform var(--t-base);
  max-width: 88%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- phoe: landing counters + bottom-nav badges ---------- */
.home-status { display: flex; gap: 8px; margin: 14px 0 2px; }
.hs-chip {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font: inherit; cursor: pointer; padding: 11px 6px; min-height: 58px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l);
  box-shadow: var(--sh-s); transition: background var(--t-base);
}
.hs-chip:active { background: var(--surface-2); }
.hs-chip .hs-n { font-size: 1.45rem; font-weight: 700; color: var(--acc-d); line-height: 1; }
.hs-chip .hs-l { font-size: .72rem; color: var(--txt-m); }
.hs-chip.zero .hs-n { color: var(--txt-s); }

.nav-btn { position: relative; }
.nav-badge {
  position: absolute; top: 3px; left: 50%; transform: translateX(2px);
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--err); color: #fff; font-size: .66rem; font-weight: 700; line-height: 18px;
  border-radius: var(--r-f); text-align: center;
}
.nav-badge[hidden] { display: none; }
.nav-dot {
  position: absolute; top: 6px; left: 50%; transform: translateX(13px);
  width: 9px; height: 9px; border-radius: 50%; background: var(--acc); border: 1.5px solid var(--bg);
}
.nav-dot[hidden] { display: none; }

/* ---------- 5ni1: a field with a mic button beside it ---------- */
.mic-wrap { display: flex; align-items: flex-start; gap: 8px; }
.mic-wrap > textarea, .mic-wrap > input { flex: 1; }
.iconbtn.mic { flex: 0 0 auto; align-self: center; }

/* ---------- "המשך מכאן": unified resume card at the top of home ---------- */
.resume { margin-top: 16px; }
.resume .resume-count {
  font-size: .78rem; font-weight: 700; color: #fff; background: var(--acc);
  border-radius: var(--r-f); min-width: 22px; height: 22px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.resume-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 2px 12px; box-shadow: var(--sh-s); }
.resume-item {
  width: 100%; display: flex; align-items: center; gap: 11px;
  background: none; border: 0; border-bottom: 1px solid var(--border);
  cursor: pointer; font: inherit; color: inherit; text-align: start;
  padding: 13px 2px; min-height: 52px;
}
.resume-item:last-child { border-bottom: 0; }
.resume-item:active { background: var(--surface-2); }
.resume-item .ri-ico { flex: 0 0 auto; font-size: 1.15rem; }
.resume-item .ri-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resume-item .ri-txt { font-size: .95rem; color: var(--txt); }
.resume-item .ri-src { font-size: .72rem; color: var(--txt-s); }
.resume-item .ri-arrow { flex: 0 0 auto; color: var(--acc-d); font-size: 1.15rem; }
.resume-item .ri-copy { flex: 0 0 auto; font-size: 1.05rem; }
.resume > .btn-ghost { margin-top: 6px; }

/* zi5i: inline calendar form on an action card */
.cal-box { background: var(--bg); border: 1px solid var(--border-s); border-radius: var(--r-m); padding: 12px 14px; }
.cal-box .tform-row { margin-bottom: 11px; }
.cal-times { display: flex; align-items: center; gap: 8px; }
.cal-times .tag-in { width: auto; flex: 1; }
.cal-times .cal-sep { color: var(--txt-s); flex: 0 0 auto; }

/* wider screens: two-column do/dont, roomier */
@media (min-width: 560px) {
  .dd { grid-template-columns: 1fr 1fr; }
}

/* ---------- capture tab (merged collector) ---------- */
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.cap-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 26px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-l); box-shadow: var(--sh-s); cursor: pointer; transition: transform .08s, background .15s;
}
.cap-btn:active { transform: scale(.97); background: var(--acc-l); }
.cap-btn .cap-ico { font-size: 2rem; line-height: 1; }
.cap-btn .cap-lbl { font-size: .95rem; font-weight: 600; color: var(--txt-x); }

/* צופה-הגרפים של מהדורת-שבת (01/08): שכבה מלאה מעל האפליקציה, מובייל ודסקטופ */
.graphs-overlay { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.graphs-bar { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; border-bottom: 1px solid var(--border); }
.graphs-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.graphs-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
.graphs-cta { width: 100%; text-align: right; }

.cap-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.cap-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.cap-sheet, .cap-menu, .cap-rec {
  position: relative; z-index: 1; width: 100%; max-width: 520px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--sh-s);
}
.cap-menu, .cap-rec { border-radius: var(--r-l); margin: auto 14px; align-self: center; display: flex; flex-direction: column; gap: 10px; }
.cap-sheet-title { font-weight: 600; color: var(--txt-x); margin-bottom: 12px; }
.cap-prev-img { max-width: 100%; max-height: 240px; border-radius: var(--r-m); display: block; margin-bottom: 12px; }
.cap-prev-audio { width: 100%; margin-bottom: 12px; }
.cap-ta {
  width: 100%; min-height: 110px; resize: vertical; font: inherit; color: var(--txt);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 12px 14px;
}
.cap-sheet-row { display: flex; gap: 10px; margin-top: 14px; }
.cap-sheet-row .btn-primary { flex: 1; }
.cap-rec { align-items: center; text-align: center; gap: 14px; }

/* ---------- הלכידה הפתוחה (21/07) ---------- */
.cap-addrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cap-part { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cap-part .cap-prev-img { max-height: 120px; margin-bottom: 0; }
.cap-part .cap-prev-audio { margin-bottom: 0; }
.cap-part-rm { font-size: .8rem; padding: 6px 10px; flex-shrink: 0; }
.cap-open-strip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: calc(100% - 32px);
  margin: 0 16px 12px; padding: 14px 16px; text-align: right; font: inherit; cursor: pointer;
  background: var(--surface); border: 1px dashed var(--acc); border-radius: var(--r-m); color: var(--txt-x);
}
.cap-rec-timer { font-size: 2rem; font-weight: 300; color: var(--txt-x); font-variant-numeric: tabular-nums; }
.cap-rec-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--err, #c0392b); animation: cap-pulse 1s infinite; }
@keyframes cap-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- responsive guard (geyw + s4dq 24/06: app wobbled left-right on
   Galaxy S22 Ultra; content was wider than the viewport). clip (not hidden) so
   the sticky header keeps working; long URLs/strings wrap instead of overflowing. */
html, body { overflow-x: clip; max-width: 100%; }
.content, .page, .card, .thr-list, .resume, .strip, .bottom-nav { max-width: 100%; }
.thr-body, .sum, .thr-head-row .sum, .ri-txt, .ri-src, .dtxt, .facts li, .pulse,
.cta-card .cta-txt, .brief-head, .disc, .resume-item, p, li, h1, h2, h3 { overflow-wrap: anywhere; }
/* brief flex rows (agenda .what, numbered-step .b): a flex child keeps its
   content's intrinsic width unless min-width:0, so a long unbreakable token
   (map URL / OneDrive inbox file-path) pushed the row past the viewport on the
   S22 Ultra even with the guard above (s4dq 24/06). Let the cell shrink + wrap. */
.row .what, .num .b { min-width: 0; overflow-wrap: anywhere; }
.ltr { overflow-wrap: anywhere; }
a, .source-url, code { overflow-wrap: anywhere; word-break: break-word; }
img, audio, video, iframe, svg { max-width: 100%; }

/* ---------- instant triage pills (capture -> triage from memory) ---------- */
.cap-flbl { font-size: .8rem; font-weight: 600; color: var(--txt-m); margin: 14px 0 6px; }
.cap-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cap-pill { padding: 9px 15px; border-radius: var(--r-f); border: 1px solid var(--border); background: var(--surface); color: var(--txt); font: inherit; font-size: .9rem; cursor: pointer; }
.cap-pill.sel { background: var(--acc); color: #fff; border-color: var(--acc); }

/* ---------- הבריף כמשטח-מצב (21/07) ---------- */
.urgent-strip { display: flex; flex-direction: column; gap: 8px; margin: 0 16px 14px; }
.urgent-btn {
  display: block; width: 100%; text-align: right; font: inherit; cursor: pointer;
  padding: 14px 16px; border-radius: var(--r-m); border: 1px solid var(--err, #c0392b);
  background: var(--err-l, #fdecea); color: var(--err-d, #7b241c);
}
.urgent-btn .ub-t { font-weight: 600; }
.urgent-det { padding: 4px 16px 10px; }
.ub-demote { font-size: .82rem; padding: 6px 10px; }
.ub-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ub-treat { flex: 0 0 auto; }
.ub-undo { font-size: .82rem; margin-top: 4px; }
.eng-enter { width: 100%; padding: 16px; font-size: 1.05rem; margin: 6px 0 10px; }
.eng-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.since-card { margin: 0 16px 14px; }
.box.box-done { border-color: var(--ok, #8FA888); }
.box.box-done .cta-num { color: var(--ok, #8FA888); }
.ed-fold { margin: 18px 16px 8px; border: 1px solid var(--border); border-radius: var(--r-m); background: var(--surface); }
.ed-fold > summary { padding: 14px 16px; cursor: pointer; color: var(--txt-m); font-weight: 600; list-style-position: inside; }
.ed-fold[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }

/* --- שלוש הדלתות (08/07/2026) --- */
.doors{display:flex;flex-direction:column;gap:14px;padding:22px 16px 8px}
.door{display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:100%;text-align:right;
  background:var(--surface,#EDECEA);border:1px solid var(--border,#D4D1CC);border-radius:16px;
  padding:20px 18px;font-family:inherit;cursor:pointer;transition:border-color .16s ease,background .16s ease}
.door:active{background:var(--surface-2,#E2E0DC);border-color:var(--acc,#C8A882)}
.door-ic{font-size:1.7rem;line-height:1}
.door-t{font-size:1.25rem;color:var(--txt-x,#0F0F0E);font-weight:500}
.door-s{font-size:.88rem;color:var(--txt-m,#5A5754)}
.door-back{margin:14px 16px 0}

/* --- חדר המכונות: לוח-ענן + הכרעות (19/07) --- */
.eng-guard { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 18px; }
.eng-dot { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--r-f); font-size: .82rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface); }
.eng-dot-n { font-weight: 700; }
.eng-dot-red { background: var(--err-l); border-color: var(--err); color: var(--err-d); }
.eng-dot-amber { background: var(--wrn-l); border-color: var(--wrn); color: var(--wrn-d); }
.eng-dot-green { background: var(--ok-l); border-color: var(--ok); color: var(--ok-d); }
.eng-scan { font-size: .78rem; color: var(--txt-s); }
.eng-rec { color: var(--acc-d); font-weight: 500; }
.eng-yn { display: flex; gap: 10px; margin-top: 10px; }
.eng-yn button { flex: 1; font: inherit; font-size: 1rem; font-weight: 600; border-radius: var(--r-m); padding: 14px; min-height: 50px; cursor: pointer; transition: background var(--t-base); }
.eng-yn .yes { background: var(--ok); color: #fff; border: 0; }
.eng-yn .yes:hover { background: var(--ok-d); }
.eng-yn .no { background: var(--bg); color: var(--err-d); border: 1px solid var(--err); }
.eng-yn button:disabled { opacity: .6; cursor: default; }

/* הדלפק היחיד (16/08): שורת-אותיות, תג-מקור ודחייה.
   האותיות מעל כן/לא ובמלוא הרוחב - טקסט עברי ארוך לא נכנס לכפתור צר, ויעד-נגיעה
   של 44px הוא הרצפה בטלפון. */
.eng-opts { margin-top: 10px; }
.eng-opts-lbl { font-size: .78rem; color: var(--txt-s); margin-bottom: 6px; }
.eng-opts .opt {
  display: block; width: 100%; text-align: start; font: inherit; font-size: .92rem;
  color: var(--txt); background: var(--bg); border: 1px solid var(--border-s);
  border-radius: var(--r-s); padding: 11px 12px; min-height: 44px; margin-bottom: 6px;
  cursor: pointer; transition: background var(--t-base), border-color var(--t-base);
}
@media (hover: hover) { .eng-opts .opt:hover { background: var(--acc-l); border-color: var(--acc); } }   /* שלב 2: בנייד :hover נדבק אחרי נגיעה ונראה כמו "מסומן" */
.eng-opts .opt:disabled { opacity: .6; cursor: default; }

.eng-origin {
  font-size: .72rem; color: var(--txt-m); background: var(--surface-2);
  border-radius: var(--r-f); padding: 2px 8px; margin-inline-start: 6px; white-space: nowrap;
}

.eng-defer { display: flex; gap: 8px; margin-top: 8px; }
.eng-defer .iconbtn { flex: 1; justify-content: center; }

/* יציאה רכה בדחייה - שהפריט לא ייעלם בקפיצה */
.thr.snoozed-out { opacity: 0; transform: translateY(-6px); transition: opacity .18s, transform .18s; }

/* שורת-המקורות בראש הדלפק */
.src-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.src-pill {
  font-size: .76rem; color: var(--txt-m); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-f); padding: 3px 10px;
}

/* ta-grow: שדה הערה שגדל עם התוכן, בלי גלילה פנימית (19/07) - חייב לבוא אחרי
   .ta-remark למעלה כדי לדרוס resize/overflow-y (אותה ספציפיות, סדר-מקור מכריע). */
.ta-grow { overflow-y: hidden; resize: none; }

/* עמוד-המענה "מה השאלה?" (23/07): רצועת-קבלות + תג-מדרגה של סולם-העדיפויות */
.rcp { margin: 10px 0 4px; }
.rcp summary { cursor: pointer; color: var(--txt-m); padding: 8px 2px; font-size: .9rem; }
.rcp-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 2px 14px; }
.rcp-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.rcp-row:last-child { border-bottom: 0; }
.rcp-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rcp-v { flex: 0 0 auto; font-size: .8rem; font-weight: 700; border-radius: var(--r-f); padding: 2px 10px; }
.rcp-v.yes { color: var(--ok-d); background: var(--ok-l); border: 1px solid var(--ok); }
.rcp-v.no { color: var(--txt-m); background: var(--bg); border: 1px solid var(--border); }
.rcp-t { flex: 1 1 200px; font-size: .92rem; color: var(--txt); }
.rcp-st { margin-top: 3px; font-size: .78rem; color: var(--txt-s); }
.rcp-note { margin-top: 4px; font-size: .85rem; color: var(--txt-m); }
.eng-tier { flex: 0 0 auto; font-size: .64rem; font-weight: 600; border-radius: var(--r-f); padding: 2px 9px; color: var(--acc-d); background: var(--acc-l); }
.eng-tier.t1 { color: var(--err-d); background: var(--err-l); }
.eng-tier.t4 { color: var(--txt-m); background: var(--bg); border: 1px solid var(--border); }

/* ---------- מסך רחב (דסקטופ, >=900px): אותו מנוע, שני חלונות (31/07/2026).
   כל כלל כאן חי מאחורי הסף - מתחתיו (מובייל, אנכי צר) אפס שינוי חזותי: שום
   כלל למעלה בקובץ לא נגוע, ושום כלל כאן לא דולף החוצה. בסיס-ה-RTL קבוע
   (html dir="rtl"): "התחלה" = ימין, "סוף" = שמאל. פס-הצד (היה bottom-nav)
   יושב פיזית בימין; התוכן (.strip + .content) מתחיל לצידו - כלומר משמאלו. ---------- */
@media (min-width: 900px) {
  :root { --nav-w: 116px; --content-w: 1040px; }

  html { font-size: 17px; } /* סולם-הטוקנים הקיים גדל במקצת, פרופורציונלית (rem) */

  body {
    max-width: none;
    padding-right: var(--nav-w);
    padding-bottom: var(--sp-6);
  }

  /* ---- פס-הצד: אותו bottom-nav בדיוק (אותם data-route, אותם class) - רק
     מסודר אנכית ומוצמד לימין במקום פס אופקי תחתון. ---- */
  .bottom-nav {
    position: fixed; top: 0; bottom: 0; right: 0; left: auto;
    max-width: none; width: var(--nav-w); margin: 0;
    flex-direction: column; justify-content: flex-start; align-items: stretch;
    gap: var(--sp-2);
    padding: var(--sp-8) var(--sp-2) var(--sp-4);
    border-top: 0; border-left: 1px solid var(--border);
  }
  .nav-btn { flex: 0 0 auto; min-height: 60px; padding: 12px 6px; font-size: .78rem; gap: 6px; }
  .nav-btn svg { width: 26px; height: 26px; }

  /* ---- כותרת + תוכן: נצמדים לצד פס-הצד (ימין), לא ממורכזים בעמוד. ---- */
  .strip, .content {
    max-width: var(--content-w);
    margin-inline-start: 0; margin-inline-end: auto;
  }
  .content { padding: var(--sp-4) var(--sp-8) var(--sp-10); }

  /* כפתור "הקרא לי" הצף (read-aloud-neural.js קפוא בהוראה מפורשת - זו דריסת
     CSS בלבד כאן ב-app.css, בלי לגעת בקובץ עצמו) זז שמאלה כך שלא ייבלע מתחת
     לפס-הצד החדש. !important כי הסקריפט מזריק את ה-style שלו ל-head בזמן
     ריצה אחרי app.css - סדר-מקור לבדו לא מבטיח שהדריסה כאן תנצח. */
  .ra-bar { inset-inline-start: calc(var(--nav-w) + 18px) !important; }

  .toast { left: calc(50% + var(--nav-w) / 2); }

  /* ---- הבריף: אותו DOM בדיוק כמו במובייל (אין הזזה של אף אלמנט) - רק
     grid-column על מה שכבר קיים. "הקופסאות" (class="sec-boxes", עוגן יחיד
     שנוסף ב-brief.js) עוברות לטור המשני יחד עם "מאז שקראת"; כותרת/דמו/חירום/
     חותמת/רענון/תקציב/"המשך מכאן"/סיום פרוסים לרוחב מלא; שאר הסקשנים (היום,
     קרוב, מהדורה/גוף, מייל, שירותים, כדאי-לא-כדאי) נשארים בטור הקריאה הראשי. */
  .brief-surface {
    display: grid;
    grid-template-columns: minmax(0, 68ch) minmax(240px, 320px);
    column-gap: var(--sp-8);
    align-items: start;
  }
  .brief-surface > section { grid-column: 1; }
  .brief-surface > section.sec-boxes { grid-column: 2; }
  .brief-surface > .resume,
  .brief-surface > .brief-head,
  .brief-surface > .demo-banner,
  .brief-surface > .urgent-strip,
  .brief-surface > .since-card,
  .brief-surface > .brief-stamp,
  .brief-surface > .brief-refresh,
  .brief-surface > .brief-budget,
  .brief-surface > .disc { grid-column: 1 / -1; }
  .brief-surface > .ed-fold { grid-column: 1; }
}

/* 01/09 מהדורת-רדיו: רצועה מתחת לכותרת הבריף */
.radio-strip{margin:10px 0 4px;}
.radio-btn{border:1px solid var(--border);background:var(--surface);color:var(--txt);border-radius:999px;padding:10px 18px;font:inherit;cursor:pointer;}
.radio-btn:hover{border-color:var(--acc);}
.radio-audio{width:100%;max-width:420px;display:block;}

/* 01/09 רזה-קודם: מרחיבי-סקשן במובייל */
.fold-sec{margin:14px 0;border:1px solid var(--border);border-radius:10px;padding:0 12px;}
.fold-sec>summary{cursor:pointer;padding:12px 0;font-weight:600;color:var(--txt);list-style-position:inside;}
.fold-sec>section{margin-top:0;}

/* 03/10/2026 (שלב 1): מקטע מייל ומדדי-המכונה - על הטוקנים הקיימים בלבד */
.mail-card .phead { margin-bottom: 6px; }
.mail-list { list-style: none; padding: 0; margin: 0 0 8px; font-size: .9rem; }
.mail-list li { padding: 5px 0; border-top: 1px solid var(--border); }
.mail-list li:first-child { border-top: 0; }
.mail-list a { color: var(--acc-d); }
.mail-sub { margin: 8px 0 4px; font-size: .78rem; font-weight: 600; color: var(--txt-s); }
.mail-back { color: var(--acc-d); font-weight: 600; }
.mail-open { margin-top: 6px; }
.machine-metrics { margin: 18px 16px 8px; border: 1px solid var(--border); border-radius: var(--r-m); background: var(--surface); padding: 0 14px; }
.machine-metrics .mm-body { padding-bottom: 10px; font-size: .88rem; color: var(--txt-m); }

/* ---------- שלב 2 (03/10/2026): "שאלות אליך" - כרטיס אחד לכל פריט, בעמוד #answer ובבית ---------- */
.qgroup { margin-top: 12px; }
.qgroup-h { font-size: .8rem; font-weight: 600; color: var(--txt-s); margin: 0 2px 6px; }
.qcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l);
  padding: 14px 16px; box-shadow: var(--sh-s); margin-bottom: 11px;
}
.qcard.stop { border-color: var(--err); }
.qcard.exc { border-inline-start: 4px solid var(--err); }
.qcard.sent { opacity: .55; }
.qc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--txt-s); margin-bottom: 4px; }
.qc-tag { font-size: .66rem; font-weight: 600; border-radius: var(--r-f); padding: 2px 9px; }
.qc-tag.exc { color: var(--err-d); background: var(--err-l); }
.qc-q { font-weight: 700; font-size: 1.02rem; line-height: 1.5; color: var(--txt-x); }
.qc-bg { margin-top: 6px; font-size: .9rem; line-height: 1.55; color: var(--txt-m); white-space: pre-wrap; }
.qcard .eng-opts .opt.rec { border-color: var(--acc); background: var(--acc-l); font-weight: 600; }
.qcard .ta-remark { margin-top: 4px; min-height: 0; }
.qc-foot { align-items: center; flex-wrap: wrap; }
.qc-foot .iconbtn, .qc-foot .qc-handle { flex: 1 1 auto; justify-content: center; text-align: center; }
.qc-all { width: 100%; margin-top: 4px; }
.q-fold { margin: 18px 0 8px; border: 1px solid var(--border); border-radius: var(--r-m); background: var(--surface); padding: 0 12px 6px; }
.q-fold > summary { padding: 14px 4px; cursor: pointer; color: var(--txt-m); font-weight: 600; list-style-position: inside; }
.q-sec { margin-top: 14px; }
.home-q .qcard:last-child { margin-bottom: 0; }

/* "הצעד הבא" בכרטיס-פירוט: שורה גלויה + ידית + תגובה (§6.5) */
.next-line { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.nx-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.nx-lbl { font-size: .72rem; font-weight: 600; color: var(--acc-d); background: var(--acc-l); border-radius: var(--r-f); padding: 2px 9px; }
.nx-txt { flex: 1 1 200px; font-size: .92rem; color: var(--txt); }
.nx-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.nx-acts .btn-ghost { flex: 1 1 auto; justify-content: center; text-align: center; }
.nx-box { margin-top: 8px; }
.nx-done { margin-top: 8px; }
.qc-handle, .nx-handle, .nx-reply, .qc-all { border: 1px solid var(--border-s); border-radius: var(--r-f); background: var(--bg); min-height: 38px; padding: 7px 13px; font-size: .85rem; }
.qc-handle:disabled { opacity: .6; cursor: default; }
.qc-free { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.qc-free .iconbtn { align-self: flex-start; }
.qc-send { border-color: var(--acc); color: var(--acc-d); }
.qc-tts { flex: 0 0 auto !important; }
.qc-free[hidden] { display: none; }

/* 15/10/2026 - סייר ההופעות: קופסת "הופעות · בלוז וג'אז" בבריף (brief.js renderGigs) */
.sec-gigs .gig .row .when { line-height: 1.35; }
.gig-title { color: var(--txt-x); font-weight: 500; margin-bottom: 2px; }
.gig-link { display: inline-block; margin-top: 6px; font-size: .85rem; font-weight: 500; color: var(--acc-d); text-decoration: none; padding: 4px 0; }
.gig-link:hover { text-decoration: underline; }
.gig-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.gig-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 4px; }
.gig-foot .hint { margin-top: 0; }
.sec-gigs details > summary { cursor: pointer; color: var(--acc-d); font-size: .9rem; padding: 8px 0; }

/* ---------- 08/11/2026: חלון "חוטים" (?view=capture) - אותו לוכד, בלי שאר הלשוניות ---------- */
.capture-only .bottom-nav { display: none; }
@media (min-width: 900px) { body.capture-only { padding-right: 0; } }
