/* ===========================================================
   Presupuesto · Simplificando — Design tokens
   ========================================================= */
:root {
  /* Neutros tibios */
  --paper: #f6f3ed;
  --paper-2: #efeae0;
  --ink: #1d1b16;
  --ink-2: #3a3730;
  --ink-3: #6b665b;
  --ink-4: #9b9588;
  --line: #e3ddd0;
  --line-2: #d2cbbb;
  --card: #fbf9f4;
  --card-elev: #ffffff;

  /* Acentos */
  --olive: #4a5d3a;          /* primario */
  --olive-2: #3a4a2c;
  --olive-soft: #c9d3b8;
  --olive-tint: #e8ecdb;

  --rust: #b15534;           /* gasto / atención */
  --rust-soft: #efd2c4;
  --rust-tint: #f8e6dc;

  --sand: #c98f3c;           /* warning */
  --sand-tint: #f3e2c4;

  --plum: #6b3f5e;           /* categorías */
  --plum-tint: #e7d4e0;

  --teal: #2d6a6a;
  --teal-tint: #cce0df;

  /* Status */
  --ok: #4a5d3a;
  --warn: #c98f3c;
  --err: #b15534;

  /* Type */
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  /* Spacing */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(29, 27, 22, 0.04), 0 1px 3px rgba(29, 27, 22, 0.04);
  --shadow-md: 0 2px 4px rgba(29, 27, 22, 0.04), 0 8px 24px rgba(29, 27, 22, 0.06);
  --shadow-lg: 0 24px 48px rgba(29, 27, 22, 0.12);
}

[data-theme="dark"] {
  --paper: #15140f;
  --paper-2: #1c1a14;
  --ink: #f1ede1;
  --ink-2: #d4cfbf;
  --ink-3: #9b9583;
  --ink-4: #66614f;
  --line: #2a2720;
  --line-2: #3a362b;
  --card: #1c1a14;
  --card-elev: #22201a;
  --olive: #a9bd8f;
  --olive-2: #c5d3ad;
  --olive-soft: #4a5d3a;
  --olive-tint: #2c3424;
  --rust: #d68969;
  --rust-tint: #3a241b;
  --sand-tint: #3a2f1b;
  --plum-tint: #2e1f2a;
  --teal-tint: #1f2e2e;
  --shadow-md: 0 2px 4px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 48px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#root { min-height: 100svh; }
button { font-family: inherit; }

/* App grid */
.app {
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
  width: 100%;
  min-height: 100svh;
  align-items: stretch;
  transition: grid-template-columns 0.25s ease;
}
@supports (min-height: 100dvh) {
  #root,
  .app { min-height: 100dvh; }
}
.app[data-collapsed="true"] { grid-template-columns: 64px minmax(0, 1fr); }

/* ============== Sidebar ============== */
.sidebar {
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  position: relative;
  align-self: stretch;
  min-height: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
}
.sidebar-shell {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  min-height: 100svh;
  max-height: 100svh;
  padding: 20px 14px max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  z-index: 12;
}
.app[data-collapsed="true"] .sidebar-shell { width: 64px; }
@supports (min-height: 100dvh) {
  .sidebar-shell {
    min-height: 100dvh;
    max-height: 100dvh;
  }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  flex-shrink: 0;
  position: relative;
}
.brand-mark::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--olive);
  bottom: 4px; right: 4px;
}
.brand-text {
  display: flex; flex-direction: column;
  line-height: 1.1;
}
.brand-text .a {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  color: var(--ink);
}
.brand-text .b {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.collapsed .brand-text { display: none; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px 8px 0;
}
.nav-section-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 8px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  font-size: 13px;
  transition: background 0.15s;
}
.nav-item:hover { background: var(--line); }
.nav-item.active {
  background: var(--ink);
  color: var(--paper);
}
.nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; }
.collapsed .nav-item .label,
.collapsed .nav-section-label { display: none; }
.collapsed .nav-item { justify-content: center; }

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: max-content;
  align-self: end;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(247, 244, 238, 0), var(--paper-2) 18%);
}
.month-pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.month-pill:hover { border-color: var(--line-2); }
.month-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 0 3px var(--olive-tint);
}
.month-pill .stack { display: flex; flex-direction: column; gap: 1px; }
.month-pill .stack .a { font-size: 12px; color: var(--ink-3); }
.month-pill .stack .b { font-size: 13px; font-weight: 500; }
.collapsed .month-pill .stack { display: none; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
  cursor: pointer;
}
.user-chip:hover { background: var(--line); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--plum-tint);
  color: var(--plum);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.user-chip .info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; max-width: 146px; overflow: hidden; }
.user-chip .info .a,
.user-chip .info .b { display: block; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .info .a { font-size: 13px; font-weight: 500; }
.user-chip .info .b { font-size: 11px; color: var(--ink-3); }
.logout-btn {
  width: 100%; border: 1px solid transparent; background: transparent; color: var(--ink-3);
  border-radius: var(--r-md); padding: 9px 10px; display: flex; align-items: center; gap: 9px;
  font: inherit; font-size: 12px; cursor: pointer; transition: var(--trans); text-align: left;
}
.logout-btn:hover { background: var(--rust-tint); color: var(--rust); border-color: var(--rust-soft); }
.logout-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collapsed .user-chip .info,
.collapsed .logout-btn span { display: none; }
.collapsed .logout-btn { justify-content: center; padding: 9px; }

/* ============== Topbar ============== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px clamp(16px, 2.4vw, 32px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.topbar h1 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  font-style: italic;
}
.topbar .crumb {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.topbar > .col { min-width: 0; }
.topbar h1 { overflow-wrap: anywhere; }

.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--line); border-color: var(--line-2); }
.icon-btn svg { width: 16px; height: 16px; }

/* ============== Content ============== */
.content {
  padding: clamp(18px, 2.4vw, 32px);
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1;
}

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}
.btn:hover { background: var(--line); border-color: var(--line-2); }
.btn.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn.primary:hover { background: var(--ink-2); }
.btn.olive {
  background: var(--olive);
  color: #fff;
  border-color: var(--olive);
}
.btn.olive:hover { background: var(--olive-2); }
.btn.lg { padding: 14px 22px; font-size: 14px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line); }
.btn svg { width: 14px; height: 14px; }

