* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  color: #e2e8f0;
}
.container {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 1400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
h1 { text-align: center; font-size: 22px; margin-bottom: 8px; color: #f1f5f9; }
.subtitle { text-align: center; font-size: 13px; color: #94a3b8; margin-bottom: 24px; }
.hint { text-align: center; font-size: 12px; color: #64748b; margin-bottom: 24px; line-height: 1.5; }
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; color: #94a3b8; margin-bottom: 6px; font-weight: 500; }
input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
input:focus { border-color: #3b82f6; }
input::placeholder { color: #475569; }
/* Native calendar picker icon is dark by default — invert on dark theme for visibility. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.55;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
input.auto-filled { border-color: #1e3a5f; color: #60a5fa; font-style: italic; }
.row2 { display: flex; gap: 12px; }
.row2 .field { flex: 1; }
button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s;
}
button:hover { opacity: 0.9; }
.btn-clear {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  margin-top: 8px;
  font-size: 14px;
  padding: 10px;
}
.btn-clear:hover { border-color: #475569; color: #e2e8f0; }
.btn-save {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  margin-top: 8px;
}
.btn-export {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  margin-top: 8px;
}
.btn-import {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  margin-top: 8px;
}
.btn-row { display: flex; gap: 8px; }
.btn-row button { flex: 1; }
.results {
  margin-top: 24px;
  padding: 20px;
  background: #0f172a;
  border-radius: 12px;
  border: 1px solid #334155;
  display: none;
}
.results.show { display: block; }
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #1e293b;
}
.result-row:last-child { border-bottom: none; }
.result-label { font-size: 13px; color: #94a3b8; }
.result-value { font-size: 16px; font-weight: 600; color: #f1f5f9; }
.result-value.profit { color: #4ade80; }
.result-value.rate { color: #facc15; font-size: 20px; }
.result-value.computed { color: #60a5fa; }
.result-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 12px 0 4px;
  border-bottom: 1px solid #1e293b;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.form-grid .field-full {
  grid-column: 1 / -1;
}
/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #e2e8f0;
  padding: 8px 0;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}
/* Calculator disclaimer */
/* Credit schedule table */
.credit-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.credit-schedule-table th {
  background: #0f172a;
  color: #64748b;
  padding: 8px 6px;
  text-align: right;
  font-weight: 600;
  border-bottom: 1px solid #334155;
  position: sticky;
  top: 0;
}
.credit-schedule-table th:first-child { text-align: left; }
.credit-schedule-table td {
  padding: 6px;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
  text-align: right;
}
.credit-schedule-table td:first-child { text-align: left; color: #64748b; }
.credit-schedule-table .cr-principal { color: #3b82f6; }
.credit-schedule-table .cr-interest { color: #f87171; }
.credit-schedule-table .cr-balance { color: #94a3b8; }

.calc-disclaimer {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(148,163,184,0.06);
  border: 1px solid #1e293b;
  border-radius: 8px;
  font-size: 11px;
  color: #475569;
  line-height: 1.5;
}
.calc-disclaimer p { margin: 0 0 4px; }
.calc-disclaimer p:last-child { margin-bottom: 0; font-style: italic; }
.calc-disclaimer strong { color: #64748b; }

.field-hint {
  font-size: 10px;
  color: #475569;
  margin: 3px 0 0;
  line-height: 1.3;
}
.compound-toggle {
  border-top: 1px solid #334155;
  padding-top: 12px;
  margin-top: 4px;
}
.compound-compare {
  margin-top: 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
}
.compound-compare-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #0f172a;
  padding: 8px 10px;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  border-bottom: 1px solid #334155;
}
.compound-compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 8px 10px;
  font-size: 13px;
  border-bottom: 1px solid #1e293b;
}
.compound-compare-row:last-child { border-bottom: none; }
.compound-compare-row .cc-label { color: #94a3b8; }
.compound-compare-row .cc-value { color: #f1f5f9; font-weight: 600; text-align: right; }
.compound-compare-row .cc-diff { color: #4ade80; font-weight: 700; text-align: right; }
.error { color: #f87171; font-size: 13px; text-align: center; margin-top: 12px; display: none; }
.success-msg {
  color: #4ade80;
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
  display: none;
  animation: fadeOut 3s forwards;
}
@keyframes fadeOut {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}
.saved-section {
  margin-top: 28px;
  display: none;
}
.saved-section.show { display: block; }
.saved-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.saved-count {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}
.saved-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.saved-table th {
  background: #0f172a;
  color: #94a3b8;
  padding: 8px 6px;
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
}
.saved-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
  white-space: nowrap;
}
.saved-table tbody tr { cursor: pointer; transition: background 0.15s; }
.saved-table tbody tr:hover td { background: #1e3a5f; }
.saved-table .num { text-align: right; }
.saved-table .profit-cell { color: #4ade80; }
.saved-table .rate-cell { color: #facc15; font-weight: 600; }
.btn-delete {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  width: auto;
  margin: 0;
}
.btn-delete:hover { background: rgba(248,113,113,0.15); }
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #334155; }
.total-row td {
  font-weight: 700;
  border-top: 2px solid #334155;
  color: #f1f5f9;
  background: #0f172a;
}
.install-banner {
  display: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.install-banner.show { display: block; }

/* Two-column desktop layout */
.main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.panel-left {
  flex: 3;
  min-width: 0;
}
.panel-right {
  flex: 2;
  min-width: 0;
  position: sticky;
  top: 20px;
}
.panel-right .results {
  display: block;
  margin-top: 0;
  min-height: 200px;
}

/* === GLOBAL SEARCH === */
.global-search {
  position: relative;
  margin-bottom: 12px;
}
.global-search-input-wrap {
  display: flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color 0.2s;
}
.global-search-input-wrap:focus-within { border-color: #3b82f6; }
.global-search-icon { font-size: 14px; margin-right: 8px; flex-shrink: 0; }
.global-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 14px;
  padding: 11px 0;
  outline: none;
}
.global-search input::placeholder { color: #475569; }
.global-search-clear {
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  width: auto;
  margin: 0;
}
.global-search-clear:hover { color: #f1f5f9; }
.global-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #0f172a;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #0f172a; }
.search-result-icon { font-size: 16px; flex-shrink: 0; }
.search-result-text { flex: 1; min-width: 0; }
.search-result-title { font-size: 13px; color: #f1f5f9; font-weight: 500; }
.search-result-sub { font-size: 11px; color: #64748b; }
.search-result-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}
.search-badge-portfolio { background: rgba(59,130,246,0.12); color: #60a5fa; }
.search-badge-history { background: rgba(250,204,21,0.12); color: #facc15; }
.search-badge-currency { background: rgba(74,222,128,0.12); color: #4ade80; }
.search-badge-dream { background: rgba(168,85,247,0.12); color: #c084fc; }
.search-badge-saving { background: rgba(34,197,94,0.12); color: #4ade80; }
.search-badge-purchase { background: rgba(251,146,60,0.12); color: #fb923c; }

.purchase-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.purchase-action {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
.purchase-action-icon {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 15px;
  min-width: 30px;
}
@media (max-width: 560px) {
  .purchase-actions {
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .purchase-actions::-webkit-scrollbar { display: none; }
  .purchase-action {
    padding: 6px 10px;
    font-size: 12px;
  }
  .purchase-action-icon {
    padding: 4px 6px;
    font-size: 14px;
    min-width: 26px;
  }
}
.purchase-link {
  color: #7dd3fc;
  text-decoration: underline;
  text-decoration-color: rgba(125, 211, 252, 0.4);
  text-underline-offset: 2px;
  word-break: break-all;
  font-size: 13px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.purchase-link:hover {
  color: #bae6fd;
  text-decoration-color: #7dd3fc;
}

.purchases-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
}
.purchases-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0 12px;
}
.purchases-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 14px;
  padding: 10px 0;
  outline: none;
}
.purchases-search input::placeholder { color: #475569; }
.purchases-search-clear {
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  width: auto;
  margin: 0;
}
.purchases-search-clear:hover { color: #f1f5f9; }
.purchases-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.purchases-chip {
  background: #0f172a;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.purchases-chip:hover { color: #e2e8f0; border-color: #475569; }
.purchases-chip.active {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  border-color: rgba(59,130,246,0.5);
}
.purchases-chip-count {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 4px;
}

.p-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 10px;
  background: rgba(148,163,184,0.04);
  transition: background 0.15s, border-color 0.15s;
}
.p-group-header:hover {
  background: rgba(148,163,184,0.1);
  border-color: rgba(148,163,184,0.35);
}
.p-group-header .caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  color: #94a3b8;
  background: rgba(148,163,184,0.15);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}
.p-group-header:hover .caret { background: rgba(148,163,184,0.25); color: #e2e8f0; }
.p-group-header.collapsed .caret { transform: rotate(-90deg); }
.p-group-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}
.p-group-hint {
  font-size: 11px;
  color: #64748b;
  font-weight: 400;
  margin-left: 4px;
  white-space: nowrap;
}
.p-group-header.collapsed .p-group-hint::before { content: 'показати'; }
.p-group-header:not(.collapsed) .p-group-hint::before { content: 'сховати'; }
.p-group-body.collapsed { display: none; }

/* Compact action buttons inside detail hero (purchase/dream) */
#purchaseDetail .dash-hero button,
#dreamDetail .dash-hero button {
  padding: 6px 10px !important;
  font-size: 13px !important;
}
@media (max-width: 560px) {
  #purchaseDetail .dash-hero button,
  #dreamDetail .dash-hero button {
    padding: 5px 8px !important;
    font-size: 12px !important;
    min-height: 32px;
  }
  #purchaseDetail .dash-hero > div:last-child,
  #dreamDetail .dash-hero > div:last-child {
    gap: 6px !important;
  }
}

/* ──────────────────────────────────────────────────────────
   In-app dialogs (modules/ui-dialog.js): toasts + modals that
   replace native alert / confirm / prompt.
   ────────────────────────────────────────────────────────── */
.ui-toast-layer {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 90vw;
}
.ui-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  font-size: 13px;
  max-width: 380px;
  min-width: 200px;
  transform: translateX(420px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.ui-toast.ui-toast-show { transform: translateX(0); opacity: 1; }
.ui-toast-msg { flex: 1; line-height: 1.4; }
.ui-toast-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  width: auto;
  margin: 0;
  line-height: 1;
}
.ui-toast-close:hover { color: #e2e8f0; }
.ui-toast-ok   { border-color: rgba(74,222,128,0.4);  background: linear-gradient(135deg,#0f2b1a 0%,#1e293b 100%); }
.ui-toast-err  { border-color: rgba(248,113,113,0.4); background: linear-gradient(135deg,#3a1212 0%,#1e293b 100%); }
.ui-toast-info { border-color: rgba(59,130,246,0.4);  background: linear-gradient(135deg,#0f1e3a 0%,#1e293b 100%); }

@media (max-width: 500px) {
  .ui-toast-layer { top: 10px; right: 10px; left: 10px; align-items: stretch; }
  .ui-toast { max-width: none; transform: translateY(-24px); }
  .ui-toast.ui-toast-show { transform: translateY(0); }
}

.ui-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4,9,20,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.15s ease;
  backdrop-filter: blur(2px);
}
.ui-dialog-backdrop.ui-dialog-show { opacity: 1; }
.ui-dialog {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
  overflow: hidden;
}
.ui-dialog-backdrop.ui-dialog-show .ui-dialog { transform: translateY(0) scale(1); }
.ui-dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
  padding: 14px 18px 0;
}
.ui-dialog-body {
  padding: 14px 18px;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.5;
}
.ui-dialog-body .ui-dialog-text { margin: 0; color: #cbd5e1; }
.ui-dialog-label {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 6px;
}
.ui-dialog-input {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}
.ui-dialog-input:focus { border-color: #3b82f6; }
.ui-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(148,163,184,0.1);
  background: rgba(15,23,42,0.4);
}
.ui-dialog-btn {
  width: auto;
  margin: 0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #334155;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ui-dialog-btn:hover { background: rgba(148,163,184,0.1); }
.ui-dialog-btn-primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.ui-dialog-btn-primary:hover { background: #2563eb; border-color: #2563eb; }
.ui-dialog-btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.ui-dialog-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.ui-dialog-btn-secondary { color: #94a3b8; }

html[data-theme-effective="light"] .ui-toast { background: #fff; border-color: #e2e8f0; color: #0f172a; }
html[data-theme-effective="light"] .ui-toast-close { color: #64748b; }
html[data-theme-effective="light"] .ui-toast-ok   { background: linear-gradient(135deg,#dcfce7 0%,#fff 100%); }
html[data-theme-effective="light"] .ui-toast-err  { background: linear-gradient(135deg,#fee2e2 0%,#fff 100%); }
html[data-theme-effective="light"] .ui-toast-info { background: linear-gradient(135deg,#dbeafe 0%,#fff 100%); }
html[data-theme-effective="light"] .ui-dialog-backdrop { background: rgba(15,23,42,0.45); }
html[data-theme-effective="light"] .ui-dialog { background: #fff; border-color: #e2e8f0; }
html[data-theme-effective="light"] .ui-dialog-title { color: #0f172a; }
html[data-theme-effective="light"] .ui-dialog-body { color: #1e293b; }
html[data-theme-effective="light"] .ui-dialog-body .ui-dialog-text { color: #334155; }
html[data-theme-effective="light"] .ui-dialog-input { background: #f8fafc; border-color: #e2e8f0; color: #0f172a; }
html[data-theme-effective="light"] .ui-dialog-btn { color: #0f172a; border-color: #e2e8f0; }
html[data-theme-effective="light"] .ui-dialog-footer { background: #f8fafc; border-color: #e2e8f0; }

/* Budget / income card */
.budget-card { margin-top: 12px; }
.budget-header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom: 10px; flex-wrap:wrap; }
.budget-edit-btn { width:auto; margin:0; padding:6px 12px; font-size:12px; }
.budget-amount { font-size:22px; font-weight:700; color:#e2e8f0; }
.budget-progress-wrap { margin-top:12px; }
.budget-progress {
  height: 14px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #334155;
}
.budget-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s, background 0.3s;
  background: #4ade80;
}
.budget-progress-bar.warn { background: #fbbf24; }
.budget-progress-bar.danger { background: #f87171; }
.budget-stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
  flex-wrap: wrap;
}
.budget-stats strong { color: #e2e8f0; }
.budget-hint {
  color: #64748b;
  font-size: 12px;
  margin: 6px 0 0;
}

/* Category breakdown rows */
.cat-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #1e293b;
}
.cat-row:last-child { border-bottom: none; }
.cat-row-icon { font-size: 18px; text-align: center; }
.cat-row-name { color: #e2e8f0; font-weight: 500; font-size: 14px; }
.cat-row-progress {
  height: 6px;
  background: rgba(148,163,184,0.15);
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}
.cat-row-progress-bar {
  height: 100%;
  background: #60a5fa;
  border-radius: 999px;
  transition: width 0.3s;
}
.cat-row-amounts {
  text-align: right;
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
}
.cat-row-amounts .bought { color: #4ade80; font-weight: 600; }

html[data-theme-effective="light"] .budget-progress { background:#f1f5f9; border-color:#e2e8f0; }
html[data-theme-effective="light"] .budget-amount { color: #0f172a; }
html[data-theme-effective="light"] .budget-stats { color: #475569; }
html[data-theme-effective="light"] .budget-stats strong { color: #0f172a; }
html[data-theme-effective="light"] .cat-row { border-color: #e2e8f0; }
html[data-theme-effective="light"] .cat-row-name { color: #0f172a; }
html[data-theme-effective="light"] .cat-row-amounts { color: #475569; }
html[data-theme-effective="light"] .cat-row-amounts .bought { color: #16a34a; }
html[data-theme-effective="light"] .cat-row-progress { background: rgba(148,163,184,0.25); }

.exclude-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  padding: 3px 8px;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 999px;
  background: rgba(148,163,184,0.06);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.exclude-toggle:hover {
  background: rgba(148,163,184,0.15);
  color: #e2e8f0;
}
.exclude-toggle input[type="checkbox"] {
  accent-color: #3b82f6;
  margin: 0;
  cursor: pointer;
}
.excluded-item {
  opacity: 0.5;
  filter: grayscale(0.4);
}
html[data-theme-effective="light"] .exclude-toggle {
  background: #fff;
  border-color: #e2e8f0;
  color: #64748b;
}
html[data-theme-effective="light"] .exclude-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.p-group-empty {
  padding: 14px 12px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
  background: rgba(148,163,184,0.04);
  border: 1px dashed rgba(148,163,184,0.18);
  border-radius: 10px;
  margin: 4px 0 8px;
}

.p-done-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 6px;
  padding: 6px 10px;
  background: rgba(74,222,128,0.06);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #4ade80;
  transition: background 0.15s, border-color 0.15s;
}
.p-done-month-header:hover { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.4); }
.p-done-month-header .caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  font-size: 12px;
  color: #4ade80;
  background: rgba(74,222,128,0.15);
  border-radius: 5px;
  font-weight: 700;
  transition: transform 0.15s;
}
.p-done-month-header.collapsed .caret { transform: rotate(-90deg); }
.p-done-month-body.collapsed { display: none; }

.p-no-results {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  background: rgba(148,163,184,0.04);
  border: 1px dashed rgba(148,163,184,0.2);
  border-radius: 10px;
}

html[data-theme-effective="light"] .purchases-search {
  background: #fff;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .purchases-search input { color: #0f172a; }
html[data-theme-effective="light"] .purchases-search input::placeholder { color: #94a3b8; }
html[data-theme-effective="light"] .purchases-chip {
  background: #fff;
  color: #64748b;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .purchases-chip:hover { color: #0f172a; }
html[data-theme-effective="light"] .purchases-chip.active {
  background: rgba(59,130,246,0.1);
  color: #2563eb;
  border-color: rgba(59,130,246,0.35);
}
html[data-theme-effective="light"] .p-done-month-header {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.2);
  color: #16a34a;
}
html[data-theme-effective="light"] .p-done-month-header .caret { color: #16a34a; }
html[data-theme-effective="light"] .purchase-link {
  color: #0284c7;
  text-decoration-color: rgba(2, 132, 199, 0.35);
}
html[data-theme-effective="light"] .purchase-link:hover {
  color: #075985;
  text-decoration-color: #0284c7;
}

/* Share menu (fallback when Web Share API is not available) */
.share-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: shareFadeIn 0.15s ease-out;
}
@keyframes shareFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.share-menu {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 18px;
  max-width: 380px;
  width: 100%;
  color: #f1f5f9;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.share-menu h3 { color: #f1f5f9; }
.share-menu-preview {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 14px;
  font-family: inherit;
  font-size: 12px;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.5;
}
.share-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.share-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  font-family: inherit;
  width: auto;
  margin: 0;
  justify-content: flex-start;
  background: #334155;
}
.share-menu-btn:hover { opacity: 0.9; }
.share-menu-btn:active { transform: scale(0.97); }
.share-menu-btn .share-ico { font-size: 20px; }
.share-menu-btn.share-tg { background: #2aabee; }
.share-menu-btn.share-wa { background: #25d366; }
.share-menu-btn.share-viber { background: #7360f2; }
.share-menu-btn.share-email { background: #64748b; }
.share-menu-btn.share-copy { background: #3b82f6; }
.share-menu-close {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.share-menu-close:hover { border-color: #94a3b8; color: #e2e8f0; }
html[data-theme-effective="light"] .share-menu {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}
html[data-theme-effective="light"] .share-menu h3 { color: #0f172a; }
html[data-theme-effective="light"] .share-menu-preview {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}
html[data-theme-effective="light"] .share-menu-close {
  border-color: #cbd5e1;
  color: #475569;
}
.search-badge-nav { background: rgba(148,163,184,0.12); color: #94a3b8; }
.search-no-results { padding: 20px; text-align: center; color: #475569; font-size: 13px; }

/* === TAB NAVIGATION === */
.main-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: #0f172a;
  border-radius: 12px;
  padding: 4px;
  border: 1px solid #334155;
}
.main-tab {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0;
  width: auto;
}
.main-tab:hover { color: #94a3b8; }
.main-tab.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === ANALYTICS STYLES === */
.a-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.a-card h3 {
  font-size: 15px;
  color: #f1f5f9;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.a-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.a-filter-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  width: auto;
  transition: all 0.2s;
}
.a-filter-btn:hover { border-color: #3b82f6; color: #e2e8f0; }
.a-filter-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.a-params {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
}
.a-field { display: flex; flex-direction: column; gap: 4px; }
.a-field label { font-size: 12px; color: #64748b; font-weight: 500; }
.a-field input, .a-field select {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  width: 160px;
}
.a-field input:focus, .a-field select:focus { border-color: #3b82f6; }
.a-btn-calc {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  margin: 0;
}
.a-btn-calc:hover { filter: brightness(1.1); }
.a-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.a-rank-table th {
  text-align: left;
  padding: 10px 8px;
  color: #64748b;
  font-weight: 600;
  border-bottom: 2px solid #334155;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.a-rank-table th:hover { color: #3b82f6; }
.a-rank-table td { padding: 10px 8px; border-bottom: 1px solid #1e293b; }
.a-rank-table tr.a-best { background: rgba(74, 222, 128, 0.06); }
.a-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.a-badge-green { background: rgba(74,222,128,0.12); color: #4ade80; }
.a-badge-yellow { background: rgba(250,204,21,0.12); color: #facc15; }
.a-badge-blue { background: rgba(96,165,250,0.12); color: #60a5fa; }
.a-combo {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.a-combo h4 {
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.a-combo-rank { color: #3b82f6; font-weight: 700; }
.a-combo-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.a-combo-item {
  background: #0f172a;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
}
.a-combo-item .name { font-weight: 600; margin-bottom: 4px; }
.a-combo-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid #334155;
  font-size: 13px;
}
.a-stat .a-stat-label { color: #64748b; font-size: 11px; }
.a-stat .a-stat-value { font-weight: 700; font-size: 15px; }
.a-stat .green { color: #4ade80; }
.a-stat .yellow { color: #facc15; }

/* Currency summary blocks (portfolio → currency) */
.currency-summary {
  flex: 1 1 260px;
  min-width: 0;
  background: rgba(15,23,42,0.5);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
}
.currency-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #334155;
}
.currency-summary-code { font-size: 13px; font-weight: 700; color: #f1f5f9; letter-spacing: 0.3px; }
.currency-summary-rate { font-size: 12px; color: #94a3b8; }
.currency-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.currency-summary-cell { min-width: 0; }
.currency-summary-cell .a-stat-label {
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.currency-summary-cell .a-stat-value {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.currency-summary-cell .green { color: #4ade80; }
@media (max-width: 640px) {
  .currency-summary { padding: 8px 10px; }
  .currency-summary-cell .a-stat-value { font-size: 13px; }
  .currency-summary-cell .a-stat-label { font-size: 10px; }
  .currency-summary-header { margin-bottom: 6px; }
}
html[data-theme-effective="light"] .currency-summary {
  background: rgba(248,250,252,0.6);
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .currency-summary-header {
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .currency-summary-code { color: #0f172a; }
html[data-theme-effective="light"] .currency-summary-rate { color: #475569; }
html[data-theme-effective="light"] .currency-summary-cell .a-stat-label { color: #64748b; }
/* Onboarding */
/* Profile section titles */
.profile-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 16px 0 8px;
  margin-top: 4px;
}

/* Privacy info */
.privacy-info { font-size: 13px; color: #94a3b8; line-height: 1.6; }
.privacy-info p { margin: 8px 0 4px; }
.privacy-info strong { color: #e2e8f0; }
.privacy-info ul { margin: 0 0 8px 20px; padding: 0; }
.privacy-info li { margin-bottom: 2px; }

/* Onboarding */
.onboarding {
  text-align: center;
  padding: 30px 20px;
}
.onboarding-steps {
  text-align: left;
  max-width: 340px;
  margin: 0 auto;
}
.onboarding-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #1e293b;
}
.onboarding-step:last-child { border-bottom: none; }
.onboarding-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.onboarding-title { font-size: 14px; font-weight: 600; color: #f1f5f9; }
.onboarding-desc { font-size: 12px; color: #64748b; margin-top: 2px; }

.a-empty {
  text-align: center;
  color: #475569;
  padding: 40px 20px;
  font-size: 14px;
  line-height: 1.6;
}
.a-reinvest-chain {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.a-reinvest-step {
  background: #0f172a;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.a-reinvest-arrow {
  color: #3b82f6;
  font-size: 20px;
  font-weight: 700;
}
.a-sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.a-sub-tab {
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid #334155;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  margin: 0;
  transition: all 0.2s;
}
.a-sub-tab:hover { border-color: #3b82f6; color: #94a3b8; }
.a-sub-tab.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* Auth bar */
.auth-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  font-size: 13px;
}
.auth-bar .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
}
.auth-bar .user-info img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #334155;
}
.auth-bar .user-name { color: #e2e8f0; font-weight: 500; }
.auth-bar .sync-status {
  font-size: 11px;
  color: #4ade80;
  display: none;
}
.auth-bar .sync-status.show { display: inline; }
.btn-auth {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  margin: 0;
  transition: all 0.2s;
}
.btn-google {
  background: #fff;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-google:hover { background: #f1f5f9; }
.btn-google svg { width: 16px; height: 16px; }
.btn-email-login {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-email-login:hover { border-color: #60a5fa; color: #60a5fa; }
.btn-logout {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
}
.btn-logout:hover { border-color: #f87171; color: #f87171; }
.btn-profile {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  margin-right: 6px;
}
.btn-profile:hover { border-color: #3b82f6; color: #60a5fa; }
.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.top-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 999px;
  max-width: 240px;
}
.top-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.top-user .user-name {
  color: #e2e8f0;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.top-user .sync-status {
  display: none;
  font-size: 11px;
  color: #4ade80;
}
.top-user .sync-status.show { display: inline; }
.top-bar .global-search {
  flex: 1;
  min-width: 0;
  max-width: 520px;
  margin: 0;
  position: relative;
}
.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.top-actions .btn-auth {
  width: auto;
  padding: 6px 12px;
  font-size: 13px;
  margin: 0;
}
.top-actions .btn-profile.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}
.top-actions .btn-profile.active:hover {
  background: #2563eb;
  border-color: #2563eb;
}
.top-actions .help-link {
  padding: 4px 6px;
}
@media (max-width: 720px) {
  .top-bar { gap: 8px; }
  .top-user .user-name { max-width: 100px; }
  .top-bar .global-search { flex-basis: 100%; order: 3; }
  .top-user { order: 1; }
  .top-actions { order: 2; margin-left: auto; }
}
@media (max-width: 400px) {
  .top-user { max-width: none; flex: 1; min-width: 0; }
  .top-user .user-name { max-width: none; flex: 1; }
  .top-actions .btn-auth { padding: 5px 10px; font-size: 12px; }
  .top-actions { gap: 6px; }
}
html[data-theme-effective="light"] .top-user {
  background: #fff;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .top-user .user-name { color: #0f172a; }
.help-link {
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}
.help-link:hover { color: #3b82f6; }
/* (firebase-notice removed) */

/* Dashboard */
.dash-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin: 0 auto 12px;
  max-width: 600px;
}
.dash-hero-label { color: #94a3b8; font-size: 13px; margin-bottom: 4px; }
.dash-hero-value { font-size: 32px; font-weight: 800; color: #f1f5f9; letter-spacing: -0.5px; }
.dash-hero-daily { margin-top: 8px; }
.dash-daily-badge {
  display: inline-block;
  background: rgba(74,222,128,0.12);
  color: #4ade80;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
}
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 auto 12px;
  max-width: 600px;
}
.dash-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
}
.dash-card-label { color: #64748b; font-size: 11px; margin-bottom: 4px; }
.dash-card-value { font-size: 18px; font-weight: 700; color: #f1f5f9; }
.dash-green { color: #4ade80; }

.dash-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #1e293b;
}
.dash-breakdown-item:last-child { border-bottom: none; }
.dash-breakdown-name {
  font-size: 14px;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-breakdown-values {
  text-align: right;
}
.dash-breakdown-gross { font-size: 14px; font-weight: 600; color: #4ade80; }
.dash-breakdown-net { font-size: 11px; color: #64748b; }

/* Currencies page */
.currency-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #1e293b;
  gap: 12px;
}
.currency-row:last-child { border-bottom: none; }
.currency-code {
  font-weight: 700;
  font-size: 14px;
  color: #f1f5f9;
  min-width: 44px;
}
.currency-name {
  flex: 1;
  font-size: 13px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.currency-rate {
  font-weight: 600;
  font-size: 15px;
  color: #f1f5f9;
  min-width: 80px;
  text-align: right;
}
.currency-star {
  background: transparent;
  border: none;
  color: #475569;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  width: auto;
  margin: 0;
  transition: color 0.2s;
}
.currency-star:hover { color: #facc15; }
.currency-star.active { color: #facc15; }
.currency-list {
  max-height: 500px;
  overflow-y: auto;
}
.currency-pinned-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.currency-pinned-code { font-size: 13px; font-weight: 700; color: #60a5fa; margin-bottom: 2px; }
.currency-pinned-rate { font-size: 20px; font-weight: 800; color: #f1f5f9; }
.currency-pinned-name { font-size: 11px; color: #475569; margin-top: 2px; }

.black-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.bm-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.bm-code { font-size: 13px; font-weight: 700; color: #f59e0b; margin-bottom: 6px; }
.bm-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.bm-label { color: #64748b; }
.bm-value { color: #f1f5f9; font-weight: 700; font-size: 14px; }
.bm-spread { font-size: 11px; color: #475569; text-align: center; margin-top: 6px; padding-top: 6px; border-top: 1px solid #1e293b; }

/* Currency settings in profile */
.currency-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.currency-select-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  margin: 0;
  transition: all 0.2s;
}
.currency-select-btn:hover { border-color: #3b82f6; color: #e2e8f0; }
.currency-select-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* Notifications */
.notify-channels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.notify-channel {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
}
.notify-channel-header { margin-bottom: 2px; }
.notify-channel-desc { font-size: 12px; color: #64748b; margin: 0; }
.tg-steps { margin-top: 12px; }
.tg-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.tg-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Expiry alert banners */
.expiry-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}
.expiry-alert-warn {
  background: rgba(250,204,21,0.08);
  border: 1px solid rgba(250,204,21,0.25);
  color: #facc15;
}
.expiry-alert-urgent {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  color: #f87171;
}
.expiry-alert-icon { font-size: 18px; flex-shrink: 0; }
.expiry-alert-text { flex: 1; }
.expiry-alert-name { font-weight: 600; color: #f1f5f9; }
.expiry-alert-days { font-weight: 700; }

/* Dreams chart */
.dreams-chart-wrap { position: relative; height: 250px; margin-bottom: 12px; }

/* Updates tab — red dot badge on the tab button when new entries exist */
.tab-badge {
  display: inline-block;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 6px;
  min-width: 14px;
  line-height: 1;
  margin-left: 4px;
  vertical-align: middle;
}

/* Updates cards */
.update-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.update-card.is-new { border-color: #3b82f6; box-shadow: 0 0 0 1px rgba(59,130,246,0.25); }
.update-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.update-card-title { font-size: 15px; font-weight: 600; color: #f1f5f9; flex: 1; }
.update-card-meta { font-size: 11px; color: #64748b; white-space: nowrap; flex-shrink: 0; }
.update-new-tag { background: rgba(59,130,246,0.15); color: #60a5fa; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-right: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.update-card-body { font-size: 13px; color: #94a3b8; line-height: 1.6; white-space: pre-wrap; }
html[data-theme-effective="light"] .update-card { background: #ffffff; border-color: #e2e8f0; }
html[data-theme-effective="light"] .update-card-title { color: #0f172a; }
html[data-theme-effective="light"] .update-card-body { color: #475569; }

/* Dream currency equivalent (USD shown beside native amount) */
.dream-equiv { color: #64748b; font-size: 12px; margin-left: 4px; font-weight: 400; cursor: help; }
.dream-equiv .cross-rate-info {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 1px;
  vertical-align: middle;
}
html[data-theme-effective="light"] .dream-equiv { color: #94a3b8; }

/* Instant CSS tooltip for cross-rate hint (native title has long delay and
   gets stripped by sanitizer in some flows). */
.cross-hint {
  position: relative;
}
.cross-hint:hover::after,
.cross-hint:focus::after {
  content: attr(data-hint);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid #334155;
  z-index: 1000;
  pointer-events: none;
}
.cross-hint:hover::before,
.cross-hint:focus::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #334155;
  z-index: 1000;
  pointer-events: none;
}
html[data-theme-effective="light"] .cross-hint:hover::after,
html[data-theme-effective="light"] .cross-hint:focus::after {
  background: #0f172a;
  color: #f8fafc;
  border-color: #0f172a;
}
html[data-theme-effective="light"] .cross-hint:hover::before,
html[data-theme-effective="light"] .cross-hint:focus::before {
  border-top-color: #0f172a;
}

/* Dream icon picker */
.dream-icon-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.dream-icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  margin: 0;
}
.dream-icon-btn:hover { border-color: #475569; background: #1e293b; }
.dream-icon-btn.active { border-color: #3b82f6; background: #1e3a8a33; }
html[data-theme-effective="light"] .dream-icon-btn { background: #f8fafc; border-color: #cbd5e1; }
html[data-theme-effective="light"] .dream-icon-btn:hover { background: #e2e8f0; border-color: #94a3b8; }
html[data-theme-effective="light"] .dream-icon-btn.active { background: #dbeafe; border-color: #3b82f6; }

/* Dream icon in list and details */
.dream-icon { font-size: 20px; margin-right: 8px; display: inline-block; }
.dream-icon-hero { font-size: 32px; margin-right: 8px; display: inline-block; }

/* Chart summary */
.chart-summary { padding: 10px 0; }
.chart-summary-date { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.chart-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.chart-summary-label { font-size: 10px; color: #64748b; }
.chart-summary-value { font-size: 16px; font-weight: 700; color: #f1f5f9; }

/* Investment detail */
.detail-header {
  text-align: center;
  padding: 20px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 16px;
}
.detail-name { font-size: 20px; font-weight: 800; color: #f1f5f9; margin-bottom: 4px; }
.detail-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.detail-invested { font-size: 28px; font-weight: 800; color: #f1f5f9; }
.detail-status { font-size: 13px; margin-top: 6px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.detail-metric {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
}
.detail-metric-label { font-size: 11px; color: #64748b; margin-bottom: 3px; }
.detail-metric-value { font-size: 17px; font-weight: 700; color: #f1f5f9; }
.detail-metric-value.green { color: #4ade80; }
.detail-metric-value.yellow { color: #facc15; }
.detail-metric-value.red { color: #f87171; }

.detail-info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #1e293b;
  font-size: 13px;
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-label { color: #64748b; }
.detail-info-value { color: #e2e8f0; font-weight: 500; }

.detail-progress {
  height: 6px;
  background: #334155;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.detail-progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b82f6, #4ade80);
  transition: width 0.3s;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.detail-actions button { flex: 1; }

/* Portfolio */
.p-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.p-item-info { flex: 1; min-width: 0; }
.p-item-name {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.p-item-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.p-type-ovdp { background: rgba(59,130,246,0.12); color: #60a5fa; }
.p-type-deposit { background: rgba(74,222,128,0.12); color: #4ade80; }
.p-type-compound { background: rgba(168,85,247,0.12); color: #a855f7; }
.p-type-insurance { background: rgba(244,114,182,0.12); color: #f472b6; }
.p-type-cash { background: rgba(148,163,184,0.15); color: #cbd5e1; }
.p-type-other { background: rgba(250,204,21,0.12); color: #facc15; }
/* Light-theme overrides — the dark-mode foreground colors wash out on white,
   especially the neutral p-type-cash used for currency badges (EUR/USD). */
html[data-theme-effective="light"] .p-type-ovdp { background: rgba(37,99,235,0.14); color: #1d4ed8; }
html[data-theme-effective="light"] .p-type-deposit { background: rgba(22,163,74,0.14); color: #15803d; }
html[data-theme-effective="light"] .p-type-compound { background: rgba(147,51,234,0.14); color: #7e22ce; }
html[data-theme-effective="light"] .p-type-insurance { background: rgba(219,39,119,0.14); color: #be185d; }
html[data-theme-effective="light"] .p-type-cash { background: rgba(71,85,105,0.14); color: #334155; }
html[data-theme-effective="light"] .p-type-other { background: rgba(202,138,4,0.14); color: #a16207; }

/* Savings row badges — 'free' and 'linked to dream' */
.saving-badge-free { background: rgba(5,150,105,0.18); color: #6ee7b7; }
.saving-badge-linked { background: rgba(30,64,175,0.25); color: #93c5fd; }
html[data-theme-effective="light"] .saving-badge-free { background: rgba(5,150,105,0.15); color: #047857; }
html[data-theme-effective="light"] .saving-badge-linked { background: rgba(37,99,235,0.14); color: #1d4ed8; }
.p-item-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.p-item-details strong { color: #e2e8f0; }
.p-item-notes { font-size: 12px; color: #64748b; font-style: italic; }
.p-item-actions { flex-shrink: 0; }
.p-item-profit {
  text-align: right;
  margin-bottom: 8px;
}
.p-item-profit .amount { font-size: 16px; font-weight: 700; color: #4ade80; }
.p-item-profit .label { font-size: 11px; color: #64748b; }
.p-status-active { color: #4ade80; }
.p-status-ended { color: #64748b; }

/* Profile */
.profile-user {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #334155;
}
.profile-name {
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 2px;
}
.profile-email {
  font-size: 13px;
  color: #64748b;
}
.profile-lang-options {
  display: flex;
  gap: 8px;
}
.profile-lang-btn {
  flex: 1;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  margin: 0;
  width: auto;
}
.profile-lang-btn:hover { border-color: #475569; color: #e2e8f0; }
.profile-lang-btn.active {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.1);
  color: #f1f5f9;
}
.profile-lang-flag { font-size: 20px; }
.profile-2fa-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #1e293b;
}
.profile-2fa-option:last-of-type { border-bottom: none; }
.profile-2fa-info { flex: 1; }
.profile-2fa-title {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 2px;
}
.profile-2fa-desc {
  font-size: 12px;
  color: #64748b;
}
.profile-2fa-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.profile-2fa-status {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.profile-2fa-status.active {
  color: #4ade80;
}
.profile-2fa-soon {
  color: #475569;
  font-style: italic;
}
.profile-2fa-btn {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  margin: 0;
  transition: all 0.2s;
}
.profile-2fa-btn:hover { border-color: #3b82f6; color: #e2e8f0; }
.profile-2fa-btn.danger {
  border-color: #f87171;
  color: #f87171;
}
.profile-2fa-btn.danger:hover { background: rgba(248,113,113,0.1); }

/* Help page */
.back-link {
  display: inline-block;
  color: #3b82f6;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 24px;
  font-weight: 500;
}
.back-link:hover { text-decoration: underline; }
.help-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid #334155;
}
.section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.section h2 {
  text-align: left;
  font-size: 17px;
  color: #f1f5f9;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section h2 .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
  flex-shrink: 0;
}
.icon-blue { background: rgba(59,130,246,0.15); }
.icon-green { background: rgba(74,222,128,0.15); }
.icon-yellow { background: rgba(250,204,21,0.15); }
.icon-purple { background: rgba(167,139,250,0.15); }
.section p { color: #94a3b8; font-size: 14px; margin-bottom: 10px; }
.step {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.step-num {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-text { font-size: 14px; color: #e2e8f0; }
.step-text strong { color: #f1f5f9; }
.tip {
  background: rgba(250,204,21,0.06);
  border: 1px solid rgba(250,204,21,0.15);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: #fbbf24;
  margin-top: 12px;
}
.formula {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: #60a5fa;
  margin: 10px 0;
  overflow-x: auto;
}
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.feature {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
}
.feature-title { font-size: 13px; font-weight: 600; color: #f1f5f9; margin-bottom: 4px; }
.feature-desc { font-size: 12px; color: #64748b; }
.kbd {
  display: inline-block;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: monospace;
  color: #e2e8f0;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .container { max-width: 100%; padding: 24px; }
}
@media (max-width: 900px) {
  .main-layout { flex-direction: column; }
  .panel-right { position: static; }
  .panel-right .results { margin-top: 24px; display: none; }
  .panel-right .results.show { display: block; }
  .help-columns { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  body { padding: 8px; }
  .container { padding: 16px; border-radius: 12px; }
  h1 { font-size: 18px; }
  .subtitle { font-size: 12px; margin-bottom: 16px; }
  .hint { font-size: 11px; margin-bottom: 16px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .form-grid .field-full { grid-column: 1 / -1; }
  .field { margin-bottom: 10px; }
  label { font-size: 11px; margin-bottom: 4px; }
  input { padding: 9px 10px; font-size: 15px; }
  button { padding: 12px; font-size: 15px; }
  .btn-row { flex-direction: column; }
  .btn-clear { padding: 10px; }
  .result-value { font-size: 14px; }
  .result-value.rate { font-size: 18px; }
  .result-label { font-size: 12px; }
  .global-search { margin-bottom: 10px; }
  .global-search input { font-size: 13px; padding: 9px 0; }
  .global-search-input-wrap { padding: 0 10px; }
  .main-tabs { margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .main-tab { font-size: 12px; padding: 10px 8px; white-space: nowrap; flex-shrink: 0; }
  .auth-bar { flex-direction: column; gap: 8px; }
  .feature-grid { grid-template-columns: 1fr; }

  /* Calculator results mobile */
  .result-row { gap: 8px; }
  .result-label { flex-shrink: 0; max-width: 55%; }
  .compound-compare-header { font-size: 10px; padding: 6px 8px; }
  .compound-compare-row { font-size: 12px; padding: 6px 8px; }

  /* Saved table mobile */
  .saved-table { font-size: 11px; }
  .saved-table th, .saved-table td { padding: 6px 4px; }

  /* Analytics params mobile */
  .a-params { flex-direction: column; gap: 10px; }
  .a-field { width: 100%; }
  .a-field input, .a-field select { width: 100%; }
  .a-btn-calc { width: 100%; padding: 12px; }

  /* Analytics tables mobile */
  .a-rank-table { font-size: 12px; }
  .a-rank-table th { padding: 8px 6px; font-size: 11px; }
  .a-rank-table td { padding: 8px 6px; }

  /* Analytics combos mobile */
  .a-combo-items { grid-template-columns: 1fr; }
  .a-combo h4 { flex-wrap: wrap; font-size: 13px; }
  .a-combo-summary { gap: 12px; }
  .a-sub-tabs { flex-wrap: wrap; }
  .a-sub-tab { font-size: 12px; padding: 6px 12px; }

  /* Reinvestment mobile */
  .a-reinvest-chain { flex-direction: column; }
  .a-reinvest-arrow { transform: rotate(90deg); }
  .a-reinvest-step { width: 100%; }

  /* Dashboard mobile */
  .dash-hero { padding: 18px 14px; }
  .dash-hero-value { font-size: 24px; }
  .dash-daily-badge { font-size: 12px; padding: 3px 10px; }
  .dash-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dash-card { padding: 12px; }
  .dash-card-value { font-size: 15px; }
  .dash-card-label { font-size: 10px; }

  /* Dreams chart mobile */
  .dreams-chart-wrap { height: 180px !important; }

  /* Chart summary mobile */
  .chart-summary-grid { grid-template-columns: 1fr !important; gap: 4px !important; }
  .chart-summary-value { font-size: 14px !important; }

  /* Investment detail mobile */
  .detail-header { padding: 16px; }
  .detail-name { font-size: 17px; }
  .detail-invested { font-size: 22px; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .detail-metric { padding: 10px; }
  .detail-metric-value { font-size: 15px; }
  .detail-actions { flex-direction: column; }

  /* Portfolio items mobile */
  .p-item { flex-direction: column; gap: 12px; }
  .p-item-actions { display: flex; align-items: center; gap: 12px; width: 100%; }
  .p-item-profit { text-align: left; margin-bottom: 0; flex: 1; }
  .p-item-name { flex-wrap: wrap; }
  .p-item-details { gap: 10px; }

  /* Breakdown mobile */
  .dash-breakdown-item { gap: 8px; }
  .dash-breakdown-name { font-size: 13px; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; }
  .dash-breakdown-gross { font-size: 13px; }

  /* Currencies mobile */
  .currency-name { font-size: 12px; }
  .currency-rate { font-size: 13px; min-width: 70px; }
  .currency-pinned-rate { font-size: 16px; }
  .bm-value { font-size: 13px; }
  .currency-select-btn { padding: 6px 12px; font-size: 12px; }
}
@media (max-width: 400px) {
  body { padding: 4px; }
  .container { padding: 10px; border-radius: 8px; }
  h1 { font-size: 16px; }
  .main-tabs { gap: 2px; padding: 3px; }
  .main-tab { font-size: 11px; padding: 8px 4px; }
  .a-card { padding: 12px; }
  .a-card h3 { font-size: 14px; }

  /* Calculator form small */
  .form-grid { gap: 0 8px; }
  label { font-size: 10px; }
  input { padding: 8px 8px; font-size: 14px; }

  /* Calculator results small */
  .result-label { font-size: 11px; }
  .result-value { font-size: 13px; }
  .result-value.rate { font-size: 16px; }

  /* Analytics small */
  .a-combo { padding: 12px; }
  .a-combo h4 { font-size: 12px; }
  .a-stat .a-stat-value { font-size: 13px; }
  .a-stat .a-stat-label { font-size: 10px; }
  .a-reinvest-step { padding: 8px 10px; font-size: 12px; }

  /* Dashboard small */
  .dash-hero-value { font-size: 20px; }
  .dash-hero-label { font-size: 11px; }
  .dash-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .dash-card { padding: 10px; }
  .dash-card-value { font-size: 14px; }

  /* Breakdown small */
  .dash-breakdown-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .dash-breakdown-values { text-align: left; }

  /* Portfolio items small */
  .p-item-details { flex-direction: column; gap: 4px; }

  /* Currencies small */
  .currency-row { gap: 8px; padding: 10px 0; }
  .currency-code { font-size: 12px; min-width: 36px; }
  .currency-name { font-size: 11px; }
  .currency-rate { font-size: 12px; min-width: 60px; }
  .currency-pinned-rate { font-size: 14px; }
  .bm-value { font-size: 12px; }
}

/* ============ MINFIN IMPORT ============ */
.minfin-import-section {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}
.minfin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-minfin-import {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px dashed #475569;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.btn-minfin-import:hover {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}
.minfin-icon { font-size: 18px; }
.minfin-count {
  font-size: 13px;
  color: #22c55e;
  font-weight: 500;
}
.minfin-filters {
  display: flex;
  gap: 16px;
  margin: 10px 0 8px;
}
.minfin-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #94a3b8;
  cursor: pointer;
}
.minfin-filter-label input[type="checkbox"] {
  accent-color: #38bdf8;
}
#minfinBondSelect,
#ovdpBondSelect,
#pOvdpBondSelect {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  background-color: #0f172a;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2 4.5l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: #f1f5f9;
  font-size: 14px;
  line-height: 1.3;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
#minfinBondSelect:hover,
#ovdpBondSelect:hover,
#pOvdpBondSelect:hover {
  border-color: #475569;
  background-color: #111c33;
}
#minfinBondSelect:focus,
#ovdpBondSelect:focus,
#pOvdpBondSelect:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
#minfinBondSelect option,
#ovdpBondSelect option,
#pOvdpBondSelect option {
  background: #0f172a;
  color: #f1f5f9;
  padding: 8px;
}
#minfinBondSelect option:disabled,
#ovdpBondSelect option:disabled,
#pOvdpBondSelect option:disabled {
  color: #64748b;
}
@media (max-width: 400px) {
  #minfinBondSelect,
  #ovdpBondSelect,
  #pOvdpBondSelect {
    padding: 10px 36px 10px 12px;
    font-size: 13px;
    background-position: right 12px center;
  }
}
.minfin-bond-info {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 10px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.6;
}
.minfin-bond-info strong {
  color: #38bdf8;
}

/* ================================================================
   LIGHT THEME
   Активується через [data-theme-effective="light"] на <html>.
   Inline script у index.html резолвить "auto" до реального значення,
   тож CSS дивиться тільки на data-theme-effective.
================================================================ */
html[data-theme-effective="light"] body {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #1e293b;
}
html[data-theme-effective="light"] .container {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 40px rgba(15,23,42,0.06);
}
html[data-theme-effective="light"] h1,
html[data-theme-effective="light"] h2,
html[data-theme-effective="light"] h3,
html[data-theme-effective="light"] h4 {
  color: #0f172a;
}
html[data-theme-effective="light"] .subtitle,
html[data-theme-effective="light"] .hint {
  color: #475569;
}
html[data-theme-effective="light"] label {
  color: #475569;
}

/* Inputs / selects / textareas
   !important needed because many inputs in index.html carry inline
   dark styles (background:#0f172a;color:#f1f5f9). */
html[data-theme-effective="light"] input,
html[data-theme-effective="light"] select,
html[data-theme-effective="light"] textarea {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
html[data-theme-effective="light"] input::placeholder,
html[data-theme-effective="light"] textarea::placeholder {
  color: #94a3b8;
}
html[data-theme-effective="light"] input:focus,
html[data-theme-effective="light"] select:focus,
html[data-theme-effective="light"] textarea:focus {
  border-color: #2563eb !important;
}
html[data-theme-effective="light"] input.auto-filled {
  border-color: #93c5fd;
  color: #1d4ed8;
}
html[data-theme-effective="light"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme-effective="light"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-theme-effective="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html[data-theme-effective="light"] input[type="month"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.7;
}
html[data-theme-effective="light"] #minfinBondSelect,
html[data-theme-effective="light"] #ovdpBondSelect {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
html[data-theme-effective="light"] #minfinBondSelect option,
html[data-theme-effective="light"] #ovdpBondSelect option {
  background: #ffffff;
  color: #0f172a;
}

/* Buttons (keep gradients as is; outline buttons need updates) */
html[data-theme-effective="light"] .btn-clear {
  background: transparent;
  border-color: #cbd5e1;
  color: #475569;
}
html[data-theme-effective="light"] .btn-clear:hover {
  border-color: #94a3b8;
  color: #0f172a;
}
/* On light theme buttons follow a single visual language:
   subtle slate background, accent-colored text + border + bottom-shadow.
   Gradients are too bright on a white card. */
/* Default unclassed <button> (e.g. "Розрахувати", "Розрахувати кредит") —
   match the accent-on-slate language. Limit selector to bare buttons so
   classed buttons (.btn-delete, .tab, .share-btn etc.) keep their styles. */
html[data-theme-effective="light"] button:not([class]) {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  box-shadow: inset 0 -2px 0 rgba(37,99,235,0.18);
}
html[data-theme-effective="light"] button:not([class]):hover {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border-color: #3b82f6;
  opacity: 1;
}
html[data-theme-effective="light"] .btn-save {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #15803d;
  border: 1px solid #86efac;
  box-shadow: inset 0 -2px 0 rgba(22,163,74,0.15);
}
html[data-theme-effective="light"] .btn-save:hover {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  border-color: #22c55e;
}
html[data-theme-effective="light"] .btn-export {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #b45309;
  border: 1px solid #fcd34d;
  box-shadow: inset 0 -2px 0 rgba(217,119,6,0.15);
}
html[data-theme-effective="light"] .btn-export:hover {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border-color: #f59e0b;
}
html[data-theme-effective="light"] .btn-import {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  box-shadow: inset 0 -2px 0 rgba(37,99,235,0.15);
}
html[data-theme-effective="light"] .btn-import:hover {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border-color: #3b82f6;
}

/* Results blocks */
html[data-theme-effective="light"] .results,
html[data-theme-effective="light"] .a-card,
html[data-theme-effective="light"] .saved-section,
html[data-theme-effective="light"] .result-section,
html[data-theme-effective="light"] .compound-compare,
html[data-theme-effective="light"] .install-banner {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .result-label {
  color: #475569;
}
html[data-theme-effective="light"] .result-value {
  color: #0f172a;
}

/* Tables */
html[data-theme-effective="light"] table,
html[data-theme-effective="light"] .saved-table,
html[data-theme-effective="light"] .credit-schedule-table,
html[data-theme-effective="light"] .a-rank-table {
  background: #ffffff;
  color: #1e293b;
}
html[data-theme-effective="light"] table th,
html[data-theme-effective="light"] .saved-table th,
html[data-theme-effective="light"] .credit-schedule-table th,
html[data-theme-effective="light"] .a-rank-table th {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] table td,
html[data-theme-effective="light"] .saved-table td,
html[data-theme-effective="light"] .credit-schedule-table td,
html[data-theme-effective="light"] .a-rank-table td {
  border-color: #e2e8f0;
  color: #1e293b;
}
html[data-theme-effective="light"] .table-wrap {
  border-color: #e2e8f0;
}

/* Main layout tabs, search */
html[data-theme-effective="light"] .main-tabs {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .main-tab {
  color: #475569;
}
html[data-theme-effective="light"] .main-tab:hover {
  color: #0f172a;
}
html[data-theme-effective="light"] .main-tab.active {
  background: #ffffff;
  color: #0f172a;
}
html[data-theme-effective="light"] .global-search,
html[data-theme-effective="light"] .global-search-input-wrap {
  background: #f8fafc;
  border-color: #cbd5e1;
}
html[data-theme-effective="light"] .global-search-results {
  background: #ffffff;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .search-result-item {
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .search-result-item:hover {
  background: #f1f5f9;
}
html[data-theme-effective="light"] .search-result-title {
  color: #0f172a;
}
html[data-theme-effective="light"] .search-result-sub {
  color: #64748b;
}

/* Portfolio items */
html[data-theme-effective="light"] .p-item {
  background: #ffffff;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .p-item:hover {
  border-color: #cbd5e1;
}
html[data-theme-effective="light"] .p-item-name {
  color: #0f172a;
}
html[data-theme-effective="light"] .p-item-details {
  color: #475569;
}
html[data-theme-effective="light"] .p-item-details strong {
  color: #0f172a;
}
html[data-theme-effective="light"] .p-item-notes {
  color: #64748b;
}

/* Profile cards and sections */
html[data-theme-effective="light"] .profile-section-title {
  color: #0f172a;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .profile-lang-btn,
html[data-theme-effective="light"] .profile-theme-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
html[data-theme-effective="light"] .profile-lang-btn:hover,
html[data-theme-effective="light"] .profile-theme-btn:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}
html[data-theme-effective="light"] .profile-lang-btn.active,
html[data-theme-effective="light"] .profile-theme-btn.active {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

/* Analytics combos and badges */
html[data-theme-effective="light"] .a-combo {
  background: #ffffff;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .a-combo-summary {
  background: #f1f5f9;
  color: #1e293b;
}
html[data-theme-effective="light"] .a-filter-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
html[data-theme-effective="light"] .a-filter-btn.active {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

/* Form grid & field-hint */
html[data-theme-effective="light"] .field-hint,
html[data-theme-effective="light"] .calc-disclaimer,
html[data-theme-effective="light"] .privacy-info {
  color: #475569;
}

/* Compound compare */
html[data-theme-effective="light"] .compound-compare-header {
  color: #475569;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .compound-compare-row {
  border-color: #e2e8f0;
}

/* Onboarding */
html[data-theme-effective="light"] .onboarding {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .onboarding-title {
  color: #0f172a;
}
html[data-theme-effective="light"] .onboarding-desc {
  color: #64748b;
}
html[data-theme-effective="light"] .onboarding-num {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Minfin info card */
html[data-theme-effective="light"] .minfin-bond-info,
html[data-theme-effective="light"] #ovdpBondInfo,
html[data-theme-effective="light"] #pOvdpBondInfo {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}
html[data-theme-effective="light"] .minfin-bond-info strong {
  color: #1d4ed8;
}

/* Delete / edit buttons */
html[data-theme-effective="light"] .btn-delete {
  color: #94a3b8;
}
html[data-theme-effective="light"] .btn-delete:hover {
  color: #ef4444;
}

/* Дрібні тіні в темних блоках */
html[data-theme-effective="light"] .a-card,
html[data-theme-effective="light"] .results {
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

/* Scrollbar для webkit */
html[data-theme-effective="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
html[data-theme-effective="light"] ::-webkit-scrollbar-track {
  background: #f1f5f9;
}

/* ================================================================
   LIGHT THEME — EXTENDED COVERAGE
   (Dashboard, Currency, Notifications, Detail, Profile, Help, тощо)
================================================================ */

/* === Body text / checkbox label === */
html[data-theme-effective="light"] .checkbox-label {
  color: #1e293b;
}
html[data-theme-effective="light"] .privacy-info strong {
  color: #0f172a;
}

/* === Global search input / icons === */
html[data-theme-effective="light"] .global-search input {
  color: #0f172a;
}
html[data-theme-effective="light"] .global-search input::placeholder {
  color: #94a3b8;
}
html[data-theme-effective="light"] .global-search-clear {
  color: #64748b;
}
html[data-theme-effective="light"] .global-search-clear:hover {
  color: #0f172a;
}
html[data-theme-effective="light"] .search-no-results {
  color: #94a3b8;
}

/* === Saved table === */
html[data-theme-effective="light"] .saved-title {
  color: #0f172a;
}
html[data-theme-effective="light"] .saved-count {
  color: #64748b;
}
html[data-theme-effective="light"] .saved-table tbody tr:hover td {
  background: #f1f5f9;
}
html[data-theme-effective="light"] .total-row td {
  background: #f1f5f9;
  border-top-color: #cbd5e1;
  color: #0f172a;
}

/* === Credit schedule details === */
html[data-theme-effective="light"] .credit-schedule-table th {
  background: #f1f5f9;
  color: #475569;
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .credit-schedule-table td:first-child {
  color: #64748b;
}

/* === Analytics card / inputs / tables === */
html[data-theme-effective="light"] .a-card h3 {
  color: #0f172a;
}
html[data-theme-effective="light"] .a-field label {
  color: #64748b;
}
html[data-theme-effective="light"] .a-field input,
html[data-theme-effective="light"] .a-field select {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}
html[data-theme-effective="light"] .a-rank-table th {
  color: #64748b;
  border-bottom-color: #cbd5e1;
}
html[data-theme-effective="light"] .a-rank-table td {
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .a-rank-table tr.a-best {
  background: rgba(34, 197, 94, 0.08);
}
html[data-theme-effective="light"] .a-combo h4 {
  color: #0f172a;
}
html[data-theme-effective="light"] .a-combo-item {
  background: #f8fafc;
  color: #1e293b;
}
html[data-theme-effective="light"] .a-combo-summary {
  border-top-color: #e2e8f0;
}
html[data-theme-effective="light"] .a-stat .a-stat-label {
  color: #64748b;
}
html[data-theme-effective="light"] .a-reinvest-step {
  background: #f8fafc;
  color: #1e293b;
}
html[data-theme-effective="light"] .a-empty {
  color: #94a3b8;
}
html[data-theme-effective="light"] .a-sub-tab {
  border-color: #e2e8f0;
  color: #64748b;
}
html[data-theme-effective="light"] .a-sub-tab:hover {
  border-color: #60a5fa;
  color: #1e293b;
}
html[data-theme-effective="light"] .a-sub-tab.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* === Auth bar / user info / top bar === */
html[data-theme-effective="light"] .auth-bar {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .auth-bar .user-info {
  color: #475569;
}
html[data-theme-effective="light"] .auth-bar .user-info img {
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .auth-bar .user-name {
  color: #0f172a;
}
html[data-theme-effective="light"] .btn-logout {
  border-color: #cbd5e1;
  color: #475569;
}
html[data-theme-effective="light"] .btn-logout:hover {
  border-color: #ef4444;
  color: #ef4444;
}
html[data-theme-effective="light"] .btn-profile {
  border-color: #cbd5e1;
  color: #475569;
}
html[data-theme-effective="light"] .btn-profile:hover {
  border-color: #3b82f6;
  color: #2563eb;
}
html[data-theme-effective="light"] .help-link {
  color: #64748b;
}
html[data-theme-effective="light"] .help-link:hover {
  color: #2563eb;
}

/* === Dashboard === */
html[data-theme-effective="light"] .dash-hero {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}
html[data-theme-effective="light"] .dash-hero-label {
  color: #475569;
}
html[data-theme-effective="light"] .dash-hero-value {
  color: #0f172a;
}
html[data-theme-effective="light"] .dash-daily-badge {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}
html[data-theme-effective="light"] .dash-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .dash-card-label {
  color: #64748b;
}
html[data-theme-effective="light"] .dash-card-value {
  color: #0f172a;
}
html[data-theme-effective="light"] .dash-breakdown-item {
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .dash-breakdown-name {
  color: #1e293b;
}
html[data-theme-effective="light"] .dash-breakdown-net {
  color: #64748b;
}

/* === Currencies page === */
html[data-theme-effective="light"] .currency-row {
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .currency-code {
  color: #0f172a;
}
html[data-theme-effective="light"] .currency-name {
  color: #475569;
}
html[data-theme-effective="light"] .currency-rate {
  color: #0f172a;
}
html[data-theme-effective="light"] .currency-star {
  color: #94a3b8;
}
html[data-theme-effective="light"] .currency-pinned-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .currency-pinned-rate {
  color: #0f172a;
}
html[data-theme-effective="light"] .currency-pinned-name {
  color: #64748b;
}

/* Black market cards */
html[data-theme-effective="light"] .bm-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .bm-label {
  color: #64748b;
}
html[data-theme-effective="light"] .bm-value {
  color: #0f172a;
}
html[data-theme-effective="light"] .bm-spread {
  color: #94a3b8;
  border-top-color: #e2e8f0;
}

/* Currency select in profile */
html[data-theme-effective="light"] .currency-select-btn {
  border-color: #e2e8f0;
  color: #475569;
}
html[data-theme-effective="light"] .currency-select-btn:hover {
  border-color: #60a5fa;
  color: #0f172a;
}
html[data-theme-effective="light"] .currency-select-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* === Notifications === */
html[data-theme-effective="light"] .notify-channel {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .notify-channel-desc {
  color: #64748b;
}
html[data-theme-effective="light"] .tg-step {
  color: #475569;
}

/* === Expiry alert === */
html[data-theme-effective="light"] .expiry-alert-name {
  color: #0f172a;
}

/* === Chart summary === */
html[data-theme-effective="light"] .chart-summary-date,
html[data-theme-effective="light"] .chart-summary-label {
  color: #64748b;
}
html[data-theme-effective="light"] .chart-summary-value {
  color: #0f172a;
}

/* === Investment detail view === */
html[data-theme-effective="light"] .detail-header {
  background: linear-gradient(135deg, #dbeafe 0%, #f1f5f9 100%);
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .detail-name {
  color: #0f172a;
}
html[data-theme-effective="light"] .detail-invested {
  color: #0f172a;
}
html[data-theme-effective="light"] .detail-metric {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .detail-metric-label {
  color: #64748b;
}
html[data-theme-effective="light"] .detail-metric-value {
  color: #0f172a;
}
html[data-theme-effective="light"] .detail-info-row {
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .detail-info-label {
  color: #64748b;
}
html[data-theme-effective="light"] .detail-info-value {
  color: #1e293b;
}
html[data-theme-effective="light"] .detail-progress {
  background: #e2e8f0;
}

/* === Profile: avatar, name, email, 2FA === */
html[data-theme-effective="light"] .profile-avatar {
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .profile-name {
  color: #0f172a;
}
html[data-theme-effective="light"] .profile-email {
  color: #64748b;
}
html[data-theme-effective="light"] .profile-2fa-option {
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .profile-2fa-title {
  color: #0f172a;
}
html[data-theme-effective="light"] .profile-2fa-desc {
  color: #64748b;
}
html[data-theme-effective="light"] .profile-2fa-status {
  color: #64748b;
}
html[data-theme-effective="light"] .profile-2fa-soon {
  color: #94a3b8;
}
html[data-theme-effective="light"] .profile-2fa-btn {
  border-color: #e2e8f0;
  color: #475569;
}
html[data-theme-effective="light"] .profile-2fa-btn:hover {
  border-color: #60a5fa;
  color: #0f172a;
}

/* === Help page === */
html[data-theme-effective="light"] .section {
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .section h2 {
  color: #0f172a;
}
html[data-theme-effective="light"] .section p {
  color: #475569;
}
html[data-theme-effective="light"] .step {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .step-text {
  color: #1e293b;
}
html[data-theme-effective="light"] .step-text strong {
  color: #0f172a;
}
html[data-theme-effective="light"] .feature {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .feature-title {
  color: #0f172a;
}
html[data-theme-effective="light"] .feature-desc {
  color: #64748b;
}
html[data-theme-effective="light"] .formula {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #1d4ed8;
}
html[data-theme-effective="light"] .kbd {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
html[data-theme-effective="light"] .back-link {
  color: #2563eb;
}

/* === Minfin import === */
html[data-theme-effective="light"] .minfin-import-section {
  background: linear-gradient(135deg, #f1f5f9 0%, #ffffff 100%);
  border-color: #e2e8f0;
}
html[data-theme-effective="light"] .btn-minfin-import {
  border-color: #cbd5e1;
  color: #475569;
}
html[data-theme-effective="light"] .btn-minfin-import:hover {
  border-color: #0ea5e9;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.05);
}
html[data-theme-effective="light"] .minfin-filter-label {
  color: #475569;
}

/* === Minfin selects (all three) === */
html[data-theme-effective="light"] #minfinBondSelect,
html[data-theme-effective="light"] #ovdpBondSelect,
html[data-theme-effective="light"] #pOvdpBondSelect {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%23475569' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2 4.5l4 4 4-4'/></svg>");
}
html[data-theme-effective="light"] #minfinBondSelect:hover,
html[data-theme-effective="light"] #ovdpBondSelect:hover,
html[data-theme-effective="light"] #pOvdpBondSelect:hover {
  border-color: #94a3b8;
  background-color: #f1f5f9;
}
html[data-theme-effective="light"] #minfinBondSelect option,
html[data-theme-effective="light"] #ovdpBondSelect option,
html[data-theme-effective="light"] #pOvdpBondSelect option {
  background: #ffffff;
  color: #0f172a;
}
html[data-theme-effective="light"] #minfinBondSelect option:disabled,
html[data-theme-effective="light"] #ovdpBondSelect option:disabled,
html[data-theme-effective="light"] #pOvdpBondSelect option:disabled {
  color: #94a3b8;
}

/* === Base input override (calculator fields) === */
html[data-theme-effective="light"] input.auto-filled {
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* === Total / result rows === */
html[data-theme-effective="light"] .result-section {
  color: #64748b;
  border-bottom-color: #e2e8f0;
}
html[data-theme-effective="light"] .result-row {
  border-bottom-color: #e2e8f0;
}

/* === Compound compare labels === */
html[data-theme-effective="light"] .compound-compare-row .cc-label {
  color: #475569;
}
html[data-theme-effective="light"] .compound-compare-row .cc-value {
  color: #0f172a;
}

/* === Minfin bond info "strong" token === */
html[data-theme-effective="light"] .calc-disclaimer strong {
  color: #475569;
}

/* ================================================================
   LIGHT THEME — INLINE-STYLE OVERRIDES (!important to beat inline)
   Деякі елементи в index.html мають inline style="" з темними
   кольорами; їх потрібно пере-обійти.
================================================================ */
html[data-theme-effective="light"] #calcType,
html[data-theme-effective="light"] #compoundYears,
html[data-theme-effective="light"] #pType,
html[data-theme-effective="light"] #dreamCurrency,
html[data-theme-effective="light"] #chartYearFilter,
html[data-theme-effective="light"] #notifyDays,
html[data-theme-effective="light"] #feedbackText {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* Допоміжні subtitle / description параграфи з inline color */
html[data-theme-effective="light"] p[style*="color:#94a3b8"],
html[data-theme-effective="light"] p[style*="color: #94a3b8"] {
  color: #475569 !important;
}
html[data-theme-effective="light"] p[style*="color:#64748b"],
html[data-theme-effective="light"] p[style*="color: #64748b"],
html[data-theme-effective="light"] p[style*="color:#475569"],
html[data-theme-effective="light"] p[style*="color: #475569"] {
  color: #64748b !important;
}
html[data-theme-effective="light"] span[style*="color:#475569"],
html[data-theme-effective="light"] span[style*="color: #475569"] {
  color: #64748b !important;
}
html[data-theme-effective="light"] div[style*="color:#94a3b8"],
html[data-theme-effective="light"] div[style*="color: #94a3b8"] {
  color: #475569 !important;
}
html[data-theme-effective="light"] div[style*="color:#64748b"],
html[data-theme-effective="light"] div[style*="color: #64748b"] {
  color: #64748b !important;
}

/* Inline-стилізовані <h2> у модалках авторизації */
html[data-theme-effective="light"] h2[style*="color:#f1f5f9"],
html[data-theme-effective="light"] h2[style*="color: #f1f5f9"] {
  color: #0f172a !important;
}



/* Telegram connect spinner */
.tg-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(59,130,246,0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: tg-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes tg-spin { to { transform: rotate(360deg); } }

