/* ===== יסוד — מערכת עיצוב (שלב 0) ===== */
* { box-sizing: border-box; }
:root {
  --blue: #0F2A4A; --blue-dark: #0A1F38;
  --orange: #F07A24; --orange-dark: #D4640D;
  --bg: #F7F7F5; --card: #FFFFFF;
  --ink: #0F2A4A; --muted: #52677D;
  --line: #D8E0E8;
  --success: #0E9F6E; --warning: #D97706; --danger: #DC2626;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(13, 43, 77, 0.10);
}
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: "Rubik", "Heebo", Arial, sans-serif;
  font-size: 15.5px;
}
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; right: -9999px; top: 0; background: var(--blue); color: #fff; padding: 10px 18px; z-index: 999; }
.skip-link:focus { right: 0; }

/* ----- סרגל עליון ----- */
.topbar {
  background: var(--blue);
  color: #fff; padding: 10px 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: #fff; text-decoration: none; }
.brand-lockup img { display: block; }
.brand-lockup .dot { color: var(--orange); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tab {
  background: rgba(255,255,255,.10); color: #fff; border: none;
  padding: 8px 15px; border-radius: 9px; cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 500;
}
.tab:hover { background: rgba(255,255,255,.22); }
.tab.active { background: #fff; color: var(--blue); font-weight: 700; }
.user-box { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.user-box img { width: 30px; height: 30px; border-radius: 50%; background: #fff; }
.linkbtn { background: none; border: none; color: #cdd9ea; cursor: pointer; font-family: inherit; font-size: 13px; text-decoration: underline; }
.linkbtn:hover { color: #fff; }

/* פס ניסיון / נעילה */
.trial-chip {
  background: var(--orange); color: #fff; font-weight: 700; font-size: 12.5px;
  border-radius: 20px; padding: 4px 13px; white-space: nowrap;
}
.lock-banner {
  background: #FDEBEB; color: var(--danger); border-bottom: 1px solid #f3b8b8;
  padding: 10px 20px; text-align: center; font-weight: 600; font-size: 14.5px;
}

/* ----- מבנה ----- */
.tab-panel { max-width: 1280px; margin: 18px auto; padding: 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
h2 { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
h3 { margin: 18px 0 8px; font-size: 16px; color: var(--blue); }
.hint { color: var(--muted); font-size: 12.5px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
/* שדות וכרטיסים לא גולשים מחוץ לאזור שלהם */
input, select, textarea { max-width: 100%; }
.card { min-width: 0; }
.grid-2 label input, .grid-2 label select,
.grid-4 label input, .grid-4 label select { width: 100%; min-width: 0; }

/* ----- ניווט ראשי מקובץ + תת-טאבים ----- */
.gtab {
  background: rgba(255,255,255,.10); color: #fff; border: none;
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 500;
  white-space: nowrap;
}
.gtab:hover { background: rgba(255,255,255,.22); }
.gtab.active { background: #fff; color: var(--blue); font-weight: 700; }
.subnav {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 7px 20px; display: flex; gap: 6px; flex-wrap: wrap;
  position: sticky; top: 54px; z-index: 45;
}
.subnav .tab { background: #EEF2F7; color: var(--muted); font-weight: 600; padding: 6px 14px; }
.subnav .tab:hover { background: #E0E7F0; color: var(--ink); }
.subnav .tab.active { background: var(--orange); color: #fff; }
.subnav[data-single="1"] { display: none; }
.block-label { margin: 12px 0; }
input, select, textarea {
  font-family: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  background: #fbfcfe; min-height: 22px;
}
/* 16px מונע זום אוטומטי של iOS Safari בעת מיקוד בשדה */
input:focus, select:focus, textarea:focus { outline: 3px solid #f9c9a2; border-color: var(--orange); }
.mini-input { width: 64px; padding: 5px 6px; text-align: center; }
.search-box { min-width: 240px; }

/* ----- כפתורים ----- */
.btn {
  border: none; border-radius: 10px; padding: 11px 20px; min-height: 44px;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); }

/* ---------- חשבון נעול (תום ניסיון): מטשטשים מידע ששווה כסף, לא מסתירים ---------- */
/* טאבים ששווים כסף/תשובות — נראים אך המידע מטושטש: מחירון, הצעה, מדריך רווח, בנק, כלים, דוחות */
body.is-locked #tab-quote,
body.is-locked #tab-pricelist,
body.is-locked #tab-guide,
body.is-locked #tab-bank,
body.is-locked #tab-tools,
body.is-locked #tab-reports { filter: blur(6px); user-select: none; }
/* טשטוש נקודתי (למשל תיאור ליקוי ותמונה שהלקוח העלה) */
body.is-locked .lock-blur { filter: blur(6px); user-select: none; }
/* כל כפתור פעולה כתום מעומעם ומוביל לתשלום (חוץ מכפתורי המנוי/קופון/תשלום) */
body.is-locked .btn.primary:not(.lock-allow) {
  opacity: .5; filter: grayscale(.35); box-shadow: none;
}
body.is-locked .btn.primary:not(.lock-allow)::after {
  content: '🔒'; font-size: .85em; margin-inline-start: 5px;
}
.btn.blue { background: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-dark); }
.btn.secondary { background: #E5EBF3; color: var(--blue); }
.btn.secondary:hover { background: #d5deeb; }
.btn.danger-outline { background: #fff; color: var(--danger); border: 1px solid #f3b8b8; }
.btn.danger-outline:hover { background: #fef2f2; }
.btn.tiny { padding: 4px 10px; font-size: 12.5px; min-height: 30px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

/* ----- פריסת הצעה ----- */
.quote-layout { display: grid; grid-template-columns: 1fr 330px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .quote-layout { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 70px; }

/* ----- פרקים וטבלאות (מודול הצעות) ----- */
.chapter { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.chapter-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #EEF2F7; padding: 10px 14px; cursor: pointer; user-select: none;
}
.chapter-head:hover { background: #E4EAF2; }
.chapter-title { font-weight: 700; font-size: 15px; flex: 1; }
.chapter-profit { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.chapter-sum { font-size: 13px; font-weight: 700; color: var(--success); min-width: 90px; text-align: left; }
.chapter-badge { background: var(--orange); color: #fff; border-radius: 20px; font-size: 11.5px; padding: 2px 9px; font-weight: 700; }
.chapter-note { padding: 8px 14px; background: #FFF7EC; border-bottom: 1px solid #F5DFC2; font-size: 12.5px; color: #8a5a17; }
.chapter-body { padding: 4px 0; overflow-x: auto; }
.price-insight { font-size: 11.5px; margin-top: 3px; line-height: 1.4; padding: 2px 7px; border-radius: 6px; display: inline-block; }
.price-insight.lvl-ok { background: #E6F7F1; color: #12805c; }
.price-insight.lvl-low { background: #FDEBEB; color: #C0392B; }
.price-insight.lvl-high { background: #FFF3E4; color: #9A6A00; }
.use-median { border: none; background: rgba(0,0,0,.09); border-radius: 5px; padding: 1px 7px; font-size: 11px; cursor: pointer; font-family: inherit; margin-inline-start: 4px; font-weight: 600; }
.use-median:hover { background: rgba(0,0,0,.17); }
table.items { width: 100%; border-collapse: collapse; }
table.items th { text-align: right; font-size: 12px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
table.items td { padding: 5px 10px; border-bottom: 1px solid #EFF2F6; font-size: 13.5px; }
table.items tr:last-child td { border-bottom: none; }
table.items tr.has-qty { background: #F0F9F4; }
td.money, th.money { text-align: left; direction: ltr; white-space: nowrap; }
td.total-cell { font-weight: 700; color: var(--blue); }
input.qty { width: 72px; padding: 5px 6px; text-align: center; font-weight: 600; }
input.line-profit { width: 60px; padding: 4px; text-align: center; }
input.line-cost { width: 84px; padding: 4px; text-align: center; }

/* ----- סיכום ----- */
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table td { padding: 7px 2px; font-size: 14px; }
.summary-table td:last-child { text-align: left; direction: ltr; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-table tr.sep td { border-top: 1px solid var(--line); }
.summary-table tr.total td { border-top: 2px solid var(--ink); font-size: 17px; font-weight: 800; padding-top: 10px; }
.profit-meter { margin-top: 14px; }
.meter { height: 9px; background: #E9EDF3; border-radius: 6px; margin: 6px 0; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--success); border-radius: 6px; transition: width .25s, background .25s; }

/* ----- ניהול מחירון ----- */
.bulk-update { background: #EEF2F7; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 12px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-chapter { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.pl-chapter-head { background: #EEF2F7; padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pl-chapter-head input.ch-name { flex: 1; min-width: 220px; font-weight: 700; }
.pl-note-row { padding: 6px 14px; background: #FFF7EC; }
.pl-note-row input { width: 100%; font-size: 12.5px; }
table.pl-items { width: 100%; border-collapse: collapse; }
table.pl-items td { padding: 4px 10px; border-bottom: 1px solid #EFF2F6; }
table.pl-items input.it-name { width: 100%; }
table.pl-items input.it-unit { width: 64px; text-align: center; }
table.pl-items input.it-cost { width: 90px; text-align: center; }

/* ----- רשימות ----- */
.quote-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.quote-row .q-num { font-weight: 700; color: var(--blue); min-width: 80px; }
.quote-row .q-name { flex: 1; min-width: 150px; }
.quote-row .q-total { font-weight: 700; direction: ltr; }

/* ----- מדריך ----- */
.guide p, .guide li { line-height: 1.65; }
.guide-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.guide-table th, .guide-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: right; font-size: 13.5px; }
.guide-table th { background: #EEF2F7; }

/* ----- מודאל ----- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; background: rgba(10,31,56,.6); display: flex; align-items: flex-start; justify-content: center; padding: 24px; z-index: 100; overflow: auto; }
.modal-box { background: #fff; border-radius: 14px; max-width: 860px; width: 100%; overflow: hidden; }
.modal-toolbar { padding: 10px 16px; background: #EEF2F7; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; top: 0; }
.preview-content { padding: 30px 40px; }

/* ===== דפי כניסה / אונבורדינג / משפטי ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 40px 36px; max-width: 460px; width: 100%; text-align: center; }
.auth-card.wide { max-width: 720px; text-align: right; }
.auth-card h1 { font-size: 24px; font-weight: 800; margin: 14px 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 14.5px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 13px;
  font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.google-btn:hover { border-color: var(--blue); background: #F7FAFF; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.legal-scroll { border: 1px solid var(--line); border-radius: 10px; background: #FBFCFE; padding: 18px; max-height: 46vh; overflow: auto; text-align: right; font-size: 14px; line-height: 1.7; }
.legal-scroll h1 { font-size: 18px; } .legal-scroll h2 { font-size: 15px; margin-top: 16px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; text-align: right; font-size: 14.5px; flex-direction: row; }
.check-row input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--orange); flex-shrink: 0; }

/* ===== לנדינג ===== */
.landing-hero { background: var(--blue); color: #fff; padding: 70px 24px 80px; text-align: center; }
.landing-hero img.logo { margin-bottom: 26px; }
.landing-hero h1 { font-size: clamp(26px, 4.5vw, 44px); font-weight: 800; margin: 0 0 12px; }
.landing-hero h1 .orange { color: var(--orange); }
.landing-hero p { color: #C6D2E2; font-size: clamp(15px, 2vw, 19px); max-width: 640px; margin: 0 auto 30px; line-height: 1.6; }
.landing-features { max-width: 1100px; margin: -40px auto 40px; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.feature-card .ico { font-size: 28px; margin-bottom: 8px; }
.feature-card b { display: block; margin-bottom: 6px; font-size: 16px; }
.feature-card span { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.landing-footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 20px 60px; }
.landing-footer a { margin: 0 8px; }

/* ===== באנר קוקיז ===== */
.cookie-banner {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 200;
  background: var(--blue); color: #fff; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
  font-size: 13.5px; box-shadow: 0 -4px 16px rgba(0,0,0,.25);
}
.cookie-banner a { color: #F9C9A2; }

/* ===== מסמך הצעה (תצוגה+הדפסה) ===== */
.qdoc { font-size: 13px; color: #111; }
.qdoc-header { display: flex; justify-content: space-between; border-bottom: 3px solid var(--orange); padding-bottom: 12px; margin-bottom: 14px; }
.qdoc-business h1 { margin: 0 0 4px; font-size: 22px; color: var(--blue); }
.qdoc-business div { font-size: 12.5px; color: #444; line-height: 1.5; }
.qdoc-meta { text-align: left; font-size: 12.5px; line-height: 1.7; }
.qdoc-meta .q-number { font-size: 16px; font-weight: 800; color: var(--blue); }
.qdoc-customer { background: #F3F5F9; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.7; }
table.qdoc-table { width: 100%; border-collapse: collapse; margin-bottom: 4px; table-layout: fixed; }
table.qdoc-table td { overflow-wrap: break-word; }
@media (max-width: 480px) {
  table.qdoc-table th, table.qdoc-table td { padding: 5px 4px; font-size: 11px; }
  table.qdoc-table td.money { white-space: normal; }
  .qdoc-totals { width: 100%; }
  .qdoc-header { flex-direction: column; gap: 8px; }
  .qdoc-meta { text-align: right; }
}
table.qdoc-table th { background: var(--blue); color: #fff; padding: 7px 9px; font-size: 12px; text-align: right; }
table.qdoc-table th.money { text-align: left; }
table.qdoc-table td { border-bottom: 1px solid #dfe3ec; padding: 6px 9px; font-size: 12.5px; }
table.qdoc-table td.money { text-align: left; direction: ltr; white-space: nowrap; }
table.qdoc-table tr.q-chapter td { background: #E7EDF5; font-weight: 800; color: var(--blue); font-size: 13px; border-top: 2px solid #c6d2ee; }
table.qdoc-table tr.q-chapter-sum td { font-weight: 700; background: #F6F8FB; }
.qdoc-totals { width: 320px; max-width: 100%; margin-inline-start: auto; border-collapse: collapse; margin-top: 10px; }
.qdoc-totals td { padding: 5px 8px; font-size: 13px; }
.qdoc-totals td:last-child { text-align: left; direction: ltr; font-weight: 600; }
.qdoc-totals tr.grand td { border-top: 2px solid #111; font-size: 16px; font-weight: 800; padding-top: 8px; }
.qdoc-terms { margin-top: 18px; font-size: 11.5px; color: #333; white-space: pre-line; border-top: 1px solid #ccc; padding-top: 10px; line-height: 1.6; }
.qdoc-sign { display: flex; justify-content: space-between; margin-top: 34px; font-size: 13px; }
.qdoc-sign .sig { border-top: 1px solid #555; padding-top: 5px; width: 220px; text-align: center; }

/* ===== הדפסה ===== */
.print-only { display: none; }
@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
  @page { size: A4; margin: 14mm 12mm; }
  table.qdoc-table tr { page-break-inside: avoid; }
  .qdoc-terms { page-break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ----- תפריט המבורגר (מובייל) ----- */
#hamburger { display: none; background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 9px; padding: 8px 13px; font-size: 19px; cursor: pointer; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(10,31,56,.55); z-index: 190; }
.drawer-overlay[hidden] { display: none; }
#navDrawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: -290px; width: 280px; z-index: 200;
  background: var(--blue); color: #fff; overflow-y: auto; padding: 16px 12px 30px;
  transition: inset-inline-start .22s ease; box-shadow: 4px 0 20px rgba(0,0,0,.3);
}
#navDrawer.open { inset-inline-start: 0; }
#navDrawer .dw-group {
  font-weight: 800; font-size: 15.5px; padding: 13px 10px; color: #F9C9A2; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; border-radius: 9px; margin-top: 2px;
}
#navDrawer .dw-group:hover { background: rgba(255,255,255,.06); }
#navDrawer .dw-caret { font-size: 12px; opacity: .7; }
#navDrawer .dw-tabs[hidden] { display: none; }
#navDrawer .dw-tab {
  display: block; width: 100%; text-align: right; background: none; border: none; color: #fff;
  font-family: inherit; font-size: 15px; padding: 10px 26px; border-radius: 9px; cursor: pointer;
}
#navDrawer .dw-tab.active { background: var(--orange); font-weight: 700; }

/* ===== התאמה מלאה למובייל ===== */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar { padding: 8px 10px; gap: 8px; }
  .brand-lockup { font-size: 17px; }
  /* במובייל: המבורגר במקום סרגלי הניווט */
  #hamburger { display: block; }
  #groupNav { display: none; }
  .subnav { display: none !important; }
  .user-box span { display: none; }             /* שם משתמש מוסתר בקטן */
  #globalSearch { width: 105px; }
  .tab-panel { padding: 0 8px; margin: 10px auto; }
  .card { padding: 13px 12px; }
  /* טבלאות רחבות נגללות בתוך הכרטיס */
  .card { overflow-x: auto; }
  .sticky { position: static; }                  /* סיכום ההצעה לא נדבק במובייל */
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .quote-layout { grid-template-columns: 1fr; }
  .modal { padding: 8px; }
  .preview-content { padding: 14px 12px; }
  .btn { min-height: 46px; }                     /* אצבעות בשטח */
  .btn.tiny { min-height: 40px; padding: 8px 12px; }  /* גם כפתורים קטנים ניתנים ללחיצה נוחה */
  .linkbtn { min-height: 40px; display: inline-flex; align-items: center; }
  input, select { min-height: 42px; font-size: 16px; }
  .landing-hero { padding: 40px 16px 50px; }
  #globalSearch { font-size: 16px; }
  /* יומן חודשי קטן ומותאם — בלי גלילה אופקית */
  .cal-grid { min-width: 0 !important; grid-template-columns: repeat(7, 1fr) !important; gap: 2px !important; }
  .cal-day { min-height: 50px !important; font-size: 9px !important; padding: 3px 2px !important; }
  .cal-day b { font-size: 11px !important; }
  /* הצעה חדשה: הטבלה נגללת בתוך הפרק, ומסתירים עמודות פחות קריטיות כדי שתתאים */
  #chaptersArea table.items { font-size: 12.5px; }
  #chaptersArea table.items th, #chaptersArea table.items td { padding: 5px 5px; }
  #chaptersArea table.items th:first-child, #chaptersArea table.items td:first-child,
  #chaptersArea table.items th:nth-child(3), #chaptersArea table.items td:nth-child(3) { display: none; }
  #chaptersArea .items input { width: 58px !important; min-width: 0; padding: 6px 4px; }
  .chapter-head { padding: 10px 10px; gap: 8px; }
  .chapter-title { font-size: 14px; }
}

/* ===== עורך כרטיס ביקור דיגיטלי ===== */
#tab-card .card-editor-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) {
  #tab-card .card-editor-grid { grid-template-columns: 1fr; }
  #tab-card .card-preview-col { position: static !important; order: -1; }
}
