/* ============================================================
   SlidesAgent v2 — Hebrew RTL · Navy/Gold palette
   ============================================================ */

:root {
  --navy:        #0e2a47;
  --navy-dark:   #0a1f35;
  --navy-light:  #1a3d5e;
  --gold:        #c8a24b;
  --gold-hover:  #d4af60;
  --bg:          #eef1f6;
  --panel:       #ffffff;
  --panel-chat:  #f4f6fb;
  --border:      #d3d9e3;
  --text:        #1a2230;
  --text-muted:  #6b7a8d;
  --bubble-user-bg:  #0e2a47;
  --bubble-bot-bg:   #f4f6fb;
  --error-bg:    #fde8e8;
  --error-text:  #9b1c1c;
  --sidebar-w:   260px;
  --toggle-w:    24px;
  --radius:      14px;
  --shadow-sm:   0 1px 4px rgba(14,42,71,.08);
  --shadow-md:   0 4px 16px rgba(14,42,71,.12);
  --transition:  .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Noto Sans Hebrew", Arimo, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  overflow: hidden;
}

/* ── Login overlay ─────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 35, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.overlay.hidden { display: none; }

.login-card {
  background: var(--panel);
  padding: 2.4rem 2rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  width: min(90vw, 360px);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.login-logo { display: flex; justify-content: center; margin-bottom: .2rem; }
.login-card h1 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.02em;
}
.login-card p { color: var(--text-muted); font-size: .9rem; }
.login-card input {
  padding: .65rem .85rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: .95rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
  text-align: right;
}
.login-card input:focus { border-color: var(--navy); }
.login-card button {
  padding: .7rem;
  border-radius: 10px;
  border: 0;
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform .1s;
}
.login-card button:hover { background: var(--navy-light); }
.login-card button:active { transform: scale(.98); }
.error { color: var(--error-text); min-height: 1.2em; font-size: .88rem; }

/* ── Lightbox ──────────────────────────────────────────────── */
#lightbox { flex-direction: column; gap: 1rem; }
#lightbox-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
#lightbox-close:hover { background: rgba(255,255,255,.28); }
#lightbox-img { max-width: 92vw; max-height: 88vh; border-radius: 10px; object-fit: contain; }