/* ============== Cards ============== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-pad { padding: 20px; }
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============== Type ============== */
.kicker {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.muted { color: var(--ink-3); }

/* ============== Tables ============== */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--paper-2); }
.tbl .num { text-align: right; font-family: var(--mono); font-feature-settings: 'tnum'; }

/* ============== Tags / pills ============== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  max-width: 100%;
  min-width: 0;
}
.tag span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tag.olive { background: var(--olive-tint); color: var(--olive-2); }
.tag.rust { background: var(--rust-tint); color: var(--rust); }
.tag.sand { background: var(--sand-tint); color: #8a5d20; }
.tag.plum { background: var(--plum-tint); color: var(--plum); }
.tag.teal { background: var(--teal-tint); color: var(--teal); }
.tag.neutral { background: var(--paper-2); color: var(--ink-3); border-color: var(--line); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }

/* ============== Inputs ============== */
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--olive-tint);
}
.input.mono { font-family: var(--mono); letter-spacing: 0.04em; }

/* ============== Misc ============== */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* Bars / progress */
.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}
.bar > i {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--olive);
  border-radius: inherit;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar.rust > i { background: var(--rust); }
.bar.sand > i { background: var(--sand); }
.bar.split { background: var(--olive-tint); }
.bar.split > i { background: var(--olive); }
.bar > .marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--ink);
  border-radius: 1px;
}

/* Modal */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(29, 27, 22, 0.45);
  display: grid;
  place-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}
.modal {
  background: var(--card);
  border-radius: var(--r-xl);
  width: min(640px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.wide { width: min(880px, 92vw); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.review-modal {
  max-height: min(88vh, 820px);
}
.review-modal .modal-body {
  min-height: 0;
}
.review-foot {
  background: var(--card);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.review-progress {
  min-width: 220px;
  flex: 1 1 280px;
}
.review-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
}
.tour-back {
  background:
    radial-gradient(circle at 18% 18%, rgba(232, 236, 219, 0.42), transparent 28%),
    rgba(29, 27, 22, 0.58);
}
.tour-card {
  width: min(920px, 92vw);
  max-height: 88vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 104px 1fr;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tour-rail {
  background: linear-gradient(180deg, var(--olive), #29331f);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tour-dot {
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.72);
  border-radius: 999px;
  height: 42px;
  font-family: var(--mono);
  cursor: pointer;
}
.tour-dot.active {
  background: #fff;
  color: var(--olive);
}
.tour-content {
  padding: 32px;
  overflow: auto;
}
.tour-content h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -0.03em;
}
.tour-content p {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
  max-width: 680px;
}
.tour-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.tour-point {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.35;
}
.tour-point span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--olive-tint);
  color: var(--olive);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tour-preview {
  margin-top: 22px;
  height: 150px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(74, 93, 58, 0.08), transparent 45%),
    var(--paper-2);
  display: grid;
  grid-template-columns: 120px 1fr;
  overflow: hidden;
}
.tour-mini-sidebar {
  background: rgba(74, 93, 58, 0.18);
  border-right: 1px solid var(--line);
}
.tour-mini-main {
  padding: 24px;
  display: grid;
  gap: 12px;
  align-content: center;
}
.tour-mini-main span,
.tour-mini-main strong,
.tour-mini-main i {
  display: block;
  height: 16px;
  border-radius: 999px;
  background: var(--line);
}
.tour-mini-main strong { width: 62%; height: 28px; background: var(--olive-tint); }
.tour-mini-main i { width: 82%; }
@media (max-width: 720px) {
  .tour-card {
    grid-template-columns: 1fr;
  }
  .tour-rail {
    flex-direction: row;
    padding: 14px;
  }
  .tour-points {
    grid-template-columns: 1fr;
  }
  .review-actions {
    width: 100%;
  }
  .review-actions .btn {
    flex: 1;
  }
}



/* Guided first-use spotlight */
body.tour-scroll-locked {
  touch-action: none;
}
.tour-spotlight-layer {
  position: fixed;
  inset: 0;
  z-index: 2500;
  pointer-events: none;
}
.tour-spotlight-segment {
  position: fixed;
  background: rgba(22, 20, 15, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: auto;
  animation: fade-in 0.2s ease both;
}
.tour-focus-frame {
  position: fixed;
  z-index: 2530;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  box-shadow:
    0 0 0 5px rgba(74, 93, 58, 0.28),
    0 0 0 7px rgba(255, 255, 255, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  animation: tour-focus-pulse 2.6s ease-in-out infinite;
}
.tour-popover-card {
  position: fixed;
  z-index: 2540;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background: var(--card-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.20);
  overflow: hidden;
  animation: tour-card-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* Progress track — flush at card top */
.tour-progress-track {
  height: 3px;
  background: var(--line);
  flex-shrink: 0;
}
.tour-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--olive), var(--sand));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Scrollable content */
.tour-card-content {
  padding: 22px 24px 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  flex: 1;
}
/* Header: step badge + kicker + close */
.tour-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.tour-step-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 3px 9px 3px 8px;
  background: var(--olive-tint);
  border: 1px solid var(--olive-soft);
  border-radius: 999px;
  flex-shrink: 0;
}
.tour-step-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--olive);
  line-height: 1;
}
.tour-step-sep,
.tour-step-total {
  font-size: 11px;
  color: var(--ink-4);
  line-height: 1;
}
.tour-card-head .kicker { flex: 1; margin: 0; }
.tour-close-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, color 0.14s;
  padding: 0;
}
.tour-close-btn:hover { background: var(--line); color: var(--ink); }
/* Title */
.tour-title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.8vw, 40px);
  line-height: 0.97;
  letter-spacing: -0.03em;
  color: var(--ink);
}
/* Body */
.tour-body {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.56;
}
/* Tip block */
.tour-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--paper-2);
  margin-bottom: 20px;
}
.tour-tip.found { border-color: var(--olive-soft); background: var(--olive-tint); }
.tour-tip.missing { border-color: var(--sand); background: var(--sand-tint); }
.tour-tip-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid var(--line-2);
  color: var(--ink-3);
  margin-top: 1px;
}
.tour-tip.found .tour-tip-icon { background: var(--olive); border-color: var(--olive-2); color: #fff; }
.tour-tip.missing .tour-tip-icon { background: var(--sand); border-color: var(--sand); color: #fff; }
.tour-tip-text { margin: 0; font-size: 12.5px; line-height: 1.48; color: var(--ink-2); }
.tour-tip.found .tour-tip-text { color: var(--olive-2); }
.tour-tip.missing .tour-tip-text { color: #7a4d12; }
/* Footer: dots + skip + nav buttons */
.tour-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line);
}
.tour-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.tour-dot-btn {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  border: 1.5px solid var(--line-2);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: width 0.2s ease, background 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}
.tour-dot-btn.done { background: var(--olive-soft); border-color: var(--olive-soft); }
.tour-dot-btn.active { width: 20px; background: var(--olive); border-color: var(--olive); }
.tour-foot-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tour-skip-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-4);
  cursor: pointer;
  text-underline-offset: 3px;
  transition: color 0.14s;
  white-space: nowrap;
}
.tour-skip-btn:hover { color: var(--ink-2); text-decoration: underline; }
@keyframes tour-card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes tour-focus-pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(74,93,58,0.28), 0 0 0 7px rgba(255,255,255,0.08), 0 24px 64px rgba(0,0,0,0.32); }
  50%       { box-shadow: 0 0 0 7px rgba(74,93,58,0.38), 0 0 0 9px rgba(255,255,255,0.12), 0 24px 64px rgba(0,0,0,0.32); }
}
@media (max-width: 760px) {
  .tour-popover-card { max-height: calc(100dvh - 28px); }
  .tour-card-content { padding: 18px 18px 0; }
  .tour-title { font-size: 26px; }
  .tour-foot { flex-wrap: wrap; gap: 14px; }
  .tour-foot-right { width: 100%; justify-content: space-between; }
  .tour-foot-right .btn { flex: 1; justify-content: center; }
}

