/* =========================================================================
   styles.css — עיצוב יחיד. מובייל-תחילה, RTL, מאפיינים לוגיים (מוכן ל-LTR).
   צבעים מוזרקים כמשתני CSS מ-config.js (ראה app.js applyTheme).
   ========================================================================= */

:root {
  --primary: #1e6fd9;
  --primary-dark: #1656ab;
  --accent: #f5a623;
  --danger: #e0362c;
  --success: #2e9e5b;
  --warning: #e08a1e;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c2430;
  --text-muted: #68727f;
  --border: #e3e7ec;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 10px rgba(20, 30, 45, 0.08);
  --shadow-lg: 0 8px 30px rgba(20, 30, 45, 0.16);
  --tap: 48px; /* גובה מינימלי למגע */
  --header-h: 56px;
  --nav-h: 62px;
  --font: system-ui, -apple-system, 'Segoe UI', Rubik, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; }

h1, h2, h3, h4 { margin: 0 0 0.4em; font-weight: 700; line-height: 1.25; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.7em; }
a { color: var(--primary); text-decoration: none; }
small { color: var(--text-muted); }

/* --- Layout שלד --- */
.app-header {
  position: sticky;
  inset-block-start: 0;
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 14px;
  z-index: 40;
  box-shadow: var(--shadow);
}
.app-header .logo { height: 30px; width: 30px; border-radius: 7px; background: #fff; padding: 2px; }
.app-header .title { font-weight: 700; font-size: 1.05rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-header .header-btn {
  background: rgba(255,255,255,0.16);
  border: none; color: #fff; width: 40px; height: 40px;
  border-radius: 10px; font-size: 1.2rem; cursor: pointer;
  display: grid; place-items: center;
}

.env-banner {
  background: var(--warning); color: #fff; text-align: center;
  font-size: 0.82rem; font-weight: 600; padding: 4px;
}

main.view {
  padding: 14px;
  padding-block-end: calc(var(--nav-h) + 20px);
  max-width: 760px;
  margin-inline: auto;
}

/* --- ניווט תחתון --- */
.bottom-nav {
  position: fixed;
  inset-block-end: 0; inset-inline: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-block-start: 1px solid var(--border);
  display: flex;
  z-index: 40;
  padding-block-end: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.68rem;
  position: relative;
  text-decoration: none;
}
.bottom-nav a .ico { font-size: 1.35rem; line-height: 1; }
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
.bottom-nav a .nav-badge {
  position: absolute; inset-block-start: 6px; inset-inline-end: calc(50% - 20px);
  background: var(--danger); color: #fff;
  min-width: 18px; height: 18px; border-radius: 9px;
  font-size: 0.66rem; display: grid; place-items: center; padding-inline: 4px;
}

/* --- כרטיסים --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-block-end: 12px;
  box-shadow: var(--shadow);
}
.card.clickable { cursor: pointer; transition: transform .05s; }
.card.clickable:active { transform: scale(0.99); }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.mt { margin-block-start: 12px; }
.mb { margin-block-end: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- כפתורים (גדולים לשטח) --- */
.btn {
  min-height: var(--tap);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: filter .1s, transform .05s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn.accent { background: var(--accent); color: #3a2a05; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: 0.88rem; }
.btn.icon { padding: 0; width: var(--tap); }

.fab {
  position: fixed;
  inset-block-end: calc(var(--nav-h) + 16px);
  inset-inline-end: 16px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: #3a2a05;
  border: none; box-shadow: var(--shadow-lg);
  font-size: 1.9rem; cursor: pointer; z-index: 35;
  display: grid; place-items: center;
}

/* --- טפסים --- */
.field { margin-block-end: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-block-end: 6px; }
.field .hint { font-size: 0.78rem; color: var(--text-muted); margin-block-start: 4px; }
input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,111,217,0.15);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }

/* מקבץ בחירה מהירה (chips) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 22px;
  background: var(--surface); color: var(--text);
  font-size: 0.92rem; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- תגיות סטטוס --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.76rem; font-weight: 600; white-space: nowrap;
}
.badge.status-new { background: #e9f0ff; color: #1656ab; }
.badge.status-scheduled { background: #fff2d9; color: #a56a00; }
.badge.status-in_progress { background: #e2f4ea; color: #1c7a44; }
.badge.status-waiting_part { background: #ffe6e0; color: #b3352b; }
.badge.status-done { background: #e6e9ee; color: #4a5563; }
.badge.status-cancelled { background: #f1f1f1; color: #8a8a8a; }
.badge.pay-open { background: #ffe6e0; color: #b3352b; }
.badge.pay-paid { background: #e2f4ea; color: #1c7a44; }
.badge.warranty { background: #fff2d9; color: #a56a00; }
.badge.warn { background: var(--warning); color: #fff; }
.badge.urgent { background: var(--danger); color: #fff; }

.warranty-alert {
  background: #fff5e0; border: 1px solid #f0d28a; color: #8a5a00;
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.9rem;
  display: flex; gap: 8px; align-items: flex-start; margin-block-end: 12px;
}

/* --- רשימות --- */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-block-end: 1px solid var(--border);
}
.list-item:last-child { border-block-end: none; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.device-ico { font-size: 1.6rem; width: 44px; text-align: center; flex-shrink: 0; }

/* --- כלים לפעולה מהירה בקריאה --- */
.quick-actions { display: flex; gap: 8px; }
.quick-actions .btn { flex: 1; }

/* --- כותרת מסך + חיפוש --- */
.page-head { display: flex; align-items: center; gap: 10px; margin-block-end: 12px; }
.page-head h1 { margin: 0; flex: 1; }
.search-bar { position: relative; margin-block-end: 12px; }
.search-bar input { padding-inline-start: 40px; }
.search-bar .search-ico { position: absolute; inset-inline-start: 12px; inset-block-start: 50%; transform: translateY(-50%); color: var(--text-muted); }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-block-end: 6px; margin-block-end: 8px; -webkit-overflow-scrolling: touch; }
.filter-row .chip { flex-shrink: 0; }

/* --- מודל / דיאלוג --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,22,32,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 60; padding: 0;
}
.modal {
  background: var(--surface);
  width: 100%; max-width: 560px;
  border-start-start-radius: 18px; border-start-end-radius: 18px;
  padding: 18px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .18s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.modal h2 { margin-block-end: 14px; }
.modal-actions { display: flex; gap: 10px; margin-block-start: 16px; }
.modal-actions .btn { flex: 1; }

/* --- Toast --- */
.toast-wrap { position: fixed; inset-block-end: calc(var(--nav-h) + 80px); inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; }
.toast {
  background: #232c38; color: #fff; padding: 11px 18px;
  border-radius: 24px; font-size: 0.92rem; box-shadow: var(--shadow-lg);
  max-width: 90%; text-align: center; animation: slideUp .2s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* --- Loading --- */
.spinner {
  width: 22px; height: 22px; border: 3px solid rgba(255,255,255,0.4);
  border-block-start-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
.spinner.dark { border-color: rgba(30,111,217,0.25); border-block-start-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.55); display: grid; place-items: center; z-index: 90; }

.empty {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.empty .emoji { font-size: 3rem; display: block; margin-block-end: 10px; }

/* --- Auth / Login --- */
.auth-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; gap: 8px;
}
.auth-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 22px; width: 100%; max-width: 380px; }
.auth-card .logo-big { width: 64px; height: 64px; display: block; margin: 0 auto 12px; }
.auth-link { display: block; width: 100%; margin-block-start: 14px; background: none; border: none; color: var(--primary); font-size: .88rem; cursor: pointer; text-align: center; padding: 6px; }

/* --- Onboarding Wizard --- */
.ob-card { max-width: 440px; }
.ob-progress { height: 4px; background: var(--border); border-radius: 2px; margin-block-end: 8px; overflow: hidden; }
.ob-bar { height: 100%; background: var(--primary); border-radius: 2px; transition: width .35s ease; }
.ob-step-label { font-size: .78rem; color: var(--text-muted); text-align: center; margin-block-end: 18px; }
.ob-actions { display: flex; gap: 10px; margin-block-start: 20px; align-items: center; }
.ob-actions #ob-next { flex: 1; }
.ob-actions #ob-finish { flex: 1; }

/* --- פורטל לקוח (call.html) --- */
.portal { max-width: 560px; margin-inline: auto; padding: 16px; }
.portal-head { text-align: center; padding: 20px 0; }
.portal-head img { width: 68px; height: 68px; border-radius: 16px; }
.thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 8px; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.success-screen { text-align: center; padding: 50px 20px; }
.success-screen .big { font-size: 4rem; }

/* --- דוחות --- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-block-end: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; text-align: center;
}
.stat .num { font-size: 1.7rem; font-weight: 800; color: var(--primary); }
.stat .lbl { font-size: 0.8rem; color: var(--text-muted); }

/* --- Utilities --- */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.hidden { display: none !important; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.pdf-link { display: inline-flex; align-items: center; gap: 6px; }

/* --- אווטאר פרופיל ב-header --- */
.header-btn.profile-btn { padding: 0; overflow: hidden; }
.header-avatar { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; display: block; }

/* --- כרטיס ביקור (biz-card) — דף ציבורי + תצוגה במסך פרופיל --- */
.biz-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 22px; text-align: center;
  max-width: 460px; margin-inline: auto;
}
.biz-logo { height: 42px; max-width: 160px; object-fit: contain; margin-block-end: 14px; }
.biz-avatar {
  width: 128px; height: 128px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 14px; display: block;
  border: 4px solid var(--surface); box-shadow: var(--shadow);
}
.biz-avatar.initials {
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 2.6rem; font-weight: 800;
}
.biz-name { font-size: 1.5rem; margin: 0 0 4px; }
.biz-title { color: var(--text-muted); margin-block-end: 6px; }
.biz-phone { font-size: 1.15rem; font-weight: 600; color: var(--text); margin-block-end: 16px; direction: ltr; }
.biz-actions { display: flex; flex-direction: column; gap: 10px; }

/* LTR overrides (מוכנות עתידית — הכיוון נקבע ע"י dir על html) */
html[dir='ltr'] .app-header { text-align: left; }

@media (min-width: 620px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 18px; }
}

