/* ============================================================
   Vidara — App styles (Envoy light treatment)

   Built from the "Vidara App Screens" design bundle.
   Design tokens live in /styles/tokens.css and define the
   --envoy-red, --carbon-*, --gem-*, --fg-*, --bg-* CSS vars
   used throughout this file.

   This file replaces the previous OmniSlides dark theme entirely.
   Legacy class names from the existing markup are kept as aliases
   in the "Legacy aliases" section near the bottom so the existing
   /pages/index.js + /public/app.js wiring continues to work.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--arctic);
  color: var(--fg-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.hidden { display: none !important; }

/* Prevent a second (body) scrollbar while the landing overlay is shown.
   The .auth-screen.landing element is position:fixed + overflow-y:auto so it
   handles its own scroll; the post-auth markup beneath it would otherwise
   make <body> tall enough to show its own scrollbar at the same time. */
body:has(.auth-screen.landing:not(.hidden)) {
  overflow: hidden;
}

/* ============================================================
   Auth screen — simple sign-in card on Envoy arctic background
   ============================================================ */
.auth-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--arctic);
}
.auth-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  max-width: 400px;
  width: calc(100% - 32px);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: var(--fw-bold);
  color: var(--fg-1);
  letter-spacing: -0.01em;
}
.auth-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--envoy-red);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px -3px rgba(250, 67, 56, 0.45);
}
.auth-description {
  color: var(--fg-3);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.auth-description strong { color: var(--fg-1); font-weight: var(--fw-semibold); }
.google-signin-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  background: #fff; color: var(--fg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 22px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.google-signin-btn:hover:not(:disabled) {
  background: var(--arctic);
  border-color: var(--carbon-30);
}
.google-signin-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-error {
  background: rgba(160, 12, 31, 0.08);
  color: var(--garnet-70);
  font-size: 13px;
  font-weight: var(--fw-medium);
  padding: 8px 12px;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  margin: 0;
}

/* ============================================================
   App frame — sidebar (232px) + page content
   ============================================================ */
.sidebar, .app-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  width: 232px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.page-content {
  margin-left: 232px;
  min-height: 100vh;
  background: var(--arctic);
}
.page-content > .main,
.page-content > #app-content > .main {
  padding: 40px 56px 56px;
}

/* ----- Sidebar top (brand) ----- */
.sidebar-top, .app-sb-top {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 18px 20px;
  border-bottom: 1px solid var(--border);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
}
.logo-icon, .app-brand-mark {
  width: 28px; height: 28px;
  background: var(--envoy-red);
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px -1px rgba(250, 67, 56, 0.4);
  flex-shrink: 0;
}
.logo-text, .app-brand-word {
  font-size: 17px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  letter-spacing: -0.01em;
}

/* ----- Sidebar nav ----- */
.sidebar-nav, .app-sb-nav {
  display: flex; flex-direction: column;
  padding: 12px 10px;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
/* Secondary nav (Settings, How To) pinned just above the user chip. Read
   as supporting / utility links — smaller font, muted color, tighter
   padding, no heavy divider — so they don't compete with the primary
   navigation for visual weight. Linear / Notion / Vercel all use this kind
   of subdued footer treatment for settings + help items. */
.sidebar-nav--secondary {
  flex: 0 0 auto;
  padding: 6px 10px 10px;
  gap: 0;
}
.sidebar-nav--secondary .sidebar-nav-item {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--fg-3);
}
.sidebar-nav--secondary .sidebar-nav-item:hover {
  background: var(--arctic);
  color: var(--fg-2);
}
.sidebar-nav--secondary .sidebar-nav-item > svg {
  width: 15px;
  height: 15px;
  color: var(--fg-3);
}
.sidebar-nav--secondary .sidebar-nav-item:hover > svg { color: var(--fg-2); }
/* Active state is still the red pill, but slightly less prominent so it
   matches the subdued type weight. */
.sidebar-nav--secondary .sidebar-nav-item.active,
.sidebar-nav--secondary .sidebar-nav-item.is-active {
  background: rgba(250, 67, 56, 0.08);
}

/* Section header inside the sidebar nav — small uppercase label that groups
   the items below it (Overview / Create / Library / Support). */
.sidebar-section-label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 14px 12px 6px;
  user-select: none;
}
.sidebar-section-label:first-child { padding-top: 4px; }
.sidebar-nav-item, .app-sb-item {
  display: flex; align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: var(--fw-medium);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav-item:hover, .app-sb-item:hover {
  background: var(--arctic);
  color: var(--fg-1);
}
.sidebar-nav-item.active,
.sidebar-nav-item.is-active,
.app-sb-item.is-active {
  background: rgba(250, 67, 56, 0.1);
  color: var(--envoy-red);
  font-weight: var(--fw-semibold);
}
.sidebar-nav-item.active:hover,
.sidebar-nav-item.is-active:hover,
.app-sb-item.is-active:hover {
  background: rgba(250, 67, 56, 0.14);
  color: var(--envoy-red);
}
.sidebar-nav-item > svg,
.app-sb-item > .app-sb-icon { color: var(--fg-3); flex-shrink: 0; }
.sidebar-nav-item.active > svg,
.sidebar-nav-item.is-active > svg,
.app-sb-item.is-active > .app-sb-icon { color: var(--envoy-red); }
.sidebar-nav-label, .app-sb-label { flex: 1; }
.nav-chevron, .app-sb-trail {
  color: var(--fg-3);
  display: inline-flex;
  flex: 0 0 auto;        /* don't stretch — the label has flex:1; the chevron must stay its natural size */
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}
.nav-expandable.open .nav-chevron,
.app-sb-expand.open .app-sb-trail { transform: rotate(180deg); }

/* Suppress the default browser focus outline on sidebar links; use a subtle
   focus-visible ring instead so keyboard users still get feedback. */
.sidebar-nav-item:focus,
.nav-sub-item:focus,
.app-sb-item:focus,
.app-sb-sub:focus { outline: none; }
.sidebar-nav-item:focus-visible,
.nav-sub-item:focus-visible,
.app-sb-item:focus-visible,
.app-sb-sub:focus-visible {
  outline: 2px solid rgba(250, 67, 56, 0.4);
  outline-offset: 1px;
}

/* Sub-panel under "Generate Slides" */
.nav-sub-panel, .app-sb-subpanel {
  padding: 2px 0 4px 36px;
  display: flex; flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease;
}
.nav-expandable.open .nav-sub-panel,
.app-sb-expand.open .app-sb-subpanel { max-height: 200px; }
.nav-sub-item, .app-sb-sub {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--fg-3);
  font-size: 13px;
  font-weight: var(--fw-medium);
  text-decoration: none;
  cursor: pointer;
}
.nav-sub-item:hover, .app-sb-sub:hover {
  background: var(--arctic);
  color: var(--fg-1);
}
.nav-sub-item.active,
.nav-sub-item.is-active { color: var(--envoy-red); font-weight: var(--fw-semibold); }

/* ----- Sidebar bottom (user chip) ----- */
.sidebar-bottom, .app-sb-bottom {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
}
.user-chip.hidden { display: none; }
.user-avatar, .app-sb-avatar {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFE4EC 0%, #FFCCDB 100%);
  color: #BE185D;
  font-size: 12px; font-weight: var(--fw-bold);
  display: inline-flex; align-items: center; justify-content: center;
  object-fit: cover;
  flex-shrink: 0;
}
.user-chip-info, .app-sb-userinfo {
  display: flex; flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.user-email, .app-sb-email {
  font-size: 12px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sign-out-btn, .app-sb-signout {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--fg-1);
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-align: left;
}
.sign-out-btn:hover, .app-sb-signout:hover { color: var(--envoy-red); }

/* ============================================================
   Home screen (Post-auth)
   ============================================================ */
.home-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 56px 56px;
}
.home-screen.hidden { display: none; }
.home-inner {
  max-width: 880px;
  display: flex; flex-direction: column;
  gap: 32px;        /* tighter than 48px since we now have more sections */
  width: 100%;
}

/* Personalized greeting at the top of the post-auth home */
.home-greeting { display: flex; flex-direction: column; gap: 6px; }
.home-greeting-title {
  font-size: 32px;
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 0;
  line-height: 1.1;
}
.home-greeting-title #home-greeting-name { color: var(--envoy-red); }
.home-greeting-sub {
  font-size: 15px;
  color: var(--fg-3);
  margin: 0;
  line-height: 1.5;
}

/* Two-column grid for Recent Queries + Saved Configurations */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.home-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.home-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.home-panel-titlebar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-1);
}
.home-panel-icon { color: var(--envoy-red); flex-shrink: 0; }
.home-panel-title {
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0;
}
.home-panel-link {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.home-panel-link:hover { color: var(--envoy-red); }
.home-panel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -8px;   /* negative margin so list items can have hover padding without breaking alignment */
  min-height: 130px;  /* keeps both panels the same height when one is empty */
}
.home-panel-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
  gap: 6px;
}
.home-panel-empty-text {
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--fg-3);
  margin: 0;
}
.home-panel-empty-sub {
  font-size: 12px;
  color: var(--fg-3);
  margin: 0;
  line-height: 1.5;
}
.home-panel-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  color: var(--envoy-red);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.home-panel-empty-cta:hover { text-decoration: underline; }

.home-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, transform 0.15s;
  min-width: 0;
}
.home-list-item:hover {
  background: var(--arctic);
  transform: translateX(2px);
}
.home-list-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-1);
  color: var(--gem-60);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-list-item:hover .home-list-icon {
  background: rgba(78, 78, 218, 0.1);
  color: var(--gem-70);
}
.home-list-body { flex: 1; min-width: 0; }
.home-list-title {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-list-meta {
  font-size: 11px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-list-time {
  font-size: 11px;
  color: var(--fg-3);
  font-weight: var(--fw-medium);
  flex-shrink: 0;
  white-space: nowrap;
}
.home-list-item:hover .home-list-time { color: var(--envoy-red); }

@media (max-width: 720px) {
  .home-grid { grid-template-columns: 1fr; }
}
.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}
.home-hero-text { flex: 1; min-width: 0; }
.home-title {
  font-size: 52px;
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  line-height: 1.04;
  color: var(--fg-1);
  margin: 0 0 18px;
}
.home-subtitle, .home-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0;
  max-width: 380px;
}