/* Page title block */
.page-title {
  margin-bottom: 28px;
}
.page-title .kicker { margin-bottom: 8px; }
.page-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 44px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.page-title h1 em {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  color: var(--ink-3);
  font-size: 40px;
}
.page-title .sub {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 15px;
  max-width: 60ch;
}

.dashboard-title-meta {
  max-width: none;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard-cycle { min-width: 0; }
.dashboard-source-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.dashboard-source-badges::-webkit-scrollbar { display: none; }
.dashboard-source-chip { flex: 0 0 auto; white-space: nowrap; }
.app-inline-alert {
  margin: 14px clamp(16px, 2.4vw, 32px) 0;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.app-inline-alert.info { background: var(--olive-tint); color: var(--olive); border-color: var(--olive-soft); }
.app-inline-alert.error { background: var(--rust-tint); color: var(--rust); border-color: var(--rust-soft); }
.app-inline-alert .btn { padding: 4px 8px; font-size: 12px; color: inherit; }

/* Animations */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(74, 93, 58, 0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(74, 93, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 93, 58, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loading-sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }
.spin { animation: spin 1s linear infinite; }

/* Spark / sparkline */
.spark { width: 100%; height: 40px; }

/* Privacy mode */
.private .secret {
  filter: blur(8px);
  user-select: none;
  transition: filter 0.2s;
}
.private .secret:hover { filter: blur(2px); }

/* Scroll */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }


/* Responsive shell */
@media (max-width: 980px) {
  .app,
  .app[data-collapsed="true"] {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 0;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidebar-shell {
    position: static;
    inset: auto;
    min-height: 0;
    max-height: none;
    width: max-content;
    min-width: 100%;
    padding: 12px 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow: visible;
    z-index: auto;
  }
  .brand,
  .sidebar-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    gap: 8px;
    min-width: max-content;
    overflow: visible;
    padding: 0;
  }
  .nav-section-label {
    display: none;
  }
  .nav-item {
    width: auto;
    white-space: nowrap;
  }
  .topbar {
    position: relative;
    top: auto;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 16px;
  }
  .topbar {
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .topbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
  .page-title h1 {
    font-size: 34px;
  }
  .page-title h1 em {
    font-size: 30px;
  }
}

/* Centered auth/loading states */
.center-shell,
.auth-shell {
  min-height: 100vh;
  width: 100vw;
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(201, 211, 184, 0.55), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(231, 212, 224, 0.55), transparent 32%),
    var(--paper);
}
.auth-layout {
  width: min(920px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(300px, 0.88fr);
  gap: 18px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.auth-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(251, 249, 244, 0.88);
  box-shadow: var(--shadow-lg);
  padding: 34px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(18px);
}
.auth-guide {
  border: 1px solid rgba(74, 93, 58, 0.22);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(29, 27, 22, 0.94), rgba(58, 74, 44, 0.9)),
    var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  overflow: hidden;
  position: relative;
}
.auth-guide::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  right: -72px;
  top: -72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 143, 60, 0.28), transparent 68%);
}
.auth-guide-head,
.auth-data-note {
  position: relative;
  z-index: 1;
}
.auth-guide-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-guide .kicker { color: rgba(246, 243, 237, 0.62); }
.auth-slide-window {
  position: relative;
  z-index: 1;
  overflow: hidden;
  height: 210px;
}
.auth-slide-track {
  display: flex;
  height: 100%;
  transition: transform 0.58s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.auth-slide-card {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 6px;
}
.auth-slide-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--olive-soft);
  margin-bottom: 8px;
}
.auth-slide-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.03em;
}
.auth-slide-card p {
  margin: 12px 0 0;
  color: rgba(246, 243, 237, 0.76);
  font-size: 15px;
  line-height: 1.48;
  max-width: 46ch;
}
.auth-slide-points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 22px;
}
.auth-slide-points span,
.auth-data-note {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-slide-points span {
  color: rgba(246, 243, 237, 0.82);
  font-size: 13px;
}
.auth-slide-points .icon,
.auth-data-note .icon { color: var(--olive-soft); }
.auth-slide-progress {
  position: relative;
  z-index: 1;
  height: 4px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(246, 243, 237, 0.16);
  overflow: hidden;
}
.auth-slide-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--olive-soft);
  transition: width 0.42s ease;
}
.auth-data-note {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(246, 243, 237, 0.14);
  border-radius: var(--r-md);
  background: rgba(246, 243, 237, 0.07);
  color: rgba(246, 243, 237, 0.72);
  font-size: 12px;
  line-height: 1.35;
}
.auth-title {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -0.03em;
}
.auth-title em {
  color: var(--olive);
}
.auth-copy {
  margin: 0 0 22px;
  color: var(--ink-3);
  font-size: 15px;
}
.auth-error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--rust-tint);
  color: var(--rust);
  font-size: 13px;
}
.auth-google,
.auth-secondary {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  padding: 13px 16px;
}
.auth-google:disabled {
  opacity: .7;
  cursor: wait;
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  cursor: pointer;
  user-select: none;
}
.auth-remember-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.auth-remember-box {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--line-2);
  background: var(--card-elev);
  position: relative;
  transition: border-color .15s ease, background .15s ease;
}
.auth-remember:hover .auth-remember-box {
  border-color: var(--olive-soft);
}
.auth-remember-input:checked + .auth-remember-box {
  background: var(--olive);
  border-color: var(--olive);
}
.auth-remember-input:checked + .auth-remember-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 1.5px solid var(--paper);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.auth-remember-text {
  font-size: 13px;
  color: var(--ink-3);
  font-family: var(--sans);
  line-height: 1.4;
}
.auth-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(1px);
  opacity: .7;
}
.auth-orb-a {
  width: 260px;
  height: 260px;
  left: calc(50% - 470px);
  top: calc(50% - 270px);
  background: var(--olive-tint);
}
.auth-orb-b {
  width: 220px;
  height: 220px;
  right: calc(50% - 470px);
  bottom: calc(50% - 260px);
  background: var(--plum-tint);
}