/* ── App shell — 3-column grid ─────────────────────────────── */
#app {
  display: grid;
  /* RTL: sidebar (right) | toggle | chat | divider | slides (left) */
  grid-template-columns: var(--sidebar-w) var(--toggle-w) 400px 2px 1fr;
  grid-template-areas: "sidebar toggle chat divider slides";
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns var(--transition);
}
#app.sidebar-collapsed {
  grid-template-columns: 0 var(--toggle-w) 400px 2px 1fr;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: none;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem .7rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.sidebar-title {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.new-session-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .7rem;
  border-radius: 8px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.new-session-btn:hover {
  background: var(--gold);
  color: var(--navy);
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: .4rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.session-item {
  padding: .65rem 1rem;
  cursor: pointer;
  border-radius: 0;
  border-right: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .4rem;
}
.session-item:hover { background: rgba(255,255,255,.07); }
.session-item.active {
  background: rgba(200,162,75,.15);
  border-right-color: var(--gold);
}
.session-item-content {
  flex: 1;
  min-width: 0;
}
.session-item-name {
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.session-item-meta {
  font-size: .76rem;
  color: rgba(255,255,255,.5);
  margin-top: .18rem;
}

/* Delete button in session item */
.session-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.35);
  font-size: .9rem;
  padding: .1rem .2rem;
  border-radius: 4px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
  opacity: 0;
}
.session-item:hover .session-delete-btn { opacity: 1; }
.session-delete-btn:hover {
  color: #ff6b6b;
  background: rgba(255,107,107,.15);
}

/* ── Confirmation modal ─────────────────────────────────────── */
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 35, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.confirm-modal {
  background: var(--panel);
  border-radius: 16px;
  padding: 1.8rem 1.6rem 1.4rem;
  width: min(88vw, 320px);
  box-shadow: var(--shadow-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.confirm-modal p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.5;
}
.confirm-modal-actions {
  display: flex;
  gap: .7rem;
  justify-content: center;
}
.confirm-modal-actions button {
  flex: 1;
  padding: .6rem .8rem;
  border-radius: 9px;
  border: none;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform .1s;
}
.confirm-modal-actions .btn-cancel {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.confirm-modal-actions .btn-cancel:hover { background: var(--border); }
.confirm-modal-actions .btn-delete {
  background: #dc3545;
  color: #fff;
}
.confirm-modal-actions .btn-delete:hover { background: #bb2d3b; }
.confirm-modal-actions button:active { transform: scale(.97); }

/* ── Sidebar toggle button ─────────────────────────────────── */
.sidebar-toggle {
  grid-area: toggle;
  background: var(--navy-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  transition: background var(--transition), color var(--transition);
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
}
.sidebar-toggle:hover {
  background: var(--navy-light);
  color: #fff;
}
#sidebar-toggle-icon {
  transition: transform var(--transition);
}
#app.sidebar-collapsed #sidebar-toggle-icon {
  transform: rotate(180deg);
}

/* ── Chat column ───────────────────────────────────────────── */
.chat-panel {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  overflow: hidden;
  min-width: 0;
}

/* Model + effort selector bar */
.model-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .9rem;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.model-bar-label {
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.model-bar-group {
  display: flex;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  gap: 0;
}
.model-bar-btn {
  padding: .25rem .65rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  border-left: 1px solid var(--border);
}
.model-bar-btn:first-child { border-left: none; }
.model-bar-btn.active {
  background: var(--navy);
  color: #fff;
}
.model-bar-btn:not(.active):hover { background: rgba(14,42,71,.07); color: var(--navy); }

/* Messages list */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Chat bubbles — WhatsApp style */
.bubble {
  padding: .6rem .95rem;
  border-radius: var(--radius);
  max-width: 78%;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: .92rem;
  position: relative;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}

/* User bubble — RIGHT side in RTL (align-self flex-start since dir=rtl, start = right) */
.bubble.user {
  align-self: flex-start;
  background: var(--bubble-user-bg);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble.user::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -6px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 0 8px;
  border-color: transparent transparent transparent var(--bubble-user-bg);
}

/* Bot bubble — LEFT side in RTL (align-self flex-end = left in RTL) */
.bubble.bot {
  align-self: flex-end;
  background: var(--bubble-bot-bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.bubble.bot::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 8px 0 0;
  border-color: transparent var(--bubble-bot-bg) transparent transparent;
}

.bubble.err {
  align-self: flex-end;
  background: var(--error-bg);
  color: var(--error-text);
  border-bottom-left-radius: 4px;
}
.bubble.err::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 8px 0 0;
  border-color: transparent var(--error-bg) transparent transparent;
}

/* Timestamp in bubble */
.bubble-ts {
  display: block;
  font-size: .68rem;
  color: rgba(255,255,255,.5);
  text-align: left;
  margin-top: .2rem;
  line-height: 1;
}
.bubble.bot .bubble-ts,
.bubble.err .bubble-ts {
  color: var(--text-muted);
}

/* File attachment chips inside bubble */
.bubble-files {
  margin-top: .35rem;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}
.bubble-file-chip {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  background: rgba(255,255,255,.18);
  border-radius: 20px;
  padding: .15rem .5rem;
  font-size: .74rem;
  color: rgba(255,255,255,.9);
}
.bubble.bot .bubble-file-chip {
  background: rgba(14,42,71,.1);
  color: var(--navy);
}

/* ── Thinking / typing indicator ───────────────────────────── */
.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: .25rem 0;
}
.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  animation: thinking-bounce 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: .2s; }
.thinking-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes thinking-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40%            { transform: translateY(-6px); opacity: 1; }
}

/* Chat input row */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  padding: .7rem .9rem;
  border-top: 1.5px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
  position: relative;
}

/* Attach button */
.attach-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.attach-btn:hover { background: var(--bg); color: var(--navy); }

/* File chips */
.file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  max-width: 120px;
  flex-shrink: 0;
}
.file-chip {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: rgba(14,42,71,.08);
  border-radius: 20px;
  padding: .2rem .55rem;
  font-size: .75rem;
  color: var(--navy);
  max-width: 100px;
  overflow: hidden;
}
.file-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .8rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.file-chip button:hover { color: var(--error-text); }

/* Textarea */
#message {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: .55rem .75rem;
  font-family: inherit;
  font-size: .93rem;
  line-height: 1.5;
  outline: none;
  min-height: 2.4rem;
  max-height: 9rem;
  overflow-y: auto;
  transition: border-color var(--transition);
  direction: rtl;
}
#message:focus { border-color: var(--navy); }

