/* ============================================
   Calendario de Gastos - Estilo Google Material
   Layout robusto escritorio + movil
   ============================================ */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --success: #0d904f;
  --success-bg: #e6f4ea;
  --danger: #d93025;
  --danger-bg: #fce8e6;
  --warning: #f9ab00;
  --warning-bg: #fef7e0;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-lg: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 64px;
  --sidebar-w: 260px;
  --font: Roboto, "Google Sans", system-ui, -apple-system, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --primary: #8ab4f8;
  --primary-dark: #aecbfa;
  --primary-light: #1e3a5f;
  --success: #81c995;
  --success-bg: #0d3b1e;
  --danger: #f28b82;
  --danger-bg: #3c1a18;
  --warning: #fdd663;
  --warning-bg: #3d2e00;
  --text: #e8eaed;
  --text-secondary: #9aa0a6;
  --border: #3c4043;
  --bg: #202124;
  --surface: #292a2d;
  --shadow: 0 1px 2px 0 rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --shadow-lg: 0 1px 3px 0 rgba(0,0,0,.3), 0 4px 8px 3px rgba(0,0,0,.15);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea { font-family: inherit; }

/* HEADER - force row layout, no wrap */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  min-height: var(--header-h);
  max-height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  padding: 0 8px 0 4px;
  gap: 4px;
  width: 100%;
  overflow: hidden;
}

