/* סוכן השרת - עיצוב. נייד קודם, כהה/בהיר לפי המערכת. בלי סגנון מוטמע ב-HTML (CSP). */

:root {
  color-scheme: light dark;
  /* צבעים בסגנון Claude: רקע שנהב, טקסט כמעט שחור, הדגשה בגוון חימר */
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f0eee6;
  --surface-3: #e5e2d7;
  --text: #1f1e1d;
  --muted: #5e5d59;
  --border: #e0ddd2;
  --accent: #ae5630;
  --accent-hover: #96482a;
  --accent-text: #ffffff;
  --accent-soft: #f6e9e1;
  --accent-strong: #8f4424; /* טקסט בגוון ההדגשה על רקע בהיר או רך */
  --info: #2a5db0;
  --info-soft: #e7eefa;
  --bubble: #f0eee6;
  --danger: #c22a2a;
  --danger-soft: #fdeaea;
  --danger-border: #f2b8b8;
  --ok: #16692e;
  --ok-soft: #e3f4e8;
  --warn: #9a5800;
  --warn-soft: #fff2d9;
  --warn-border: #f1d29b;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 6px 20px rgb(0 0 0 / 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --tap: 48px;
  --term-bg: #0d1016;
  --reader-w: min(46vw, 680px);
  --vvh: 100dvh;
  --vvtop: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624;
    --surface: #30302e;
    --surface-2: #3a3a37;
    --surface-3: #474743;
    --text: #f5f4ef;
    --muted: #b7b5ad;
    --border: #4a4945;
    --accent: #d97757;
    --accent-hover: #e38a6c;
    --accent-text: #1f1e1d;
    --accent-soft: #4a3229;
    --accent-strong: #f0a585;
    --info: #8db4f5;
    --info-soft: #24324a;
    --bubble: #3a3a37;
    --danger: #ff8a8a;
    --danger-soft: #3a1717;
    --danger-border: #6e2a2a;
    --ok: #5fcf7e;
    --ok-soft: #15301f;
    --warn: #f3b44c;
    --warn-soft: #36290f;
    --warn-border: #6b5220;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
body.reader-open { overflow: hidden; }

a { color: var(--accent-strong); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.center { text-align: center; justify-content: center; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.boot { display: grid; place-items: center; min-height: 60dvh; color: var(--muted); }
.noscript { padding: 24px; text-align: center; }

/* ---------- אייקונים ---------- */
.ic { width: 20px; height: 20px; flex: 0 0 auto; }
.ic-inline { width: 16px; height: 16px; vertical-align: -3px; }
.ic-dim { color: var(--muted); }
.ic-folder { color: var(--warn); }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); min-width: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, opacity 0.12s;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
/* רקע אדום מלא עם טקסט לבן: גוון קבוע בשני המצבים (ה-danger של מצב כהה בהיר מדי, ניגודיות 2.7) */
.btn-danger { background: #c22a2a; border-color: #c22a2a; color: #fff; }
.btn-danger:hover { background: #a82222; border-color: #a82222; }
.btn-danger-text { color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: var(--tap); padding: 0 12px; font-size: 16px; }
.btn-lg { min-height: 52px; font-size: 17px; padding: 0 20px; }
.btn-block { width: 100%; white-space: normal; text-align: center; line-height: 1.25; padding-block: 6px; }
.icon-btn { padding: 0; width: var(--tap); }
.icon-btn.btn-sm { width: var(--tap); min-width: var(--tap); }
.btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }

.badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: #c22a2a; color: #fff; /* קבוע בשני המצבים: ב-danger של מצב כהה הניגודיות עם לבן הייתה 2.7 */
  font-size: 11px; font-weight: 700; line-height: 1;
}
.badge-btn { position: relative; color: var(--warn); border-color: var(--warn-border); background: var(--warn-soft); }
.badge-btn .badge { position: absolute; top: -4px; inset-inline-end: -4px; }

/* ---------- טפסים ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: 15px; }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
.input {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 16px; /* מונע הגדלה אוטומטית ב-iOS */
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .compose-input::placeholder { font-family: var(--font); }
/* שדה LTR (נתיב, שם קובץ) עם placeholder בעברית: ה-placeholder מימין לשמאל, הערך משמאל לימין */
input.input[dir="ltr"]:placeholder-shown { direction: rtl; }
textarea.input { resize: vertical; line-height: 1.4; }
select.input { appearance: auto; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1 1 auto; min-width: 0; }
.form-error { color: var(--danger); font-size: 14px; font-weight: 600; min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; font-size: 16px; }
.checkbox { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- כספת ---------- */
.secret-form { display: flex; flex-direction: column; gap: 12px; }
.secret-field { display: flex; flex-direction: column; gap: 8px; }
.secret-count:empty { display: none; }
.secret-label { font-size: 18px; font-weight: 700; margin: 0; }
.secret-row { display: flex; gap: 8px; align-items: flex-start; }
.secret-row .input { flex: 1 1 auto; min-width: 0; font-family: var(--mono); }
.secret-ta { min-height: 140px; }
.masked { -webkit-text-security: disc; text-security: disc; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.result { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius-sm); font-weight: 700; }
.result-ok { background: var(--ok-soft); color: var(--ok); }
.result-muted { background: var(--surface-2); color: var(--muted); }
.path-box { margin-top: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; text-align: left; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }

/* ---------- הודעות קופצות ---------- */
.toasts {
  position: fixed; z-index: 100;
  inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: 560px; width: fit-content;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text); color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 15px; font-weight: 600;
  animation: toast-in 0.18s ease-out;
}
.toast-error { background: #c22a2a; color: #fff; }
.toast-ok { background: #16692e; color: #fff; } /* קבוע: ה-ok של מצב כהה בהיר מדי לטקסט לבן (1.96) */
.toast-warn { background: #9a5800; color: #fff; }
.toast-out { opacity: 0; transition: opacity 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- חלונות ---------- */
.dlg {
  padding: 0; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--text);
  width: min(520px, calc(100vw - 24px));
  max-height: calc(var(--vvh) - 24px);
  box-shadow: var(--shadow);
}
.dlg::backdrop { background: rgb(0 0 0 / 0.45); }
.dlg-wide { width: min(760px, calc(100vw - 24px)); }
.dlg-inner { display: flex; flex-direction: column; max-height: calc(var(--vvh) - 26px); }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 8px; padding-inline-start: 18px; border-bottom: 1px solid var(--border); }
.dlg-title { flex: 1 1 auto; margin: 0; font-size: 18px; }
.dlg-body { padding: 16px 18px; overflow: auto; }
.dlg-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.dlg-msg { margin: 0; font-size: 16px; }
.dlg-palette { width: min(640px, calc(100vw - 24px)); }
.dlg-palette .dlg-body { padding: 0; }

/* ---------- מעטפת ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.app-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 17px; white-space: nowrap; flex: 0 0 auto; }
.device-name { flex: 1 1 auto; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; }
.device-name[dir="ltr"] { text-align: left; }
.tabs {
  display: flex; gap: 4px; padding: 6px 8px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
  position: sticky; top: 0; z-index: 5;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
}
.tab:hover { background: var(--surface-2); }
.tab.is-active { background: var(--accent-soft); color: var(--accent-strong); }
.tab-badge { margin-inline-start: 2px; }
.main-wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 14px 12px calc(40px + env(safe-area-inset-bottom)); }
.main { display: flex; flex-direction: column; gap: 6px; }
.section { margin-bottom: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-title { margin: 0; font-size: 18px; }
.page-title { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.version { font-size: 12px; text-align: center; margin-top: 18px; }

/* ---------- כרטיסים ורשימות ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.card-narrow { max-width: 620px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card-row { display: flex; align-items: flex-start; gap: 12px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card-rc { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; border-color: var(--accent); }
.card-help { display: flex; gap: 12px; align-items: flex-start; box-shadow: none; background: var(--surface-2); }
.card-help p { margin: 4px 0 0; }
/* סשן שהסתיים: רקע אפור וקו מקווקו (לא opacity, כדי שהטקסט יישאר קריא) */
.session-card.is-dead { background: var(--surface-2); border-style: dashed; box-shadow: none; }
.session-card.is-dead .cwd { background: var(--surface); }
.kind-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); flex: 0 0 auto; }
.kind-claude { background: var(--accent-soft); color: var(--accent-strong); }
.kind-rc { background: var(--ok-soft); color: var(--ok); }
.pills { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-muted { background: var(--surface-2); color: var(--muted); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.li-title .pill { margin-inline-start: 8px; }
.cwd { margin-top: 10px; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; color: var(--muted); }
.actions-row { display: grid; grid-template-columns: 1fr; gap: 10px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-align: start; width: 100%;
}
.list-btn { cursor: pointer; font: inherit; }
.list-btn:hover { background: var(--surface-2); }
.list-compact .list-item { min-height: 48px; padding: 6px 10px; }
.li-main { flex: 1 1 auto; min-width: 0; }
.li-title { font-weight: 700; overflow-wrap: anywhere; }
.li-sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.li-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* שיחה קודמת: במסך צר הכפתורים יורדים לשורה משלהם במקום לכווץ את הכותרת */
.history-item { flex-wrap: wrap; }
.history-item .li-main { flex: 1 1 220px; }
.history-item .li-actions { margin-inline-start: auto; }
.li-path { overflow-wrap: anywhere; }
/* שמות קבצים ונתיבים (משמאל לימין) מיושרים לימין, ליד הכותרת והאייקון ולא בצד השני של השורה */
.li-title.ltr, .li-path, .file-name { text-align: right; }
.card-item { flex-wrap: wrap; }
.card-item .li-actions { margin-inline-start: auto; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }
.empty p { margin: 0; }
.empty .ic { width: 28px; height: 28px; }

/* ---------- באנרים ---------- */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2);
}
.banner > .ic { width: 22px; height: 22px; }
.banner-main { flex: 1 1 180px; min-width: 0; }
.banner-title { font-weight: 800; }
.banner-sub { font-size: 14px; overflow-wrap: anywhere; }
.banner-warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--text); }
.banner-warn > .ic { color: var(--warn); }
.banner-danger { background: var(--danger-soft); border-color: var(--danger-border); }
.banner-danger > .ic { color: var(--danger); }
.banner-danger .banner-title { color: var(--danger); }
.banner-compact { margin: 0; border-radius: 0; border-inline: 0; padding: 6px 10px; gap: 8px; flex-wrap: nowrap; }
.banner-compact .banner-main { flex: 1 1 auto; }
.banner-compact .banner-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-compact .banner-title { font-size: 14px; }

