/* בוט הפוליסות – שלוש ערכות נושא מתוך ספריית הסגנונות (clean-pro, bold-dark, soft-air), בצבעי המותג של אלי */

:root, [data-theme="clean"] {
  --bg: #F4F6FC;
  --bg-fx: none;
  --surface: #FFFFFF;
  --surface-2: #EEF1FA;
  --text: #141B4D;
  --muted: #5E6690;
  --line: #E3E6F3;
  --accent: #F9B914;
  --on-accent: #141B4D;
  --hero: #141B4D;
  --on-hero: #FFFFFF;
  --link: #2343B8;
  --mark: #FFE69A;
  --side-bg: #141B4D;
  --side-text: #C9CEEA;
  --side-active: #141B4D;
  --side-active-bg: #F9B914;
  --side-head: #FFFFFF;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgb(20 27 77 / .05), 0 10px 26px rgb(20 27 77 / .07);
  --glass: none;
  --font-head: 'Rubik', 'Heebo', sans-serif;
  --head-weight: 800;
  --num-weight: 800;
}

[data-theme="dark"] {
  --bg: #0A0D22;
  --surface: #141936;
  --surface-2: #1C2248;
  --text: #F3F4FB;
  --muted: #9AA1C9;
  --line: #262D5C;
  --accent: #F9B914;
  --on-accent: #141B4D;
  --hero: #F9B914;
  --on-hero: #141B4D;
  --link: #FFD15C;
  --mark: #6B5410;
  --side-bg: #0F1330;
  --side-text: #9AA1C9;
  --side-active: #141B4D;
  --side-active-bg: #F9B914;
  --side-head: #FFFFFF;
  --radius: 16px;
  --radius-lg: 26px;
  --shadow: 0 14px 34px rgb(0 0 0 / .35);
  --font-head: 'Rubik', 'Heebo', sans-serif;
  --head-weight: 900;
  --num-weight: 900;
}

