/* ================================================================
   TOKENS
   ================================================================ */
:root {
  --bg-0: #ffffff;
  --bg-1: #f7f6f3;
  --bg-2: #eeede8;
  --bg-3: #e2e1da;
  --text-0: #18180f;
  --text-1: #595950;
  --text-2: #8c8c82;
  --border: rgba(0, 0, 0, 0.10);
  --border-md: rgba(0, 0, 0, 0.18);

  --green: #3b6d11;
  --green-bg: #eaf3de;
  --green-dim: #c0dd97;
  --red: #a32d2d;
  --red-bg: #fcebeb;
  --blue: #185fa5;
  --blue-bg: #e6f1fb;
  --amber: #85500b;
  --amber-bg: #faeeda;
  --purple: #534ab7;
  --teal: #0f6e56;

  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --mono: 'Courier New', Courier, monospace;

  --sidebar-w: 240px;
  --header-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-0: #18180f;
    --bg-1: #21211a;
    --bg-2: #2a2a22;
    --bg-3: #33332a;
    --text-0: #f0efe6;
    --text-1: #999985;
    --text-2: #5c5c4e;
    --border: rgba(255, 255, 255, 0.10);
    --border-md: rgba(255, 255, 255, 0.18);

    --green: #97c459;
    --green-bg: rgba(59, 109, 17, 0.22);
    --green-dim: #3b6d11;
    --red: #f09595;
    --red-bg: rgba(163, 45, 45, 0.22);
    --blue: #85b7eb;
    --blue-bg: rgba(24, 95, 165, 0.22);
    --amber: #fac775;
    --amber-bg: rgba(133, 80, 11, 0.22);
    --purple: #afa9ec;
    --teal: #5dcaa5;
  }
}

/* ================================================================
   RESET
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.5;
  min-height: 100dvh;
}
input, select, textarea, button {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0.5px solid var(--border-md);
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.1s, opacity 0.1s;
  white-space: nowrap;
}
button:hover { background: var(--bg-2); }
button:active { opacity: 0.7; }
button.primary {
  background: var(--text-0);
  color: var(--bg-0);
  border-color: var(--text-0);
}
button.primary:hover { opacity: 0.85; }
button.danger { color: var(--red); border-color: var(--red-bg); }
button.danger:hover { background: var(--red-bg); }
input, select {
  background: var(--bg-1);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
input:focus, select:focus { border-color: var(--blue); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 0.5px solid var(--border); margin: 1rem 0; }

/* ================================================================
   SPLASH
   ================================================================ */
.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: 12px;
  color: var(--text-2);
}
.splash-logo {
  font-size: 40px;
  font-family: var(--mono);
  font-weight: bold;
  color: var(--text-1);
}
.splash-text { font-size: 14px; }

/* ================================================================
   AUTH PAGES  (login + setup)
   ================================================================ */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1rem;
  background: var(--bg-1);
}
.auth-card {
  background: var(--bg-0);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 380px;
}
.auth-logo {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 0.25rem;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 1.75rem;
}
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-1); }
.auth-error {
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 4px;
}
.auth-hint {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1rem;
  text-align: center;
}

/* ================================================================
   APP SHELL
   ================================================================ */
.app-shell {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100dvh;
}
.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  background: var(--bg-0);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-logo {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.header-spacer { flex: 1; }
.header-user {
  font-size: 12px;
  color: var(--text-1);
}
.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  overflow: hidden;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  border-right: 0.5px solid var(--border);
  overflow-y: auto;
  height: calc(100dvh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-0);
}
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.txn-list { display: flex; flex-direction: column; gap: 5px; }
.txn-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-1);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border-md);
  transition: background 0.1s;
}
.txn-item:hover { background: var(--bg-2); }
.txn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.txn-info { flex: 1; min-width: 0; }
.txn-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-freq { font-size: 11px; color: var(--text-2); }
.txn-amount {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
  text-align: right;
}
.txn-amount.income { color: var(--green); }
.txn-amount.expense { color: var(--red); }
.txn-remove {
  font-size: 11px;
  padding: 1px 6px;
  border: none;
  color: var(--text-2);
  background: transparent;
  opacity: 0;
  transition: opacity 0.1s;
}
.txn-item:hover .txn-remove { opacity: 1; }
.txn-remove:hover { color: var(--red); background: var(--red-bg); }