.alerts-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.alert-unread { border-color: var(--danger-border); background: var(--danger-soft); }
.alert-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 4px; }
.alert-msg { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }

/* ---------- קבצים ---------- */
.crumbs-host { margin-bottom: 10px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface-2); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 14px; }
.crumb { border: 0; background: transparent; padding: 6px 8px; min-height: var(--tap); min-width: var(--tap); border-radius: 6px; cursor: pointer; color: var(--accent-strong); }
.crumb:hover { background: var(--surface-3); }
.crumb-cur { color: var(--text); font-weight: 700; }
.crumb-sep { color: var(--muted); }
.preview { display: grid; place-items: center; }
.preview-img { max-height: 70vh; border-radius: 8px; }

/* ---------- כניסה ---------- */
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding: 24px 18px; }
.auth-logo { display: grid; place-items: center; }
.auth-logo img { border-radius: 50%; }
.auth-title { margin: 0; text-align: center; font-size: 24px; }
.auth-card p { margin: 0; }
.auth-foot { margin-top: 8px !important; }

.auth-card-wide { max-width: 520px; }
.auth-card .form { gap: 12px; }
.auth-card h1 + .muted { margin-top: -6px; }
.big-num { font-size: 18px; font-weight: 700; }

/* ---------- סיסמה: שדה עם עין, מד חוזק, דרישות ---------- */
.pw-row { display: flex; gap: 8px; align-items: stretch; }
.pw-row .input { flex: 1 1 auto; min-width: 0; font-family: var(--mono); }
.pw-row .input:placeholder-shown { font-family: var(--font); }
.eye-btn { flex: 0 0 auto; }
.btn.is-busy { cursor: progress; }

.meter { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 22px; }
.meter-label { color: var(--muted); }
.meter-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex: 1 1 auto; max-width: 220px; }
.meter-seg { height: 6px; border-radius: 3px; background: var(--surface-3); }
.meter-text { font-weight: 700; min-width: 56px; }
.meter.lvl-1 .meter-seg:nth-child(-n+1) { background: var(--danger); }
.meter.lvl-2 .meter-seg:nth-child(-n+2) { background: var(--warn); }
.meter.lvl-3 .meter-seg:nth-child(-n+3) { background: var(--accent); }
.meter.lvl-4 .meter-seg { background: var(--ok); }
.meter.lvl-1 .meter-text { color: var(--danger); }
.meter.lvl-2 .meter-text { color: var(--warn); }
.meter.lvl-3 .meter-text { color: var(--accent-strong); }
.meter.lvl-4 .meter-text { color: var(--ok); }

