/* PermitAI — ממשק עברית RTL לצוות הרישוי של מינהל ההנדסה בני ברק.
   שפה חזותית: כחול-נייבי עירוני, ירוק עירוני, טורקיז; Heebo לטקסט, Rubik לכותרות, Frank Ruhl Libre לציטוטי תקנון.
   ללא תלויות חיצוניות — הגופנים מקומיים (עובד גם ברשת סגורה). */
@import url("../fonts/fonts.css");

:root {
  color-scheme: light;
  /* פלטה */
  --navy: #163158;        --navy-ink: #0f2240;   --navy-2: #24477a;
  --green: #81c341;       --green-ink: #3d7417;  --green-tint: #eef7e4;
  --muni-green: #006734;
  --azure: #0093ad;       --azure-tint: #e3f4f7;
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --line: #e3e8ef;
  --line-strong: #c9d3e3;
  --ink: #1d2b45;
  --ink-2: #4a5873;
  --muted: #5f6b7e;
  --brand: var(--navy);
  --brand-ink: #ffffff;
  --brand-soft: #e8eef7;
  --focus: #0093ad;
  --series-1: #2c5aa0;
  --good: #2f6f12;  --good-bg: #eef7e4;
  --bad: #b42318;   --bad-bg: #fdf1f0;
  --warn: #8a5300;  --warn-bg: #fff5e1;
  --review: #5a3fa8;--review-bg: #f1edfb;
  --info: #0b6f84;  --info-bg: #e3f4f7;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(22,49,88,.05), 0 6px 20px rgba(22,49,88,.05);
  --font: "Heebo", "Segoe UI", Arial, sans-serif;
  --font-head: "Rubik", "Heebo", "Segoe UI", Arial, sans-serif;
  --font-book: "Frank Ruhl Libre", "David", "Times New Roman", serif;
}