@media (prefers-reduced-motion: reduce) {
  .auth-slide-track,
  .auth-slide-progress span {
    transition: none;
  }
}

@media (max-width: 860px) {
  .auth-shell {
    overflow-y: auto;
    place-items: start center;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    width: min(520px, calc(100vw - 28px));
  }
  .auth-guide { order: 1; }
  .auth-panel { order: 2; }
  .auth-guide,
  .auth-panel {
    padding: 22px;
    border-radius: 22px;
  }
  .auth-slide-window {
    height: 188px;
  }
}

.empty-state {
  min-height: 120px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--paper-2);
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  font-size: 13px;
}
.empty-state.compact {
  min-height: 240px;
}


/* Profile */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: stretch;
  grid-auto-rows: auto;
}
.profile-grid > .card {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.profile-grid > .card > .card-pad { flex: 1; }
.profile-card-main { grid-row: span 2; }
.profile-wide { grid-column: 1 / -1; height: auto; }
.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span,
.toggle-line { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.settings-row { display: flex; flex-wrap: wrap; gap: 12px; }
.toggle-line { display: inline-flex; align-items: center; gap: 8px; }
.phone-field { grid-column: 1 / -1; }
.phone-grid { display: grid; grid-template-columns: 112px 120px minmax(160px, 1fr); gap: 10px; }
.profile-gamification-inline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.profile-gamification-top { order: -1; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.phone-country-select { font-weight: 700; }
.profile-gamification-tile > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.2; }
.profile-gamification-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: linear-gradient(135deg, var(--olive-tint), var(--paper-2)); min-width: 0; }
.profile-gamification-tile > span { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--card); color: var(--olive); box-shadow: var(--shadow-sm); flex-shrink: 0; }
.profile-gamification-tile b,
.profile-gamification-tile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-gamification-tile small { color: var(--ink-3); font-size: 11px; }
.bank-rule-editor { display: grid; grid-template-columns: minmax(180px, .9fr) 130px minmax(260px, 1.2fr) auto; gap: 10px; align-items: stretch; }
.bank-rules-table { min-width: 860px; }
.status-banner { margin-bottom: 16px; padding: 14px; border-radius: var(--r-md); font-size: 13px; }
.status-banner.ok { background: var(--olive-tint); color: var(--olive); }
.status-banner.error { background: var(--rust-tint); color: var(--rust); }
.status-banner.warn { background: var(--sand); color: var(--ink); border: 1px solid var(--line); }
.connection-card { display: flex; gap: 12px; align-items: center; min-height: 72px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper-2); }
.connection-card[data-connected="true"] { background: var(--olive-tint); border-color: var(--olive-soft); color: var(--olive); }
.scope-row { padding: 8px 0; }
.scope-row > span { width: 22px; height: 22px; border-radius: 6px; background: var(--paper-2); display: grid; place-items: center; color: var(--ink-3); }
.text-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 860px) {
  .profile-grid,
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-card-main { grid-row: auto; }
  .profile-identity-row { align-items: flex-start; }
  .phone-grid,
  .profile-gamification-inline,
  .bank-rule-editor { grid-template-columns: 1fr; }
}