.reqs { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 4px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 14px; }
.req { display: flex; align-items: center; gap: 8px; }
.req-ic { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto; }
.req-ic .ic { width: 14px; height: 14px; stroke-width: 3; }
.req-idle { color: var(--muted); }
.req-idle .req-ic { background: var(--surface-3); }
.req-ok { color: var(--ok); }
.req-ok .req-ic { background: var(--ok-soft); }
.req-bad { color: var(--danger); }
.req-bad .req-ic { background: var(--danger-soft); }
.err-list { margin: 6px 0 0; padding-inline-start: 20px; font-weight: 600; }

/* ---------- קודים ---------- */
.code-input { font-family: var(--mono); font-size: 26px; letter-spacing: 0.28em; text-align: center; min-height: 56px; padding-inline: 8px; }
.code-input::placeholder { font-family: var(--mono); letter-spacing: 0.28em; color: var(--surface-3); }
.code-backup { font-size: 22px; letter-spacing: 0.08em; }
.code-backup::placeholder { letter-spacing: 0.08em; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row .input { flex: 1 1 auto; min-width: 0; }
.code-row .btn { min-height: 56px; }

.codes-view { display: flex; flex-direction: column; gap: 12px; }
.codes-grid {
  list-style: none; margin: 0; padding: 10px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  counter-reset: code;
}
.code-item { display: flex; align-items: baseline; gap: 4px; min-width: 0; font-size: 15px; font-weight: 700; user-select: all; white-space: nowrap; }
.code-item::before { counter-increment: code; content: counter(code) "."; color: var(--muted); font-size: 11px; font-weight: 600; min-width: 18px; text-align: right; }
@media (max-width: 330px) { .codes-grid { grid-template-columns: 1fr; } }
.codes-actions .btn { flex: 1 1 140px; }
.check-strong { font-weight: 700; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); border: 1px solid var(--warn-border); }

/* ---------- אפליקציית אימות (QR) ---------- */
.totp-enroll { display: flex; flex-direction: column; gap: 12px; }
.howto { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; font-size: 15px; }
.qr-wrap { display: grid; place-items: center; }
.qr-box { width: min(240px, 72vw); padding: 0; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.qr-svg { display: block; width: 100%; height: auto; }
.secret-details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.secret-details summary { min-height: var(--tap); display: flex; align-items: center; padding: 0 12px; cursor: pointer; font-weight: 600; font-size: 15px; }
.secret-line { display: flex; align-items: center; gap: 8px; padding: 0 8px 8px 12px; }
.secret-text { flex: 1 1 auto; min-width: 0; font-size: 15px; letter-spacing: 0.06em; overflow-wrap: anywhere; user-select: all; text-align: left; }

/* ---------- אשף: פס התקדמות ואפשרויות ---------- */
.steps { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); text-align: center; }
.step::before { content: ""; position: absolute; top: 14px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--ok); }
.step-num { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); font-weight: 800; font-size: 13px; color: var(--muted); }
.step-num .ic { width: 16px; height: 16px; stroke-width: 3; }
.step.is-current { color: var(--text); font-weight: 700; }
.step.is-current .step-num { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.step.is-done .step-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-label { line-height: 1.2; }

.opt-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.opt-card.is-done { border-color: var(--ok); }
.opt-head { display: flex; align-items: flex-start; gap: 12px; }
.opt-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.opt-card.is-done .opt-ic { background: var(--ok-soft); color: var(--ok); }
.opt-title { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opt-body { display: flex; flex-direction: column; gap: 10px; }
.setup-meta { justify-content: space-between; font-size: 14px; }

.tfa-body { display: flex; flex-direction: column; gap: 10px; }
.tfa-alts { display: flex; flex-direction: column; gap: 8px; }
.tfa-alts:empty { display: none; }
.tfa-or { text-align: center; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; margin: 2px 0; }
.tfa-or::before, .tfa-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--border); }

.done-ic { display: grid; place-items: center; }
.done-ic .ic { width: 56px; height: 56px; color: var(--ok); }
.done-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.done-list li { display: flex; align-items: flex-start; gap: 8px; }
.done-list .ic { color: var(--ok); margin-top: 2px; }
.plain-list { margin: 0; padding-inline-start: 20px; font-size: 14px; }

/* ---------- חשבון ---------- */
.acct { display: flex; flex-direction: column; gap: 14px; }
.acct-card { display: flex; flex-direction: column; gap: 10px; }
.acct-title { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.kv-val { font-weight: 700; overflow-wrap: anywhere; text-align: left; }
.method { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.method-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.method-title { font-weight: 800; }
.method .card-actions, .acct-card .card-actions { margin-top: 0; }
.small { font-size: 14px; margin: 0; }
.warn-text { color: var(--warn); font-weight: 700; }
.acct-item { flex-wrap: wrap; }
.acct-item .li-main { flex: 1 1 200px; }
.acct-item .li-actions { margin-inline-start: auto; }
.ip { font-family: var(--mono); font-size: 0.95em; }
.activity .act-item { min-height: 0; padding: 8px 10px; align-items: flex-start; }
.act-item .pill { margin-top: 2px; }
.act-fail { border-color: var(--danger-border); }

/* ---------- סריקת קבצים מצורפים ---------- */
.scan-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-pending { background: var(--surface-2); color: var(--muted); }
.scan-clean { background: var(--ok-soft); color: var(--ok); }
.scan-warn { background: var(--warn-soft); color: var(--warn); }
.scan-infected { background: var(--danger-soft); color: var(--danger); }
.up-scan { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 3px; min-width: 0; }
.up-scan .scan-approve { padding: 0 10px; font-size: 13px; color: var(--warn); border-color: var(--warn-border); }
.up-item { align-items: flex-start; }
.up-item.is-warn { border-color: var(--warn); }
.li-scan { margin-top: 3px; }
/* במגש: התג נשבר לשתי שורות במקום שלוש נקודות, כדי ש"נחסם" והסיבה ייראו במלואם */
.up-main .scan-tag { white-space: normal; overflow: visible; line-height: 1.35; padding-block: 2px; }

/* ---------- חלון סוד קופץ ---------- */
.dlg-secret .dlg-title { display: flex; align-items: center; gap: 8px; }
.secret-ask { margin: 0; font-size: 17px; line-height: 1.5; }
.secret-ask strong { font-weight: 800; }

/* ---------- חסימות ---------- */
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.table-wrap { overflow-x: auto; }
.blocks-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.blocks-table th, .blocks-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: middle; }
.blocks-table th { color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap; }
.blocks-table tbody tr:last-child td { border-bottom: 0; }
.blocks-table .td-act { text-align: end; }
/* נייד: כל חסימה ככרטיס, כותרת העמודה לפני כל ערך */
@media (max-width: 640px) {
  .blocks-table thead { display: none; }
  .blocks-table, .blocks-table tbody, .blocks-table tr, .blocks-table td { display: block; width: 100%; }
  .blocks-table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 8px; }
  .blocks-table td { display: flex; align-items: center; gap: 10px; padding: 4px 0; border: 0; }
  .blocks-table td::before { content: attr(data-label); flex: 0 0 92px; color: var(--muted); font-size: 13px; }
  .blocks-table td.td-act { justify-content: flex-end; }
  .blocks-table td.td-act::before { display: none; }
}

