/* ============================================
   TIMELINE — Industrial Editorial Dark Theme
   Syne + JetBrains Mono
   ============================================ */

:root {
  --bg:        #0a0a0a;
  --bg2:       #111111;
  --bg3:       #1a1a1a;
  --bg4:       #222222;
  --border:    #2a2a2a;
  --border2:   #333333;
  --text:      #e8e8e8;
  --text2:     #999999;
  --text3:     #555555;
  --accent:    #d4f542;   /* electric lime */
  --accent2:   #ff6b35;   /* warm orange */
  --red:       #ff3b3b;
  --sidebar-w: 220px;
  --radius:    4px;
  --font-head: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ── LIGHT MODE ── */
body.light {
  --bg:      #f4f4f0;
  --bg2:     #ffffff;
  --bg3:     #ededea;
  --bg4:     #e4e4e0;
  --border:  #d8d8d4;
  --border2: #c8c8c4;
  --text:    #1a1a1a;
  --text2:   #555555;
  --text3:   #999999;
  --accent:  #7ab800;   /* darker lime for contrast */
  --accent2: #e05a20;
  --red:     #d42b2b;
}

body.light .noise { opacity: 0.15; }
body.light .sidebar::after { opacity: 0.2; }
body.light .modal-backdrop { background: rgba(0,0,0,0.45); }
body.light .nav-btn.active { background: rgba(122, 184, 0, 0.08); }
body.light .btn-primary { color: #fff; }
body.light .btn-primary:hover { background: #6aa300; }
body.light .toast { color: #fff; }
body.light .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  margin: 0 16px 8px;
  padding: 7px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 7px;
  width: calc(100% - 32px);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle-icon { font-size: 13px; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow: hidden;
}

/* Noise overlay */
.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── LAYOUT ── */
body { display: flex; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
  position: relative;
}

.sidebar::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 20%;
  height: 60%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.logo-mark {
  color: var(--accent);
  font-size: 20px;
  font-family: var(--font-head);
  line-height: 1;
}

.logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--text);
}

.nav { flex: 1; padding: 8px 0; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  position: relative;
}

.nav-btn:hover { color: var(--text2); background: var(--bg3); }

.nav-btn.active {
  color: var(--accent);
  background: rgba(212, 245, 66, 0.05);
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.nav-icon { font-size: 14px; width: 16px; text-align: center; }

.sidebar-stats {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat { text-align: center; }

.stat-num {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  line-height: 1.2;
}

.stat-lbl {
  display: block;
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-btn {
  margin: 0 16px;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
  letter-spacing: 0.05em;
}

.settings-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── MAIN ── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  max-width: 900px;
}

/* ── TABS ── */
.tab { display: none; animation: fadeIn 0.2s ease; }
.tab.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tab-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tab-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tab-date {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── COMPOSE ── */
.compose {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}

.compose-input {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
  min-height: 70px;
  outline: none;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.compose-input::placeholder { color: var(--text3); }

.compose-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compose-hint {
  font-size: 10px;
  color: var(--text3);
  margin-top: 8px;
  letter-spacing: 0.06em;
}

/* ── INPUTS ── */
.input, .select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}

.input:focus, .select:focus { border-color: var(--accent); }

.select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.select option { background: var(--bg3); }

textarea.input { resize: vertical; font-family: var(--font-mono); }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 9px 18px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-primary:hover { background: #c8e838; transform: translateY(-1px); }
.btn-primary:disabled { background: var(--text3); color: var(--bg); cursor: not-allowed; transform: none; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.btn-ghost:hover { border-color: var(--text2); color: var(--text); }

.btn-danger {
  background: rgba(255, 59, 59, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.btn-danger:hover { background: rgba(255,59,59,0.2); }

/* ── ENTRIES ── */
.entries-list { display: flex; flex-direction: column; gap: 8px; }

.entry-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.entry-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--cat-color, var(--accent));
  opacity: 0.7;
}

.entry-item:hover {
  border-color: var(--border2);
  background: var(--bg3);
  transform: translateX(2px);
}

.entry-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.entry-date-badge {
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 72px;
}

.entry-cat-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.entry-body { color: var(--text); font-size: 13px; line-height: 1.5; }
.entry-notes { color: var(--text2); font-size: 11px; margin-top: 5px; }

.entry-badges {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 2px;
  color: var(--text3);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}

.empty-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }
.empty-text { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ── CALENDAR ── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.month-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
  min-width: 160px;
  text-align: center;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  text-align: center;
}

.cal-weekdays span {
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 24px;
}

.cal-cell {
  aspect-ratio: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  font-size: 13px;
}

.cal-cell:hover { border-color: var(--border2); background: var(--bg3); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }

.cal-cell.today {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.cal-cell.has-entries {
  background: var(--bg3);
}

.cal-cell.selected {
  background: rgba(212, 245, 66, 0.08);
  border-color: var(--accent);
}

.cal-dots {
  display: flex;
  gap: 3px;
  margin-top: 3px;
}

.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.cal-dot.receipt { background: var(--accent2); }

.cal-detail {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 80px;
}

.cal-detail-empty { color: var(--text3); font-size: 12px; }

.cal-detail-date {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--accent);
}

/* ── RECEIPTS ── */
.receipt-upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.receipt-upload-zone:hover, .receipt-upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(212, 245, 66, 0.03);
}

.drop-icon {
  font-size: 36px;
  color: var(--text3);
  margin-bottom: 12px;
  transition: color 0.2s;
}

.receipt-upload-zone:hover .drop-icon { color: var(--accent); }

.drop-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.drop-sub { color: var(--text3); font-size: 11px; }

.ocr-progress { margin-bottom: 20px; }
.ocr-bar { height: 2px; background: var(--border); border-radius: 1px; margin-bottom: 8px; }
.ocr-fill { height: 100%; background: var(--accent); border-radius: 1px; transition: width 0.3s; width: 0%; }
#ocrStatus { font-size: 11px; color: var(--text2); letter-spacing: 0.08em; }

.receipt-result { animation: fadeIn 0.3s ease; }

.receipt-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.field-group.full { grid-column: 1 / -1; }

.field-group label {
  display: block;
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.field-group .input { width: 100%; }

.receipt-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.receipt-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.receipt-vendor { font-weight: 500; color: var(--text); }
.receipt-amount { color: var(--accent); font-family: var(--font-head); font-weight: 700; }
.receipt-meta { font-size: 11px; color: var(--text3); }

/* ── SEARCH ── */
.search-bar { margin-bottom: 12px; }
.search-input { width: 100%; font-size: 14px; padding: 12px 14px; }

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ── TEMPLATES ── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.template-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.template-card:hover { border-color: var(--border2); background: var(--bg3); }

.template-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 5px;
}

.template-preview {
  font-size: 11px;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ── FORM HELPERS ── */
.form-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ── MODALS ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 28px;
  width: 480px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

.modal-wide { width: 560px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.close-btn:hover { color: var(--text); background: var(--bg3); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Category list in settings */
.cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.cat-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.cat-name { flex: 1; font-size: 12px; }

.cat-del {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  transition: color 0.15s;
}

.cat-del:hover { color: var(--red); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: #000;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--radius);
  opacity: 0;
  transition: all 0.25s;
  pointer-events: none;
  z-index: 9000;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error { background: var(--red); color: #fff; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── EXPORT TOOLBAR ── */
.export-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.export-toolbar .btn-ghost {
  font-size: 11px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.export-toolbar .btn-ghost .icon { font-size: 12px; opacity: 0.7; }

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border2);
  margin: 0 2px;
}

/* ── RESPONSIVE ── */
@media (max-width: 680px) {

  /* ── Layout: sidebar becomes a bottom nav bar ── */
  body {
    flex-direction: column;
    overflow: hidden;
  }

  .sidebar {
    width: 100%;
    min-height: unset;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 0;
    flex-direction: row;
    align-items: stretch;
    order: 2; /* push to bottom */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg2);
  }

  /* Hide non-nav sidebar elements */
  .logo,
  .sidebar-stats,
  .settings-btn,
  .theme-toggle,
  .sidebar::after {
    display: none;
  }

  /* Nav becomes a horizontal row of icon buttons */
  .nav {
    flex: 1;
    display: flex;
    flex-direction: row;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }

  .nav-btn {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 4px 8px;
    font-size: 9px;
    letter-spacing: 0.03em;
    min-width: 52px;
    text-align: center;
  }

  /* Show label text under icon in bottom nav */
  .nav-btn::after {
    content: attr(data-tab);
    font-size: 9px;
    text-transform: capitalize;
    color: inherit;
    line-height: 1;
  }

  .nav-btn.active::before {
    /* Move active indicator to top of button */
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 2px;
  }

  .nav-icon { font-size: 16px; width: auto; }

  /* Settings icon at end of bottom nav */
  .settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    border: none;
    border-radius: 0;
    border-left: 1px solid var(--border);
    background: none;
    font-size: 16px;
    padding: 10px 14px 8px;
    min-width: 52px;
  }

  /* Main content fills screen above bottom nav */
  .main {
    order: 1;
    padding: 20px 16px;
    padding-bottom: 80px; /* clearance for fixed bottom nav */
    overflow-y: auto;
    max-width: 100%;
    height: 100dvh;
  }

  /* ── Typography & spacing ── */
  .tab-title { font-size: 22px; }

  .tab-header {
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  /* ── Export toolbar: wrap into 2×2 grid ── */
  .export-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .toolbar-divider { display: none; }

  .export-toolbar .btn-ghost {
    justify-content: center;
  }

  /* ── Compose row: stack vertically ── */
  .compose-row {
    flex-wrap: wrap;
  }

  .compose-row .select,
  .compose-row .input[type="date"] {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .compose-row .btn-primary {
    flex: 1 1 100%;
    text-align: center;
  }

  /* Change hint text for mobile */
  .compose-hint::before { content: 'Tap Add to submit'; }
  .compose-hint { font-size: 0; } /* hide original text */
  .compose-hint::before { font-size: 10px; }

  /* ── Forms ── */
  .receipt-fields { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  /* ── Calendar ── */
  .cal-cell { padding: 6px 4px; font-size: 11px; }

  /* ── Month nav ── */
  .month-nav { gap: 8px; }

  /* ── Toast: clear of bottom nav ── */
  .toast { bottom: 80px; }

  /* ── Modal: full-width on small screens ── */
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px 12px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
  }

  .modal-backdrop.open {
    align-items: flex-end;
  }
}