* { box-sizing: border-box; }
/* ברירת מחדל לאייקונים (ספציפיות 0): בלי גודל מפורש, SVG מתפרס על כל הרוחב */
:where(svg[aria-hidden="true"]) { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--bg); direction: rtl; -webkit-font-smoothing: antialiased; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(0,147,173,.45); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); letter-spacing: -.1px; }
h1 { font-size: 26px; margin: 0 0 4px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 18px; margin: 0 0 14px; font-weight: 600; }
h3 { font-size: 15.5px; margin: 0 0 8px; font-weight: 600; }
.sub { color: var(--ink-2); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ================================================================ מעטפת: פס עליון · כותרת · פס שלושה צבעים */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.utilbar { background: var(--navy); color: #dbe4f1; font-size: 13px; }
.utilbar .in-w { display: flex; align-items: center; gap: 14px; min-height: 36px; }
.utilbar b { color: #fff; font-weight: 600; }
.utilbar .grow { flex: 1; }
.utilbar a, .utilbar button.lnk { color: #fff; background: none; border: 0; cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.utilbar .dot { opacity: .45; }
.in-w { max-width: 1440px; margin: 0 auto; padding: 0 28px; width: 100%; }

.masthead { background: var(--surface); position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 0 var(--line); }
.masthead .in-w { display: flex; align-items: center; gap: 28px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none !important; flex: none; }
.brand .mark { width: 44px; height: 44px; flex: none; }
.brand .bt { display: flex; flex-direction: column; line-height: 1.15; }
.brand .bt b { font-family: var(--font-head); font-size: 21px; font-weight: 700; color: var(--navy); }
.brand .bt b em { font-style: normal; color: var(--green-ink); }
.brand .bt span { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { position: relative; color: var(--navy); padding: 26px 12px 24px; font-size: 15.5px; font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.nav a svg { width: 17px; height: 17px; opacity: .55; flex: none; }
.nav a:hover { text-decoration: none; color: var(--navy-ink); }
.nav a:hover svg { opacity: .9; }
.nav a::after { content: ""; position: absolute; inset-inline: 12px; bottom: 14px; height: 3px; border-radius: 3px; background: transparent; }
.nav a.active { font-weight: 700; }
.nav a.active svg { opacity: 1; color: var(--green-ink); }
.nav a.active::after { background: var(--green); }
.nav .sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; flex: none; }
.mast-actions { display: flex; align-items: center; gap: 10px; flex: none; }
@media (max-width: 1240px) { .masthead .in-w { gap: 16px; } .nav a { padding-inline: 9px; font-size: 15px; } .nav a::after { inset-inline: 9px; } }
@media (max-width: 1100px) { .nav a svg { display: none; } .brand .bt span { display: none; } .utilbar .in-w > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; } }
.stripe { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 4px; }
.stripe i:nth-child(1) { background: var(--azure); }
.stripe i:nth-child(2) { background: var(--navy); }
.stripe i:nth-child(3) { background: var(--green); }

.main { flex: 1; min-width: 0; }
.page { padding: 28px 28px 64px; max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 260px; }
.page-head .eyebrow { font-size: 13px; color: var(--green-ink); font-weight: 600; margin-bottom: 2px; }
.appfoot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12.5px; }
.appfoot .in-w { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; min-height: 46px; }
.appfoot .grow { flex: 1; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; align-items: center; gap: 12px; }
.topbar .grow { flex: 1; }

/* ================================================================ רכיבים */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card, .row > .card + .card { margin-top: 0; }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: 0 2px 4px rgba(22,49,88,.06), 0 10px 26px rgba(22,49,88,.08); }
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
@media (max-width: 1150px) { .g4, .g6 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g2 { grid-template-columns: 1fr; } .masthead .in-w { flex-wrap: wrap; gap: 6px; padding-top: 8px; } .nav a { padding: 12px 10px 14px; } .nav a::after { bottom: 6px; } .page { padding: 18px 16px 48px; } .in-w { padding: 0 16px; } }

.btn { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--navy); padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--navy-2); text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-ink); border-color: var(--navy-ink); }
.btn.accent { background: var(--green); border-color: var(--green); color: var(--navy-ink); font-weight: 700; }
.btn.accent:hover { background: #74b437; border-color: #74b437; }
.btn.danger, .btn.danger-outline { color: var(--bad); border-color: #e7b4ae; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }

label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
input.in, select.in, textarea.in { border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 9px 12px; font-size: 14.5px; min-width: 0; color: var(--ink); }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--azure); outline: none; box-shadow: 0 0 0 3px rgba(0,147,173,.15); }
textarea.in { resize: vertical; }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; line-height: 1.7; }
.chip svg { width: 13px; height: 13px; }
.st-pass { color: var(--good); background: var(--good-bg); border-color: #cfe7b5; }
.st-fail { color: var(--bad); background: var(--bad-bg); border-color: #f3cdc8; }
.st-warn { color: var(--warn); background: var(--warn-bg); border-color: #f2ddb0; }
.st-review { color: var(--review); background: var(--review-bg); border-color: #dcd3f4; }
.st-condition, .st-info { color: var(--info); background: var(--info-bg); border-color: #bfe3ea; }
.st-na, .st-neutral { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }
.tag { display: inline-block; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-weight: 600; color: var(--navy); font-size: 13px; padding: 10px 12px; border-bottom: 2px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #f0f6fb; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.facts { table-layout: fixed; }
table.facts th:first-child, table.facts td:first-child { width: 26%; color: var(--ink-2); }
table.facts th:nth-child(2), table.facts td:nth-child(2) { width: 30%; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
table.facts td:last-child { width: 44%; }
table.facts .srcchip { max-width: 100%; }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 11px 16px; cursor: pointer; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--navy); }
.tabs button.on { color: var(--navy); border-bottom-color: var(--green); font-weight: 700; }
.tabs .cnt { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; margin-inline-start: 6px; color: var(--ink-2); }

.stat { padding: 16px 18px 14px; position: relative; overflow: hidden; }
.card.stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--line-strong); }
.card.stat.k-good::before { background: var(--green); }
.card.stat.k-bad::before { background: var(--bad); }
.card.stat.k-warn::before { background: #e3a21a; }
.card.stat.k-info::before { background: var(--azure); }
.stat .v.alert { color: var(--bad); }
.stat .v { font-family: var(--font-head); font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat .l { color: var(--ink); font-size: 14px; font-weight: 500; margin-top: 2px; }
.stat .d { font-size: 12.5px; color: var(--muted); }

.empty { padding: 36px; text-align: center; color: var(--muted); }
.notice { border: 1px solid var(--line); border-inline-start: 4px solid var(--azure); background: var(--azure-tint); padding: 11px 16px; border-radius: 10px; font-size: 14px; color: var(--ink); }
.notice.warn { border-inline-start-color: #e3a21a; background: var(--warn-bg); }
.notice.bad { border-inline-start-color: var(--bad); background: var(--bad-bg); }
.notice.good { border-inline-start-color: var(--green); background: var(--green-tint); }
.notice.muted-n { border-inline-start-color: var(--line-strong); background: var(--surface-2); color: var(--ink-2); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.col > .card + .card { margin-top: 4px; }
.spacer { flex: 1; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 500; }

/* ================================================================ כניסה */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); background: var(--surface); }
.login .pane { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 96px); }
.login .box { width: 100%; max-width: 420px; }
.login .box h1 { font-size: 28px; margin-top: 18px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.login .hero { background: var(--navy); color: #dbe4f1; position: relative; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 5vw, 80px); overflow: hidden; }
.login .hero::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 6px; background: linear-gradient(to left, var(--azure) 0 33.3%, var(--navy-2) 33.3% 66.6%, var(--green) 66.6%); }
.login .hero h2 { color: #fff; font-size: 34px; line-height: 1.25; margin: 0 0 14px; max-width: 560px; text-wrap: balance; }
.login .hero p { max-width: 520px; font-size: 16px; margin: 0 0 12px; }
.login .hero .pts { display: grid; gap: 10px; margin: 18px 0 28px; max-width: 520px; }
.login .hero .pts div { display: flex; gap: 10px; align-items: flex-start; }
.login .hero .pts b { font-family: var(--font-head); color: var(--green); font-size: 20px; line-height: 1.2; min-width: 22px; }
.login .hero .plan-art { position: absolute; inset-inline-start: -40px; top: -30px; width: 460px; opacity: .14; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login .hero { display: none; } }
.err { color: var(--bad); font-size: 13.5px; min-height: 18px; }

/* ================================================================ העלאה */
.drop { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 34px 26px; text-align: center; background: var(--surface-2); cursor: pointer; transition: .15s; }
.drop:hover { border-color: var(--azure); background: #f0f8fa; }
.drop.over { border-color: var(--azure); background: var(--azure-tint); }
.drop b { display: block; font-family: var(--font-head); font-size: 18px; color: var(--navy); margin-bottom: 6px; }
.drop svg { display: block; width: 40px; height: 40px; margin: 0 auto 10px; color: var(--azure); }
.upl { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.upl svg { width: 18px; height: 18px; flex: none; color: var(--navy-2); }
.bar { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; flex: 1; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: linear-gradient(to left, var(--azure), var(--green)); width: 0; transition: width .25s; }

/* ================================================================ ממצאים ומקורות */
.finding { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; box-shadow: 0 1px 2px rgba(22,49,88,.04); }
.finding + .finding { margin-top: 12px; }
.finding .ft { font-weight: 600; font-size: 15.5px; color: var(--navy); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.finding .fd { grid-column: 1 / -1; color: var(--ink); font-size: 14.5px; }
.finding .fx { grid-column: 1 / -1; font-size: 14px; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; }
.finding .fx b { color: var(--navy); }
.finding .src { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.finding .meta { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
.finding.decided-accept { border-inline-start: 4px solid var(--green); }
.finding.decided-reject { border-inline-start: 4px solid var(--muted); opacity: .78; }
.finding.decided-edit { border-inline-start: 4px solid var(--azure); }
.srcchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 3px 10px; font-size: 13px; cursor: pointer; color: var(--navy); max-width: 100%; min-width: 0; text-align: right; }
.srcchip:hover { border-color: var(--azure); background: #f0f8fa; }
.srcchip svg { width: 14px; height: 14px; flex: none; color: var(--navy-2); }
.srcchip .q { font-family: var(--font-book); font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 420px; }
.srcchip .chip { flex: none; }
.srcchip.stack { flex-wrap: wrap; white-space: normal; }
.srcchip.stack .q { white-space: normal; max-width: none; flex-basis: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.verdict { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 16px; }
.verdict .big { font-family: var(--font-head); font-size: 19px; font-weight: 700; }
.verdict.pass { background: var(--good-bg); border-color: #b9dc95; }
.verdict.fail { background: var(--bad-bg); border-color: #efbbb4; }
.verdict.review { background: var(--warn-bg); border-color: #edd29a; }
.quote-book, .vside .notice { font-family: var(--font-book); font-size: 15px; }

/* ================================================================ מציג מסמכים */
.modal-back { position: fixed; inset: 0; background: rgba(15,34,64,.55); z-index: 100; display: flex; align-items: stretch; justify-content: center; padding: 24px; }
.modal { background: var(--surface); border-radius: 14px; width: min(1400px, 100%); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 70px rgba(15,34,64,.35); }
.modal.narrow { width: min(780px, 100%); height: auto; max-height: 100%; align-self: center; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.modal-head .t { text-align: right;  font-family: var(--font-head); font-weight: 600; color: var(--navy); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { flex: 1; overflow: auto; padding: 18px; }
.viewer { display: grid; grid-template-columns: 150px minmax(0, 1fr) 340px; height: 100%; min-height: 0; background: var(--surface); }
.viewer.nothumbs { grid-template-columns: minmax(0, 1fr) 340px; }
.viewer.noside { grid-template-columns: 150px minmax(0, 1fr); }
.viewer.nothumbs.noside { grid-template-columns: minmax(0, 1fr); }
.viewer.noside .vside, .viewer.nothumbs .thumbs { display: none; }
.modal.viewer-modal { width: min(1600px, 100%); height: 100%; }
.vmain { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.vtoolbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.ztb { display: flex; align-items: center; gap: 2px; padding: 6px 10px; flex-wrap: wrap; }
.ztb-b { padding: 5px 8px; border-radius: 8px; }
.ztb-b svg { width: 18px; height: 18px; }
.ztb-pct { min-width: 52px; text-align: center; font-weight: 600; color: var(--navy); font-size: 13px; }
.ztb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.ztb-hint { margin-inline-start: auto; color: var(--muted); }
.vstage-host { flex: 1; min-height: 0; position: relative; }
.zstage { position: absolute; inset: 0; overflow: hidden; background: #4a5568; cursor: grab; touch-action: none; outline: none; }
.zstage.grabbing { cursor: grabbing; }
.zpage { position: absolute; left: 0; top: 0; transform-origin: center center; background: #fff; box-shadow: 0 6px 26px rgba(0,0,0,.4); }
.zpage img { image-rendering: auto; }
.hl-layer { position: absolute; inset: 0; pointer-events: none; }
.thumbs { border-inline-end: 1px solid var(--line); overflow: auto; padding: 8px; background: var(--surface-2); }
.thumbs button { display: block; width: 100%; border: 2px solid transparent; background: var(--surface); padding: 3px; margin-bottom: 8px; border-radius: 6px; cursor: pointer; }
.thumbs button.on { border-color: var(--azure); }
.thumbs img { width: 100%; display: block; }
.thumbs span { font-size: 11.5px; color: var(--ink-2); }
.stage { overflow: auto; background: #56637a; position: relative; }
.stage .pagewrap { position: relative; margin: 16px auto; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); transform-origin: top center; }
.stage img { display: block; width: 100%; }
.hl { position: absolute; background: rgba(129, 195, 65, .32); outline: 2px solid rgba(61, 116, 23, .9); border-radius: 2px; pointer-events: none; }
.vside { border-inline-start: 1px solid var(--line); overflow: auto; padding: 14px; font-size: 13.5px; }
.vside pre { white-space: pre-wrap; font-family: var(--font-book); font-size: 14px; line-height: 1.7; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 50vh; overflow: auto; }
@media (max-width: 1000px) { .viewer { grid-template-columns: 1fr; } .thumbs, .vside { display: none; } }

/* ================================================================ שאלות הבהרה */
.chat { display: flex; flex-direction: column; height: calc(100vh - 300px); min-height: 460px; }
.msgs { flex: 1; overflow: auto; padding: 4px 2px 12px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; padding: 11px 15px; border-radius: 14px; font-size: 14.5px; }
.msg.user { align-self: flex-start; background: var(--navy); color: #fff; border-end-start-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); border-end-end-radius: 4px; box-shadow: 0 1px 2px rgba(22,49,88,.04); }
.msg .cite { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 700; background: var(--azure-tint); color: var(--info); border: 1px solid #9fd3de; border-radius: 9px; cursor: pointer; vertical-align: super; margin: 0 2px; line-height: 1; }
.msg .cite:hover { background: var(--azure); color: #fff; }
.msg .srcs { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.msg .srcs .grp { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.msg .nosrc { margin-top: 8px; }
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md h4 { font-family: var(--font-head); color: var(--navy); font-size: 15.5px; font-weight: 600; margin: 12px 0 6px; padding-bottom: 3px; border-bottom: 2px solid var(--green-tint); }
.md h4:first-child { margin-top: 0; }
.md h4.kb { color: var(--info); border-bottom-color: var(--azure-tint); }
.md ul, .md ol { margin: 4px 0 10px; padding-inline-start: 22px; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--green-ink); }
.md strong { color: var(--navy); font-weight: 700; }
.composer { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); align-items: stretch; }
.composer textarea { flex: 1; min-height: 50px; max-height: 160px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.suggest button { border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--navy); border-radius: 999px; padding: 3px 13px; font-size: 13px; cursor: pointer; }
.suggest button:hover { border-color: var(--green); background: var(--green-tint); }

/* ================================================================ תרשימים (סדרה אחת, תוויות ישירות, תצוגת טבלה) */
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hb { display: grid; grid-template-columns: minmax(140px, 240px) 1fr 64px; align-items: center; gap: 10px; font-size: 13.5px; }
.hb .lab { color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; overflow-wrap: anywhere; }
.hb .track { position: relative; height: 16px; background: var(--surface-2); border-radius: 4px; }
.hb .fill { position: absolute; inset-inline-start: 0; top: 2px; bottom: 2px; background: var(--series-1); border-radius: 4px; min-width: 2px; }
.hb .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--green-ink); }
.hb .val { font-variant-numeric: tabular-nums; color: var(--ink); text-align: left; direction: ltr; font-weight: 500; }
.hb:hover .fill { background: var(--navy); }
.chart-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--navy-2); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--navy-ink); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 56px; }
.spark i { flex: 1; background: var(--series-1); border-radius: 3px 3px 0 0; min-height: 2px; }

/* ================================================================ ציר זמן תוכניות */
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line-strong); }
.tl { position: relative; padding: 6px 0 10px; }
.tl::before { content: ""; position: absolute; inset-inline-start: -19px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--navy-2); }
.tl.dep::before { border-style: dashed; border-color: #e3a21a; }
.tl .rel { font-size: 12.5px; color: var(--ink-2); }
.toast { position: fixed; bottom: 22px; left: 22px; background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 200; box-shadow: 0 10px 30px rgba(15,34,64,.3); font-size: 14px; max-width: 460px; border-inline-start: 4px solid var(--green); }
.toast.bad { background: #8f1d14; border-inline-start-color: #f3a59c; }
.steps { display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }
.step.on { color: var(--navy); font-weight: 600; }
.step.done { color: var(--good); }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--azure); border-radius: 50%; animation: sp 0.8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } .bar > i { transition: none; } }
.pre { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; font-family: var(--font-book); line-height: 1.75; }
.rule { border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; background: var(--surface); }
.rule + .rule { margin-top: 8px; }
.rule .rv { font-family: var(--font-head); font-weight: 600; color: var(--navy); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1150px) { .split { grid-template-columns: 1fr; } }
.kbd { font-family: Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; direction: ltr; unicode-bidi: isolate; }

/* ניתוח גאומטרי */
.geo-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.geo-map { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.geo-map img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.geo-map .open { position: absolute; top: 8px; inset-inline-start: 8px; }
.geo-map { position: relative; }
.legend { display: grid; gap: 6px; font-size: 13.5px; }
.legend i { display: inline-block; width: 26px; height: 0; vertical-align: middle; margin-inline-end: 8px; }
.geo-map figcaption { padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
ul.checks { list-style: none; margin: 4px 0; padding: 0; }
ul.checks li { margin: 3px 0; }

@media print {
  .utilbar, .masthead, .stripe, .appfoot, .btn, .composer, .suggest { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* מצב התיק — לפקיד */
.ss { border-top: 4px solid var(--navy); }
.ss-next { display: flex; gap: 10px; align-items: flex-start; background: var(--azure-tint); border: 1px solid #b9e2ea; border-radius: 8px; padding: 10px 12px; margin: 12px 0; color: var(--navy-ink); }
.ss-next svg { width: 18px; height: 18px; color: var(--azure); flex: none; margin-top: 2px; transform: scaleX(-1); }
.ss-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ss-sec { border: 1px solid var(--line, #dfe5ee); border-radius: 8px; padding: 10px 12px; border-inline-start-width: 4px; background: #fff; }
.ss-sec.bad { border-inline-start-color: var(--bad); }
.ss-sec.warn { border-inline-start-color: #d88a00; }
.ss-sec.info { border-inline-start-color: var(--azure); }
.ss-sec.good { border-inline-start-color: var(--green); }
.ss-h { display: flex; justify-content: space-between; align-items: center; font-size: 15px; color: var(--navy); }
.ss-n { font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.ss-sec.bad .ss-n { color: var(--bad); } .ss-sec.warn .ss-n { color: var(--warn); } .ss-sec.info .ss-n { color: var(--info); } .ss-sec.good .ss-n { color: var(--good); }
.ss-list { margin: 0; padding-inline-start: 18px; max-height: 260px; overflow: auto; }

/* הסבר בראש לשונית */
.explain { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--azure); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.explain b { color: var(--navy); }
/* טבלת נתונים קומפקטית */
.t.facts.compact td { vertical-align: top; padding: 9px 10px; }
.t.facts.compact tr.conflict td { background: var(--bad-bg); }
.fsrc { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
.fv { margin-top: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.srclink { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; color: var(--navy-2); font-size: 12.5px; cursor: pointer; font-family: inherit; }
.srclink:hover { text-decoration: underline; }
.srclink svg { width: 13px; height: 13px; opacity: .7; }
.srclink .ok { color: var(--good); font-weight: 700; }

/* ---------- תיקוני ביקורת UX 4.11.2026 ---------- */
.navtoggle { display: none; align-items: center; gap: 6px; background: none; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 12px; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; }
.navtoggle svg { width: 20px; height: 20px; }
.mfa-banner { background: #fff7e6; border-bottom: 1px solid #f0d9a8; color: #6b4a00; font-size: 13.5px; }
.mfa-banner .in-w { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.mfa-banner svg { width: 16px; height: 16px; flex: none; }
.mfa-banner a { font-weight: 700; color: #6b4a00; text-decoration: underline; }
.noaccess { max-width: 620px; margin: 40px auto; text-align: center; padding: 36px 28px; }
.noaccess > svg { width: 42px; height: 42px; color: var(--navy); opacity: .6; }
.noaccess h1 { font-size: 22px; margin: 10px 0; }
.login .forgot { margin-top: 14px; }
.login .forgot summary { cursor: pointer; color: var(--navy); }
.login .forgot div { margin-top: 6px; line-height: 1.6; }
.cnt-label { font-size: 12px; }
.load-more { display: flex; justify-content: center; margin-top: 12px; }
.perm-matrix td, .perm-matrix th { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: start; white-space: nowrap; }
.perm-matrix .y { color: var(--green-ink); font-weight: 700; }
.perm-matrix .n { color: var(--ink-3, #9aa3af); }
.params-row-save[hidden] { display: none !important; }

@media (max-width: 900px) {
  .utilbar .org, .utilbar .today, .utilbar .dot { display: none; }
  .utilbar .in-w { gap: 10px; min-height: 32px; font-size: 12.5px; }
  .masthead .in-w { flex-wrap: wrap; gap: 8px; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
  .navtoggle { display: inline-flex; }
  .nav { display: none; order: 10; flex-basis: 100%; flex-direction: column; align-items: stretch; overflow: visible; }
  .app.nav-open .nav { display: flex; }
  .nav a { padding: 12px 8px; border-top: 1px solid var(--line); }
  .nav a::after { display: none; }
  .nav a.active { background: var(--surface-2); }
  .nav .sep { display: none; }
  .mast-actions { margin-inline-start: auto; }
  .page-head { flex-wrap: wrap; }
  .page-head h1 { font-size: 22px; overflow-wrap: anywhere; }
  .page-head .col { align-items: stretch !important; width: 100%; }
  .page-head .row { flex-wrap: wrap; }
  .tabs { overflow-x: auto; scrollbar-width: thin; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  main, .page { max-width: 100vw; overflow-x: hidden; }
}

/* תכונת hidden גוברת על display של רכיבי הטופס (שדה קוד האימות הופיע למרות שהוסתר) */
[hidden] { display: none !important; }
