* { 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; }
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, #8b5cf6, #7c3aed);
  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-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; }
/* 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-logout {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
}
.btn-logout:hover { border-color: #f87171; color: #f87171; }
.top-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}
.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; }

/* 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-other { background: rgba(250,204,21,0.12); color: #facc15; }
.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; }

  /* 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; }
}