/* Mini flow visual (Omni → Slides) */
.home-visual, .mfv {
  display: flex; align-items: center; gap: 14px;
  color: var(--envoy-red);
}
.hv-dashboard, .mfv-dash,
.hv-slides, .mfv-slides {
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.hv-dash-label, .hv-slides-label, .mfv-label {
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hv-tiles, .mfv-tiles {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 172px;
}
.hv-tile, .mfv-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  height: 70px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xs);
}
.hv-tile svg, .mfv-tile svg { width: 100%; height: auto; }
.hv-tile-kpi, .mfv-tile.mfv-kpi {
  flex-direction: column;
  gap: 3px;
}
.hv-kpi-num, .mfv-kpi-n {
  font-size: 16px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  line-height: 1;
}
.hv-kpi-label, .mfv-kpi-l {
  font-size: 9px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.hv-arrow, .mfv-arrow { color: var(--envoy-red); }
.hv-arrow svg, .mfv-arrow svg { width: 44px; height: 22px; }
.hv-slide-stack, .mfv-stack {
  position: relative;
  width: 148px;
  height: 108px;
}
.hv-slide, .mfv-slide {
  position: absolute;
  border-radius: 6px;
  width: 124px; height: 84px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.hv-slide-1, .mfv-s1 {
  top: 0; left: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
}
.hv-slide-1 svg, .mfv-s1 svg { width: 100%; height: auto; }
.hv-slide-2, .mfv-s2 { top: 10px; left: 12px; z-index: 2; background: #FAFAFC; }
.hv-slide-3, .mfv-s3 { top: 20px; left: 24px; z-index: 1; background: #F4F4F7; }
.hv-slide-chart { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* Action cards */
.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.home-action-card, .home-card {
  display: flex; align-items: center; gap: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  text-decoration: none;
  color: var(--fg-1);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}
.home-action-card:hover, .home-card:hover {
  border-color: rgba(250, 67, 56, 0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.home-action-icon, .home-card-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  background: rgba(250, 67, 56, 0.1);
  color: var(--envoy-red);
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.home-action-card:first-child .home-action-icon,
.home-card.is-primary .home-card-icon {
  background: var(--envoy-red);
  color: #fff;
}
.home-action-body, .home-card-body { flex: 1; min-width: 0; }
.home-action-title, .home-card-t {
  font-size: 15px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 4px;
}
.home-action-desc, .home-card-d {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.5;
  margin: 0;
}
.home-action-arrow, .home-card-arrow {
  color: var(--fg-3);
  transition: transform 0.15s, color 0.15s;
  flex-shrink: 0;
}
.home-action-card:hover .home-action-arrow,
.home-card:hover .home-card-arrow {
  color: var(--envoy-red);
  transform: translateX(3px);
}

.home-howto-hint, .home-hint {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px;
  color: var(--fg-3);
}
.home-howto-link, .home-hint-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--envoy-red);
  text-decoration: none;
  font-weight: var(--fw-semibold);
}
.home-howto-link:hover, .home-hint-link:hover { text-decoration: underline; }

/* ============================================================
   Page header (shared across Generate Slides flow & others)
   ============================================================ */
.main {
  width: 100%;
  max-width: 1100px;
}
.templates-header, .page-head {
  max-width: 960px;
  margin-bottom: 28px;
}
.templates-title, .page-title, .flow-page-title, #flow-page-title {
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.templates-subtitle, .page-sub, #flow-page-subtitle {
  font-size: 15px;
  color: var(--fg-3);
  margin: 0;
  line-height: 1.5;
}

/* ─── Slide Templates screen ──────────────────────────────────────────────
   Tabs + sectioned grids of slide thumbnails. The JS in loadTemplatesScreen
   renders `.tmpl-entry > .tmpl-item > .tmpl-thumb > <img>` with a `.tmpl-label`
   sibling, plus `.tmpl-section-header` / `.tmpl-section-grid` wrappers. None
   of these had any CSS, so the page was rendering as raw stacked HTML. */
.templates-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--arctic);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 24px;
}
.templates-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.templates-tab:hover { color: var(--fg-1); }
.templates-tab.active {
  background: #fff;
  color: var(--envoy-red);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.templates-grid { max-width: 1100px; }
.templates-grid.hidden { display: none; }

.tmpl-section-header {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.tmpl-section-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px 14px;
  margin-bottom: 28px;
}
.tmpl-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.tmpl-item {
  width: 100%;
}
.tmpl-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tmpl-thumb:hover {
  border-color: var(--carbon-30);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}
.tmpl-thumb > img {
  display: block;
  width: 100%;
  height: 100%;
  /* `contain` keeps the slide aspect ratio intact rather than upscaling +
     cropping to fill, which is what was producing the soft/blurry edges on
     the smaller-source thumbnails. */
  object-fit: contain;
  background: #fff;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
/* Layout mockup thumbnails (the wireframe SVGs for Full / Text|Chart / Chart|Text).
   These render in monochrome on the arctic background. */
.tmpl-thumb-layout {
  background: #fff;
  color: var(--fg-2);
  padding: 12px;
}
.tmpl-thumb-layout > svg {
  width: 100%;
  height: 100%;
  display: block;
}
.tmpl-label {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tmpl-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--fg-3);
}
.tmpl-error {
  padding: 24px;
  text-align: center;
  color: var(--garnet-70);
  background: rgba(160, 12, 31, 0.04);
  border: 1px solid rgba(160, 12, 31, 0.2);
  border-radius: var(--radius);
}

/* ─── Slide Templates header (title + Import button) ──────────────────────── */
.templates-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1100px;
}
.templates-header-row > div:first-child { min-width: 0; }
.templates-header-row .primary-btn {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: flex-start;
}

/* User-imported template entry — shows a small "×" remove button overlaid on
   the thumbnail so the user can prune their custom set. */
.tmpl-entry--imported .tmpl-item { position: relative; }
.tmpl-entry-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(31, 35, 45, 0.7);
  border: 0;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.tmpl-entry--imported:hover .tmpl-entry-remove { opacity: 1; }
.tmpl-entry-remove:hover { background: var(--envoy-red); }

/* ─── Classify modal (Title/Body chooser for each imported slide) ─────────── */
.modal.modal-wide { max-width: 720px; width: 100%; }
.tmpl-classify-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tmpl-classify-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tmpl-classify-thumb {
  width: 120px;
  aspect-ratio: 16 / 9;
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tmpl-classify-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.tmpl-classify-name {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.tmpl-classify-toggle {
  display: inline-flex;
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}
.tmpl-classify-opt {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tmpl-classify-opt:hover { color: var(--fg-1); }
.tmpl-classify-opt.active {
  background: #fff;
  color: var(--envoy-red);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
/* The "Exclude" pill is destructive — when active, use a muted grey
   treatment to make it visually distinct from the Title / Body picks. */
.tmpl-classify-opt[data-type="exclude"].active {
  color: var(--fg-3);
  background: #fff;
}
/* Dim excluded rows so the user can see at a glance what they've cut. */
.tmpl-classify-row--exclude {
  opacity: 0.55;
}
.tmpl-classify-row--exclude .tmpl-classify-thumb { filter: grayscale(0.6); }

/* Summary line at the top of the classify list showing fetch count + how
   the user has classified them. Surfaces the total clearly so a
   backend-truncated import is immediately obvious. */
.tmpl-classify-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--fg-2);
  margin-bottom: 6px;
}
.tmpl-classify-summary strong { color: var(--fg-1); font-weight: var(--fw-semibold); }
.tmpl-classify-summary-sep { color: var(--fg-4); }
.tmpl-classify-summary-muted { color: var(--fg-3); }
.tmpl-classify-summary-muted strong { color: var(--fg-2); }

@media (max-width: 720px) {
  .tmpl-classify-row { grid-template-columns: 80px 1fr; row-gap: 8px; }
  .tmpl-classify-thumb { width: 80px; }
  .tmpl-classify-toggle { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 1200px) {
  .tmpl-section-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .tmpl-section-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .tmpl-section-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .tmpl-section-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   App card shell (wraps generate-slides flow)
   ============================================================ */
.card-section { width: 100%; }
.main-card, .app-card {
  max-width: 960px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.tab-pane.hidden { display: none; }

/* ----- Steps bar ----- */
.steps-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--arctic);
  gap: 12px;
  flex-wrap: nowrap;
}
.step {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-3);
  font-size: 13px;
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.step-number, .step-num {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--fg-3);
  flex-shrink: 0;
}
.step.active, .step.is-active {
  color: var(--fg-1);
  font-weight: var(--fw-semibold);
}
.step.active .step-number,
.step.active .step-num,
.step.is-active .step-number,
.step.is-active .step-num {
  background: var(--envoy-red);
  border-color: transparent;
  color: #fff;
}
.step.is-done, .step.done {
  color: var(--fg-2);
}
.step.is-done .step-number,
.step.is-done .step-num,
.step.done .step-number,
.step.done .step-num {
  background: var(--cilantro-40);
  border-color: transparent;
  color: #fff;
}
.step-connector, .step-conn {
  flex: 1;
  min-width: 12px;
  height: 1px;
  background: var(--border);
  margin: 0 4px;
}

/* ----- Panel container ----- */
.panel, .app-panel {
  padding: 36px 40px;
}
.panel.hidden { display: none; }

/* ============================================================
   Input form (Step 1)
   ============================================================ */
.input-group, .ig { margin-bottom: 22px; }
.input-label, .ig-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.input-wrapper, .ig-wrap { position: relative; }
.input-wrapper input,
.ig-input {
  width: 100%;
  padding: 13px 48px 13px 16px;
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrapper input::placeholder,
.ig-input::placeholder { color: var(--fg-4); }
.input-wrapper input:focus,
.ig-input:focus {
  border-color: var(--envoy-red);
  box-shadow: 0 0 0 3px rgba(250, 67, 56, 0.12);
}
.paste-btn, .ig-paste {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 6px;
  border-radius: 6px;
  color: var(--fg-3);
  cursor: pointer;
  display: inline-flex;
}
.paste-btn:hover, .ig-paste:hover { background: var(--arctic); color: var(--fg-1); }
.input-hint, .ig-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.5;
}
.input-hint code, .ig-hint code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--arctic);
  color: var(--fg-2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* URL field warning state (mismatched domain etc.) */
.url-warning {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--garnet-70);
  font-weight: var(--fw-medium);
}
.url-warning.hidden { display: none; }

/* ============================================================
   Buttons
   ============================================================ */
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  background: var(--envoy-red);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s, opacity 0.15s;
  width: 100%;
}
.primary-btn:hover:not(:disabled) {
  background: var(--envoy-red-hover);
  box-shadow: 0 6px 16px -4px rgba(250, 67, 56, 0.4);
  transform: translateY(-1px);
}
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-arrow { transition: transform 0.2s; }
.primary-btn:hover .btn-arrow { transform: translateX(3px); }

.secondary-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.secondary-btn:hover { background: var(--arctic); border-color: var(--carbon-30); }

/* Compact modifier for buttons living inside cards / dense lists */
.small-btn {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 6px;
}

.danger-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: #fff;
  border: 1px solid var(--garnet-70);
  border-radius: var(--radius);
  color: var(--garnet-70);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.danger-btn:hover { background: rgba(160, 12, 31, 0.05); }
/* When combined with .small-btn, .danger-btn's own 12/22 padding wins via
   source order. Re-apply the compact sizing here so a button with both
   classes matches its sibling .secondary-btn.small-btn instead of towering
   over it (this is exactly the Add Slide vs Clear All mismatch). */
.danger-btn.small-btn,
.small-btn.danger-btn {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* ============================================================
   Progress panel (Step 3/4/5 — extracting/gathering/generating)
   ============================================================ */
.progress-container {
  display: flex; flex-direction: column;
  gap: 22px;
  text-align: center;
}
.progress-header { margin-bottom: 8px; }
.progress-label {
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
}
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--carbon-10);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--envoy-red) 0%, var(--envoy-red-hover) 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.progress-log {
  background: var(--arctic);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  text-align: left;
  line-height: 1.6;
}

/* ============================================================
   Customize panel (Step 2 — mode selector + tile grid)
   ============================================================ */
.customize-header, .cz-head { margin-bottom: 22px; }
.customize-title, .cz-title {
  font-size: 20px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 4px;
}
.customize-subtitle, .cz-sub {
  font-size: 14px;
  color: var(--fg-3);
  margin: 0;
}

.customize-mode-grid, .cz-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}
.customize-mode-card, .cz-mode {
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 14px;          /* was 18px — tighter for a more compact card */
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: var(--font-sans);
}
.customize-mode-card:hover, .cz-mode:hover { border-color: var(--carbon-30); }
.customize-mode-card.active,
.customize-mode-card.is-active,
.cz-mode.is-active {
  border-color: var(--envoy-red);
  background: rgba(250, 67, 56, 0.04);
}
.customize-mode-icon, .cz-mode-icon {
  width: 32px; height: 32px;   /* was 36 */
  border-radius: 8px;
  background: var(--envoy-red);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.customize-mode-icon > svg, .cz-mode-icon > svg { width: 18px; height: 18px; }
.customize-mode-card:not(.active):not(.is-active) .customize-mode-icon,
.cz-mode:not(.is-active) .cz-mode-icon {
  background: #F4F4F7;
  color: var(--carbon-60);
}
.customize-mode-body, .cz-mode > div { flex: 1; min-width: 0; }
/* The markup uses an `<h3>` (and `<h4>` for the older skin). Without an
   explicit override the `<h3>` renders at the browser default (huge), which
   was blowing the card up to ~120px tall. Constrain heading + paragraph to
   the same compact type scale we use elsewhere. */
.customize-mode-card h3,
.customize-mode-card h4,
.cz-mode h3,
.cz-mode h4 {
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 2px;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.customize-mode-card p, .cz-mode p {
  font-size: 12px;
  color: var(--fg-3);
  margin: 0;
  line-height: 1.4;
}

/* Tile grid */
.basic-tiles-section { margin-bottom: 28px; }
.basic-tiles-header, .cz-tiles-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.basic-tiles-label, .cz-tiles-label {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.basic-tiles-meta, .cz-tiles-meta {
  display: flex; align-items: center;
  gap: 14px;
}
.basic-tiles-count, .cz-count {
  font-size: 12px;
  color: var(--fg-3);
  font-weight: var(--fw-medium);
}
.cz-selall {
  display: inline-flex; align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  cursor: pointer;
}
.cz-check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
}
.basic-tiles-grid, .cz-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.tilec {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--gem-60);
}
.tilec:hover { border-color: var(--carbon-30); }
.tilec.is-selected, .tilec.selected { border-color: var(--envoy-red); }
.tilec.is-selected .tilec-check,
.tilec.selected .tilec-check {
  background: var(--envoy-red);
  border-color: var(--envoy-red);
}
.tilec.is-selected .tilec-check::after,
.tilec.selected .tilec-check::after {
  content: ""; position: absolute; inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><polyline points="3.5,8.5 6.5,11 12.5,4.5" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center / 65%;
}
.tilec-check {
  position: absolute; top: 10px; right: 10px;
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
}
.tilec-preview {
  height: 80px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: var(--arctic);
  padding: 10px;
  display: flex; align-items: center; justify-content: center;
}
.tilec-preview svg { width: 100%; height: 100%; }
.tilec-kpi {
  font-size: 22px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  letter-spacing: -0.01em;
}
.tilec-table {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; width: 100%; height: 100%;
  padding: 4px;
}
.tilec-table span {
  background: currentColor;
  opacity: 0.25;
  border-radius: 2px;
}
.tilec-name {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  line-height: 1.3;
}

/* ─── Chart tile cards (basic-tiles-grid) ────────────────────────────────────
   The JS in `showCustomizePanel` builds tiles with the class names
   `.tile-card`, `.tile-card-check`, `.tile-card-name`, `.tile-card-footer`,
   `.tile-card-type`, `.tile-card-type-dot`. The earlier `.tilec*` styles up
   above never matched, so the cards were rendering completely unstyled —
   giant block-level names, no checkbox, no card chrome. These rules give
   them proper card layout, selection state, and a type badge. */
.tile-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  padding-right: 36px;          /* leave room for the absolute checkbox */
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 76px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.tile-card:hover {
  border-color: var(--carbon-30);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.tile-card.selected {
  border-color: var(--envoy-red);
  background: rgba(250, 67, 56, 0.03);
}
.tile-card-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.tile-card-check > svg {
  opacity: 0;
  transition: opacity 0.15s;
}
.tile-card.selected .tile-card-check {
  background: var(--envoy-red);
  border-color: var(--envoy-red);
}
.tile-card.selected .tile-card-check > svg { opacity: 1; }
.tile-card-name {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  margin: 0;
}
.tile-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.tile-card-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tile-card-type-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--gem-60, #4e4eda);
  display: inline-block;
}
/* ─── "Select all" toggle in the basic-tiles header ──────────────────────── */
.tile-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  cursor: pointer;
  user-select: none;
}
.tile-select-all-check {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.tile-select-all-check .tile-check-icon {
  opacity: 0;
  transition: opacity 0.15s;
}
.tile-select-all-check.all-selected {
  background: var(--envoy-red);
  border-color: var(--envoy-red);
}
.tile-select-all-check.all-selected .tile-check-icon { opacity: 1; }
.tile-select-all-check.partial {
  background: var(--envoy-red);
  border-color: var(--envoy-red);
}
.tile-select-all-check.partial::after {
  content: "";
  position: absolute;
  inset: 50% 3px auto 3px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transform: translateY(-50%);
}

/* Footer actions inside customize panel */
.customize-footer, .cz-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.customize-footer .primary-btn,
.cz-foot .primary-btn { width: auto; }
.customize-footer .secondary-btn,
.cz-foot .secondary-btn { width: auto; }
/* Group the Save layout + Generate Slides buttons on the right while Back
   sits on the left. `space-between` on .customize-footer pushes the two
   sides apart automatically. */
.customize-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.basic-selection-warning,
.basic-tiles-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(184, 131, 12, 0.08);
  border: 1px solid rgba(184, 131, 12, 0.3);
  color: #8a6310;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 14px;
}
.basic-selection-warning > svg {
  flex-shrink: 0;
  color: #b8830c;
}
.basic-tiles-error {
  background: rgba(160, 12, 31, 0.06);
  border-color: rgba(160, 12, 31, 0.3);
  color: var(--garnet-70);
}
.basic-tiles-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 20px;
  color: var(--fg-3);
  font-size: 14px;
}
/* Sheets-mode notice when KPI tiles get filtered out of the chart picker. */
.basic-tiles-skipped-note {
  font-size: 12px;
  color: var(--fg-3);
  font-style: italic;
  margin: 0 0 10px;
}