/* --- פס טאבים בהגדרות (מובייל: גלילה אופקית, ללא שבירה) --- */
.settings-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 10px;
  margin-block-end: 6px;
  scrollbar-width: thin;
}
.settings-tabs::-webkit-scrollbar { height: 4px; }
.settings-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.settings-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --- באנר "גרסה חדשה זמינה" (מעל הניווט התחתון) --- */
.update-banner {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-size: 0.9rem;
}
.update-banner .btn.sm { flex: 0 0 auto; background: var(--primary); color: #fff; border-color: var(--primary); }
.update-banner .ub-x {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.8;
}

/* --- צ'אט צוות (מובייל-קודם) --- */
.chat-channels {
  display: flex; gap: 6px; padding: 8px 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border-block-end: 1px solid var(--border);
}
.chat-seg {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-muted); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.chat-seg.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-scroll { padding-bottom: 96px; }
.chat-older { padding: 8px 0; }
.chat-msg { display: flex; margin: 6px 10px; }
.chat-msg.own { justify-content: flex-end; }
.chat-msg.other { justify-content: flex-start; }
.chat-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.chat-msg.own .chat-bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-name { font-size: 0.72rem; font-weight: 700; opacity: 0.85; margin-block-end: 2px; }
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-meta { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-block-start: 3px; }
.chat-time { font-size: 0.68rem; opacity: 0.7; }
.chat-bubble.deleted { font-style: italic; opacity: 0.6; }
.chat-bubble.failed { background: #fdecea; color: var(--danger); border-color: var(--danger); }
.chat-bubble.sending { opacity: 0.7; }
.chat-del, .chat-retry {
  background: transparent; border: none; cursor: pointer;
  font-size: 0.72rem; color: inherit; opacity: 0.75; padding: 0;
}
.chat-composer {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 8px; align-items: flex-end;
  padding: 8px 10px;
  background: var(--surface);
  border-block-start: 1px solid var(--border);
  z-index: 900;
}
.chat-composer textarea {
  flex: 1; resize: none;
  border: 1px solid var(--border); border-radius: 18px;
  padding: 9px 14px; font: inherit; line-height: 1.3;
  max-height: 120px;
}
.chat-send {
  flex: 0 0 auto; width: 44px; height: 44px;
  border-radius: 50%; padding: 0; font-size: 1.1rem;
}
.chat-attach {
  flex: 0 0 auto; width: 44px; height: 44px;
  border-radius: 50%; padding: 0; font-size: 1.2rem;
}
.chat-img {
  display: block; max-width: 220px; max-height: 260px;
  border-radius: 10px; margin-block-end: 4px; cursor: pointer; object-fit: cover;
}
.chat-lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.9);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.chat-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ── מאגר ידע ─────────────────────────────────────────── */
.kb-search-wrap { padding: 10px 16px 0; }
.kb-search {
  width: 100%; padding: 9px 14px; border-radius: 22px;
  border: 1px solid var(--border); font: inherit; font-size: .93rem;
  background: var(--surface); color: var(--text);
}
.kb-chips { padding: 8px 12px 0; gap: 7px; flex-wrap: wrap; }
.kb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 14px 100px;
}
.kb-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: box-shadow .15s;
}
.kb-card:hover { box-shadow: var(--shadow-lg); }
.kb-thumb {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover; display: block;
  background: var(--bg);
}
.kb-pdf-ico {
  width: 100%; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; background: var(--bg);
}
.kb-card-body { padding: 8px 10px; }
.kb-card-title {
  font-size: .88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kb-card-sub { font-size: .78rem; margin-block-start: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-block-start: 4px; align-items: center; }
.kb-tag { font-size: .72rem; background: var(--bg); border-radius: 8px; padding: 2px 6px; }
.kb-vis-ico { margin-inline-start: auto; font-size: .8rem; }
.kb-del-btn {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  border: none; font-size: .8rem; cursor: pointer;
  display: grid; place-items: center; z-index: 2;
}
.kb-del-btn:hover { background: var(--danger); }
.kb-empty { grid-column: 1/-1; padding: 48px 16px; text-align: center; }
.kb-empty .emoji { font-size: 2.5rem; display: block; margin-block-end: 10px; }

/* upload modal */
.kb-modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.kb-modal { width: 100%; }
.kb-drop { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.kb-progress-bar {
  height: 6px; border-radius: 3px; background: var(--border); overflow: hidden;
}
.kb-progress-fill { height: 100%; background: var(--primary); transition: width .2s; }

/* fullscreen image viewer */
.kb-viewer-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px;
}
.kb-viewer-close {
  position: absolute; top: 12px; inset-inline-end: 16px;
  background: none; border: none; color: #fff;
  font-size: 1.6rem; cursor: pointer; z-index: 1;
}
.kb-viewer-img { max-width: 100%; max-height: 80vh; border-radius: 10px; object-fit: contain; }
.kb-viewer-caption { color: #fff; text-align: center; margin-block-start: 12px; max-width: 480px; }