/* מסך חסימה */
.blocked-card { text-align: center; align-items: center; }
.blocked-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); }
.blocked-ic .ic { width: 30px; height: 30px; }
.blocked-msg { font-size: 17px; line-height: 1.6; }

/* ---------- באנר מידע (כניסה חדשה) ---------- */
.banner-info { background: var(--info-soft); border-color: var(--info); }
.banner-info > .ic { color: var(--info); }
.banner-info .banner-title { color: var(--info); }
.banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.banner-col { flex-direction: column; align-items: stretch; gap: 6px; }
.banner-head { display: flex; align-items: center; gap: 10px; }
.banner-head .ic { color: var(--warn); width: 22px; height: 22px; }
.pill-info { background: var(--info-soft); color: var(--info); }
.alert-info { border-color: var(--info); background: var(--info-soft); }

/* ---------- מסוף ---------- */
.term-screen {
  position: fixed; inset-inline: 0; top: var(--vvtop);
  height: var(--vvh);
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.term-head {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; padding-top: calc(4px + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.term-head .btn { background: transparent; border-color: transparent; }
.term-head .btn:hover { background: var(--surface-2); }
.term-head .badge-btn { background: var(--warn-soft); border-color: var(--warn-border); }
.term-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.term-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.term-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.app-host { display: contents; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.dot-ok { background: var(--ok); }
.dot-wait { background: var(--warn); animation: pulse 1s infinite alternate; }
.dot-bad { background: var(--danger); }
.dot-off { background: var(--muted); }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.35; } }

.menu {
  position: absolute; z-index: 20; top: calc(100% + 4px); inset-inline-end: 6px;
  min-width: 250px;
  padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: var(--tap); padding: 0 12px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: start; font-size: 16px;
}
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu-item:hover { background: var(--surface-2); }
.menu-danger { color: var(--danger); }
.menu-row { display: flex; align-items: center; gap: 8px; padding: 2px 6px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-row-label { flex: 1 1 auto; font-size: 14px; color: var(--muted); }

.term-body { position: relative; flex: 1 1 auto; min-height: 80px; background: var(--term-bg); }
.term-host { position: absolute; inset: 4px 2px 2px 6px; }
.term-host .xterm { height: 100%; }
/* xterm.css צובע את ה-viewport בשחור; השארית מתחת לשורה האחרונה נראתה כפס שחור */
.term-host .xterm .xterm-viewport { background-color: var(--term-bg); scrollbar-width: none; }
/* הגלילה מצוירת ע"י xterm עצמו; פס הגלילה המקורי של ה-viewport בצבץ כחץ/קו בפינה */
.term-host .xterm .xterm-viewport::-webkit-scrollbar { display: none; }
.term-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; padding: 16px;
  background: rgb(13 16 22 / 0.82);
}
.overlay-card { max-width: 420px; padding: 18px; border-radius: var(--radius); background: var(--surface); text-align: center; display: flex; flex-direction: column; gap: 10px; }
.overlay-title { font-weight: 800; font-size: 18px; }
.overlay-card p { margin: 0; }

.keybar {
  flex: 0 0 auto;
  display: flex; gap: 8px; padding: 8px;
  overflow-x: auto; scrollbar-width: thin;
  background: var(--surface); border-top: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.key {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  min-width: var(--tap); min-height: var(--tap); padding: 0 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); cursor: pointer;
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  justify-content: center;
  touch-action: manipulation;
}
.key:active { background: var(--surface-3); }
.key-accent { color: var(--accent-strong); }
.key-toggle { font-family: var(--font); }
.key-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.key-label { font-size: 15px; }

.compose {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
}
.compose-row { display: flex; align-items: flex-end; gap: 8px; }
.compose-input {
  flex: 1 1 auto; min-width: 0;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.4;
  resize: none; overflow-y: hidden;
}
.compose-input.is-scroll { overflow-y: auto; }
.compose-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-send { padding: 0 14px; }
.tools-row { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tools-row::-webkit-scrollbar { display: none; }
.btn-tool { min-height: var(--tap); padding: 0 10px; font-size: 16px; font-weight: 600; background: transparent; flex: 0 0 auto; }
.compose-hint { font-size: 12px; white-space: nowrap; }

/* תור שליחה: ההודעות ממתינות כאן, התיבה כבר פנויה */
.outbox { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: hidden; font-size: 13px; color: var(--muted); min-height: 26px; }
.outbox-label { flex: 0 0 auto; font-weight: 600; }
.outbox-chip { flex: 0 1 auto; min-width: 0; padding: 2px 8px; border-radius: 999px; border: 1px dashed var(--border); background: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.outbox-chip.is-sending { border-style: solid; border-color: var(--accent); }
.compose-err { padding: 6px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 600; }

/* צירוף קוד */
.dlg-code .dlg-body { padding-block: 12px; }
.code-lang { max-width: 260px; }
.code-ta { font-family: var(--mono); font-size: 14px; line-height: 1.45; min-height: 38vh; white-space: pre; overflow: auto; tab-size: 2; text-align: left; }
.code-ta::placeholder { text-align: right; }
.code-info { overflow-wrap: anywhere; }

.tray { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.up-item {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  width: 250px; padding: 6px; padding-inline-end: 2px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.up-item.is-done { border-color: var(--ok); }
.up-item.is-error { border-color: var(--danger); }
.up-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: var(--surface-2); }
.up-file { display: grid; place-items: center; color: var(--muted); }
.up-main { flex: 1 1 auto; min-width: 0; }
.up-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.up-item.is-error .up-status { color: var(--danger); }
.up-item.is-done .up-status { color: var(--ok); }
.up-prog { width: 90px; height: 8px; accent-color: var(--accent); }

.drop-overlay {
  position: absolute; inset: 10px; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 3px dashed var(--accent); border-radius: 18px;
  background: rgb(34 89 214 / 0.18);
  color: var(--text); font-size: 20px; font-weight: 800;
  pointer-events: none;
}
.drop-overlay .ic { width: 40px; height: 40px; }

/* ---------- קורא התמלול ---------- */
.reader {
  position: fixed; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.reader-full { inset-inline: 0; top: var(--vvtop); height: var(--vvh); }
.reader-side { top: 0; bottom: 0; inset-inline-start: 0; width: var(--reader-w); border-inline-end: 1px solid var(--border); box-shadow: var(--shadow); }
.term-screen.with-reader { padding-inline-start: var(--reader-w); }
.reader-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; padding-inline-start: 14px; padding-top: calc(6px + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.reader-status { font-size: 12px; }
.st-text-ok { color: var(--ok); }
.st-text-warn { color: var(--warn); }
.reader-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 12px 80px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.reader-full .reader-body > * { width: 100%; max-width: 860px; margin-inline: auto; }
.reader-jump { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); inset-inline-start: 50%; transform: translateX(50%); box-shadow: var(--shadow); }
[dir="ltr"] .reader-jump { transform: translateX(-50%); }

.msg { border-radius: 14px; padding: 10px 14px 12px; border: 1px solid var(--border); background: var(--surface); }
.msg-user { background: var(--accent-soft); border-color: transparent; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.msg-who { font-weight: 800; color: var(--text); }
.msg-time { font-size: 12px; }
.msg-copy { margin-inline-start: auto; border: 0; background: transparent; color: var(--muted); width: var(--tap); height: var(--tap); margin-block: -6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.msg-copy:hover { background: var(--surface-2); color: var(--text); }
.msg-text { overflow-wrap: anywhere; font-size: 16px; line-height: 1.6; }
.msg-user .msg-text { white-space: pre-wrap; }
.msg-system { text-align: center; font-size: 13px; color: var(--muted); padding: 2px 12px; }
.msg-tool { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.msg-tool summary { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 4px 12px; cursor: pointer; list-style: none; }
.msg-tool summary::-webkit-details-marker { display: none; }
.msg-tool summary::before { content: "▸"; color: var(--muted); }
.msg-tool[open] summary::before { content: "▾"; }
.tool-name { font-weight: 700; flex: 0 0 auto; }
.tool-sum { flex: 1 1 auto; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-tool[open] .tool-sum { white-space: normal; }
.tool-body { margin: 0; padding: 10px 12px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; overflow: auto; }
.tool-body-empty { margin: 0; padding: 8px 12px; font-size: 13px; }

/* ---------- markdown ---------- */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md-p { margin: 0 0 10px; }
.md-h { font-weight: 800; margin: 14px 0 8px; line-height: 1.3; }
.md-h1 { font-size: 21px; }
.md-h2 { font-size: 19px; }
.md-h3 { font-size: 17px; }
.md-h4, .md-h5, .md-h6 { font-size: 16px; }
.md-hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.md-quote { margin: 0 0 10px; padding: 4px 12px; border-inline-start: 4px solid var(--border); color: var(--muted); }
.md-list { margin: 0 0 10px; padding-inline-start: 24px; }
.md-list li { margin: 3px 0; }
.md-list .md-list { margin: 4px 0; }
.md-code { margin: 0 0 10px; border-radius: 10px; overflow: hidden; background: var(--term-bg); direction: ltr; }
.md-code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 12px; background: #1a1f29; }
.md-pre { margin: 0; padding: 10px 12px 12px; background: var(--term-bg); color: #e6e9ef; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.5; direction: ltr; text-align: left; }
.md-copy { width: var(--tap); height: var(--tap); flex: 0 0 auto; border: 0; background: transparent; color: #c9ced8; cursor: pointer; display: grid; place-items: center; }
.md-copy:hover { background: rgb(255 255 255 / 0.12); }
.md-lang { font-size: 12px; color: #aab2c0; font-family: var(--mono); }
.md-code-inline { font-family: var(--mono); font-size: 0.88em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); unicode-bidi: isolate; }
.md-table-wrap { overflow-x: auto; margin: 0 0 10px; }
.md-table { border-collapse: collapse; font-size: 14px; min-width: 60%; }
.md-table th, .md-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: start; vertical-align: top; }
.md-table th { background: var(--surface-2); font-weight: 800; }
.md-table .al-center { text-align: center; }
.md-table .al-end { text-align: end; }
.md-link { overflow-wrap: anywhere; }
.md-badlink { text-decoration: underline dotted; color: var(--muted); }

/* ---------- פלטה ---------- */
.palette { display: flex; flex-direction: column; max-height: min(70vh, calc(var(--vvh) - 140px)); }
.palette-search-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.palette-search { border: 0; box-shadow: none !important; padding-inline: 4px; }
.palette-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 8px; }
.palette-list > p { padding: 10px; margin: 0; }
.palette-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  width: 100%; min-height: var(--tap); padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: start;
}
.palette-item.is-active { background: var(--accent-soft); }
.pal-name { font-weight: 800; color: var(--accent-strong); }
.pal-desc { flex: 1 1 200px; font-size: 15px; color: var(--muted); }

/* ---------- מסכים רחבים ---------- */
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .actions-row { grid-template-columns: 1fr 1fr; }
  .main-wrap { padding: 20px 20px 48px; }
  /* כותרת ולשוניות מיושרות לרוחב התוכן (1040), לא נמתחות לכל המסך */
  .app-head, .tabs { padding-inline: max(14px, calc((100% - 1040px) / 2 + 20px)); }
  .tab { flex: 0 0 auto; padding: 0 16px; }
}
@media (min-width: 900px) {
  .term-host { inset: 6px 4px 4px 10px; }
  .keybar { padding: 6px 10px; }
  .compose { padding: 8px 10px 10px; }
}
@media (max-width: 899px) {
  .term-screen.with-reader { padding-inline-start: 0; }
}
/* נייד: ארבע הלשוניות נכנסות במלואן (אייקון מעל תווית), בלי גלילה שמסתירה את "חשבון" */
@media (max-width: 519px) {
  .tabs { gap: 2px; padding: 4px; }
  .tab { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 4px 2px; min-height: 54px; font-size: 13px; position: relative; }
  .tab > span:not(.badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-badge { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; }
}
@media (max-width: 420px) {
  .auth-screen { padding: 12px; }
  .auth-card { padding: 20px 14px; }
  .device-name { font-size: 12px; }
  .app-head { gap: 8px; }
  .compose-hint { display: none; }
  /* צרף ומצלמה: אייקון בלבד. התווית נשארת לקורא מסך */
  .tool-collapse { width: var(--tap); padding: 0; }
  .tool-collapse .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* "פתח באפליקציה" זמין בתפריט, כדי שלשם השיחה יישאר מקום */
  .term-head .app-host { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
   הממשק כמו Claude Code בנייד: רשימת שיחות, צ'אט, סרגל קלט, גיליונות
   ===================================================================== */

/* ---------- מעטפת: נייד עם סרגל תחתון, מחשב עם כותרת ולשוניות ---------- */
.shell-mobile { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.shell-mobile .main-wrap { padding-top: calc(12px + env(safe-area-inset-top)); }
.bottom-nav {
  position: fixed; z-index: 10; inset-inline: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; min-width: 48px; border-radius: 14px;
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.is-active { color: var(--accent-strong); background: var(--accent-soft); }
.nav-ic { position: relative; display: grid; place-items: center; }
.nav-ic .ic { width: 22px; height: 22px; }
.nav-badge { position: absolute; top: -7px; inset-inline-end: -14px; }
.nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shell-desktop { height: 100dvh; display: flex; flex-direction: column; }
.shell-desktop .app-head { flex: 0 0 auto; gap: 16px; padding-inline: 16px; }
.top-nav { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.top-nav .nav-item { flex-direction: row; gap: 8px; min-height: 48px; padding: 0 14px; font-size: 16px; }
.top-nav .nav-badge { top: -8px; inset-inline-end: -10px; }
.shell-desktop .main { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: block; }
.main-split { display: grid !important; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); overflow: hidden !important; }
.split-list { min-height: 0; overflow-y: auto; background: var(--surface); border-inline-end: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.split-chat { position: relative; min-width: 0; min-height: 0; display: flex; }
.split-chat > .chat-screen { flex: 1 1 auto; }
.split-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; text-align: center; }
.banners { display: flex; flex-direction: column; }
.banners:empty { display: none; }
.banners .banner { margin-bottom: 12px; }

/* ---------- רשימת שיחות ---------- */
.chat-list-wrap { display: flex; flex-direction: column; gap: 12px; }
.cl-head { display: flex; align-items: center; gap: 8px; }
.cl-title { margin: 0; flex: 1 1 auto; font-size: 26px; font-weight: 800; }
.cl-column .cl-title { font-size: 22px; }
.cl-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cl-actions .icon-btn { background: transparent; border-color: transparent; }
.menu-wrap { position: relative; }
.menu-wrap .menu { top: calc(100% + 4px); inset-inline-end: 0; }
.cl-tools { display: flex; flex-direction: column; gap: 8px; }
.search-row { display: flex; align-items: center; gap: 4px; min-height: 48px; padding-inline-start: 14px; border-radius: 999px; background: var(--surface-2); }
.search-row:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.search-ic { color: var(--muted); flex: 0 0 auto; }
.search-input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding-inline: 6px; box-shadow: none !important; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear { flex: 0 0 auto; background: transparent; border-color: transparent; border-radius: 50%; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-btn {
  min-height: 48px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.seg-btn:hover { background: var(--surface-2); }
.seg-btn.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chat-list { display: flex; flex-direction: column; gap: 8px; }
.chat-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 64px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--text); text-align: start; cursor: pointer; font: inherit;
}
.chat-item:hover { background: var(--surface-2); }
.chat-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.ci-dot { width: 10px; height: 10px; margin-top: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.st-working .ci-dot { background: var(--ok); animation: pulse 1s infinite alternate; }
.st-waiting .ci-dot { background: var(--warn); }
.st-open .ci-dot { background: var(--ok); }
.st-closed .ci-dot { background: transparent; border: 2px solid var(--muted); }
.st-archived .ci-dot { background: transparent; border: 2px dashed var(--muted); }
.ci-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ci-top { display: flex; align-items: flex-start; gap: 8px; }
.ci-title { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 17px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ci-date { flex: 0 0 auto; padding-top: 2px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.ci-desc { font-size: 15px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ci-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ci-tags .pill { font-size: 13px; }
.pill .ic { width: 14px; height: 14px; }
.pill-event { background: var(--danger-soft); color: var(--danger); }
.pill-st-working, .pill-st-open { background: var(--ok-soft); color: var(--ok); }
.pill-st-waiting { background: var(--warn-soft); color: var(--warn); }
.pill-st-closed, .pill-st-archived { background: var(--surface-2); color: var(--muted); }
.pad { padding: 10px; margin: 0; }

/* מגירה (מתוך שיחה בנייד) */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / 0.42); opacity: 0; transition: opacity 0.18s; }
.drawer-backdrop.is-in { opacity: 1; }
.drawer {
  position: fixed; z-index: 51; top: 0; bottom: 0; inset-inline-start: 0;
  width: min(88vw, 390px); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform 0.2s ease-out;
}
.drawer.is-in { transform: none; }
.drawer .cl-title { font-size: 22px; }
.drawer-links { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.drawer-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px; }
.drawer-link:hover { background: var(--surface-2); }
.drawer-link .badge { margin-inline-start: auto; }
body.drawer-open, body.sheet-open { overflow: hidden; }

/* ---------- מסך שיחה ---------- */
.chat-screen { position: relative; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.chat-mobile { position: fixed; inset-inline: 0; top: var(--vvtop); height: var(--vvh); }
.chat-desktop { height: 100%; width: 100%; }
.chat-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: 4px 8px; padding-top: calc(4px + env(safe-area-inset-top));
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.chat-head .icon-btn { background: transparent; border-color: transparent; }
.chat-head .badge-btn { background: var(--warn-soft); border-color: var(--warn-border); }
.chat-title-btn {
  flex: 1 1 auto; min-width: 0; min-height: 48px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 2px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--text);
  cursor: pointer; text-align: start; font: inherit;
}
.chat-title-btn:hover { background: var(--surface-2); }
.chat-title { max-width: 100%; font-weight: 800; font-size: 17px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { display: flex; align-items: center; gap: 6px; max-width: 100%; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.chat-sub-text { overflow: hidden; text-overflow: ellipsis; }
.chat-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.dot-warn { background: var(--warn); }
.chat-main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.chat-body { flex: 1 1 auto; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 20px; }
.chat-col { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 16px; }
.chat-log:empty { display: none; }
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; }
.chat-empty p { margin: 0; }
.chat-empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.chat-empty-ic .ic { width: 28px; height: 28px; }
.chat-empty-title { font-size: 20px; font-weight: 800; }
.chat-missing { margin: 24px auto; max-width: 420px; }
.chat-jump { position: absolute; bottom: 12px; inset-inline-start: 50%; transform: translateX(50%); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }

/* הודעות */
.cm-user { align-self: flex-end; max-width: 86%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cm-bubble { padding: 10px 14px; border-radius: 20px; border-end-end-radius: 6px; background: var(--bubble); font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.cm-user-text { white-space: pre-wrap; }
.cm-time { font-size: 13px; color: var(--muted); padding-inline: 6px; }
.cm-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cm-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.cm-file .ic { width: 16px; height: 16px; color: var(--muted); }
.cm-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-bubble-event { background: var(--danger-soft); }
.cm-event-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 14px; font-weight: 800; color: var(--danger); }
.cm-event-head .ic { width: 16px; height: 16px; }
.cm-assistant { font-size: 16px; line-height: 1.65; }
.cm-text { overflow-wrap: anywhere; }
.cm-system { align-self: center; max-width: 90%; padding: 2px 12px; font-size: 14px; color: var(--muted); text-align: center; }
.cm-tools { display: flex; flex-direction: column; gap: 8px; }
.cm-fold { border-radius: 12px; }
.cm-fold-head {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px;
  border-radius: 12px; cursor: pointer; list-style: none; color: var(--muted); font-size: 15px;
}
.cm-fold-head::-webkit-details-marker { display: none; }
.cm-fold-head:hover { background: var(--surface-2); }
.cm-fold-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--text); flex: 0 0 auto; }
.cm-fold-ic .ic { width: 16px; height: 16px; }
.cm-fold-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-verb { color: var(--text); font-weight: 600; }
.cm-target { font-size: 14px; }
.cm-chev { display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; transition: transform 0.15s; }
.cm-chev .ic { width: 18px; height: 18px; }
.cm-fold[open] > .cm-fold-head .cm-chev, .adv[open] > .adv-head .cm-chev { transform: rotate(180deg); }
.cm-fold[open] > .cm-fold-head .cm-fold-label { white-space: normal; overflow-wrap: anywhere; }
.cm-fold-body { margin: 2px 0 4px; margin-inline-start: 46px; padding: 8px 12px; border-inline-start: 2px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.cm-tool-k { font-size: 13px; font-weight: 700; color: var(--muted); }
.cm-tool-note { font-size: 15px; }
.cm-pre { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow: auto; text-align: left; }
.cm-tool-state { flex: 0 0 auto; }
.cm-tool.is-running .cm-tool-state { width: 14px; height: 14px; border: 2px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.cm-tool.is-done .cm-tool-state { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.cm-think-text { white-space: pre-wrap; font-style: italic; color: var(--muted); font-size: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }
.cm-working { display: flex; align-items: center; gap: 10px; padding: 4px 2px; color: var(--accent-strong); font-weight: 700; font-size: 16px; }
.spark-spin { display: grid; place-items: center; }
.spark-spin .ic { width: 22px; height: 22px; animation: spin 2.4s linear infinite; }

/* שאלות ואישורים של Claude */
.prompt-dock { flex: 0 0 auto; padding: 8px 12px 0; background: var(--bg); max-height: 55%; overflow-y: auto; }
.prompt-card { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--accent); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.prompt-q { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; font-size: 17px; line-height: 1.4; }
.prompt-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.prompt-detail { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--term-bg); color: #e6e9ef; font-family: var(--mono); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
.prompt-opts { display: flex; flex-direction: column; gap: 8px; }
.prompt-opt { width: 100%; min-height: 52px; justify-content: flex-start; white-space: normal; text-align: start; line-height: 1.3; padding-block: 8px; }

/* שיחה סגורה */
.resume-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-2); border-top: 1px solid var(--border); font-size: 15px; }
.resume-bar > .ic { color: var(--muted); }
.resume-text { flex: 1 1 auto; min-width: 0; }

/* ---------- סרגל הקלט ---------- */
.composer { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer > :not(.slash) { width: 100%; max-width: 780px; margin-inline: auto; }
.chat-desktop .composer { padding-bottom: 14px; }
.cmp-meta { display: flex; align-items: center; gap: 8px; }
.chip-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0; border: 0; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.chip-face { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; font-weight: 600; }
.chip-face .ic { width: 16px; height: 16px; color: var(--accent); }
.chip-btn:hover .chip-face { background: var(--surface-2); }
.chip-btn:disabled { opacity: 0.5; cursor: default; }
.cmp-box { display: flex; flex-direction: column; padding: 4px 8px 6px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 0.05); }
.cmp-box:focus-within { border-color: var(--accent); }
.cmp-input { width: 100%; min-height: 48px; padding: 12px 8px 6px; border: 0; background: transparent; color: var(--text); font-size: 16px; line-height: 1.45; resize: none; overflow-y: hidden; outline: none; }
.cmp-input.is-scroll { overflow-y: auto; }
.cmp-input::placeholder { color: var(--muted); }
.cmp-bar { display: flex; align-items: center; gap: 8px; }
.cmp-plus, .cmp-send, .cmp-stop { border-radius: 50%; }
.cmp-plus { background: transparent; }
.cmp-send { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.cmp-send:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.cmp-send:disabled { background: var(--surface-2); border-color: var(--border); color: var(--muted); opacity: 1; }
.cmp-stop { background: var(--text); border-color: var(--text); color: var(--bg); }
.cmp-stop:hover { background: var(--text); opacity: 0.85; }
.cmp-stop .ic { fill: currentColor; }
.att-tray { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.att-chip { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 8px; width: 250px; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.att-chip.is-done { border-color: var(--ok); }
.att-chip.is-warn { border-color: var(--warn); }
.att-chip.is-error { border-color: var(--danger); }
.att-chip.is-sent { border-style: dashed; }
.att-chip .up-name { font-size: 15px; }
.att-chip .up-meta { font-size: 13px; }
.att-x { flex: 0 0 auto; background: transparent; border-color: transparent; }
.up-note { font-size: 13px; color: var(--danger); font-weight: 600; }
.slash {
  position: absolute; z-index: 15; bottom: 100%; inset-inline: 12px;
  max-height: min(50vh, 380px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.slash-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: start; cursor: pointer; font: inherit; }
.slash-item:hover, .slash-item.is-active { background: var(--accent-soft); }

/* ---------- גיליונות ---------- */
.sheet-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 12px; border: 0; border-radius: 14px; background: transparent; color: var(--text); cursor: pointer; text-align: start; font: inherit; }
.sheet-item:hover { background: var(--surface-2); }
.sheet-item.is-on { background: var(--accent-soft); }
.sheet-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); flex: 0 0 auto; }
.sheet-main { display: flex; flex-direction: column; min-width: 0; }
.sheet-label { font-weight: 700; font-size: 16px; }
.sheet-sub { font-size: 14px; color: var(--muted); }
.sheet-check { color: var(--accent); margin-inline-start: auto; }
.term-sheet { position: fixed; inset: 0; z-index: 45; background: var(--bg); }
.adv { border: 1px solid var(--border); border-radius: 12px; }
.adv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 12px; cursor: pointer; font-weight: 700; list-style: none; }
.adv-head::-webkit-details-marker { display: none; }
.adv-body { padding: 0 12px 12px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.counter { font-variant-numeric: tabular-nums; }
.dlg-details .kv { font-size: 15px; }
.link-btn { min-height: 48px; padding: 0 6px; border: 0; background: transparent; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- אירועים ---------- */
.page-intro { margin: 0 0 12px; }
.ev-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.ev-card { display: flex; flex-direction: column; gap: 8px; border-inline-start: 4px solid var(--border); }
.ev-critical { border-inline-start-color: var(--danger); }
.ev-high { border-inline-start-color: var(--warn); }
.ev-info { border-inline-start-color: var(--info); }
.ev-card.is-closed { background: var(--surface-2); box-shadow: none; }
.ev-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ev-time { margin-inline-start: auto; font-size: 14px; color: var(--muted); }
.ev-title { margin: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.ev-card .card-actions { margin-top: 4px; }
.lvl-critical { background: #c22a2a; color: #fff; }
.lvl-high { background: var(--warn-soft); color: var(--warn); }
.lvl-info { background: var(--info-soft); color: var(--info); }

/* ---------- התראות והתקנה ---------- */
.notif { display: flex; flex-direction: column; gap: 14px; }
.notif-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.notif-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.ic-ok { color: var(--ok); }
.notif-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-block { display: flex; flex-direction: column; gap: 8px; }
.notif-sub { margin: 0; font-size: 16px; }
.lvl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
.lvl-main { flex: 1 1 200px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.mail-result { font-size: 15px; overflow-wrap: anywhere; }
.mail-result:empty { display: none; }
.mail-result.is-ok { color: var(--ok); }
.mail-result.is-bad { color: var(--danger); font-weight: 600; }
.inst { display: flex; flex-direction: column; gap: 14px; }
.inst > p { margin: 0; }
.inst-sec { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; }
.inst-title { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.inst-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.inst-step { display: flex; align-items: center; gap: 10px; }
.inst-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 800; flex: 0 0 auto; }
.inst-text { flex: 1 1 auto; }
.inst-pic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--info); flex: 0 0 auto; }
.install-banner .banner-actions .btn { min-width: 96px; }

/* גיליון תחתון בנייד (שיחה חדשה, "+", מודל, מסופים) */
@media (max-width: 899px) {
  dialog.dlg-sheet {
    margin: auto 0 0; width: 100vw; max-width: 100vw;
    border-radius: 22px 22px 0 0; border-bottom: 0;
    max-height: calc(var(--vvh) - 24px);
  }
  dialog.dlg-sheet .dlg-inner { max-height: calc(var(--vvh) - 26px); padding-bottom: env(safe-area-inset-bottom); }
}
@media (min-width: 900px) {
  .bottom-nav { display: none; }
}
@media (max-width: 380px) {
  .nav-item { font-size: 14px; }
  .cl-title { font-size: 23px; }
}

/* ---------- כניסה עם Google (לפי העיצוב הרשמי של Sign in with Google) ---------- */
.gsi-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 0 16px;
  border: 1px solid #747775; border-radius: 26px;
  background: #ffffff; color: #1f1f1f;
  font: 500 16px/1 Roboto, "Segoe UI", Arial, var(--font);
  cursor: pointer;
  transition: background-color 0.12s, box-shadow 0.12s;
}
.gsi-btn:hover { background: #f8faff; box-shadow: 0 1px 2px rgb(60 64 67 / 0.3), 0 1px 3px 1px rgb(60 64 67 / 0.15); }
.gsi-btn:disabled { opacity: 0.7; cursor: progress; }
.gsi-logo { width: 20px; height: 20px; flex: 0 0 auto; }
@media (prefers-color-scheme: dark) {
  .gsi-btn { background: #131314; border-color: #8e918f; color: #e3e3e3; }
  .gsi-btn:hover { background: #1f1f20; box-shadow: none; }
}
.link-alt { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.google-block { display: flex; flex-direction: column; gap: 12px; }
.pw-alt { margin-top: 4px; }
.field-err:empty { display: none; }
.field-err { font-size: 14px; }
.kv-edit { gap: 8px; }
.kv-edit .kv-val { flex: 1 1 auto; text-align: end; }

/* ---------- אישור כניסה ממכשיר חדש ---------- */
.approve-card { text-align: center; }
.approve-num {
  margin: 4px auto; min-width: 140px; padding: 6px 18px; border-radius: 22px;
  font: 800 76px/1.1 var(--font); letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--surface-2); border: 2px solid var(--border);
}
.approve-num.is-dead { color: var(--muted); text-decoration: line-through; }
.approve-text { font-size: 17px; margin: 0; }
.approve-count { margin: 0; font-variant-numeric: tabular-nums; }
.approve-status { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 28px; font-weight: 700; color: var(--accent-strong); }
.approve-status.st-bad { color: var(--danger); }
.spin { width: 16px; height: 16px; border: 2px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex: 0 0 auto; }
.approve-actions:empty { display: none; }
.approve { display: flex; flex-direction: column; gap: 12px; }
.approve-head { display: flex; align-items: center; gap: 10px; }
.approve-alert-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); flex: 0 0 auto; }
.approve-title { margin: 0; font-size: 20px; }
.approve-kv { font-size: 16px; }
.approve-ask { margin: 4px 0 0; font-weight: 700; font-size: 17px; }
.approve-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.approve-choice {
  min-height: 72px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface);
  color: var(--text); font: 800 34px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
}
.approve-choice:hover { background: var(--surface-2); }
.approve-choice.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.approve-result { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 8px 0; }
.approve-result-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); }
.approve-result-ic .ic { width: 30px; height: 30px; }
.approve-result.is-ok .approve-result-ic { background: var(--ok-soft); color: var(--ok); }
.approve-result.is-bad .approve-result-ic { background: var(--danger-soft); color: var(--danger); }
.approve-page .card-narrow { max-width: 520px; }
.dlg-approve .dlg-body { padding-top: 12px; }
/* הוספת מכשיר: QR וקישור */
.link-dev { gap: 12px; }
.link-url { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 14px; overflow-wrap: anywhere; word-break: break-all; text-align: left; }
.link-count { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.qr-box.is-dead { opacity: 0.25; }
.link-actions { justify-content: center; }
/* כש-Claude שואל: הגיליון במרכז. מקום לתמלול: בלי צ'יפים, בלי באנרים מקוצרים ובלי כפתור "לסוף" */
.chat-screen.has-prompt .cmp-meta, .chat-screen.has-prompt > .alert-banner-host, .chat-screen.has-prompt .chat-jump { display: none !important; }
/* אימות מחדש */
.reauth-other { display: flex; flex-direction: column; gap: 10px; }
/* הודעות קופצות מעל סרגל הניווט התחתון ומעל שורת הכתיבה, כדי לא לכסות כפתורים */
body:has(.bottom-nav) .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }
body:has(.chat-screen .composer) .toasts { bottom: calc(132px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body:has(.bottom-nav) .toasts { bottom: calc(12px + env(safe-area-inset-bottom)); } }
/* שומר הטעינה (boot.js): מודול לא נטען */
.boot-failed { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; color: var(--text); }
.boot-failed .boot-msg { font-size: 18px; font-weight: 600; margin: 0; text-align: center; }
.boot-failed .btn { min-width: 160px; }