/* Send button — pill */
.send-btn {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: none;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform .1s;
  box-shadow: 0 2px 8px rgba(14,42,71,.25);
}
.send-btn:hover { background: var(--navy-light); }
.send-btn:active { transform: scale(.92); }

/* ── Column divider ────────────────────────────────────────── */
.col-divider {
  grid-area: divider;
  background: var(--border);
  box-shadow: -2px 0 6px rgba(14,42,71,.06), 2px 0 6px rgba(14,42,71,.06);
}

/* ── Slides panel ──────────────────────────────────────────── */
.slides-panel {
  grid-area: slides;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  min-width: 0;
}

/* Theme bar */
.theme-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  background: var(--panel);
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.theme-cards {
  display: flex;
  gap: .6rem;
  flex-shrink: 0;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  border-radius: 8px;
  padding: .35rem .45rem;
  border: 2px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition), transform .1s;
  background: var(--bg);
  flex-shrink: 0;
}
.theme-card:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.theme-card.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,162,75,.25); }
.theme-card:active { transform: scale(.97); }
.theme-card img {
  width: 80px;
  height: 52px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
  display: block;
  background: #d8dce4;
}
.theme-card-name {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.theme-card.active .theme-card-name { color: var(--navy); }

/* Brand group */
.brand-group {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
  margin-inline-start: auto;
  position: relative;
}

/* Brand upload button */
.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem .85rem;
  border-radius: 8px;
  border: 1.5px solid var(--navy);
  background: transparent;
  color: var(--navy);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.brand-btn:hover {
  background: var(--navy);
  color: #fff;
}

/* Help tooltip — fixed to not overflow */
.help-wrapper {
  position: relative;
  display: inline-flex;
}
.help-btn {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.help-btn:hover, .help-btn:focus { border-color: var(--navy); color: var(--navy); background: rgba(14,42,71,.06); outline: none; }
.help-tooltip {
  display: none;
  position: fixed;
  background: var(--navy);
  color: #fff;
  font-size: .8rem;
  line-height: 1.5;
  padding: .65rem .85rem;
  border-radius: 9px;
  width: 230px;
  max-width: min(230px, 90vw);
  text-align: right;
  box-shadow: var(--shadow-md);
  z-index: 500;
  pointer-events: none;
}
.help-wrapper:hover .help-tooltip,
.help-btn:focus + .help-tooltip,
.help-wrapper.tooltip-open .help-tooltip {
  display: block;
}

/* Slides toolbar */
.slides-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1rem;
  background: var(--panel);
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}

/* View toggle — segmented control */
.view-toggle {
  display: flex;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  padding: 2px;
  gap: 2px;
}
.view-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .32rem .75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.view-btn:hover { color: var(--navy); }
.view-btn.active {
  background: var(--panel);
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(14,42,71,.12);
}

/* Download button */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem 1rem;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy);
  font-family: inherit;
  font-size: .83rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), transform .1s;
  box-shadow: 0 2px 6px rgba(200,162,75,.3);
}
.download-btn:hover { background: var(--gold-hover); }
.download-btn:active { transform: scale(.97); }

/* Slides body */
.slides-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Overview / thumbnail grid */
.thumbs-view {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.thumbs-view.hidden { display: none; }
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .9rem;
}
.thumbs img {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  display: block;
  transition: transform .15s, box-shadow .15s;
}
.thumbs img:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(14,42,71,.14);
}

/* Slideshow mode */
.slideshow-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  overflow: hidden;
}
.slideshow-view.hidden { display: none; }

.slide-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 100%;
  overflow: hidden;
}
.slide-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
}

.slide-nav-btn {
  flex-shrink: 0;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.slide-nav-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.slide-nav-btn:disabled { opacity: .35; cursor: default; }
.slide-nav-btn:disabled:hover { background: var(--panel); color: var(--text-muted); border-color: var(--border); }

.slide-counter {
  text-align: center;
  padding: .4rem 0 .6rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.slide-counter.hidden { display: none; }

/* ── Scrollbar tweaks ───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0b8c8; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  #app {
    grid-template-columns: var(--sidebar-w) var(--toggle-w) 1fr 2px 0 !important;
  }
  .slides-panel { display: none; }
  .col-divider { display: none; }
}
@media (max-width: 640px) {
  #app {
    grid-template-columns: 0 var(--toggle-w) 1fr 0 0 !important;
  }
  .sidebar { display: none; }
  .sidebar-toggle { display: none; }
}