/* ============================================================
   Result panel (Step 5 — success)
   ============================================================ */
.result-container, .result-panel {
  text-align: center;
  padding: 48px 40px;
}
.result-icon, .rs-icon {
  width: 52px; height: 52px;
  border-radius: 999px;
  background: var(--cilantro-20);
  color: var(--cilantro-60);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.result-title, .rs-title {
  font-size: 24px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.result-subtitle, .rs-sub, #result-subtitle {
  font-size: 14px;
  color: var(--fg-3);
  margin: 0 0 32px;
}

.result-preview, .rs-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 32px;
}
.rs-slide {
  aspect-ratio: 16/9;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  box-shadow: var(--shadow-xs);
  position: relative;
}
.rs-eyebrow {
  font-size: 9px;
  font-weight: var(--fw-bold);
  color: var(--envoy-red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rs-title-l {
  font-size: 16px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-top: 6px;
  line-height: 1.15;
}
.rs-byline { font-size: 9px; color: var(--fg-3); margin-top: 4px; }
.rs-h {
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-bottom: 8px;
}
.rs-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rs-kl {
  font-size: 8px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--fw-semibold);
}
.rs-kv {
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
}

.result-actions, .rs-actions {
  display: flex; gap: 10px; justify-content: center;
}
.result-actions .primary-btn,
.rs-actions .primary-btn,
.result-actions .secondary-btn,
.rs-actions .secondary-btn { width: auto; }
.result-secondary-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
}
.result-secondary-links a,
.result-secondary-links .download-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fg-3);
  text-decoration: none;
  font-weight: var(--fw-medium);
  font-family: var(--font-sans);
  font-size: 13px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.result-secondary-links a:hover,
.result-secondary-links .download-pdf-link:hover { color: var(--envoy-red); }
.result-secondary-sep { color: var(--fg-4); }

/* ─── "Charts included" list on the success screen ──────────────────────────
   2-column card so dashboards with 40+ charts don't produce a wall of rows.
   The .query-items wrapper is a CSS grid; the header sits above it. */
.query-summary {
  margin: 32px auto 0;
  max-width: 900px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.query-summary > p {
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--arctic);
}
.query-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.query-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  min-width: 0;
}
/* No top border on the first row (items 1+2) — the header above already
   provides the separator. Using top-borders (instead of bottom-borders)
   keeps things clean for odd counts: the last row never has a dangling
   border below it. */
.query-item:nth-child(-n+2) { border-top: 0; }
/* Vertical divider between the two columns. */
.query-item:nth-child(odd) { border-right: 1px solid var(--border); }
.query-name {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.query-rows {
  font-size: 11px;
  font-weight: var(--fw-medium);
  color: var(--fg-3);
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Drop to a single column on narrow screens — the card stops being useful
   as a table when each column is only ~200px wide. */
@media (max-width: 640px) {
  .query-items { grid-template-columns: 1fr; }
  .query-item:nth-child(odd) { border-right: 0; }
}

/* ============================================================
   Preview / Slide builder (used in custom mode)
   ============================================================ */
.preview-container { padding: 8px 0; }
.preview-title {
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 6px;
}
.preview-subtitle {
  font-size: 13px;
  color: var(--fg-3);
  margin: 0 0 20px;
}
/* Generic loading spinner. The `.spinner` class had no CSS at all so the
   div was rendering as an empty box — now it's a 40px circle with a partial
   ring that rotates. Sized via `width/height` on the element itself when the
   caller wants something smaller (e.g. inline `style={{ width: '14px' }}`). */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--envoy-red);
  border-radius: 50%;
  animation: spinner-rotate 0.85s linear infinite;
}
@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}
.preview-spinner {
  margin: 0 auto 18px;
}

/* Progress bar shown under the chart name in the Generating Slides step,
   plus the "Slide N of M" caption below it. */
.preview-progress {
  max-width: 360px;
  margin: 4px auto 6px;
  height: 6px;
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.preview-progress-fill {
  height: 100%;
  background: var(--envoy-red);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 999px;
}
.preview-count {
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--fg-3);
  margin: 6px 0 0;
}
/* Slide builder — single column layout (the broken 2-column grid was leaving
   "Your slides" + Add Slide / Clear All on one side and the slide cards
   wandering to the other). */