/* Mobile resilience layer */
@media (max-width: 760px) {
  html, body { font-size: 14px; }
  .app { min-height: 100dvh; }
  .main { min-width: 0; }
  .content { padding: 14px; max-width: 100%; }
  .card, .card-pad, .modal, .tour-card { min-width: 0; }
  .row { min-width: 0; flex-wrap: wrap; }
  .between { gap: 10px; flex-wrap: wrap; }
  .page-title { margin-bottom: 18px; }
  .page-title h1 { font-size: 32px; line-height: 1; }
  .page-title h1 em { font-size: 30px; }
  .page-title .sub { max-width: 100%; }
  .content > div[style*="grid-template-columns"],
  .content > section[style*="grid-template-columns"],
  .card > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .card-head { gap: 10px; align-items: flex-start; }
  .tbl { display: block; width: 100%; overflow-x: auto; white-space: nowrap; }
  .topbar h1 { font-size: 24px; }
  .topbar-actions .btn { padding: 9px 12px; }
  .auth-shell { padding: 12px; min-height: 100dvh; width: 100%; }
  .auth-layout { gap: 12px; }
  .auth-panel, .auth-guide { padding: 18px; border-radius: 18px; }
  .auth-title { font-size: 38px; }
  .auth-slide-card h2 { font-size: 31px; letter-spacing: 0; }
  .auth-slide-window { height: 176px; }
  .modal,
  .modal.wide,
  .tour-card {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }
  .modal-body { max-height: none; }
  .tour-card { grid-template-columns: 1fr; }
  .tour-rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  input.input, select.input, textarea.input, .btn { max-width: 100%; }
}

@media (max-width: 430px) {
  .nav { width: 100%; }
  .nav-item { flex: 1 0 auto; justify-content: center; }
  .nav-item .label { font-size: 12px; }
  .topbar { gap: 10px; }
  .topbar-actions { justify-content: stretch; }
  .topbar-actions .btn { flex: 1; }
  .auth-copy, .auth-slide-card p { font-size: 14px; }
}


/* Data transparency */
.data-flow-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.data-flow-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.data-flow-step {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px; border-radius: var(--r-sm);
  background: var(--paper-2); font-size: 12px; font-weight: 600;
  color: var(--ink-3);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.data-flow-step.flow-active {
  background: var(--olive-tint);
  color: var(--olive);
  box-shadow: 0 0 0 1.5px var(--olive-soft);
}
.data-flow-step.flow-done {
  background: var(--olive-tint);
  color: var(--olive);
}
.data-flow-step.flow-pending {
  opacity: 0.45;
}
.flow-arrow { color: var(--line-2); display: inline-flex; transition: color 0.3s ease; }
.flow-arrow.flow-arrow-lit { color: var(--olive-soft); }
.flow-spin { display: inline-flex; animation: spin 1s linear infinite; }
.flow-pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--olive);
  animation: flow-pulse 1.1s ease-in-out infinite;
  flex-shrink: 0;
}
.flow-done-badge { animation: pop-in 0.25s ease both; }
.data-flow-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--ink-3); font-size: 12px; text-align: right; }
.data-flow-summary b { color: var(--olive); }
@keyframes flow-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }
@media (max-width: 760px) {
  .data-flow-card { align-items: flex-start; flex-direction: column; }
  .data-flow-summary { align-items: flex-start; text-align: left; }
}


/* Categorization rules */
.rule-editor { display: grid; grid-template-columns: minmax(180px, 1fr) 120px minmax(160px, 1fr) auto; gap: 10px; align-items: center; }
.rule-list { display: grid; gap: 8px; }
.rule-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(140px, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper-2); }
@media (max-width: 760px) { .rule-editor, .rule-row { grid-template-columns: 1fr; } }


/* Editable categories */
.category-editor { display: grid; grid-template-columns: minmax(160px, 1fr) 120px minmax(160px, 1fr) auto; gap: 10px; align-items: center; }
.category-list { display: flex; flex-wrap: wrap; gap: 8px; }
.category-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper-2); }
@media (max-width: 760px) { .category-editor { grid-template-columns: 1fr; } .category-pill { width: 100%; justify-content: space-between; } }