[data-theme="air"] {
  --bg: #ECEEF8;
  --bg-fx: linear-gradient(165deg, #E6E8F6 0%, #F7F8FD 55%, #EAECF7 100%);
  --surface: rgb(255 255 255 / .66);
  --surface-2: rgb(255 255 255 / .5);
  --text: #141B4D;
  --muted: #6A7096;
  --line: rgb(20 27 77 / .09);
  --accent: #141B4D;
  --on-accent: #FFFFFF;
  --hero: rgb(255 255 255 / .75);
  --on-hero: #141B4D;
  --link: #2343B8;
  --mark: #FFE69A;
  --side-bg: rgb(255 255 255 / .55);
  --side-text: #5E6690;
  --side-active: #FFFFFF;
  --side-active-bg: #141B4D;
  --side-head: #141B4D;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 10px 30px rgb(40 50 120 / .10);
  --glass: blur(16px);
  --font-head: 'Heebo', system-ui, sans-serif;
  --head-weight: 700;
  --num-weight: 300;
}

/* ---------- בסיס ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh;
  font-family: 'Heebo', system-ui, sans-serif; font-size: 16px; line-height: 1.6;
  color: var(--text); background: var(--bg-fx, none), var(--bg); background-attachment: fixed;
  overflow-x: clip;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); line-height: 1.15; text-wrap: balance; }
.i { width: 20px; height: 20px; flex: none; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- מבנה ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; width: 286px; flex: none;
  display: flex; flex-direction: column; gap: 6px; padding: 22px 16px;
  background: var(--side-bg); color: var(--side-text); backdrop-filter: var(--glass);
  border-inline-start: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 18px; color: var(--side-head); }
.brand .logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--on-accent); flex: none; }
[data-theme="air"] .brand .logo { background: #141B4D; color: #F9B914; }
.brand b { display: block; font-family: var(--font-head); font-weight: 900; font-size: 19px; line-height: 1.1; }
.brand small { font-size: 13px; opacity: .75; }
.side nav { display: grid; gap: 4px; }
.side nav a {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px;
  font-weight: 700; color: var(--side-text);
}
.side nav a:hover { background: color-mix(in srgb, var(--side-active-bg) 14%, transparent); }
.side nav a.on { background: var(--side-active-bg); color: var(--side-active); }
.side nav a em { margin-inline-start: auto; font-style: normal; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.side nav a.on em { background: var(--side-active); color: var(--side-active-bg); }
.side .hist { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 18px; }
.side .hist h4 { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px; font-size: 13px; font-weight: 800; letter-spacing: .3px; color: var(--side-head); opacity: .8; }
.side .hist ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; overflow-x: hidden; display: grid; gap: 2px; align-content: start; scrollbar-width: thin; }
.side .hist li { display: flex; align-items: center; border-radius: 12px; }
.side .hist li a { flex: 1; min-width: 0; padding: 9px 10px; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .hist li.on, .side .hist li:hover { background: color-mix(in srgb, var(--side-active-bg) 14%, transparent); }
.side .hist li.on a { color: var(--side-head); font-weight: 700; }
.side .hist li button { opacity: 0; width: 34px; height: 34px; border: 0; background: none; color: var(--side-text); cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.side .hist li:hover button, .side .hist li button:focus-visible { opacity: 1; }
.side .hist .empty { padding: 4px 10px; font-size: 14px; opacity: .7; }
.new-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin-top: 4px; border: 1px dashed color-mix(in srgb, var(--side-text) 45%, transparent); border-radius: 14px; background: none; color: var(--side-head); font-weight: 700; cursor: pointer; }
.new-btn:hover { border-style: solid; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 32px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 22px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .actions { display: flex; gap: 8px; }
.view { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 32px 120px; }
.view.narrow { max-width: 880px; }
.tabbar { display: none; }

/* ---------- רכיבים ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); backdrop-filter: var(--glass); }
.pad { padding: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font-weight: 700; cursor: pointer; white-space: nowrap; backdrop-filter: var(--glass);
}
.btn:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.dark { background: var(--hero); color: var(--on-hero); border-color: transparent; }
.btn.ghost { background: none; border-color: transparent; box-shadow: none; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.co { background: color-mix(in srgb, var(--hero) 10%, transparent); color: var(--text); }
[data-theme="dark"] .tag.co { background: var(--surface-2); }
.tag.old { background: #FFF1D6; color: #8A5A00; }
[data-theme="dark"] .tag.old { background: #3A2E10; color: #FFD15C; }
.tag.red { background: #FDE8E8; color: #B42318; }
.tag.green { background: #E3F6EA; color: #0B7A3B; }
.tag.yellow { background: #FFF4CC; color: #7A5600; }
[data-theme="dark"] .tag.red { background: #4A1717; color: #FFB4AB; }
[data-theme="dark"] .tag.green { background: #123A24; color: #8BE3AE; }
[data-theme="dark"] .tag.yellow { background: #3A2E10; color: #FFD15C; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--muted); }
select, .input {
  height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); outline: none; min-width: 0;
}
select:focus, .input:focus { border-color: var(--accent); }
select { padding-inline-end: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238890B5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 18px; background-position: left 12px center; }
[data-theme="dark"] select { color-scheme: dark; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters select { flex: 1 1 170px; }
.section { margin-top: 34px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__head h2 { font-size: 21px; }
.section__head a, .lnk { font-size: 15px; font-weight: 700; color: var(--link); cursor: pointer; background: none; border: 0; padding: 0; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .ico { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--surface-2); color: var(--muted); margin-bottom: 14px; }
.empty-state .ico .i { width: 30px; height: 30px; }
.empty-state h3 { font-size: 20px; }
.empty-state p { margin-top: 6px; color: var(--muted); max-width: 52ch; margin-inline: auto; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--text) 18%, transparent); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
[data-theme="clean"] .spinner { border-top-color: #141B4D; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 92px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- מסך הבית / שאלה ---------- */
.hero { padding: 34px 34px 30px; border-radius: var(--radius-lg); background: var(--hero); color: var(--on-hero); position: relative; overflow: hidden; box-shadow: var(--shadow); backdrop-filter: var(--glass); border: 1px solid var(--line); }
[data-theme="clean"] .hero { background: radial-gradient(700px 300px at 0% 0%, #2A3680, transparent 60%), #141B4D; }
.hero h1 { font-size: clamp(28px, 3.4vw, 40px); }
.hero h1 span { color: var(--accent); }
[data-theme="dark"] .hero h1 span { color: #141B4D; text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; }
[data-theme="air"] .hero h1 span { color: #2343B8; }
.hero p { margin-top: 8px; font-size: 17.5px; opacity: .85; max-width: 60ch; }
.composer { margin-top: 22px; background: var(--surface); color: var(--text); border-radius: 22px; padding: 10px; box-shadow: 0 16px 36px rgb(10 14 40 / .18); border: 1px solid var(--line); }
[data-theme="air"] .composer { background: #fff; }
.composer textarea { display: block; width: 100%; min-height: 64px; max-height: 260px; padding: 12px 14px; border: 0; outline: none; resize: none; background: none; font-size: 17.5px; line-height: 1.55; }
.composer textarea::placeholder { color: var(--muted); }
.composer .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px; }
.composer .row select { height: 40px; font-size: 14.5px; border-radius: 999px; flex: 0 1 190px; background-color: var(--surface-2); border-color: transparent; }
.composer .send { margin-inline-start: auto; min-width: 128px; }
.examples { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.examples button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--on-hero) 25%, transparent); background: color-mix(in srgb, var(--on-hero) 8%, transparent); color: inherit; font-size: 15px; font-weight: 500; cursor: pointer; text-align: start; }
.examples button:hover { background: color-mix(in srgb, var(--on-hero) 16%, transparent); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.kpi { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: var(--glass); }
.kpi b { display: block; font-family: var(--font-head); font-weight: var(--num-weight); font-size: 34px; line-height: 1.1; letter-spacing: -.5px; }
.kpi span { font-size: 14px; font-weight: 600; color: var(--muted); }
.mini-list { display: grid; gap: 10px; }
.mini-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.mini-list a .t { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list a small { color: var(--muted); font-size: 13.5px; white-space: nowrap; }

/* שיחה */
.thread { display: grid; gap: 18px; }
.q { padding: 4px 4px 0; }
.q small { display: block; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.q p { font-family: var(--font-head); font-weight: 700; font-size: 21px; line-height: 1.35; white-space: pre-wrap; }
.q .scope { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ans { padding: 24px 26px; }
.ans__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 14.5px; font-weight: 700; }
.ans__head .bot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--hero); color: var(--accent); }
[data-theme="dark"] .ans__head .bot { color: #141B4D; }
[data-theme="air"] .ans__head .bot { background: #141B4D; color: #F9B914; }
.ans__head .grow { flex: 1; }
.ans__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ans__foot .meta { margin-inline-end: auto; color: var(--muted); font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 28px; }
.steps li .st { display: grid; place-items: center; width: 22px; height: 22px; flex: none; }
.steps li.done .st { color: #12A150; }
.steps li.error .st { color: #E5484D; }
.steps li a { color: var(--link); font-weight: 600; }
.steps li a:hover { text-decoration: underline; }
.working { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-weight: 700; }
.working .time { margin-inline-start: auto; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.live { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); }
details.trace { margin-top: 4px; }
details.trace summary { cursor: pointer; color: var(--muted); font-size: 14.5px; font-weight: 700; list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
details.trace summary::-webkit-details-marker { display: none; }
details.trace[open] summary .i { transform: rotate(90deg); }
details.trace .steps { margin: 6px 0 4px; }
.err { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 16px; background: #FDECEA; color: #7A1D16; }
[data-theme="dark"] .err { background: #3A1616; color: #FFC9C2; }
.err .i { margin-top: 3px; }
.err .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dock { position: sticky; bottom: 0; padding: 14px 0 22px; background: linear-gradient(transparent, var(--bg) 30%); margin-top: 10px; }
.dock .composer { margin-top: 0; box-shadow: var(--shadow); }
.dock .composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px; }
.dock .composer textarea { flex: 1; min-height: 50px; font-size: 16.5px; padding: 12px; }
.dock .composer .row { padding: 2px; flex: none; }
.dock .composer .send { min-width: 0; }

/* תוכן מעוצב בתשובה (Markdown) */
.md { font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
.md > *:first-child { margin-top: 0; }
.md p, .md ul, .md ol, .md blockquote, .md .tbl { margin: 0 0 14px; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--font-head); margin: 22px 0 8px; line-height: 1.25; }
.md h1 { font-size: 24px; } .md h2 { font-size: 21px; } .md h3 { font-size: 18.5px; } .md h4 { font-size: 17px; }
.md ul, .md ol { padding-inline-start: 22px; }
.md li { margin: 4px 0; }
.md strong { font-weight: 800; }
.md a { color: var(--link); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.md a.src { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; margin: 2px 0; border-radius: 999px; background: var(--surface-2); text-decoration: none; font-size: 14px; font-weight: 700; line-height: 1.9; color: var(--link); vertical-align: baseline; }
.md a.src::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l4 4v14H6z'/%3E%3Cpath d='M14 3v4h4'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l4 4v14H6z'/%3E%3Cpath d='M14 3v4h4'/%3E%3C/svg%3E") center/contain no-repeat; }
.md a.src:hover { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.md blockquote { padding: 10px 16px; border-inline-start: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.md .tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.md table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.55; }
.md th, .md td { padding: 10px 12px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.md th { background: var(--surface-2); font-weight: 800; white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md td a.src { display: inline; padding: 1px 6px; border-radius: 8px; line-height: 1.7; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.md td a.src::before { display: inline-block; vertical-align: -2px; margin-inline-end: 3px; }
.md th, .md td { min-width: 84px; }

/* ---------- חיפוש ורשימות ---------- */
.search-big { position: relative; }
.search-big input { width: 100%; height: 58px; padding: 0 54px 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 18px; outline: none; backdrop-filter: var(--glass); }
.search-big input:focus { border-color: var(--accent); }
.search-big .i { position: absolute; top: 19px; right: 20px; color: var(--muted); }
.results { display: grid; gap: 12px; margin-top: 18px; }
.res { display: block; padding: 18px 20px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.res:hover { transform: translateY(-1px); }
.res__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.res h3 { font-size: 17.5px; font-family: 'Heebo', sans-serif; font-weight: 800; line-height: 1.35; }
.res p { margin-top: 6px; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.res p mark { color: var(--text); }
.res__acts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 14.5px; }
.res__acts a, .res__acts button { color: var(--link); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; min-height: 32px; }
.count-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 15px; font-weight: 600; }

.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.co { display: grid; gap: 2px; padding: 16px 18px; text-align: start; cursor: pointer; border: 1px solid var(--line); }
.co.on { outline: 3px solid var(--accent); outline-offset: -1px; }
.co b { font-size: 17px; font-weight: 800; }
.co .n { font-family: var(--font-head); font-weight: var(--num-weight); font-size: 28px; line-height: 1.15; }
.co .tag { justify-self: start; margin-top: 4px; }
.docs { width: 100%; border-collapse: separate; border-spacing: 0; }
.docs-wrap { overflow: hidden; padding: 0; }
.docs th { white-space: nowrap; background: var(--surface-2); text-align: start; font-size: 14px; color: var(--muted); font-weight: 800; padding: 12px 14px; }
.docs td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; font-size: 15.5px; }
.docs tr.row { cursor: pointer; }
.docs tr.row:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.docs td.t { font-weight: 700; }
.docs td.n { white-space: nowrap; color: var(--muted); }
.more { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- צפייה במסמך ---------- */
.doc-head { padding: 22px 24px; }
.doc-head h2 { font-size: 24px; margin-top: 8px; font-family: 'Heebo', sans-serif; font-weight: 800; }
.doc-head .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-head .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.doc-head .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pager { position: sticky; top: 68px; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.pager input { width: 76px; text-align: center; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.paper { padding: 34px 40px; font-size: 17px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 300px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: #FFF4CC; color: #6B4B00; font-size: 15px; margin-top: 12px; }
[data-theme="dark"] .note { background: #3A2E10; color: #FFD15C; }

/* ---------- שינויים ---------- */
.day-head { font-size: 15px; font-weight: 800; color: var(--muted); margin: 24px 4px 10px; }
.chg { padding: 16px 18px; }
.chg__top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chg h3 { font-size: 17px; font-family: 'Heebo', sans-serif; font-weight: 800; margin-top: 6px; }
.chg .md { font-size: 15px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- הגדרות ---------- */
.set-grid { display: grid; gap: 18px; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.theme-card { padding: 12px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: start; }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.theme-card .sw { display: flex; height: 64px; border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.theme-card .sw i { flex: 1; }
.theme-card b { display: block; }
.theme-card small { color: var(--muted); font-size: 13.5px; }
.status-line { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-top: 10px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: #8B8D98; flex: none; }
.status-dot.ok { background: #12A150; } .status-dot.bad { background: #E5484D; }
.steps-howto { margin: 12px 0 0; padding-inline-start: 22px; color: var(--muted); }
.steps-howto li { margin: 4px 0; }

/* ---------- הודעה קופצת ---------- */
.toast { position: fixed; z-index: 90; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 999px; background: #141B4D; color: #fff; box-shadow: 0 16px 36px rgb(0 0 0 / .28); font-weight: 600; max-width: calc(100vw - 32px); }
[data-theme="dark"] .toast { background: #F3F4FB; color: #141B4D; }
.toast button { border: 0; background: #F9B914; color: #141B4D; font-weight: 800; border-radius: 999px; min-height: 38px; padding: 0 16px; cursor: pointer; }

/* ---------- טלפון ---------- */
@media (max-width: 900px) {
  .side { display: none; }
  .top { padding: 10px 16px; min-height: 60px; }
  .top h1 { font-size: 20px; }
  .view { padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); }
  .hero { padding: 24px 18px 20px; margin: 0 -4px; }
  .composer .row select { flex: 1 1 130px; }
  .composer .send { flex: 1 1 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 28px; }
  .ans { padding: 18px 16px; }
  .md { font-size: 16.5px; }
  .paper { padding: 22px 18px; font-size: 16.5px; }
  .themes { grid-template-columns: 1fr; }
  .docs thead { display: none; }
  .docs, .docs tbody, .docs tr, .docs td { display: block; width: 100%; }
  .docs tr.row { padding: 12px 14px; border-top: 1px solid var(--line); }
  .docs td { border: 0; padding: 2px 0; }
  .docs td.n { display: inline; margin-inline-end: 10px; font-size: 14px; }
  .pager { top: 60px; }
  .dock { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); backdrop-filter: blur(16px);
  }
  [data-theme="air"] .tabbar { background: rgb(255 255 255 / .88); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; min-width: 60px; min-height: 52px; padding: 6px 8px; border-radius: 16px; font-size: 12px; font-weight: 700; color: var(--muted); }
  .tabbar a.on { color: var(--text); background: color-mix(in srgb, var(--accent) 22%, transparent); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ---------- הדפסה: רק התשובה שנבחרה ---------- */
@media print {
  body.printing { background: #fff; }
  body.printing .side, body.printing .top, body.printing .tabbar, body.printing .dock, body.printing .toast { display: none !important; }
  body.printing .thread > *:not(.print-me) { display: none !important; }
  body.printing .print-me { box-shadow: none; border: 0; }
  body.printing .ans__foot { display: none; }
  body.printing .view { padding: 0; max-width: none; }
}

.only-mobile { display: none; }
@media (max-width: 900px) { .only-mobile { display: block; } .only-mobile[hidden] { display: none; } }

/* מתג מהיר / יסודי */
.mode { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); flex: none; }
.mode button { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; }
.mode button .i { width: 16px; height: 16px; }
.mode button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgb(20 27 77 / .14); }
[data-theme="dark"] .mode button.on { background: var(--accent); color: var(--on-accent); }
.ans__head .tag .i { width: 14px; height: 14px; }
.dock .composer .row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
@media (max-width: 900px) {
  .composer .row .mode { order: -1; }
  .dock .composer { flex-direction: column; align-items: stretch; }
  .dock .composer .row { justify-content: space-between; }
  .dock .composer .send { flex: 0 0 auto; }
}

/* בחירת חברה לפני השאלה */
.co-pick { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; min-width: 0; }
.co-pick__label { flex: none; font-size: 14px; font-weight: 800; color: var(--muted); padding-inline-start: 6px; }
.co-pick__chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; min-width: 0; }
.co-pick__chips::-webkit-scrollbar { display: none; }
.co-pick .chip-btn { flex: none; height: 36px; font-size: 14px; background: var(--surface-2); border-color: transparent; }
.co-pick .chip-btn.on { background: var(--hero); color: var(--on-hero); }
[data-theme="dark"] .co-pick .chip-btn.on { background: var(--accent); color: var(--on-accent); }
.composer .row select[name="company"] { flex: 0 1 170px; }

/* מיקרופון */
.icon-btn.mic { width: 46px; height: 46px; flex: none; background: var(--surface-2); border-color: transparent; }
.icon-btn.mic.rec { background: #E5484D; color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(229 72 77 / .45); } 50% { box-shadow: 0 0 0 10px rgb(229 72 77 / 0); } }

/* מחיקה מההיסטוריה */
.q__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q__top small { margin-bottom: 0; }
.del-q { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--muted); min-height: 32px; }
.del-q .i { width: 16px; height: 16px; }
.del-q:hover { color: #E5484D; }
.top .icon-btn { width: 40px; height: 40px; }
.top .icon-btn .i { width: 18px; height: 18px; }
.hist-row { display: flex; align-items: center; gap: 6px; padding-inline-end: 6px; }
.hist-row a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.hist-row a .t { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row .icon-btn { width: 44px; height: 44px; border-color: transparent; background: none; color: var(--muted); }
.side .hist li button { opacity: .45; }
@media (max-width: 900px) {
  .composer .row .mic { order: 0; }
  .co-pick { flex-wrap: wrap; }
  .co-pick__label { width: 100%; }
}

/* תיבת שאלת ההמשך: שורת כתיבה מלאה, ומתחתיה הכפתורים */
.dock .composer { flex-direction: column; align-items: stretch; gap: 2px; }
.dock .composer textarea { min-height: 48px; }
.dock .composer .row { flex-wrap: wrap; justify-content: flex-start; }
.dock .composer .row .send { margin-inline-start: auto; }

/* בלי גלילה לצדדים בטלפון */
.mini-list { grid-template-columns: minmax(0, 1fr); }
.co-pick__chips { flex: 1 1 0; }
.composer, .composer form, .hero { min-width: 0; max-width: 100%; }

.switch-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 16px; background: var(--surface-2); cursor: pointer; }
.switch-row input { width: 22px; height: 22px; margin-top: 3px; accent-color: #141B4D; flex: none; }
.switch-row b { display: block; }
.switch-row small { display: block; color: var(--muted); font-size: 14px; }

/* אין חיבור למחשב */
.offline { position: sticky; top: 0; z-index: 95; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #FDECEA; color: #7A1D16; border-bottom: 1px solid #F5C2BC; }
.offline > .i { flex: none; }
.offline div { flex: 1; min-width: 0; }
.offline b { display: block; }
.offline span { display: block; font-size: 14.5px; }
.offline .btn { flex: none; background: #fff; }

.connecting { position: fixed; z-index: 96; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: #141B4D; color: #fff; font-weight: 700; font-size: 14.5px; box-shadow: 0 10px 26px rgb(0 0 0 / .25); }
.connecting .spinner { border-color: rgb(255 255 255 / .3); border-top-color: #F9B914; }
a.kpi { display: block; color: inherit; }

/* מסך כניסה */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login__card { width: 100%; max-width: 400px; display: grid; gap: 14px; padding: 30px 24px; text-align: center; justify-items: center; }
.login__card .logo { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: #141B4D; color: #F9B914; }
.login__card .logo .i { width: 30px; height: 30px; }
.login__card h1 { font-size: 26px; }
.login__card .input, .login__card .btn { width: 100%; height: 52px; font-size: 17px; }
.login__err { color: #B42318; font-weight: 700; }
.pw-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pw-form .input { flex: 1 1 200px; }