.slide-builder {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.slide-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.slide-builder-label {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.slide-builder-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.slide-list {
  display: flex; flex-direction: column;
  gap: 10px;
}
.drop-line {
  height: 2px;
  background: var(--envoy-red);
  border-radius: 1px;
  margin: -4px 0;
}
.drop-line.hidden { display: none; }
.add-slide-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: #fff;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--fg-2);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.add-slide-btn:hover { border-color: var(--envoy-red); color: var(--envoy-red); }

/* ─── Slide card (custom mode) ──────────────────────────────────────────────
   Each entry in the slide-list. Layout: drag handle • thumbnail/preview •
   inline editors (type select + title input or tab dropdown) • action buttons
   (Change background, remove). Without these rules the children rendered as
   raw unstyled HTML controls stacked vertically — what the screenshot showed. */
.slide-card {
  position: relative;     /* anchor for .slide-layout-popup */
  display: grid;
  grid-template-columns: 24px 120px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.slide-card:hover {
  border-color: var(--carbon-30);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.slide-card.dragging { opacity: 0.5; }
.slide-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 100%;
  color: var(--fg-3);
  cursor: grab;
  user-select: none;
}
.slide-drag-handle:hover { color: var(--fg-1); }
.slide-drag-handle:active { cursor: grabbing; }
.slide-card-bg {
  position: relative;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background-color: var(--arctic);
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.slide-card-blank-bg {
  font-size: 9px;
  font-weight: var(--fw-bold);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
}

/* ─── Mini "change layout" button rendered inside the slide thumbnail ─────
   Body slide cards include a small overlay that previews the slide layout
   (full / text-chart / chart-text) and opens a popup to swap between them.
   Without these rules it was rendering as a raw stretched button stuck in
   the bottom-right of the thumbnail. */
.slide-layout-overlay-btn {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 24px;
  height: 16px;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.slide-layout-overlay-btn:hover {
  background: #fff;
  border-color: var(--envoy-red);
  color: var(--envoy-red);
}
.slide-layout-overlay-btn > svg { width: 16px; height: 10px; }
.slide-layout-overlay-btn--light {
  background: rgba(31, 35, 45, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.slide-layout-overlay-btn--light:hover {
  background: rgba(31, 35, 45, 0.95);
  border-color: #fff;
  color: #fff;
}

/* Popup of layout choices. Anchored to `.slide-card` (which is now
   `position: relative`) so it can escape the thumbnail's `overflow: hidden`
   clip and appear above the action area on the right side of the card —
   close to the "Change Layout" button that triggers it. */
.slide-layout-popup {
  position: absolute;
  bottom: calc(100% - 8px);
  right: 12px;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.slide-layout-popup.hidden { display: none; }
.slide-layout-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 6px;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.slide-layout-opt:hover {
  background: var(--arctic);
  color: var(--fg-1);
}
.slide-layout-opt.active {
  border-color: var(--envoy-red);
  color: var(--envoy-red);
  background: rgba(250, 67, 56, 0.04);
}
.slide-layout-opt > svg { display: block; }

/* KPI-grid layout: six narrow selects in a 3×2 arrangement, replacing the
   single chart-tab dropdown when the user picks the "KPI Grid" layout. */
.slide-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  min-width: 0;
}

/* chart-kpis layout: chart select up top, three KPI selects stacked below. */
.slide-kpi-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  min-width: 0;
  margin-top: 4px;
}
.slide-kpi-cell {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-medium);
  color: var(--fg-1);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 18px 4px 8px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%231F232D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px 10px;
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.slide-kpi-cell:focus {
  outline: none;
  border-color: var(--envoy-red);
  box-shadow: 0 0 0 2px rgba(250, 67, 56, 0.12);
}

/* Optional inline text input on text-chart / chart-text layouts. */
.slide-text-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-2);
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.slide-text-input:focus {
  outline: none;
  border-color: var(--envoy-red);
  box-shadow: 0 0 0 3px rgba(250, 67, 56, 0.1);
  background: #fff;
}
.slide-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.slide-type-select {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
}
.slide-type-select:focus { outline: none; border-color: var(--envoy-red); }
.slide-title-input,
.slide-card-info select:not(.slide-type-select) {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--fg-1);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Custom-style the chart-tab <select> so the chevron isn't slammed against
   the right edge by the browser's native arrow rendering. The native arrow
   is hidden via `appearance: none`, and an inline SVG chevron is painted
   in via background-image with controlled offset. */
.slide-card-info select:not(.slide-type-select) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231F232D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
}
.slide-title-input::placeholder { color: var(--fg-3); }
.slide-title-input:focus,
.slide-card-info select:focus {
  outline: none;
  border-color: var(--envoy-red);
  box-shadow: 0 0 0 3px rgba(250, 67, 56, 0.1);
}
.slide-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* Vertical stack for the two "Change …" buttons so they sit one above the
   other; the × button sits beside the stack, centered vertically. */
.slide-card-actions-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.slide-card-actions-stack .slide-change-bg-btn,
.slide-card-actions-stack .slide-change-layout-btn {
  justify-content: flex-start;
}
.slide-change-bg-btn,
.slide-change-layout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-2);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.slide-change-bg-btn:hover,
.slide-change-layout-btn:hover {
  background: var(--arctic);
  border-color: var(--carbon-30);
  color: var(--fg-1);
}
.slide-change-layout-btn > svg {
  flex-shrink: 0;
  color: var(--fg-3);
}
.slide-change-layout-btn:hover > svg { color: var(--envoy-red); }
.slide-remove-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.slide-remove-btn:hover {
  background: rgba(250, 67, 56, 0.08);
  border-color: rgba(250, 67, 56, 0.3);
  color: var(--envoy-red);
}

/* ============================================================
   Modals — generic light theme
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(31, 35, 45, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.modal-overlay.hidden { display: none; }
.modal,
.modal-overlay > .modal,
.modal-overlay > div:not(.bg-picker-modal-inner) {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 64px);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header { padding: 24px 28px 8px; flex-shrink: 0; }
/* Scrollable middle for modals whose content can exceed the viewport
   (e.g. Load configuration with many filter rows). Header + actions stay
   pinned; everything in between scrolls inside this body. */
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-actions { flex-shrink: 0; }
.modal-title {
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 4px;
}
.modal-subtitle {
  font-size: 14px;
  color: var(--fg-3);
  margin: 0;
}
.modal-preview { padding: 16px 28px; }
/* Standard input slot inside a modal — matches the spacing convention of
   `.modal-preview` so a labeled URL field can sit cleanly between the
   header and the actions row. */
.modal-input-group {
  padding: 18px 28px 8px;
}
.modal-input-group .input-label {
  margin-bottom: 8px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px 22px;
  border-top: 1px solid var(--border);
}
.modal-actions .primary-btn,
.modal-actions .secondary-btn,
.modal-actions .danger-btn { width: auto; }

/* Outer card: holds the Title section and the URL section stacked. */
.modal-url-display {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.modal-url-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
/* Header row inside each section: small red icon + uppercase label, on a
   shared baseline. The flex centering + explicit `display: block` on the SVG
   keeps the icon's box vertically centered with the label cap-height
   regardless of the SVG viewBox padding. */
.modal-url-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-url-section-icon {
  color: var(--envoy-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Reserve a square box so successive section icons align horizontally even
     if their viewBoxes don't share identical aspect ratios. */
  width: 16px;
  height: 16px;
}
.modal-url-section-icon > svg { display: block; }
.modal-url-label {
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* The dashboard name reads as a product string, not code — sans-serif, normal
   word-break, sits flush left under the label row. */
.modal-card-name {
  display: block;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  min-width: 0;
}

/* URL chip: white pill nested inside the card. Holds the URL string and the
   open-in-new-tab affordance. Min-height guarantees the pill is visible even
   while textContent is still empty (e.g. between modal open and fetch race). */
.modal-url-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 38px;
  min-width: 0;
}
.modal-url-value {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-1);
  word-break: break-all;
  line-height: 1.5;
}
.modal-url-open {
  color: var(--gem-60);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.modal-url-open > svg { display: block; }
.modal-url-open:hover { background: rgba(78, 78, 218, 0.08); color: var(--gem-70); }
.modal-tile-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 28px 16px;
  max-height: 360px;
  overflow-y: auto;
}
.modal-selection-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 28px 16px;
  background: rgba(184, 131, 12, 0.08);
  border: 1px solid rgba(184, 131, 12, 0.3);
  color: #8a6310;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.4;
}
.modal-selection-warning > svg {
  flex-shrink: 0;
  color: #b8830c;
}
/* The .hidden override needs to win over the new `display: flex`. */
.modal-selection-warning.hidden { display: none; }
/* Inline loading + error states inside the Title section. Kept compact —
   no extra padding — so they slot in where the dashboard name would render
   instead of inflating the section to fixed-block size. */
.modal-card-loading {
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-3);
  font-size: 13px;
  line-height: 1.35;
}
.modal-card-error {
  padding: 0;
  color: var(--garnet-70);
  font-size: 13px;
  line-height: 1.35;
}
.modal-card-content.hidden,
.modal-card-error.hidden,
.modal-card-loading.hidden { display: none; }

/* Background-picker modal */
.bg-picker-modal { background: #fff; }
/* Modal footer layout: "Apply to all body slides" toggle on the left, Cancel
   on the right. Uses .modal-actions's default justify-content: flex-end,
   overridden here to space the two ends apart. */
.bg-picker-actions {
  justify-content: space-between !important;
  align-items: center;
}
.bg-picker-apply-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-sans);
  /* The label is the click target; the native checkbox lives inside it but
     is visually hidden via the sr-only pattern so only the custom box +
     text render. Without this, the browser-rendered checkbox shows up
     between the custom box and the label text, adding ~20px of dead gap. */
  position: relative;
}
.bg-picker-apply-all.hidden { display: none; }
.bg-picker-apply-all-input {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.bg-picker-apply-all-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.bg-picker-apply-all-box > svg { opacity: 0; transition: opacity 0.15s; }
.bg-picker-apply-all-input:checked + .bg-picker-apply-all-box {
  background: var(--envoy-red);
  border-color: var(--envoy-red);
}
.bg-picker-apply-all-input:checked + .bg-picker-apply-all-box > svg { opacity: 1; }
.bg-picker-apply-all-input:focus-visible + .bg-picker-apply-all-box {
  outline: 2px solid rgba(250, 67, 56, 0.4);
  outline-offset: 2px;
}
.bg-picker-apply-all-text {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
}
.bg-picker-modal-inner { padding: 24px 28px; }
.bg-picker-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px;
  color: var(--fg-3);
}
.bg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-height: 480px; overflow-y: auto;
  /* Reserve space for the inner scrollbar so the right column doesn't get
     cropped when the scrollbar reduces the content width. */
  padding-right: 4px;
}
/* Each background thumbnail. The grid has uniform 16:9 cells regardless of
   the underlying image size, with the label sitting underneath in a clean
   caption. Without these rules the grid was rendering at the natural image
   sizes (mix of huge images + raw text for "Plain white"), spilling out of
   the modal horizontally. */