/* Gamification */
/* ── Transfer matching card ──────────────────────────────── */
.transfer-card { overflow: hidden; margin-bottom: 24px; }
.transfer-card-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: none; border: none; cursor: pointer; gap: 12px; text-align: left; transition: background 0.15s; }
.transfer-card-header:hover { background: var(--paper-2); }
.transfer-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--paper-2); color: var(--ink-3); flex-shrink: 0; transition: background 0.2s, color 0.2s; }
.transfer-card-icon--active { background: var(--olive-tint); color: var(--olive); }
.transfer-card-body { border-top: 1px solid var(--line); }
.transfer-section { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.transfer-section:last-child { border-bottom: none; }
.transfer-section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 10px; }
.transfer-suggestion { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.transfer-suggestion:last-child { border-bottom: none; }
.transfer-suggestion-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.transfer-suggestion-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.transfer-pair { display: flex; flex-direction: column; gap: 4px; }
.transfer-pair-row { display: flex; align-items: center; gap: 6px; }
.transfer-loan { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.transfer-loan:last-child { border-bottom: none; }
.transfer-confirmed { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.transfer-confirmed:last-child { border-bottom: none; }

.gamification-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; padding: 14px 16px; border-radius: var(--r-md); background: var(--olive-tint); color: var(--olive); border: 1px solid var(--olive-soft); }
.gamification-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--card); }
.gamification-progress { width: min(280px, 100%); height: 8px; border-radius: 999px; background: rgba(74, 93, 58, .16); overflow: hidden; }
.gamification-progress span { display: block; height: 100%; border-radius: inherit; background: var(--olive); }
.gamification-profile { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gamification-profile > div { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper-2); display: flex; flex-direction: column; gap: 2px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.badge.done { color: var(--olive); background: var(--olive-tint); border-color: var(--olive-soft); }
@media (max-width: 760px) { .gamification-card { flex-direction: column; align-items: stretch; } .gamification-profile { grid-template-columns: 1fr; } }


/* Referrals */
.referral-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr); gap: 16px; align-items: center; }
@media (max-width: 760px) { .referral-box { grid-template-columns: 1fr; } }

/* Admin panel */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .65fr);
  gap: 16px;
  align-items: start;
}
.admin-panel,
.admin-detail-card,
.admin-jobs-card { min-width: 0; }
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-table td { vertical-align: top; }
.admin-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.btn.danger { color: var(--rust); }
.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-detail-grid span,
.admin-config-list > div,
.admin-analysis {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  padding: 10px;
}
.admin-detail-grid span { display: flex; flex-direction: column; gap: 2px; }
.admin-detail-grid small,
.admin-config-list span { color: var(--ink-3); }
.admin-config-list { display: grid; gap: 8px; }
.admin-config-list > div { display: flex; justify-content: space-between; gap: 10px; }
.admin-jobs-card { margin-top: 16px; }
.admin-jobs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 16px;
  padding: 16px;
}
.admin-log-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  padding: 14px;
  min-width: 0;
}
.admin-analysis { display: grid; gap: 6px; color: var(--ink-2); }
.admin-analysis span { color: var(--ink-3); font-size: 12px; }
.admin-log-list { display: grid; gap: 8px; }
.admin-log-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
}
.admin-log-row p { margin: 0; color: var(--ink-2); font-size: 12px; }
.admin-log-row.error { border-color: var(--rust-soft); background: var(--rust-tint); }
.admin-log-row.warn { border-color: var(--sand); }
@media (max-width: 980px) {
  .admin-stat-grid,
  .admin-grid,
  .admin-jobs-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin-actions { justify-content: flex-start; }
  .admin-detail-grid { grid-template-columns: 1fr; }
}


/* Overflow safety */
.card, .modal, .tour-card, .profile-grid, .admin-grid, .data-flow-card { min-width: 0; }
.card-head, .data-flow-step, .category-pill, .rule-row { min-width: 0; overflow-wrap: anywhere; }
.tbl td, .tbl th { overflow-wrap: anywhere; }

/* Onboarding readability */
.auth-layout { align-items: center; }
.auth-guide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, rgba(232, 236, 219, 0.94), rgba(251, 249, 244, 0.92)), var(--card);
  color: var(--ink);
}
.auth-guide::after { background: radial-gradient(circle, rgba(74, 93, 58, 0.14), transparent 68%); }
.auth-guide-head { margin-bottom: 24px; }
.auth-guide .kicker,
.auth-slide-card p,
.auth-slide-points span,
.auth-data-note { color: var(--ink-3); }
.auth-slide-card { justify-content: center; }
.auth-slide-kicker { color: var(--olive); }
.auth-slide-progress { background: var(--line); }
.auth-slide-progress span { background: var(--olive); }
.auth-data-note { border-color: var(--line); background: rgba(255,255,255,.5); }

.admin-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 12px;
}