/* ADD FORM */
.add-form-wrap {
  background: var(--bg-1);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 12px;
}
.add-form { display: flex; flex-direction: column; gap: 7px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.form-inline { display: flex; align-items: center; gap: 8px; }
.form-inline label { font-size: 12px; color: var(--text-1); white-space: nowrap; flex-shrink: 0; }
.form-inline input, .form-inline select { flex: 1; }
.w-55 { width: 55px !important; flex: none !important; }

/* BALANCE EDIT */
.balance-edit {
  background: var(--blue-bg);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.balance-edit label { font-size: 12px; color: var(--text-1); }
.balance-edit-row { display: flex; gap: 6px; align-items: center; }
.balance-edit-row input { flex: 1; font-family: var(--mono); }

/* SETTINGS PANEL */
.settings-wrap {
  background: var(--bg-1);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 12px;
}
.settings-form { display: flex; flex-direction: column; gap: 7px; }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main {
  overflow-y: auto;
  height: calc(100dvh - var(--header-h));
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* METRIC CARDS */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric-card {
  background: var(--bg-1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.metric-card.clickable { cursor: pointer; }
.metric-card.clickable:hover { background: var(--bg-2); }
.metric-label {
  font-size: 11px;
  color: var(--text-1);
  margin-bottom: 4px;
}
.metric-value {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.metric-value.income { color: var(--green); }
.metric-value.expense { color: var(--red); }
.metric-value.negative { color: var(--red); }

/* VIEW CONTROLS */
.view-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tab-group {
  display: flex;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tab-btn {
  border: none;
  border-right: 0.5px solid var(--border-md);
  border-radius: 0;
  padding: 5px 16px;
  font-size: 13px;
  background: transparent;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active { background: var(--bg-2); font-weight: 500; }
.nav-label {
  font-size: 14px;
  font-weight: 500;
  min-width: 150px;
  text-align: center;
}
.nav-btn { padding: 5px 12px; font-size: 14px; }

/* ================================================================
   TIMELINE — MONTHLY
   ================================================================ */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.timeline-header {
  display: grid;
  grid-template-columns: 28px 1fr auto 100px;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}
.timeline-header span {
  font-size: 11px;
  color: var(--text-2);
}
.timeline-header .right { text-align: right; }

.tl-row {
  display: grid;
  grid-template-columns: 28px 1fr auto 100px;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  align-items: center;
  transition: background 0.1s;
}
.tl-row.has-txns { background: var(--bg-1); }
.tl-row.is-today { background: var(--blue-bg); }
.tl-row.is-past { opacity: 0.55; }
.tl-day {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}
.tl-row.is-today .tl-day { color: var(--blue); font-weight: 600; }
.tl-pills { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pill {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.pill.income { background: var(--green-bg); color: var(--green); }
.pill.expense { background: var(--red-bg); color: var(--red); }
.tl-net {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  font-weight: 500;
}
.tl-net.income { color: var(--green); }
.tl-net.expense { color: var(--red); }
.tl-net.empty { color: var(--text-2); }
.tl-balance {
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  font-weight: 500;
}
.tl-balance.active { color: var(--text-0); }
.tl-balance.dim { color: var(--text-2); font-weight: 400; }
.tl-balance.negative { color: var(--red); }

/* ================================================================
   YEARLY VIEW
   ================================================================ */
.yearly { display: flex; flex-direction: column; gap: 1rem; }
.chart-wrap {
  background: var(--bg-1);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
}
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 4px; }
.bar-label { font-size: 10px; color: var(--text-2); }
.bar-track { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar-fill {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}
.bar-fill.positive { background: var(--green-bg); border-top: 2px solid var(--green-dim); }
.bar-fill.negative { background: var(--red-bg); border-top: 2px solid var(--red); }

.year-table { display: flex; flex-direction: column; gap: 2px; }
.year-header {
  display: grid;
  grid-template-columns: 52px repeat(4, 1fr);
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}
.year-header span { font-size: 11px; color: var(--text-2); }
.year-header .right { text-align: right; }
.year-row {
  display: grid;
  grid-template-columns: 52px repeat(4, 1fr);
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  align-items: center;
  cursor: pointer;
  transition: background 0.1s;
}
.year-row:hover { background: var(--bg-1); }
.year-row.is-current { background: var(--blue-bg); }
.year-row.is-past { opacity: 0.55; }
.year-month-name { font-size: 13px; font-weight: 500; }
.year-row.is-current .year-month-name { color: var(--blue); }
.year-cell {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}
.year-cell.income { color: var(--green); }
.year-cell.expense { color: var(--red); }
.year-cell.net-pos { color: var(--green); font-weight: 600; }
.year-cell.net-neg { color: var(--red); font-weight: 600; }
.year-cell.bal { color: var(--text-0); font-size: 13px; font-weight: 600; }
.year-cell.bal-neg { color: var(--red); font-size: 13px; font-weight: 600; }

/* ================================================================
   NOTIFICATIONS / TOAST
   ================================================================ */
.toast-area {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--text-0);
  color: var(--bg-0);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  animation: slideIn 0.2s ease;
}
.toast.error { background: var(--red); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
}
.modal {
  background: var(--bg-0);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 360px;
}
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: 1rem; }
.modal-form { display: flex; flex-direction: column; gap: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ================================================================
   DESKTOP/MOBILE VISIBILITY HELPERS
   ================================================================ */
.mobile-only  { display: none !important; }
.desktop-only { display: flex; }   /* default: visible */

/* ================================================================
   MOBILE LAYOUT  (≤ 700px)
   ================================================================ */
@media (max-width: 700px) {
  /* Switch visibility */
  .desktop-only { display: none !important; }
  .mobile-only  { display: flex !important; }

  /* Shell fills the screen, room for bottom nav */
  .app-shell {
    grid-template-rows: var(--header-h) 1fr;
    max-width: 100%;
    border: none;
    margin: 0;
  }

  /* Header */
  .app-header { padding: 0 1rem; }
  .header-logo { font-size: 16px; }

  /* Mobile body takes remaining height minus bottom nav */
  .mobile-body {
    overflow: hidden;
    height: calc(100dvh - var(--header-h) - 58px);
    flex-direction: column;
  }

  /* Each mobile page scrolls independently */
  .mobile-page {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-entries { gap: 0.6rem; }

  /* Metrics 2-col on mobile */
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric-card { padding: 10px 12px; }
  .metric-value { font-size: 15px; }

  /* Timeline columns tighter */
  .timeline-header,
  .tl-row { grid-template-columns: 64px 1fr auto 86px; gap: 6px; }

  /* Year table */
  .year-header,
  .year-row { grid-template-columns: 44px repeat(4, 1fr); font-size: 11px; }

  /* View controls wrap nicely */
  .view-controls { flex-wrap: wrap; gap: 6px; }
  .nav-label { min-width: 110px; font-size: 13px; }

  /* Settings page full width */
  .mobile-settings-page .settings-wrap { border-radius: 0; border-left: none; border-right: none; }

  /* Bigger touch targets */
  button { min-height: 36px; }
  .tab-btn { padding: 6px 14px; }
  .txn-remove { min-height: 28px; }
}

/* ================================================================
   BOTTOM NAV
   ================================================================ */
.mobile-nav {
  display: none; /* shown only on mobile via media query below */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: var(--bg-0);
  border-top: 0.5px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 200;
  flex-direction: row;
  align-items: stretch;
}
@media (max-width: 700px) {
  .mobile-nav { display: flex; }
}
.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  min-height: unset;
  padding: 6px 0;
  transition: color 0.15s, background 0.15s;
}
.mobile-nav-btn.active { color: var(--blue); background: var(--blue-bg); }
.mobile-nav-icon { font-size: 18px; line-height: 1; }
.mobile-nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; }

/* Safe area padding for body content on iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 700px) {
    .mobile-body { height: calc(100dvh - var(--header-h) - 58px - env(safe-area-inset-bottom)); }
  }
}

/* ================================================================
   DESKTOP WIDTH CONSTRAINT remains above 900px
   ================================================================ */

/* ================================================================
   UTILITY
   ================================================================ */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-6 { gap: 6px; }
.mt-4 { margin-top: 4px; }
.hidden { display: none !important; }

/* ================================================================
   TIMELINE — PER-ENTRY ROW OVERRIDES
   ================================================================ */
.tl-row {
  grid-template-columns: 68px 1fr auto 100px;
}
.tl-entry-name {
  font-size: 13px;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-row.day-first {
  margin-top: 6px;
  border-top: 0.5px solid var(--border);
  padding-top: 6px;
}
.tl-row.day-first:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 4px;
}
.tl-day {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
}
.tl-row.is-today .tl-day { color: var(--blue); }

.tl-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.8;
}

/* ================================================================
   DESKTOP WIDTH CONSTRAINT (~60%)
   ================================================================ */
@media (min-width: 900px) {
  .app-shell {
    max-width: 60%;
    margin: 0 auto;
    border-left: 0.5px solid var(--border);
    border-right: 0.5px solid var(--border);
    min-height: 100dvh;
  }
  .app-header {
    /* sticky header must also be constrained — handled by app-shell width */
    left: auto;
    right: auto;
  }
}

/* ================================================================
   ROLLING VIEW
   ================================================================ */
.rolling-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.rolling-bal-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--blue-bg);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.rolling-bal-label {
  font-size: 12px;
  color: var(--text-1);
  flex: 1;
}
.rolling-bal-value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
}
.rolling-bal-edit {
  background: var(--blue-bg);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}
.rolling-bal-edit label {
  font-size: 12px;
  color: var(--text-1);
}
.rolling-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.rolling-wrap .timeline {
  margin-bottom: 0;
}

/* ================================================================
   ROLLING VIEW — INFINITE SCROLL
   ================================================================ */
.rolling-month-group {
  margin-bottom: 1.5rem;
}
.rolling-sentinel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 1.5rem 0 2rem;
}
.rolling-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-2);
  animation: rolling-pulse 1.2s ease-in-out infinite;
}
.rolling-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.rolling-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes rolling-pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1); }
}

/* ================================================================
   IMPORT / EXPORT
   ================================================================ */
.import-label {
  display: block;
  cursor: pointer;
}
.import-label span {
  display: block;
  width: 100%;
  text-align: center;
  padding: 5px 12px;
  font-size: 13px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background 0.1s;
}
.import-label:hover span { background: var(--bg-2); }

.import-confirm {
  background: var(--amber-bg);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 8px;
}
.import-mode-opt {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  transition: background 0.1s;
}
.import-mode-opt.active {
  background: var(--bg-2);
  font-weight: 500;
}
.import-mode-opt input { width: auto; }

/* PWA install hint */
.pwa-ios-hint {
  background: var(--blue-bg);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
}