.bg-grid-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  min-width: 0;
}
.bg-grid-item > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--arctic);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.bg-grid-item:hover > img {
  border-color: var(--carbon-30);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.bg-grid-item-selected > img {
  border-color: var(--envoy-red);
  box-shadow: 0 0 0 3px rgba(250, 67, 56, 0.15);
}
/* Some entries (like "Plain white") have no <img> — they render just a
   labeled blank cell. Give the cell the same 16:9 footprint so the grid
   stays aligned. */
.bg-grid-item:not(:has(img)) {
  position: relative;
}
.bg-grid-item:not(:has(img))::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #fff;
  border: 2px dashed var(--border-strong);
  border-radius: 8px;
}
.bg-grid-item:not(:has(img))::after {
  content: attr(data-blank-label);
  position: absolute;
  inset: 0 0 28px 0;          /* leave room for the actual label below */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--fg-3);
  pointer-events: none;
}
.bg-grid-label {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ─── Conflict modal ("Tabs already exist") ─────────────────────────────── */
.conflict-main-actions {
  display: flex;
  gap: 10px;
  padding: 16px 28px 4px;
}
.conflict-main-actions .primary-btn { flex: 1; width: auto; }
/* The advanced-options toggle is a secondary action — give it real button
   chrome so it matches the primary's height instead of looking like a tiny
   link button stuck next to a giant red bar. */
.conflict-advanced-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-family: var(--font-sans);
  color: var(--fg-1);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.conflict-advanced-toggle:hover {
  background: var(--arctic);
  border-color: var(--carbon-30);
}
.conflict-advanced-toggle > svg {
  transition: transform 0.2s;
}
/* Flip the chevron when the advanced panel is open. We rely on the panel
   being a sibling that's NOT `.hidden` to detect open state. */
.conflict-advanced-panel:not(.hidden) ~ * .conflict-advanced-toggle > svg,
.conflict-advanced-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.conflict-advanced-panel.hidden { display: none; }
.conflict-advanced-panel {
  padding: 14px 28px 4px;
}

/* "1 of N selected · Select all" row at the top of the advanced panel. */
.conflict-select-all-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
  font-size: 12px;
  color: var(--fg-2);
}
.conflict-selected-count {
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--fg-3);
}
/* The select-all label uses the same chip+box pattern as the main tile picker
   but inverted (label on left, box on right) inside this modal. */