/* Categorization memory viewer */
.categorization-memory-card { overflow: hidden; }
.memory-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .72fr);
  gap: 16px;
  align-items: center;
}
.memory-open-copy { margin: 0; }
.memory-live-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.memory-live-strip > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.memory-live-strip b { font-size: 20px; }
.memory-live-strip span { color: var(--ink-3); font-size: 12px; }
.memory-modal-back {
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: rgba(29, 27, 22, .48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: clamp(12px, 3vw, 32px);
  display: grid;
  place-items: center;
}
.memory-modal {
  width: min(1180px, 100%);
  max-height: min(88dvh, 900px);
  background: var(--card);
  border: 1px solid rgba(255,255,255,.52);
  border-radius: var(--r-xl);
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.memory-modal-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.memory-modal-head h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -.03em;
}
.memory-modal-head p { margin: 8px 0 0; max-width: 70ch; }
.memory-modal-body {
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 16px;
}
.memory-section-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper-2);
  padding: 16px;
  display: grid;
  gap: 14px;
}
.memory-section-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; }
.memory-section-head h4 { margin: 0; font-size: 16px; }
.memory-section-head p { margin: 4px 0 0; }
.memory-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.memory-table { min-width: 1040px; }
.memory-table .input { padding: 8px 10px; font-size: 13px; }
.memory-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; white-space: nowrap; flex-wrap: wrap; }
.memory-add-row { grid-template-columns: minmax(180px, 1fr) 120px 120px minmax(150px, .8fr) auto; align-items: stretch; }
.memory-rule-create { grid-template-columns: minmax(220px, 1fr) 120px minmax(180px, .9fr) auto; align-items: stretch; }
@media (max-width: 900px) {
  .memory-overview { grid-template-columns: 1fr; }
  .memory-live-strip { grid-template-columns: 1fr; }
  .memory-modal-back { align-items: end; padding: 10px; }
  .memory-modal { max-height: 92dvh; border-radius: 18px; }
  .memory-modal-head { padding: 18px; }
  .memory-modal-body { padding: 12px; }
  .memory-add-row,
  .memory-rule-create { grid-template-columns: 1fr; }
  .memory-table { min-width: 880px; }
}

/* Benefits */
.benefits-content { display: flex; flex-direction: column; gap: 16px; }
.benefits-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.benefits-today-card { min-width: 210px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(135deg, var(--olive-tint), var(--card)); padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); }
.benefits-control-card { overflow: visible; }
.benefits-filters-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.benefits-filters-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.benefits-filter-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.segmented-control { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); }
.segmented-control button { border: 0; background: transparent; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.segmented-control button.active { background: var(--olive); color: var(--paper); box-shadow: var(--shadow-sm); }
.segmented-control button.today-day { color: var(--olive); font-weight: 700; }
.segmented-control button.active.today-day { color: var(--paper); }
.benefits-day-control { flex-wrap: wrap; gap: 3px; }
.benefits-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.benefit-card { min-width: 0; height: 100%; }
.benefit-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.benefit-main-row { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; align-items: center; }
.benefit-discount { width: 68px; height: 68px; border-radius: 18px; display: grid; place-items: center; background: var(--paper-2); color: var(--muted); font-size: 22px; font-weight: 800; letter-spacing: -.04em; flex-shrink: 0; }
.benefit-discount--highlight { background: var(--olive); color: var(--paper); }
.benefit-title-block { min-width: 0; }
.benefit-title-block h3 { margin: 0; font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.benefit-day-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--olive); }
.benefit-summary { font-size: 13px; overflow-wrap: anywhere; line-height: 1.4; }
.benefits-load-more { display: flex; justify-content: center; padding: 4px 0 10px; }
@media (max-width: 1180px) { .benefits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .benefits-hero { flex-direction: column; align-items: stretch; }
  .benefits-today-card { width: 100%; }
  .benefits-filters-row { flex-direction: column; align-items: stretch; }
  .benefits-grid { grid-template-columns: 1fr; }
  .segmented-control { border-radius: var(--r-lg); }
  .segmented-control button { flex: 1; text-align: center; }
}

/* ── Mobile app shell ──────────────────────────────────────────────── */
.mobile-nav { display: none; }
/* ─── Generate modal: centered card with backdrop blur ─── */
.gen-modal-back {
  z-index: 200;
  background: rgba(29, 27, 22, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: gen-fade-in 0.28s ease;
}
.gen-modal {
  position: relative;
  width: min(560px, 92vw);
  max-height: 88vh;
  background: var(--card-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: 0 32px 64px rgba(29, 27, 22, 0.22), 0 0 0 1px rgba(255,255,255,0.04) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: gen-pop-in 0.42s cubic-bezier(0.2, 0.85, 0.25, 1);
  transform-origin: 50% 60%;
}
.gen-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: transparent;
}
@keyframes gen-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes gen-pop-in {
  from { opacity: 0; transform: translateY(24px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}

/* ─── Compact GenerateView used inside modal ─── */
.gen-compact { display: flex; flex-direction: column; padding: 32px 32px 24px; gap: 20px; overflow-y: auto; }
.gen-compact-head { text-align: center; }
.gen-compact-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 38px;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.05;
  background: linear-gradient(135deg, var(--ink) 30%, var(--olive) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gen-compact-progress { display: flex; flex-direction: column; gap: 6px; }
.gen-compact-progress-row { display: flex; justify-content: space-between; align-items: baseline; }
.gen-compact-status { font-size: 13px; color: var(--ink-2); font-weight: 500; transition: color 0.2s; }
.gen-compact-pct { font-size: 12px; color: var(--ink-3); }
.gen-compact-bar {
  height: 6px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.gen-compact-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--olive) 0%, var(--olive-soft) 100%);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.3, 0.7, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.gen-compact-bar > i.sheen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: gen-sheen 1.6s linear infinite;
}
@keyframes gen-sheen {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.gen-compact-stages { display: flex; flex-direction: column; gap: 4px; }
.gen-compact-stage {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  transition: background 0.25s ease, transform 0.25s ease;
}
.gen-compact-stage.active {
  background: linear-gradient(90deg, var(--olive-tint) 0%, transparent 90%);
}
.gen-compact-stage.done .gen-compact-stage-label { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--olive-soft); }
.gen-compact-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 10px;
  font-family: var(--mono);
  background: var(--paper-2);
  color: var(--ink-4);
  border: 1.5px solid var(--line);
  transition: all 0.3s ease;
}
.gen-compact-stage.active .gen-compact-dot {
  background: var(--olive-tint);
  color: var(--olive);
  border-color: var(--olive);
  box-shadow: 0 0 0 0 rgba(74, 93, 58, 0.4);
  animation: gen-pulse-ring 1.6s infinite;
}
.gen-compact-stage.done .gen-compact-dot {
  background: var(--olive);
  color: #fff;
  border-color: var(--olive);
}
@keyframes gen-pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(74, 93, 58, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(74, 93, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 93, 58, 0); }
}
.gen-compact-stage-body { flex: 1; min-width: 0; padding-top: 3px; }
.gen-compact-stage-label { font-size: 13px; color: var(--ink-4); font-weight: 400; transition: color 0.25s; }
.gen-compact-stage.active .gen-compact-stage-label { color: var(--ink); font-weight: 500; }
.gen-compact-livenote {
  margin-top: 4px;
  font-size: 11px;
  color: var(--olive-2);
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gen-compact-livenote .live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--olive);
  flex-shrink: 0;
  animation: gen-pulse-ring 1.2s infinite;
}