.header-left,
.header-right {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.header-center {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.logo {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text);
  white-space: nowrap;
}

.logo-icon { color: var(--primary); font-size: 28px !important; flex-shrink: 0; }
.logo-text { white-space: nowrap; }

.gratis-badge {
  display: inline-flex;
  align-items: center;
  background: #0d904f;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  line-height: 1.4;
  flex-shrink: 0;
}
[data-theme="dark"] .gratis-badge { background: #81c995; color: #0d1f12; }

.month-nav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 2px;
}

.current-month {
  font-size: 1.25rem;
  font-weight: 400;
  min-width: 160px;
  text-align: center;
  white-space: nowrap;
  margin: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(0,0,0,.08); color: var(--text); }
[data-theme="dark"] .icon-btn:hover { background: rgba(255,255,255,.08); }
.icon-btn .material-symbols-outlined { font-size: 22px; }

.btn-primary, .btn-secondary, .btn-danger, .btn-text, .btn-amazon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  border-radius: 18px;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
[data-theme="dark"] .btn-primary { color: #202124; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--primary-light); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-text {
  background: transparent;
  color: var(--primary);
  height: auto;
  padding: 8px 12px;
}
.btn-text:hover { background: var(--primary-light); }

.btn-support {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-support:hover { transform: scale(1.02); }

.btn-amazon {
  background: #ff9900;
  color: #111;
  width: 100%;
  height: 48px;
  font-size: 1rem;
  border-radius: 8px;
  margin: 16px 0;
}
.btn-amazon:hover { background: #e88b00; }
.full { width: 100%; }

.app-body {
  display: flex !important;
  flex-direction: row !important;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex !important;
  flex-direction: column !important;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  z-index: 50;
  transition: transform var(--transition);
}

.side-nav {
  padding: 12px 8px;
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px;
}

.nav-item {
  width: 100%;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: 0 24px 24px 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(0,0,0,.04); }
[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,.04); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}
.nav-item .material-symbols-outlined { font-size: 22px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.privacy-badge {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 10px;
  border-radius: var(--radius-sm);
}
.privacy-badge .material-symbols-outlined { color: var(--success); font-size: 20px; flex-shrink: 0; }
.privacy-badge strong { display: block; color: var(--text); font-size: 0.8125rem; }

.free-note {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--success);
  text-align: center;
  font-weight: 500;
}

.main-content {
  flex: 1 1 auto;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.cards-row {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.stat-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-card.income .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-card.expense .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat-card.balance .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.debt .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-card.owed-to-me .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-card.i-owe .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat-info { min-width: 0; }
.stat-label { display: block; font-size: 0.8125rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }

.dashboard-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.panel.full-width { grid-column: 1 / -1; }
.panel-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}
.panel-header h2 { font-size: 1.125rem; font-weight: 500; margin: 0; }
.chart-container { position: relative; height: 220px; margin-bottom: 16px; }
.category-list { display: flex; flex-direction: column; gap: 8px; }
.cat-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.cat-row:last-child { border-bottom: none; }
.cat-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cat-name { flex: 1; font-size: 0.875rem; min-width: 0; }
.cat-amount { font-weight: 500; font-size: 0.875rem; white-space: nowrap; }
.cat-pct { color: var(--text-secondary); font-size: 0.75rem; min-width: 40px; text-align: right; }

.transactions-list { display: flex; flex-direction: column; gap: 4px; }
.tx-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tx-item:hover { background: var(--bg); }
.tx-icon {
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.tx-icon.expense { background: var(--danger-bg); color: var(--danger); }
.tx-icon.income { background: var(--success-bg); color: var(--success); }
.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-weight: 500; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 0.75rem; color: var(--text-secondary); }
.tx-amount { font-weight: 500; font-size: 0.9375rem; white-space: nowrap; }
.tx-amount.expense { color: var(--danger); }
.tx-amount.income { color: var(--success); }

.daily-bars {
  display: flex; flex-direction: row; align-items: flex-end;
  gap: 4px; height: 120px; overflow-x: auto; padding-bottom: 24px;
}
.day-bar-wrap {
  flex: 1; min-width: 28px; display: flex; flex-direction: column;
  align-items: center; height: 100%; justify-content: flex-end; cursor: pointer;
}
.day-bar {
  width: 100%; max-width: 32px; border-radius: 4px 4px 0 0;
  background: var(--primary); min-height: 2px;
}
.day-bar.income-only { background: var(--success); }
.day-bar.expense-heavy { background: var(--danger); }
.day-label { font-size: 0.625rem; color: var(--text-secondary); margin-top: 4px; }

.calendar-wrapper {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 20px;
}
.calendar-header-days {
  display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  font-size: 0.75rem; font-weight: 500; color: var(--text-secondary);
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 8px; }
.cal-day {
  aspect-ratio: 1; min-height: 64px; padding: 6px; border-radius: 8px;
  cursor: pointer; display: flex; flex-direction: column;
}
.cal-day:hover { background: var(--bg); }
.cal-day.other-month { opacity: 0.4; }
.cal-day.today .cal-day-num {
  background: var(--primary); color: #fff; border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .cal-day.today .cal-day-num { color: #202124; }
.cal-day.selected { background: var(--primary-light); }
.cal-day-num { font-size: 0.8125rem; font-weight: 500; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; justify-content: center; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }
.cal-amount { font-size: 0.625rem; text-align: center; margin-top: 2px; font-weight: 500; }
.cal-amount.neg { color: var(--danger); }
.cal-amount.pos { color: var(--success); }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px; margin-bottom: 16px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.input, .select, .input-search {
  height: 40px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 0.875rem;
}
.input:focus, .select:focus, .input-search:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,.2);
}
.input-search { min-width: 180px; }
.select-sm {
  height: 32px; padding: 0 8px; font-size: 0.8125rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
.table-container {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left; padding: 12px 16px; font-weight: 500;
  color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.text-right { text-align: right; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 500;
}
.badge-expense { background: var(--danger-bg); color: var(--danger); }
.badge-income { background: var(--success-bg); color: var(--success); }
.action-btns { display: flex; gap: 4px; }

.debts-grid, .categories-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.debt-card, .cat-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.debt-card.settled { opacity: 0.6; }
.debt-type { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.debt-type.owed { color: var(--success); }
.debt-type.owe { color: var(--danger); }
.debt-person { font-size: 1.125rem; font-weight: 500; margin-bottom: 4px; }
.debt-amount { font-size: 1.5rem; font-weight: 500; margin: 8px 0; }
.debt-meta { font-size: 0.8125rem; color: var(--text-secondary); }
.debt-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cat-card {
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  cursor: pointer; padding: 16px;
}
.cat-card:hover { box-shadow: var(--shadow-lg); }
.cat-card-icon {
  width: 44px; height: 44px; min-width: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.cat-card-name { font-weight: 500; flex: 1; }
.cat-card-total { font-size: 0.875rem; color: var(--text-secondary); }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-secondary); }
.empty-state .material-symbols-outlined { font-size: 64px; opacity: 0.4; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 16px; opacity: 0;
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 28px rgba(0,0,0,.28);
}
.modal-sm { max-width: 400px; }
.modal-affiliate, .modal-exit { max-width: 440px; }
.modal-legal { max-width: 560px; }
.modal-header {
  display: flex; flex-direction: row; align-items: center;
  justify-content: space-between; padding: 20px 24px 0;
}
.modal-header h2 { font-size: 1.25rem; font-weight: 500; margin: 0; }
.modal form, .modal > p, .modal .export-actions, .modal .danger-zone,
.modal .affiliate-content, .modal .exit-content, .modal .legal-body {
  padding: 16px 24px 24px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group .input, .form-group .select, .form-group textarea.input { width: 100%; }
.form-group textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input-color {
  width: 60px; height: 40px; padding: 2px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; background: var(--surface);
}
.segmented {
  display: flex; flex-direction: row; background: var(--bg);
  border-radius: 8px; padding: 3px; gap: 2px;
}
.seg-btn {
  flex: 1; border: none; background: transparent; padding: 8px; border-radius: 6px;
  font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); cursor: pointer;
}
.seg-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.modal-actions {
  display: flex; flex-direction: row; justify-content: flex-end; gap: 8px; padding: 8px 24px 20px;
}
.hint { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.hint.small { font-size: 0.75rem; }
.export-actions { display: flex; flex-direction: column; gap: 10px; }
.file-label { cursor: pointer; justify-content: center; }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.danger-zone h3 { font-size: 0.875rem; color: var(--danger); margin-bottom: 12px; }
.affiliate-content { text-align: center; }
.affiliate-icon .material-symbols-outlined { font-size: 56px; color: var(--primary); margin-bottom: 8px; }
.affiliate-message { font-size: 1.125rem; font-weight: 500; margin-bottom: 12px; color: var(--text); }
.affiliate-note { font-size: 0.75rem; color: var(--text-secondary); margin-top: 8px; }
.exit-content > p { margin-bottom: 16px; color: var(--text-secondary); font-size: 0.9375rem; }
.exit-actions { display: flex; flex-direction: column; gap: 12px; padding: 0; }
.exit-share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.exit-hint { margin-top: 16px; font-size: 0.75rem; color: var(--text-secondary); text-align: center; }
.legal-body {
  font-size: 0.875rem; line-height: 1.6; color: var(--text-secondary);
  max-height: 60vh; overflow-y: auto;
}
.legal-body h3 { color: var(--text); font-size: 0.9375rem; font-weight: 500; margin: 16px 0 6px; }
.legal-body p { margin-bottom: 8px; }
.legal-body ul { padding-left: 20px; margin-bottom: 12px; }
.legal-body a { color: var(--primary); }
.legal-date { font-size: 0.75rem; margin-top: 16px; opacity: 0.8; }

.fab {
  display: none; position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; border-radius: 16px; background: var(--primary);
  color: #fff; border: none; box-shadow: var(--shadow-lg); cursor: pointer;
  z-index: 90; align-items: center; justify-content: center;
}
[data-theme="dark"] .fab { color: #202124; }
.fab .material-symbols-outlined { font-size: 28px; }

.toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: #323232; color: #fff; padding: 12px 20px; border-radius: 8px;
  font-size: 0.875rem; box-shadow: var(--shadow-lg); pointer-events: auto;
}
.gcal-container {
  margin-top: 20px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: var(--surface);
}

.mobile-month-bar {
  display: none; background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 8px 12px; flex-direction: row; align-items: center; justify-content: center; gap: 4px;
}

@media (max-width: 1100px) {
  .cards-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: var(--header-h);
    height: calc(100vh - var(--header-h));
    transform: translateX(-100%); box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .btn-label { display: none; }
  .fab { display: flex; }
  .header-center { display: none !important; }
  .mobile-month-bar { display: flex !important; }
  .main-content { padding: 16px; }
  .logo-text { font-size: 1rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .cards-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; min-width: 40px; }
  .stat-value { font-size: 1.125rem; }
  .stat-label { font-size: 0.75rem; }
  .cal-day { min-height: 52px; padding: 4px; }
  .gratis-badge { display: none; }
  .current-month { min-width: 140px; font-size: 1.1rem; }
}

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40;
}
.sidebar-backdrop.show { display: block; }

.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 32px 24px 100px; margin-top: auto; font-size: 0.8125rem;
  color: var(--text-secondary); width: 100%;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px;
}
.footer-brand strong { display: block; color: var(--text); font-size: 1rem; margin-bottom: 2px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer-link {
  background: none; border: none; color: var(--primary); font-family: inherit;
  font-size: 0.8125rem; cursor: pointer; padding: 0; text-decoration: underline;
}
.footer-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.footer-share-label { margin-right: 4px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); cursor: pointer; font-size: 0.8125rem; padding: 0;
}
.share-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-secondary.share-btn { width: auto; height: 36px; border-radius: 18px; padding: 0 12px; }
.footer-legal { line-height: 1.6; border-top: 1px solid var(--border); padding-top: 16px; }
.footer-legal a { color: var(--primary); }
.footer-privacy-note { margin-top: 6px; color: var(--success); }
.footer-affiliate-note { margin-top: 4px; font-size: 0.75rem; }
.footer-free-note { margin-top: 6px; font-weight: 500; color: var(--text); }

.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1500;
  background: var(--surface); box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  border-top: 1px solid var(--border); padding: 16px 20px;
  transform: translateY(110%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-content {
  max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap;
  align-items: center; gap: 16px; justify-content: space-between;
}
.cookie-text { flex: 1; min-width: 260px; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }
.cookie-text strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 0.9375rem; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.link-btn {
  background: none; border: none; color: var(--primary); font: inherit;
  cursor: pointer; text-decoration: underline; padding: 0;
}

@media (max-width: 600px) {
  .cookie-content { flex-direction: column; align-items: stretch; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn-primary, .cookie-actions .btn-text { flex: 1; justify-content: center; }
  .site-footer { padding-bottom: 120px; }
}