.conflict-select-all-row .tile-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  cursor: pointer;
  user-select: none;
}
.conflict-select-all-row .tile-select-all-check {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.conflict-select-all-row .tile-select-all-check .tile-check-icon {
  opacity: 0;
  transition: opacity 0.15s;
}
.conflict-select-all-row .tile-select-all-check.all-selected,
.conflict-select-all-row .tile-select-all-check.partial {
  background: var(--envoy-red);
  border-color: var(--envoy-red);
}
.conflict-select-all-row .tile-select-all-check.all-selected .tile-check-icon { opacity: 1; }
.conflict-select-all-row .tile-select-all-check.partial::after {
  content: "";
  position: absolute;
  inset: 50% 3px auto 3px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transform: translateY(-50%);
}

/* Tab-list rows. Each is a card with a checkbox on the left, the tab name
   middle, and a rename input on the right. Bare HTML was producing a stack
   of unstyled rows; this gives proper grouping + alignment. */
.conflict-tab-list {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 40vh;
  overflow-y: auto;
}
.conflict-tab-item {
  display: grid;
  grid-template-columns: 22px 1fr minmax(140px, 200px);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.conflict-tab-item.selected {
  border-color: rgba(250, 67, 56, 0.3);
  background: rgba(250, 67, 56, 0.02);
}
.conflict-tab-item:hover { border-color: var(--carbon-30); }

/* Per-row checkbox. Shares the .tile-card-check class with chart tile
   cards, which sets `position: absolute; top: 12px; right: 12px` so the
   check sits in the corner of those cards. In the conflict modal it lives
   inside a grid cell, so we have to explicitly cancel those offsets,
   otherwise the box gets shifted down-and-left out of the card. */
.conflict-tab-checkbox {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.conflict-tab-checkbox > svg { opacity: 0; transition: opacity 0.15s; }
.conflict-tab-item.selected .conflict-tab-checkbox {
  background: var(--envoy-red);
  border-color: var(--envoy-red);
}
.conflict-tab-item.selected .conflict-tab-checkbox > svg { opacity: 1; }

.conflict-tab-name {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conflict-tab-newname {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-1);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.conflict-tab-newname::placeholder { color: var(--fg-3); }
.conflict-tab-newname:focus {
  outline: none;
  border-color: var(--envoy-red);
  box-shadow: 0 0 0 3px rgba(250, 67, 56, 0.1);
}

@media (max-width: 560px) {
  .conflict-tab-item { grid-template-columns: 22px 1fr; }
  .conflict-tab-newname { grid-column: 2 / -1; }
}

/* ============================================================
   Saved / Settings / How-to / Templates screens
   (Not in the new design — kept on-brand with token-based styling)
   ============================================================ */
#screen-saved,
#screen-settings,
#screen-howto,
#screen-templates {
  padding: 40px 56px 56px;
  background: var(--arctic);
}
#screen-saved.hidden,
#screen-settings.hidden,
#screen-howto.hidden,
#screen-templates.hidden { display: none; }

/* ─── Settings screen ─────────────────────────────────────────────────────
   None of these classes had any CSS, so the page was rendering with raw
   browser defaults: label and value were inline siblings with no separator,
   producing "Emailcharisse.hao@envoy.com". Now structured as a card-based
   settings layout. */
.settings-header {
  max-width: 720px;
  margin-bottom: 28px;
}
.settings-title {
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.settings-subtitle {
  font-size: 15px;
  color: var(--fg-3);
  margin: 0;
  line-height: 1.5;
}
.settings-section {
  max-width: 720px;
  margin-bottom: 28px;
}
.settings-section-title {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.settings-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.settings-label {
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
}
.settings-row-hint {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.4;
}
.settings-value {
  font-size: 14px;
  color: var(--fg-2);
  text-align: right;
  font-weight: var(--fw-medium);
}
.settings-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-1);
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  user-select: all;
  white-space: nowrap;
}

/* ─── Saved configurations screen ─────────────────────────────────────────── */
.saved-header {
  max-width: 1100px;
  margin-bottom: 24px;
}
.saved-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.saved-header-row > div:first-child { min-width: 0; flex: 1; }
.saved-title {
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.saved-subtitle {
  font-size: 15px;
  color: var(--fg-3);
  margin: 0;
  line-height: 1.5;
  max-width: 640px;
}
.saved-header-row .primary-btn {
  /* .primary-btn is `width: 100%` by default for the main CTAs; in the saved
     header it should hug its label and sit beside the title, not eat the row. */
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: flex-start;
}

#saved-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  max-width: 1100px;
}
#saved-list .saved-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#saved-list .saved-card:hover {
  border-color: var(--border-strong, #d4d4d8);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
}
.saved-card-body {
  display: flex;
  gap: 12px;
  min-width: 0;
}
.saved-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(78, 78, 218, 0.08);
  color: var(--gem-60, #4e4eda);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.saved-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.saved-card-name {
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.saved-card-meta {
  font-size: 12px;
  color: var(--fg-3);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-card-url {
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  opacity: 0.85;
}
.saved-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.saved-card-actions .secondary-btn {
  flex: 1;
  justify-content: center;
}

/* Wrapper for the filters block inside a modal — same horizontal padding
   as the rest of the modal sections. */
.modal-filters-section {
  padding: 18px 28px 4px;
}
.modal-filters-section:empty,
.modal-filters-section[style*="display: none"] { padding: 0; }

/* ─── Filter rows (Load + Create configuration modals) ───────────────────
   Without these rules each filter row was rendering as raw inline label +
   raw input — labels and inputs of varying widths jammed together with no
   alignment. Now structured as a clean label-on-left / input-on-right grid. */
.filter-section-label {
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.filter-section-hint {
  font-size: 12px;
  color: var(--fg-3);
  margin: 0 0 14px;
  line-height: 1.45;
}
.filter-controls-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.filter-cell {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.filter-cell-label {
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--fg-2);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-cell-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-1);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-cell-input::placeholder {
  color: var(--fg-3);
}
.filter-cell-input:focus {
  outline: none;
  border-color: var(--envoy-red);
  box-shadow: 0 0 0 3px rgba(250, 67, 56, 0.1);
}
.filter-cell-input--omni-default::placeholder {
  color: var(--gem-60, #4e4eda);
  font-style: italic;
}
@media (max-width: 560px) {
  .filter-cell { grid-template-columns: 1fr; gap: 4px; }
}

/* ─── Load-configuration refresh toggle ───────────────────────────────────
   Sits between the URL inputs and the action row inside the Load modal.
   The native <input type="checkbox"> is visually hidden; we paint a custom
   square box that flips to Envoy-red when checked. */
.load-config-refresh {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 24px 18px;
  padding: 12px 14px;
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
}
.load-config-refresh:hover { border-color: var(--carbon-30); }
.load-config-refresh-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.load-config-refresh-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.15s, border-color 0.15s;
}
.load-config-refresh-box > svg { opacity: 0; transition: opacity 0.15s; }
.load-config-refresh-input:checked + .load-config-refresh-box {
  background: var(--envoy-red);
  border-color: var(--envoy-red);
}
.load-config-refresh-input:checked + .load-config-refresh-box > svg { opacity: 1; }
.load-config-refresh-input:focus-visible + .load-config-refresh-box {
  outline: 2px solid rgba(250, 67, 56, 0.4);
  outline-offset: 2px;
}
.load-config-refresh-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.load-config-refresh-title {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  line-height: 1.3;
}
.load-config-refresh-desc {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.4;
}
.saved-card-delete {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.saved-card-delete:hover {
  background: rgba(250, 67, 56, 0.08);
  color: var(--envoy-red);
  border-color: rgba(250, 67, 56, 0.3);
}
.saved-empty {
  grid-column: 1 / -1;
  padding: 40px 24px;
  text-align: center;
  color: var(--fg-3);
  font-size: 14px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin: 0;
}

/* How-to */
.howto-header { max-width: 720px; margin-bottom: 24px; }
.howto-title {
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.howto-subtitle {
  font-size: 15px;
  color: var(--fg-3);
  margin: 0;
}
.howto-tabs {
  display: flex; gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.howto-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;                 /* breathing room between the icon and the label */
  background: transparent;
  border: 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.howto-tab > svg { flex-shrink: 0; }
.howto-tab.active { color: var(--envoy-red); border-bottom-color: var(--envoy-red); }
.howto-section { margin-bottom: 32px; max-width: 960px; }
.howto-section-title {
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 12px;
}
.howto-feature-grid,
.howto-mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.howto-feature,
.howto-mode-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.howto-feature-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: rgba(250, 67, 56, 0.1);
  color: var(--envoy-red);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.howto-feature-label,
.howto-mode-card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;             /* breathing room between the icon and the title */
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-bottom: 4px;
}
.howto-mode-card-title > svg,
.howto-feature-label > svg { flex-shrink: 0; color: var(--envoy-red); }
.howto-feature-desc {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.5;
}
.howto-steps { display: flex; flex-direction: column; gap: 14px; }
.howto-step { display: flex; gap: 14px; }
.howto-step-num {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--envoy-red);
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.howto-step-title {
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-bottom: 2px;
}
.howto-step-desc {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.5;
}
.howto-flow-desc {
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.55;
}
.howto-tip {
  background: var(--arctic);
  border-left: 3px solid var(--envoy-red);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--fg-2);
  border-radius: 0 6px 6px 0;
  margin-top: 12px;
}
.howto-service-email {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--arctic);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================================
   Toast
   ============================================================ */
#app-toast {
  position: fixed; bottom: 24px; left: 50%;
  background: var(--carbon-90);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: var(--fw-medium);
  z-index: 400;
  box-shadow: var(--shadow-md);
  /* Hidden by default — only `.toast-show` makes it visible. Without these
     rules the toast was permanently stuck on-screen because `.toast-hide`
     in the JS has nothing to bind to. */
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
#app-toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#app-toast.toast-hide {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}
#app-toast.hidden { display: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .sidebar, .app-sidebar { width: 200px; }
  .page-content { margin-left: 200px; }
  .page-content > .main,
  .page-content > #app-content > .main,
  .home-screen { padding: 32px 28px; }
  .home-hero { flex-direction: column; align-items: flex-start; gap: 24px; }
  .home-actions { grid-template-columns: 1fr; }
  .basic-tiles-grid, .cz-tiles { grid-template-columns: repeat(2, 1fr); }
  .customize-mode-grid, .cz-mode-grid { grid-template-columns: 1fr; }
  .result-preview, .rs-preview { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .home-title { font-size: 36px; }
  .panel, .app-panel { padding: 24px 20px; }
  .steps-bar { padding: 12px 16px; gap: 6px; overflow-x: auto; }
}

/* ============================================================
   Pre-auth landing page (Vidara Preview design)
   All rules scoped under .auth-screen.landing so they only
   apply on the marketing landing screen and never leak into
   the post-auth in-app styles above.
   ============================================================ */
.auth-screen.landing {
  position: fixed; inset: 0; z-index: 200;
  display: block;
  background: var(--bg-1);
  overflow-y: auto;
  overflow-x: hidden;   /* let the Vidara arrow bulge past the visual without triggering scroll */
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.auth-screen.landing a { color: inherit; text-decoration: none; }
.auth-screen.landing *, .auth-screen.landing *::before, .auth-screen.landing *::after { box-sizing: border-box; }

/* Top nav */
.auth-screen.landing .lp-nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 246, 249, 0.85);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
/* Nav spans the full viewport width — brand hugs the left edge, buttons hug
   the right edge. Vertical + horizontal offset matches the post-auth sidebar
   logo so signing in doesn't visually shift the Vidara mark. */
.auth-screen.landing .lp-nav-inner {
  max-width: none;
  margin: 0;
  padding: 18px 20px;       /* 20px left = same X as the sidebar logo; 18px top = same Y */
  display: flex; align-items: center; gap: 28px;
}
.auth-screen.landing .lp-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--fg-1);
  font-weight: var(--fw-bold);
  font-size: 17px;           /* matches .app-brand-word */
  letter-spacing: -0.01em;
}
.auth-screen.landing .lp-brand-mark {
  /* Match the post-auth .app-brand-mark exactly so the logo is pixel-stable
     when the auth screen hides and the sidebar appears. */
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--envoy-red);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px -1px rgba(250, 67, 56, 0.4);
  flex-shrink: 0;
}
.auth-screen.landing .lp-brand-mark.sm { width: 22px; height: 22px; border-radius: 6px; box-shadow: none; }
.auth-screen.landing .lp-nav-items {
  display: flex; gap: 28px;
  margin-left: 20px;
  flex: 1;
}
.auth-screen.landing .lp-nav-link {
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--fg-2);
  transition: color 150ms ease;
}
.auth-screen.landing .lp-nav-link:hover { color: var(--envoy-red); }
.auth-screen.landing .lp-nav-actions { display: flex; align-items: center; gap: 16px; }

/* Buttons */
.auth-screen.landing .lp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.auth-screen.landing .lp-btn-primary { background: var(--envoy-red); color: #fff; }
.auth-screen.landing .lp-btn-primary:hover {
  background: var(--envoy-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(250, 67, 56, 0.4);
}
.auth-screen.landing .lp-btn-ghost {
  background: transparent;
  color: var(--fg-1);
  padding: 11px 8px;
}
.auth-screen.landing .lp-btn-ghost:hover { color: var(--envoy-red); }
.auth-screen.landing .lp-btn-google {
  background: #fff;
  color: var(--fg-1);
  border: 1px solid var(--border-strong);
  padding: 11px 18px;
}
.auth-screen.landing .lp-btn-google:hover:not(:disabled) {
  background: var(--arctic);
  border-color: var(--carbon-30);
}
.auth-screen.landing .lp-btn-google:disabled { opacity: 0.6; cursor: not-allowed; }

/* Hero — fills the available viewport height and centers its content both
   vertically and horizontally, so the headline + tile stack sit in the middle
   of the screen instead of riding the top-left. */
.auth-screen.landing .lp-hero {
  min-height: calc(100vh - 64px);    /* viewport minus the sticky nav */
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-screen.landing .lp-hero-grid {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 56px;
  align-items: stretch;   /* let the copy column fill the row so we can flex-center its content */
}
/* Vertically center the headline + lead + button inside the copy column so
   the words line up with the middle of the dashboard/slides tile stack. */
.auth-screen.landing .lp-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-screen.landing .lp-display {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: var(--fw-bold);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--fg-1);
  margin: 0 0 22px;
  text-wrap: balance;
}
.auth-screen.landing .lp-lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0 0 32px;
  max-width: 540px;
  text-wrap: pretty;
}
.auth-screen.landing .lp-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.auth-screen.landing .lp-fineprint { font-size: 12px; color: var(--fg-3); margin: 0; }
.auth-screen.landing .lp-fineprint strong { color: var(--fg-1); font-weight: var(--fw-semibold); }
.auth-screen.landing .auth-error {
  background: rgba(160, 12, 31, 0.08);
  color: var(--garnet-70);
  font-size: 13px;
  font-weight: var(--fw-medium);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 8px 0 0;
  text-align: left;
  display: inline-block;
}

/* ============================================================
   Hero visual — Omni dashboard + Slides editor + Vidara arrow,
   with two floating notification cards layered on top for product
   storytelling (Omni connected / Deck ready).
   ============================================================ */
.auth-screen.landing .lp-visual {
  position: relative;
  width: min(100%, calc(100vh - 180px));
  aspect-ratio: 10 / 9;
  height: auto;
  margin: 0 auto;
}

/* Omni dashboard card — anchored top-left, 16:10 like a monitor */
.auth-screen.landing .lp-omni-card {
  position: absolute;
  top: 0; left: 0;
  width: 80%;
  aspect-ratio: 16 / 10;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: 2;
}
.auth-screen.landing .lp-omni-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px;
  background: #fff;
  border-bottom: 1px solid #EEF0F4;
  gap: 8px;
}
.auth-screen.landing .lp-omni-topbar-left { display: inline-flex; align-items: center; gap: 12px; }
.auth-screen.landing .lp-omni-topbar-right { display: inline-flex; align-items: center; gap: 8px; }
.auth-screen.landing .lp-omni-crumbs {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  white-space: nowrap;
  min-width: 0;
}
.auth-screen.landing .lp-omni-crumb-muted { color: #64748B; font-weight: var(--fw-medium); }
.auth-screen.landing .lp-omni-sep { color: #CBD5E1; }
.auth-screen.landing .lp-omni-crumb-active { color: #0F172A; font-weight: var(--fw-bold); }
.auth-screen.landing .lp-omni-star { color: #F59E0B; font-size: 12px; }
.auth-screen.landing .lp-omni-link { font-size: 11px; font-weight: var(--fw-semibold); color: #0F172A; padding: 4px 6px; }
.auth-screen.landing .lp-omni-pill-dark {
  font-size: 11px; font-weight: var(--fw-bold);
  background: #0F172A; color: #fff;
  padding: 5px 12px; border-radius: 999px;
}
.auth-screen.landing .lp-omni-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: var(--fw-semibold);
  color: #0F172A; background: #fff;
  border: 1px solid #E2E8F0;
  padding: 4px 10px; border-radius: 999px;
}
.auth-screen.landing .lp-omni-av {
  width: 22px; height: 22px; border-radius: 999px;
  background: linear-gradient(135deg, #FFE4EC 0%, #FFCCDB 100%);
  color: #BE185D; font-size: 10px; font-weight: var(--fw-bold);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.auth-screen.landing .lp-omni-av::after {
  content: ""; position: absolute; top: -1px; right: -1px;
  width: 6px; height: 6px; border-radius: 999px;
  background: #FF2D55; border: 1.5px solid #fff;
}
.auth-screen.landing .lp-omni-menu-row {
  display: flex; gap: 16px;
  padding: 4px 16px 5px;
  background: #fff;
  border-bottom: 1px solid #EEF0F4;
  font-size: 10px;
  font-weight: var(--fw-medium);
  color: #475569;
}
.auth-screen.landing .lp-omni-content { padding: 10px 12px; background: #fff; }
.auth-screen.landing .lp-omni-kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.auth-screen.landing .lp-omni-kpi {
  background: #F4F4F7;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  gap: 2px;
  min-width: 0;
}
/* Each piece of the KPI tile stacks on its own row:
   label → value → delta badge → sparkline. The badge gets its own line
   below the big value so it never overlaps with anything. */
.auth-screen.landing .lp-omni-kpi > .lp-okpi-label {
  display: block;
}
.auth-screen.landing .lp-omni-kpi > .lp-okpi-value {
  margin: 4px 0 2px;
}
.auth-screen.landing .lp-omni-kpi > .lp-okpi-badge {
  align-self: flex-start;   /* keep the badge tight on the left, not stretched */
  white-space: nowrap;
}
.auth-screen.landing .lp-okpi-spark {
  width: 100%;
  height: 18px;
  margin-top: auto;
  display: block;
}
.auth-screen.landing .lp-okpi-label {
  font-size: 10px;
  font-weight: var(--fw-medium);
  color: #64748B;
  line-height: 1.2;
}
.auth-screen.landing .lp-okpi-value {
  font-size: 22px;
  font-weight: var(--fw-regular);
  color: #0F172A;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 2px 0 5px;
}
.auth-screen.landing .lp-okpi-row { display: inline-flex; align-items: center; gap: 6px; }
.auth-screen.landing .lp-okpi-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.2;
}
.auth-screen.landing .lp-okpi-badge.up { background: #D7F1DD; color: #15803D; }
.auth-screen.landing .lp-okpi-badge.down { background: #FBE0DD; color: #B91C1C; }
.auth-screen.landing .lp-okpi-arrow { font-size: 11px; line-height: 1; }

.auth-screen.landing .lp-omni-charts-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.auth-screen.landing .lp-omni-chart-tile {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 8px 10px 10px;
  height: 110px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.auth-screen.landing .lp-omni-chart-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: #0F172A;
  margin-bottom: 8px;
}
.auth-screen.landing .lp-omni-chart-dots { color: #94A3B8; font-size: 13px; line-height: 1; }
.auth-screen.landing .lp-omni-line { width: 100%; flex: 1; }
.auth-screen.landing .lp-omni-chart-axis {
  display: flex; justify-content: space-between;
  margin-top: 4px;
  font-size: 8px; color: #94A3B8;
  font-weight: var(--fw-medium);
}
.auth-screen.landing .lp-omni-bars {
  display: flex; align-items: flex-end; gap: 4px;
  flex: 1; padding-bottom: 2px;
}
.auth-screen.landing .lp-omni-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 4px;
}
.auth-screen.landing .lp-omni-donut-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  flex: 1;
  min-height: 0;
}
.auth-screen.landing .lp-omni-donut {
  width: 100%;
  height: auto;
  max-height: 100%;
}
.auth-screen.landing .lp-omni-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 9px;
  color: #475569;
  min-width: 0;
}
.auth-screen.landing .lp-dl-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: var(--fw-medium);
}
.auth-screen.landing .lp-dl-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.auth-screen.landing .lp-dl-v {
  margin-left: auto;
  color: #0F172A;
  font-weight: var(--fw-semibold);
}

/* Vidara transformation arrow — short dashed cubic-Bezier curve. */
.auth-screen.landing .lp-flow {
  position: absolute;
  top: 28%;
  right: 5%;
  width: 13%;
  aspect-ratio: 13 / 15;
  z-index: 5;
  pointer-events: none;
}
.auth-screen.landing .lp-flow-arrow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* Animate the dashed flow line so data feels like it's moving */
.auth-screen.landing .lp-flow-arrow > path:first-child {
  animation: lp-flow-dash 1.4s linear infinite;
}
@keyframes lp-flow-dash {
  to { stroke-dashoffset: -22; }
}
.auth-screen.landing .lp-flow-pill {
  position: absolute;
  top: 30%;
  left: 62%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--envoy-red);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: 11px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  box-shadow: 0 4px 12px -3px rgba(250, 67, 56, 0.45);
}

/* Slides editor card — anchored bottom-right */
.auth-screen.landing .lp-slides-card {
  position: absolute;
  bottom: 0; right: 0;
  width: 80%;
  aspect-ratio: 16 / 10;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: 4;
  display: flex;
  flex-direction: column;
}

/* === Google Slides editor mock (inside .lp-slides-card) === */
.auth-screen.landing .lp-gs-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 10px;
  border-bottom: 1px solid #E5E7EB;
  background: #fff;
  flex-shrink: 0;
}
.auth-screen.landing .lp-gs-titlebar-left {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
}
.auth-screen.landing .lp-gs-icon { flex-shrink: 0; }
.auth-screen.landing .lp-gs-filename {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-screen.landing .lp-gs-star { color: #CBD5E1; font-size: 11px; line-height: 1; }
.auth-screen.landing .lp-gs-titlebar-right {
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0;
}
.auth-screen.landing .lp-gs-slideshow {
  font-size: 10px;
  font-weight: var(--fw-medium);
  color: #0F172A;
  padding: 3px 9px;
  border: 1px solid #C8E6C9;
  background: #E8F5E9;
  border-radius: 4px;
}
.auth-screen.landing .lp-gs-share {
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: #fff;
  background: #1A73E8;
  padding: 3px 11px;
  border-radius: 999px;
}
.auth-screen.landing .lp-gs-menubar {
  display: flex; gap: 12px;
  padding: 4px 12px;
  border-bottom: 1px solid #E5E7EB;
  background: #fff;
  font-size: 10px;
  color: #475569;
  font-weight: var(--fw-medium);
  flex-shrink: 0;
}
.auth-screen.landing .lp-gs-body {
  display: grid;
  grid-template-columns: 60px 1fr;
  flex: 1;
  min-height: 0;
  background: #F1F3F4;
}
.auth-screen.landing .lp-gs-rail {
  border-right: 1px solid #E5E7EB;
  background: #fff;
  padding: 6px 5px;
  display: flex; flex-direction: column; gap: 5px;
  overflow: hidden;
}
.auth-screen.landing .lp-gs-thumb {
  display: flex; align-items: stretch; gap: 4px;
}
.auth-screen.landing .lp-gs-thumb-num {
  width: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #94A3B8;
  font-weight: var(--fw-semibold);
  font-size: 7px;
  flex-shrink: 0;
}
.auth-screen.landing .lp-gs-thumb-card {
  flex: 1;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  padding: 3px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.auth-screen.landing .lp-gs-thumb.is-active .lp-gs-thumb-card {
  border-color: #4285F4;
  border-width: 1.5px;
}
.auth-screen.landing .lp-gs-thumb-title {
  color: var(--envoy-red);
  font-weight: var(--fw-bold);
  font-size: 5px;
  letter-spacing: -0.01em;
}
.auth-screen.landing .lp-gs-thumb-eyebrow {
  color: var(--envoy-red);
  font-weight: var(--fw-bold);
  font-size: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.auth-screen.landing .lp-gs-thumb-big {
  color: #0F172A;
  font-weight: var(--fw-bold);
  font-size: 7px;
  letter-spacing: -0.01em;
}
.auth-screen.landing .lp-gs-canvas {
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  min-width: 0;
}
.auth-screen.landing .lp-gs-stage {
  width: 100%;
  aspect-ratio: 16/10;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.auth-screen.landing .lp-gs-slide-title {
  font-size: clamp(16px, 3vw, 28px);
  color: var(--envoy-red);
  font-weight: var(--fw-bold);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

/* === Floating notification cards layered on the visual === */
.auth-screen.landing .lp-notif {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-lg);
  z-index: 6;
  min-width: 180px;
  animation: lp-notif-pop 0.5s var(--ease-out) backwards;
}
.auth-screen.landing .lp-notif-top {
  top: -4%;
  right: -4%;
  animation-delay: 0.2s;
}
.auth-screen.landing .lp-notif-bottom {
  bottom: 4%;
  left: -4%;
  /* Pop in once on load, then a very gentle continuous bob up/down. */
  animation:
    lp-notif-pop 0.5s var(--ease-out) 0.6s backwards,
    lp-notif-bob 3.5s ease-in-out 1.2s infinite;
}
@keyframes lp-notif-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes lp-notif-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.auth-screen.landing .lp-notif-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-screen.landing .lp-notif-success {
  background: var(--cilantro-20);
  color: var(--cilantro-60);
}
.auth-screen.landing .lp-notif-thumb {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--arctic);
  flex-shrink: 0;
}
.auth-screen.landing .lp-notif-body { min-width: 0; }
.auth-screen.landing .lp-notif-title {
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-screen.landing .lp-notif-sub {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 2px;
}

/* Feature strip */
.auth-screen.landing .lp-features {
  max-width: var(--container-max);
  margin: 32px auto 0;
  padding: 24px 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.auth-screen.landing .lp-feature { display: flex; gap: 12px; }
.auth-screen.landing .lp-feature-tick {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--cilantro-20);
  color: var(--cilantro-60);
  display: flex; align-items: center; justify-content: center;
}
.auth-screen.landing .lp-feature-t {
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-bottom: 2px;
}
.auth-screen.landing .lp-feature-d {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.45;
}

/* How it works */
.auth-screen.landing .lp-how {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px 32px;
}
.auth-screen.landing .lp-how-head { margin-bottom: 40px; max-width: 720px; }
.auth-screen.landing .lp-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--envoy-red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.auth-screen.landing .lp-h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 0;
  text-wrap: balance;
}
.auth-screen.landing .lp-how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.auth-screen.landing .lp-how-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: transform 250ms ease, box-shadow 250ms ease;
}
.auth-screen.landing .lp-how-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.auth-screen.landing .lp-how-num {
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: var(--envoy-red);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.auth-screen.landing .lp-how-t {
  font-size: 20px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-bottom: 8px;
}
.auth-screen.landing .lp-how-d {
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-2);
}

/* ─── Landing "How to use" — standalone page view ─────────────────────────
   Reached via the "How to use" nav link (#how-to-use). When this view is
   active, `.lp-view--main` is hidden so the howto reads like a separate
   documentation page rather than a section appended to the home view. */
.auth-screen.landing .lp-view { /* shared view shell */ }
.auth-screen.landing .lp-view.hidden { display: none; }

/* Page chrome inside the howto view. Two-layer layout:
   - .lp-page is a centered max-width column on the arctic background. Holds
     the "← Back to Vidara" link OUTSIDE the docs card so it reads as
     navigation between pages.
   - .lp-page-card is the actual white documentation card (with a soft border
     and gentle shadow) where the docs content lives. This gives the page
     visual presence instead of floating in the arctic emptiness.
*/
.auth-screen.landing .lp-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 32px 96px;
}
.auth-screen.landing .lp-page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
  text-decoration: none;
  padding: 6px 12px;
  margin: 0 -12px 20px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.auth-screen.landing .lp-page-back:hover {
  color: var(--envoy-red);
  background: rgba(250, 67, 56, 0.06);
}
/* The actual docs card — white panel with thin border and gentle shadow.
   Header, prereq, steps, CTA all live inside with consistent inner padding. */
.auth-screen.landing .lp-page-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.auth-screen.landing .lp-page-head {
  padding: 0;
  margin: 0;
  border: 0;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}
.auth-screen.landing .lp-page-head .lp-eyebrow {
  display: inline-block;
  font-size: 11px;
  margin-bottom: 14px;
}
.auth-screen.landing .lp-page-title {
  font-size: 2.25rem;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
.auth-screen.landing .lp-page-lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-2);
  margin: 0;
  text-wrap: pretty;
}

/* Yellow-tinted "Before you start" callout — sits inside the docs card,
   nested with its own border on the card's white background. */
.auth-screen.landing .lp-page-prereq {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  background: rgba(184, 131, 12, 0.06);
  border: 1px solid rgba(184, 131, 12, 0.25);
  border-radius: var(--radius-md);
}
.auth-screen.landing .lp-page-prereq-mark {
  color: #b8830c;
  flex-shrink: 0;
  margin-top: 1px;
}
.auth-screen.landing .lp-page-prereq-body { min-width: 0; flex: 1; }
.auth-screen.landing .lp-page-prereq-title {
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-bottom: 4px;
}
.auth-screen.landing .lp-page-prereq-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0 0 10px;
}
.auth-screen.landing .lp-page-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(31, 35, 45, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  user-select: all;
  color: var(--fg-1);
  word-break: break-all;
}

/* Numbered step blocks. */
.auth-screen.landing .lp-page-steps {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.auth-screen.landing .lp-page-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: start;
}
.auth-screen.landing .lp-page-step-num {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--envoy-red);
  color: #fff;
  font-size: 15px;
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-screen.landing .lp-page-step-body { min-width: 0; }
.auth-screen.landing .lp-page-step-title {
  font-size: 20px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 4px 0 8px;
  letter-spacing: -0.01em;
}
.auth-screen.landing .lp-page-step-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-2);
  margin: 0;
}

/* Mode cards inside step 2. */
.auth-screen.landing .lp-page-modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.auth-screen.landing .lp-page-mode {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.auth-screen.landing .lp-page-mode-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.auth-screen.landing .lp-page-mode-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(250, 67, 56, 0.08);
  color: var(--envoy-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-screen.landing .lp-page-mode-name {
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
}
.auth-screen.landing .lp-page-mode-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-2);
  margin: 0;
}

.auth-screen.landing .lp-page-cta {
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}
.auth-screen.landing .lp-page-cta-sub {
  font-size: 12px;
  color: var(--fg-3);
  margin: 0;
}

@media (max-width: 720px) {
  .auth-screen.landing .lp-page { padding: 32px 20px 60px; }
  .auth-screen.landing .lp-page-card { padding: 32px 24px; gap: 28px; }
  .auth-screen.landing .lp-page-title { font-size: 1.75rem; }
  .auth-screen.landing .lp-page-modes { grid-template-columns: 1fr; }
  .auth-screen.landing .lp-page-step { grid-template-columns: 36px 1fr; gap: 14px; }
  .auth-screen.landing .lp-page-step-num { width: 30px; height: 30px; font-size: 14px; }
}

/* ─── Legacy `.lp-howto` styles ──
   Kept for backwards compat; the inline howto SECTION on the landing has
   been removed, but the post-auth /?flow=howto page still uses some of
   these tokens. New work should target `.lp-page-*` instead. */
.auth-screen.landing .lp-howto {
  border-top: 1px solid var(--border-subtle);
  background: #fff;
}
.auth-screen.landing .lp-howto-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px 32px;
}
.auth-screen.landing .lp-howto-head {
  max-width: 720px;
  margin-bottom: 36px;
}
.auth-screen.landing .lp-howto-head .lp-lead {
  margin-top: 14px;
}
/* Yellow-tinted "Before you start" callout */
.auth-screen.landing .lp-howto-prereq {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  background: rgba(184, 131, 12, 0.06);
  border: 1px solid rgba(184, 131, 12, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 40px;
}
.auth-screen.landing .lp-howto-prereq-mark {
  color: #b8830c;
  flex-shrink: 0;
  margin-top: 1px;
}
.auth-screen.landing .lp-howto-prereq-title {
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-bottom: 4px;
}
.auth-screen.landing .lp-howto-prereq-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0;
}
.auth-screen.landing .lp-howto-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(31, 35, 45, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  user-select: all;
  color: var(--fg-1);
  white-space: nowrap;
}

/* Numbered steps. Same red circle treatment as the post-auth howto page so
   the visual language carries through after sign-in. */
.auth-screen.landing .lp-howto-steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.auth-screen.landing .lp-howto-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  align-items: start;
}
.auth-screen.landing .lp-howto-step-num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--envoy-red);
  color: #fff;
  font-size: 14px;
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-screen.landing .lp-howto-step-body { min-width: 0; }
.auth-screen.landing .lp-howto-step-title {
  font-size: 17px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.auth-screen.landing .lp-howto-step-desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0;
}