.gen-compact-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--paper-2);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

.gen-compact-error {
  padding: 12px 14px;
  background: var(--rust-tint, rgba(180, 80, 60, 0.1));
  color: var(--rust, #b4503c);
  border-radius: var(--r-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gen-compact-celebrate {
  text-align: center;
  padding: 12px 0 4px;
  animation: gen-fade-in 0.4s ease;
}
.gen-compact-check-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--olive);
  color: #fff;
  display: grid; place-items: center;
  margin: 0 auto 10px;
  animation: gen-check-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4);
  box-shadow: 0 8px 24px rgba(74, 93, 58, 0.3);
}
.gen-compact-done-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
}
@keyframes gen-check-pop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

.gen-compact-foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.gen-compact-foot .btn { min-width: 130px; justify-content: center; }

@media (max-width: 767px) {
  .gen-modal { width: 96vw; max-height: 92dvh; border-radius: var(--r-lg); }
  .gen-compact { padding: 24px 20px 20px; gap: 16px; }
  .gen-compact-title { font-size: 30px; }
}

.mobile-header { display: none; }

@media (max-width: 767px) {
  /* Hide desktop sidebar and topbar, collapse grid to single column */
  .sidebar { display: none !important; }
  .topbar { display: none !important; }
  .app { grid-template-columns: 1fr !important; display: flex !important; flex-direction: column !important; height: 100dvh !important; min-height: unset !important; overflow: hidden; }
  .main { flex: 1; min-height: 0; overflow-y: auto; }

  /* Mobile top header */
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--card-elev); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 30; min-height: 52px;
  }
  .mobile-header-title { font-weight: 600; font-size: 15px; }
  .mobile-header-generate-btn {
    display: flex; align-items: center; gap: 5px;
    background: var(--olive); color: #fff; border: none; border-radius: 999px;
    padding: 6px 12px; font-size: 12px; font-weight: 600; font-family: var(--sans);
    cursor: pointer; white-space: nowrap;
  }
  .mobile-header-month {
    font-size: 12px; color: var(--olive); font-weight: 600;
    background: var(--olive-tint); padding: 4px 10px; border-radius: 999px; cursor: pointer;
  }

  /* Mobile bottom nav — flex item (no position:fixed) so it anchors at the real bottom of the app
     without Safari-chrome/scroll-offset issues when the inner scroll container handles overflow */
  .mobile-nav {
    display: flex; flex-shrink: 0;
    background: var(--card-elev); border-top: 1px solid var(--line);
    z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 16px rgba(29,27,22,0.08);
  }
  .mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 8px 4px; border: none; background: none; cursor: pointer; color: var(--ink-4);
    font-size: 10px; font-family: var(--sans); gap: 3px; min-height: 56px;
    transition: color 0.15s;
  }
  .mobile-nav-item.active { color: var(--olive); }
  .mobile-nav-item svg, .mobile-nav-item .icon { width: 20px; height: 20px; }

  /* Mobile generate hero */
  .mobile-generate-hero {
    display: flex; flex-direction: column; min-height: calc(100dvh - 120px);
    padding: 32px 20px; align-items: center; justify-content: center; gap: 0;
  }
  .mobile-pipeline-overlay {
    position: fixed; inset: 0; z-index: 50;
    background: var(--paper); display: flex; flex-direction: column;
    overflow-y: auto; padding-bottom: 24px;
  }
  .mobile-pipeline-header {
    padding: 16px 20px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; background: var(--paper); z-index: 1;
  }
  .mobile-pipeline-stage {
    display: flex; gap: 14px; padding: 14px 20px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-pipeline-dot {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    flex-shrink: 0; font-family: var(--mono); font-size: 11px;
  }

  /* Simplify content padding on mobile */
  .content { padding: 16px !important; }
  .page-title { margin-bottom: 16px; }

  /* Generate modal → bottom sheet on mobile */
  .gen-modal-back {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .gen-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90dvh !important;
    border-radius: var(--r-xl) var(--r-xl) 0 0 !important;
    animation: gen-slide-up 0.35s cubic-bezier(0.2, 0.85, 0.25, 1) !important;
    transform-origin: bottom center !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
  }
  @keyframes gen-slide-up {
    from { transform: translateY(100%); opacity: 0.8; }
    to   { transform: none; opacity: 1; }
  }
  .gen-compact { padding: 24px 20px 20px !important; }
  .gen-compact-title { font-size: 28px !important; }
  .gen-modal-close { top: 12px !important; right: 12px !important; }
}