/* Inline mode cards inside step 2 (Basic / Custom). */
.auth-screen.landing .lp-howto-modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.auth-screen.landing .lp-howto-mode {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.auth-screen.landing .lp-howto-mode-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  margin-bottom: 6px;
}
.auth-screen.landing .lp-howto-mode-title > svg { color: var(--envoy-red); flex-shrink: 0; }
.auth-screen.landing .lp-howto-mode p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-2);
  margin: 0;
}

.auth-screen.landing .lp-howto-cta {
  margin-top: 40px;
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 720px) {
  .auth-screen.landing .lp-howto-inner { padding: 60px 20px; }
  .auth-screen.landing .lp-howto-modes { grid-template-columns: 1fr; }
}

/* ============================================================
   Feature deep-dives — one section per sidebar item in the app
   (Generate Slides / Update Sheets / Custom Templates / Saved
   Configurations). Alternating text-left/visual-right layout.
   ============================================================ */
.auth-screen.landing .lp-deepdive {
  border-top: 1px solid var(--border-subtle);
}
.auth-screen.landing .lp-dd-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px 32px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
  gap: 64px;
  align-items: center;
}
.auth-screen.landing .lp-deepdive--alt .lp-dd-inner .lp-dd-text { order: 2; }
.auth-screen.landing .lp-deepdive--alt .lp-dd-inner .lp-dd-visual { order: 1; }
.auth-screen.landing .lp-dd-text { min-width: 0; }
.auth-screen.landing .lp-dd-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--envoy-red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.auth-screen.landing .lp-dd-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 0 0 16px;
  text-wrap: balance;
}
.auth-screen.landing .lp-dd-desc {
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0 0 24px;
}
.auth-screen.landing .lp-dd-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-screen.landing .lp-dd-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.5;
}
.auth-screen.landing .lp-dd-bullets li strong { color: var(--fg-1); font-weight: var(--fw-semibold); }
.auth-screen.landing .lp-dd-tick {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--cilantro-20);
  color: var(--cilantro-60);
  font-size: 11px;
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* Mock UI inside each deep-dive — shared browser-frame skin */
.auth-screen.landing .lp-dd-visual { min-width: 0; }
.auth-screen.landing .lp-dd-mock {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-screen.landing .lp-dd-mock-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--arctic);
  border-bottom: 1px solid var(--border);
}
.auth-screen.landing .lp-dd-mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.auth-screen.landing .lp-dd-mock-path {
  margin-left: 12px;
  font-size: 12px;
  color: var(--fg-3);
  font-family: var(--font-mono);
}
.auth-screen.landing .lp-dd-mock-body { padding: 24px 26px; }

/* --- Generate Slides mock --- */
.auth-screen.landing .lp-dd-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 6px;
}
.auth-screen.landing .lp-dd-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-3);
  font-weight: var(--fw-medium);
}
.auth-screen.landing .lp-dd-step.is-active { color: var(--fg-1); }
.auth-screen.landing .lp-dd-step-num {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: var(--fg-3);
}
.auth-screen.landing .lp-dd-step.is-active .lp-dd-step-num {
  background: var(--envoy-red);
  border-color: transparent;
  color: #fff;
}
.auth-screen.landing .lp-dd-field { margin-bottom: 12px; }
.auth-screen.landing .lp-dd-field-label {
  display: block;
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.auth-screen.landing .lp-dd-field-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--arctic);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-1);
}
.auth-screen.landing .lp-dd-field-input > svg { color: var(--fg-3); flex-shrink: 0; }
.auth-screen.landing .lp-dd-field-input > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-screen.landing .lp-dd-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--envoy-red);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--fw-bold);
  cursor: default;
}

/* --- Update Sheets mock --- */
.auth-screen.landing .lp-dd-sheets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-screen.landing .lp-dd-sheet-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-screen.landing .lp-dd-sheet-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(33, 148, 78, 0.1);
  color: var(--cilantro-60);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-screen.landing .lp-dd-sheet-meta { min-width: 0; }
.auth-screen.landing .lp-dd-sheet-name {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-screen.landing .lp-dd-sheet-sub {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 2px;
}
.auth-screen.landing .lp-dd-sheet-pill {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.auth-screen.landing .lp-dd-sheet-pill.is-fresh { background: var(--cilantro-20); color: var(--cilantro-60); }
.auth-screen.landing .lp-dd-sheet-pill.is-stale { background: rgba(184, 131, 12, 0.15); color: #8a6310; }
.auth-screen.landing .lp-dd-sheet-pill.is-busy  { background: rgba(250, 67, 56, 0.1); color: var(--envoy-red); }

/* --- Custom Templates mock --- */
.auth-screen.landing .lp-dd-tmpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.auth-screen.landing .lp-dd-tmpl-count {
  font-size: 11px;
  color: var(--fg-3);
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--fw-medium);
}
.auth-screen.landing .lp-dd-tmpl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.auth-screen.landing .lp-dd-tmpl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-screen.landing .lp-dd-tmpl-thumb {
  aspect-ratio: 16/10;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.auth-screen.landing .lp-dd-tmpl.is-selected .lp-dd-tmpl-thumb {
  border-color: var(--envoy-red);
  box-shadow: 0 0 0 3px rgba(250, 67, 56, 0.12);
}
.auth-screen.landing .lp-dd-tmpl-band {
  height: 14px;
  flex-shrink: 0;
}
.auth-screen.landing .lp-dd-tmpl-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 14px;
}
.auth-screen.landing .lp-dd-tmpl-h {
  display: block;
  height: 8px;
  width: 70%;
  border-radius: 2px;
}
.auth-screen.landing .lp-dd-tmpl-l {
  display: block;
  height: 4px;
  background: var(--carbon-15, #DCDEE5);
  border-radius: 2px;
  width: 90%;
}
.auth-screen.landing .lp-dd-tmpl-name {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
}

/* --- Saved Configurations mock --- */
.auth-screen.landing .lp-dd-saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-screen.landing .lp-dd-saved-new {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--envoy-red);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: default;
  text-transform: none;
  letter-spacing: 0;
}
.auth-screen.landing .lp-dd-saved-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auth-screen.landing .lp-dd-saved-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border-subtle);
}
.auth-screen.landing .lp-dd-saved-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg-1);
  color: var(--gem-60);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-screen.landing .lp-dd-saved-meta { min-width: 0; }
.auth-screen.landing .lp-dd-saved-name {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-screen.landing .lp-dd-saved-sub {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 2px;
}
.auth-screen.landing .lp-dd-saved-mark {
  font-size: 11px;
  color: var(--fg-3);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .auth-screen.landing .lp-dd-inner {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 56px 32px;
  }
  .auth-screen.landing .lp-deepdive--alt .lp-dd-inner .lp-dd-text { order: 1; }
  .auth-screen.landing .lp-deepdive--alt .lp-dd-inner .lp-dd-visual { order: 2; }
}

/* Footer (light gray) */
.auth-screen.landing .lp-foot {
  background: var(--carbon-5);
  color: var(--fg-3);
  border-top: 1px solid var(--border);
  padding: 24px 32px;
}
.auth-screen.landing .lp-foot-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  font-size: 13px;
}
.auth-screen.landing .lp-foot-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--fg-1);
  font-weight: var(--fw-bold);
}
.auth-screen.landing .lp-foot-built {
  display: flex; align-items: center; gap: 8px;
}
.auth-screen.landing .lp-foot-built img { opacity: 0.9; }
.auth-screen.landing .lp-foot-meta {
  margin-left: auto;
  display: flex; gap: 20px;
}
.auth-screen.landing .lp-foot-meta a { transition: color 150ms ease; }
.auth-screen.landing .lp-foot-meta a:hover { color: var(--fg-1); }

@media (max-width: 980px) {
  .auth-screen.landing .lp-nav-items { display: none; }
  .auth-screen.landing .lp-hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .auth-screen.landing .lp-visual { height: 480px; }
  .auth-screen.landing .lp-features { grid-template-columns: repeat(2, 1fr); }
  .auth-screen.landing .lp-how-grid { grid-template-columns: 1fr; }
  .auth-screen.landing .lp-foot-inner { flex-wrap: wrap; }
  .auth-screen.landing .lp-foot-meta { margin-left: 0; }
}
@media (max-width: 640px) {
  .auth-screen.landing .lp-nav-inner { padding: 12px 20px; }
  .auth-screen.landing .lp-hero { padding: 40px 20px 24px; }
  .auth-screen.landing .lp-how { padding: 60px 20px; }
  .auth-screen.landing .lp-visual { height: 420px; }
  .auth-screen.landing .lp-features { grid-template-columns: 1fr; padding: 20px; }
}
