#profile-section .profile-card.collapsed {
  box-shadow: 0 1px 2px rgba(31,38,135,0.10);
}
#profile-section .profile-card.collapsed .profile-summary-grid,
#profile-section .profile-card.collapsed .profile-table,
#profile-section .profile-card.collapsed .profile-chart {
  display: none !important;
}

/* ===== Stocks Cards Layout ===== */
/* === Allocation View Switch (Sectors/Countries) === */
.allocation-switch-wrapper {
  display: flex;
  justify-content: center;
  margin: 2.2rem 0 1.2rem 0;
  width: 100%;
}

.allocation-switch {
  position: relative;
  display: inline-flex;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(18px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  padding: 0.35rem 0.5rem;
  gap: 0.4rem;
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.35),
    inset 0 2px 6px rgba(255, 255, 255, 0.3);
}

.allocation-option {
  position: relative;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.35rem;
  border-radius: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition:
    color 0.35s ease,
    transform 0.35s ease;
  letter-spacing: 0.3px;
}

.allocation-option .option-icon svg {
  display: block;
}

.allocation-option.active {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.allocation-option:not(.active):hover {
  color: rgba(255, 255, 255, 0.95);
}

.switch-glow {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 8px);
  background: linear-gradient(135deg, var(--stocks-row-grad-start) 0%, var(--stocks-row-grad-end) 100%);
  border-radius: 40px;
  box-shadow:
    0 8px 25px rgba(102, 126, 234, 0.5),
    inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  transition:
    transform 0.5s cubic-bezier(0.77, 0, 0.175, 1),
    width 0.3s ease;
  z-index: 0;
}

.allocation-switch .allocation-option {
  z-index: 1;
}

.allocation-switch.sectors-active .switch-glow {
  transform: translateX(0);
}
.allocation-switch.countries-active .switch-glow {
  transform: translateX(100%);
}
/* Dividends switch: mirror Allocation behavior */
.allocation-switch.monthly-active .switch-glow {
  transform: translateX(0);
}
.allocation-switch.annual-active .switch-glow {
  transform: translateX(100%);
}
.allocation-switch.table-active .switch-glow {
  transform: translateX(0);
}
.allocation-switch.chart-active .switch-glow {
  transform: translateX(100%);
}
/* Admin submenu: Snapshots vs Users */
.allocation-switch.snapshots-active .switch-glow {
  transform: translateX(0);
}
.allocation-switch.users-active .switch-glow {
  transform: translateX(100%);
}

/* Chart type toggle (Bar / Line) */
.chart-type-toggle-inline {
  grid-column: 1;
  justify-self: start;
}

.dividends-chart-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin: 0;
}

.dividends-chart-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.dividends-chart-title {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.dividends-chart-filter-label {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
  font-weight: 600;
}

.dividends-chart-filter-select {
  min-width: 110px;
  text-align: center;
}

#dividends-monthly-chart-filter {
  grid-column: 3;
  justify-self: end;
}

@media (max-width: 768px) {
  .dividends-chart-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dividends-chart-title,
  #dividends-monthly-chart-filter {
    grid-column: 1;
  }

  .dividends-chart-filter-row {
    justify-content: space-between;
  }
}

.allocation-switch.chart-type-switch {
  transform: scale(0.85);
}

.allocation-switch.bar-active .switch-glow {
  transform: translateX(0);
}
.allocation-switch.line-active .switch-glow {
  transform: translateX(100%);
}

/* ===== Admin: Delete Range inputs and button ===== */
#admin-section .admin-range .admin-input {
  flex: 1 1 40%; /* allow shrink/grow while targeting ~40% */
  max-width: calc(50% - 8px); /* ensure stays within panel */
  min-width: 160px; /* avoid too-small inputs on narrow screens */
  box-sizing: border-box;
}
#admin-section .admin-range {
  display: flex;
  align-items: center;
  gap: 0.2rem; /* reduce spacing ~80% */
  flex-wrap: wrap; /* prevent overflow outside panel */
}
#admin-section #delete-range-btn {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px; /* emoji icon size */
}

/* ===== Admin: Snapshot Stats panels sizing ===== */
#admin-section .snapshots-stats.compact .stat-card.mini {
  transform: scale(0.8);
  transform-origin: top left;
}
#admin-section #snapshots-stats-panel {
  /* Place on same row and set width */
  flex: 0 0 50%;
  max-width: 50%;
}

/* Place Delete Range panel on same row and reduce width by 50% */
#admin-section #delete-range-panel {
  flex: 0 0 50%;
  max-width: 50%;
}

/* Enlarge fonts inside Snapshot Stats panel */
#admin-section #snapshots-stats-panel .panel-zone-title {
  font-size: 1.25rem;
}
#admin-section #snapshots-stats-panel .snapshots-stats.compact .stat-card.mini .stat-label {
  font-size: 0.95rem;
}
#admin-section #snapshots-stats-panel .snapshots-stats.compact .stat-card.mini span#total-snapshots-count,
#admin-section #snapshots-stats-panel .snapshots-stats.compact .stat-card.mini span#snapshots-date-range,
#admin-section #snapshots-stats-panel .snapshots-stats.compact .stat-card.mini span#snapshots-size {
  font-size: 1.1rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .allocation-option {
    padding: 0.55rem 1rem;
    font-size: 0.75rem;
  }
}

/* === New Vertical Allocation Layout === */
.allocation-container.vertical-layout {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 0 1rem 2rem 1rem;
}

.allocation-stats.vertical-list {
  flex: 0 0 auto;
  min-width: 260px;
  max-width: 320px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.allocation-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  max-height: 460px;
}

.allocation-list-vertical::-webkit-scrollbar {
  width: 8px;
}
.allocation-list-vertical::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.allocation-list-vertical::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  border-radius: 10px;
}

.allocation-list-vertical > div {
  border-left-width: 4px !important;
}

/* Darker allocation items (~40% more dark vs previous) */
.allocation-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.2rem 0.4rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: none;
}
.allocation-item:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
  border-color: transparent;
}
.allocation-item .allocation-name {
  color: #cfd3da;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.allocation-item .allocation-percentage {
  color: #cfd3da;
  font-weight: 400;
  font-size: 0.85rem;
  padding: 0;
  text-shadow: none;
  text-align: right;
  white-space: nowrap;
}

.allocation-pie-wrapper.square-pie {
  flex: 0 0 auto;
  width: 480px;
  height: 480px;
  max-width: 480px;
  max-height: 480px;
  display: flex;
  position: relative;
  overflow: visible;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  backdrop-filter: none;
}

.allocation-pie-wrapper.square-pie canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 500px;
  max-height: 500px;
}

.allocation-hover-popup {
  position: absolute;
  top: 50%;
  left: calc(100% + 1rem);
  width: 360px;
  max-width: min(360px, 80vw);
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(18px) scale(0.97);
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  z-index: 5;
}

.allocation-hover-popup.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

.allocation-hover-popup-header,
.allocation-hover-popup-table {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.allocation-hover-popup.is-visible .allocation-hover-popup-header,
.allocation-hover-popup.is-visible .allocation-hover-popup-table {
  opacity: 1;
  transform: translateY(0);
}

.allocation-hover-popup.is-visible .allocation-hover-popup-table {
  transition-delay: 0.04s;
}

.allocation-hover-popup-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.allocation-hover-popup-title {
  color: #f6f7fb;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.1;
}

.allocation-hover-popup-percent {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
}

.allocation-hover-popup-table {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.allocation-hover-popup-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 14.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.28rem;
  margin-right: -0.28rem;
}

.allocation-hover-popup-body::-webkit-scrollbar {
  width: 6px;
}

.allocation-hover-popup-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.allocation-hover-popup-body::-webkit-scrollbar-thumb {
  background: rgba(127, 230, 255, 0.38);
  border-radius: 999px;
}

.allocation-hover-popup-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 92px;
  gap: 0.65rem;
  align-items: center;
  min-height: 1.55rem;
}

.allocation-hover-popup-row > span {
  min-width: 0;
}

.allocation-hover-popup-row--head {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.allocation-hover-popup-symbol,
.allocation-hover-popup-value {
  color: #eef2ff;
  font-size: 0.79rem;
  font-weight: 600;
}

.allocation-hover-popup-company {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.79rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.allocation-hover-popup-value {
  text-align: right;
}

.allocation-hover-popup-more {
  padding-top: 0.4rem;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.73rem;
  text-align: right;
}

.allocation-hover-popup-empty {
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  font-style: italic;
}

@media (max-width: 860px) {
  .allocation-container.vertical-layout {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  .allocation-stats.vertical-list {
    flex: 0 0 auto;
    width: 100%;
    max-width: 480px;
    min-width: unset;
  }
  .allocation-pie-wrapper.square-pie {
    width: 420px;
    height: 420px;
    max-width: 420px;
    max-height: 420px;
  }

  .allocation-hover-popup {
    left: auto;
    right: 0.75rem;
    width: min(320px, calc(100% - 1.5rem));
  }
}

@media (max-width: 500px) {
  .allocation-pie-wrapper.square-pie {
    width: 320px;
    height: 320px;
    max-width: 320px;
    max-height: 320px;
  }
  .allocation-list-vertical {
    max-height: 340px;
  }

  .allocation-hover-popup {
    top: auto;
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    width: auto;
    transform: translateY(10px) scale(0.97);
  }

  .allocation-hover-popup.is-visible {
    transform: translateY(0) scale(1);
  }

  .allocation-hover-popup-row {
    grid-template-columns: 64px minmax(0, 1fr) 78px;
    gap: 0.45rem;
  }
}
.stocks-table {
  width: 100%;
  max-width: 960px; /* center like Allocation panels */
  margin: 0 auto; /* perfect centering */
  border-collapse: separate;
  border-spacing: 0 0; /* remove vertical gap between rows */
}

/* Stocks table: reduce color intensity across all columns */
#stocks-section .stocks-table {
  filter: saturate(0.85) brightness(0.95);
}

.stocks-table th,
.stocks-table td {
  font-weight: 400;
}

/* Center the Stocks header controls to the same width */
#stocks-section .table-header {
  max-width: 960px;
  margin: 1.5rem auto 1.5rem;
}

#stocks-gains-section .table-header {
  justify-content: center;
  margin: 1.5rem auto 1rem;
}

#stocks-section .stocks-last-updated {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.72rem;
  margin-left: 0.35rem;
  margin-right: 0.35rem;
  white-space: nowrap;
}

#stocks-section .stocks-table thead th {
  position: relative;
}

#deposits-section .stocks-table thead th {
  position: relative;
}

#dividends-monthly-table thead th {
  position: relative;
}

.column-filter-toggle {
  margin-left: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.column-filter-toggle .chev {
  font-size: 0.9rem;
}

.column-filter-toggle.active {
  color: #00c774;
}

.column-filter-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.column-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 0.5rem;
  border-radius: 12px;
  background: rgba(15, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 20;
}

.column-filter-menu.open {
  display: block;
}

.column-filter-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-weight: 600;
  text-align: left;
}

.column-filter-option.active {
  background: rgba(0, 199, 116, 0.15);
  color: #00c774;
}

.column-filter-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Stocks: header row design to match Dividends */
#stocks-section .stocks-table thead th {
  background: var(--stocks-row-grad-start);
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
  border-radius: 0;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 10px 12px 12px;
  text-shadow: none;
  white-space: nowrap;
}

/* Stocks: keep the header row pinned below the fixed navbar while scrolling.
   thead must be block-level (since tr uses display:grid) so position:sticky engages. */
#stocks-section .stocks-table thead {
  display: block;
  position: sticky;
  top: calc(var(--app-navbar-height) + var(--app-navbar-sticky-gap));
  z-index: 50;
  background: var(--stocks-row-grad-start);
}
#stocks-section .stocks-table tbody {
  display: block;
}

/* Subtle hover for Stocks headers – match Dividends */
#stocks-section .stocks-table th.sortable:hover {
  color: #64ffda;
  background: rgba(255, 255, 255, 0.06);
}

/* Center the Deposits header controls to the same width */
#deposits-section .table-header {
  /* revert to default (no forced centering) */
  max-width: unset;
  margin: 0 0 1.5rem 0;
}

.stocks-table thead tr {
  display: grid;
  grid-template-columns: 28px 33px 70px 94px 1.38fr 112px 81px 70px 136px 101px 115px 115px 90px;
  gap: 8px;
}

/* Deposits table header grid */
#deposits-section .stocks-table thead tr {
  display: grid;
  grid-template-columns: 86px 70px minmax(118px, 1.05fr) minmax(138px, 1.45fr) minmax(108px, 1fr) minmax(88px, 0.85fr) 84px;
  gap: 4px;
  padding: 0 4px;
}

/* Prevent wrapping of the 'Price Change' column header text */
.stocks-table thead th:nth-child(8) {
  white-space: nowrap;
}
.stocks-table thead th {
  background: var(--stocks-row-grad-start);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 12px 12px;
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
  border-radius: 0;
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-shadow: none;
}

#stocks-tbody tr {
  display: grid;
  grid-template-columns: 28px 33px 70px 94px 1.38fr 112px 81px 70px 136px 101px 115px 115px 90px;
  gap: 3px;
  position: relative;
  z-index: 1;
  overflow: visible;
  /* Darker card background for clear breakdown contrast */
  /* Lightened ~15% (reduced alpha values for a brighter appearance) */
  /* Lightened further by ~20% (alphas * 0.8) */
  background: var(--stocks-row-grad-start);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px; /* further compact (~30% of 4px) */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  min-height: unset;
  align-items: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

/* Deposits table rows styled like Stocks cards */
#deposits-tbody tr {
  display: grid;
  grid-template-columns: 86px 70px minmax(118px, 1.05fr) minmax(138px, 1.45fr) minmax(108px, 1fr) minmax(88px, 0.85fr) 84px;
  gap: 4px;
  /* Match lightened Stocks row gradient */
  /* Lightened ~20% (alphas *0.8) */
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.476), rgba(0, 0, 0, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px; /* further compact */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  min-height: unset;
  align-items: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

#deposits-tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.22);
  /* Lightened hover similar to Stocks */
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

#stocks-tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.22);
  /* Hover state also lightened proportionally */
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

#stocks-tbody tr.action-menu-open {
  z-index: 260;
}

#stocks-tbody tr.stock-row-editing {
  position: relative;
  z-index: 5000;
  isolation: isolate;
}

#stocks-tbody tr.stock-row-editing:hover {
  z-index: 5000;
}

#stocks-tbody tr.stock-row-editing td[data-field='broker'],
#stocks-tbody tr.stock-row-editing td[data-field='sector'] {
  position: relative;
  z-index: 5010;
  overflow: visible;
}

#stocks-tbody tr.stock-row-editing td[data-field='broker']:focus-within,
#stocks-tbody tr.stock-row-editing td[data-field='sector']:focus-within {
  z-index: 5030;
}

#stocks-tbody tr.stock-row-editing .broker-dropdown,
#stocks-tbody tr.stock-row-editing .sector-dropdown {
  z-index: 5020;
}

#stocks-tbody td {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 3px; /* zero vertical padding */
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  line-height: 1.05; /* slightly tighter */
}

#deposits-tbody td {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: none;
  line-height: 1.05;
}

/* Deposits header labels: match Stocks/Dividends style */
#deposits-section .stocks-table thead th {
  text-align: center;
  background: var(--stocks-row-grad-start);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 10px 12px 12px;
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;
  white-space: nowrap;
}

/* Deposits sortable header hover – match Stocks */
#deposits-section .stocks-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, background 0.2s ease;
}
#deposits-section .stocks-table thead th.sortable:hover {
  color: #64ffda;
  background: rgba(255, 255, 255, 0.06);
}

#deposits-section .deposits-exclude-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

#deposits-section .deposits-header-info {
  position: relative;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(220, 220, 220, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#deposits-section .deposits-header-info:hover,
#deposits-section .deposits-header-info:focus-visible {
  border-color: rgba(120, 255, 214, 0.55);
  background: rgba(0, 199, 116, 0.12);
  color: #e8fff6;
  transform: translateY(-1px);
  outline: none;
}

#deposits-section .deposits-header-info::before,
#deposits-section .deposits-header-info::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#deposits-section .deposits-header-info::before {
  content: '';
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(6px);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(14, 20, 30, 0.96) transparent transparent transparent;
}

#deposits-section .deposits-header-info::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 12px);
  width: min(260px, calc(100vw - 48px));
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  transform: translateX(-50%) translateY(6px);
  background:
    radial-gradient(circle at top left, rgba(120, 255, 214, 0.14), transparent 46%),
    linear-gradient(165deg, rgba(18, 24, 36, 0.98), rgba(9, 13, 22, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.48);
  color: rgba(232, 236, 241, 0.94);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  z-index: 40;
}

#deposits-section .deposits-header-info:hover::before,
#deposits-section .deposits-header-info:hover::after,
#deposits-section .deposits-header-info:focus-visible::before,
#deposits-section .deposits-header-info:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#deposits-section .deposit-exclude-cell {
  padding: 0 8px;
}

#deposits-section .deposit-exclude-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #00c774;
}

#deposits-section .deposit-exclude-checkbox:focus-visible {
  outline: 2px solid rgba(120, 255, 214, 0.42);
  outline-offset: 2px;
}

#stocks-tbody td[data-field='number'] {
  justify-content: center;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

#stocks-tbody td[data-field='symbol'],
#stocks-tbody td[data-field='company'] {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

/* Center content in Symbol column */
#stocks-tbody td[data-field='symbol'] {
  justify-content: center !important;
  text-align: center;
}

#stocks-tbody td[data-field='allocation'],
#stocks-tbody td[data-field='weight'] {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

/* Center content in Weight column */
#stocks-tbody td[data-field='weight'] {
  justify-content: center;
  text-align: center;
}

#stocks-tbody td[data-field='share_price'],
#stocks-tbody td[data-field='price_change'] {
  font-weight: 600;
}

/* Align Price column slightly left */
#stocks-tbody td[data-field='share_price'] {
  justify-content: flex-start !important;
  text-align: left !important;
  padding-left: 6px;
  padding-right: 0;
}

/* Align Price Change column left (not centered) */
#stocks-tbody td[data-field='price_change'] {
  justify-content: flex-start !important;
  text-align: left !important;
  padding-left: 6px;
  padding-right: 0;
}

/* Align Price Change header label left */
.stocks-table thead th:nth-child(8) {
  text-align: left;
}

/* Align Price header label left */
.stocks-table thead th:nth-child(7) {
  text-align: left;
}

/* Align Shares column slightly left */
#stocks-tbody td[data-field='shares'] {
  display: flex;
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: left !important;
  padding-left: 6px;
  padding-right: 0;
}

#stocks-tbody td[data-field='shares'] input {
  text-align: left !important;
}

/* Align Shares header label left */
.stocks-table thead th:nth-child(6) {
  text-align: left;
}

/* Deposits: align numeric and action columns */
#deposits-tbody td[data-field='count'] {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

#deposits-tbody td[data-field='amount'] {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

#deposits-tbody td.action-buttons {
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#stocks-tbody td[data-field='risk'] {
  font-weight: 700;
  white-space: nowrap; /* force single line */
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-start;
  text-align: left;
}

#stocks-tbody td[data-field='risk'] .risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

#stocks-tbody td[data-field='risk'] .risk-dot--high {
  background: #e05a5a;
}

#stocks-tbody td[data-field='risk'] .risk-dot--medium {
  background: #e6c06a;
}

#stocks-tbody td[data-field='risk'] .risk-dot--safe {
  background: #6c9be6;
}

#stocks-tbody td[data-field='risk'] .risk-dot--very-safe {
  background: #63d18b;
}

#stocks-tbody td.action-buttons {
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  grid-column: 13;
  overflow: visible;
}

#stocks-tbody .action-menu,
#stocks-tbody .action-menu-panel {
  z-index: 300;
}

/* Compact stock rows */
#stocks-section .stocks-table td {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

#stocks-section .stocks-table .action-menu-toggle {
  width: 28px;
  height: 24px;
}

.stocks-table .sort-icon {
  display: inline;
  opacity: 0.6;
  margin-left: 4px;
  vertical-align: baseline;
}

.stocks-table th.sorted-asc .sort-icon::after {
  content: '';
}
.stocks-table th.sorted-desc .sort-icon::after {
  content: '';
}

/* Inputs/selects inside cards */
#stocks-tbody .editable-cell input,
#stocks-tbody .editable-cell select {
  width: 100%;
  background: #232323;
  color: #fff;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 6px 8px;
}

/* Price change colors already set inline; add default neutral */
.price-change-cell {
  color: #ccc;
}

/* Stocks table: light gray text for key columns */
#stocks-section td[data-field="symbol"],
#stocks-section td[data-field="company"],
#stocks-section td[data-field="shares"],
#stocks-section td[data-field="share_price"],
#stocks-section td[data-field="broker"],
#stocks-section td[data-field="sector"],
#stocks-section td[data-field="risk"] {
  color: #dcdcdc;
}

#stocks-section td[data-field="company"] {
  position: relative;
  max-width: 180px;
}

#stocks-section td[data-field="company"] .company-ellipsis {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.2em;
  max-height: 2.4em;
}

#stocks-section td[data-field="company"][data-tooltip] {
  cursor: help;
}

#stocks-section td[data-field="company"][data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 10px;
  top: 100%;
  margin-top: 8px;
  background: #ffffff;
  color: #111111;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.2;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1000;
  white-space: nowrap;
  max-width: none;
}

#stocks-section td[data-field="company"][data-tooltip]::before {
  content: '';
  position: absolute;
  left: 24px;
  top: calc(100% + 2px);
  border: 6px solid transparent;
  border-bottom-color: #ffffff;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1001;
}

#stocks-section td[data-field="company"][data-tooltip]:hover::after,
#stocks-section td[data-field="company"][data-tooltip]:hover::before {
  opacity: 1;
  transform: translateY(0) scale(1);
}

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

:root {
  --stocks-row-grad-start: rgba(20, 26, 38, 0.98);
  --stocks-row-grad-end: rgba(14, 18, 28, 0.98);
  --app-navbar-height: 104px;
  --app-navbar-body-gap: 18px;
  --app-navbar-sticky-gap: 12px;
  --app-navbar-offset: calc(var(--app-navbar-height) + var(--app-navbar-body-gap));
}

body {
  font-family: 'Manrope', 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  background: var(--stocks-row-grad-start);
  padding-top: var(--app-navbar-offset);
}

/* === Login Page === */
.login-body {
  padding-top: 0;
  background-color: #0b0f1a;
  background-image:
    radial-gradient(ellipse 80% 55% at 12% -8%, rgba(102, 126, 234, 0.35), transparent 62%),
    radial-gradient(ellipse 60% 45% at 100% 14%, rgba(0, 217, 255, 0.22), transparent 65%),
    radial-gradient(ellipse 65% 55% at 50% 112%, rgba(56, 139, 253, 0.22), transparent 62%);
  background-attachment: fixed;
}

.login-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  min-width: 0;
  background: linear-gradient(145deg, rgba(15, 22, 42, 0.92), rgba(10, 15, 30, 0.96));
  backdrop-filter: blur(24px);
  border-radius: 20px;
  padding: 2.2rem 2rem 1.6rem;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(102, 126, 234, 0.18);
  transform: none;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.login-card:hover {
  transform: none;
  border-color: rgba(102, 126, 234, 0.32);
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(102, 126, 234, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-language-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}

.auth-language-bar label {
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: normal;
}

.auth-language-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 10px;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  max-width: 100%;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-language-select:hover,
.auth-language-select:focus {
  border-color: rgba(0, 217, 255, 0.6);
  background: rgba(0, 217, 255, 0.08);
  outline: none;
}

.auth-language-select option {
  color: #111;
}

.login-brand {
  position: relative;
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-logo-hero {
  height: 104px;
  width: auto;
  display: block;
  margin: 0 auto 0.4rem;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4));
}

.brand-logo-hero-fallback {
  height: 92px;
  opacity: 0.96;
}

.brand-logo-wrap {
  width: 120px;
  height: 120px;
  margin: 0 auto 0.6rem auto;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow:
    0 14px 36px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
}

.brand-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}

.brand-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.25), rgba(0, 217, 255, 0.12), transparent 70%);
  opacity: 1;
  filter: blur(30px);
  pointer-events: none;
}

.brand-title {
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(255, 255, 255, 0.35);
}

.brand-sub {
  margin-top: 0.15rem;
  margin-left: auto;
  margin-right: auto;
  color: rgba(160, 185, 220, 0.85);
  font-weight: 500;
  font-size: 0.88rem;
  letter-spacing: 0.3px;
  line-height: 1.45;
  max-width: 30ch;
  text-wrap: balance;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.input-group {
  text-align: left;
}

.input-label {
  display: block;
  margin-bottom: 0.35rem;
  color: rgba(160, 185, 225, 0.9);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.password-wrapper {
  position: relative;
}

.login-input {
  width: 100%;
  background: rgba(12, 17, 32, 0.8);
  color: #e2e8f0;
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 10px;
  padding: 12px 42px 12px 14px;
  font-size: 0.95rem;
  outline: none;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.login-input:focus {
  border-color: rgba(102, 126, 234, 0.55);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18), 0 0 20px rgba(102, 126, 234, 0.08);
  background: rgba(12, 17, 32, 0.95);
}

.login-input::placeholder { color: rgba(130, 155, 195, 0.45); }

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

.shake {
  animation: shakeX 0.35s ease;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(102, 126, 234, 0.12);
  border: 1px solid rgba(102, 126, 234, 0.25);
  color: rgba(160, 185, 225, 0.9);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.password-toggle:hover {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.4);
}

.login-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 0.25rem;
}

.remember-me {
  display: inline-flex;
  gap: 0.5rem;
  align-items: flex-start;
  color: rgba(160, 185, 225, 0.8);
  user-select: none;
  font-size: 0.85rem;
  flex: 1 1 170px;
  min-width: 0;
  line-height: 1.4;
}

.remember-me span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.remember-me input {
  accent-color: #667eea;
  margin-top: 0.08rem;
}

.forgot-link {
  color: #6b8cff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  flex: 0 1 auto;
  max-width: 100%;
  text-align: right;
  line-height: 1.4;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

.forgot-link:hover {
  color: #00d9ff;
  text-decoration: underline;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.login-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #5a6fd6 50%, #4f5ec8 100%);
  border: 1px solid rgba(102, 126, 234, 0.4);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.login-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.45);
  background: linear-gradient(135deg, #7b93ff 0%, #667eea 50%, #5a6fd6 100%);
}

.login-btn.ghost {
  background: rgba(102, 126, 234, 0.08);
  border: 1px solid rgba(102, 126, 234, 0.22);
  color: rgba(160, 185, 225, 0.9);
}

.login-btn.ghost:hover {
  background: rgba(102, 126, 234, 0.16);
  border-color: rgba(102, 126, 234, 0.35);
  color: #fff;
}

.login-separator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.8rem 0 0.4rem 0;
}

.sep-line {
  flex: 1;
  height: 1px;
  background: rgba(102, 126, 234, 0.15);
}

.sep-text {
  color: rgba(160, 185, 225, 0.6);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.login-footer {
  margin-top: 0.9rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
}

.register-card {
  max-width: 500px;
  padding: 1.4rem 1.3rem 1.05rem;
}

.register-brand {
  margin-bottom: 0.82rem;
}

.register-brand-logo {
  height: 136px;
  margin-bottom: 0.08rem;
}

.register-brand-sub {
  margin-top: 0;
  font-size: 0.78rem;
}

.register-form {
  gap: 0.58rem;
}

.register-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.56rem 0.72rem;
}

.register-field-full {
  grid-column: 1 / -1;
}

.register-body .input-label {
  margin-bottom: 0.24rem;
  font-size: 0.72rem;
}

.register-body .login-input {
  min-height: 40px;
  padding: 9px 38px 9px 11px;
  border-radius: 9px;
  font-size: 0.88rem;
}

.register-body select.login-input {
  padding-right: 12px;
}

.register-body .password-toggle {
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 0.8rem;
}

.register-body .consent-row {
  gap: 0.48rem;
  margin-top: 0.05rem;
  font-size: 0.74rem;
  line-height: 1.3;
}

.register-body .consent-row input[type='checkbox'] {
  width: 14px;
  height: 14px;
  margin-top: 0.12rem;
}

.register-body .login-btn {
  padding: 0.66rem 0.86rem;
  font-size: 0.86rem;
}

.register-body .login-footer {
  margin-top: 0.42rem;
}

@media (max-width: 640px) {
  .register-card {
    padding: 1.15rem 0.92rem 0.9rem;
  }

  .register-brand-logo {
    height: 116px;
  }

  .register-fields-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .register-field-full {
    grid-column: auto;
  }
}

/* === WOW Login Warning Dialog === */
.wow-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  transition: opacity 0.25s ease;
}

.wow-dialog.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.wow-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 118, 117, 0.35), rgba(10, 14, 24, 0.85) 55%);
  backdrop-filter: blur(10px);
}

.wow-dialog__panel {
  position: relative;
  width: min(520px, calc(100% - 2.5rem));
  padding: 1.6rem 1.7rem 1.4rem;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.3s ease;
  text-align: center;
  overflow: hidden;
}

.wow-dialog.is-visible .wow-dialog__panel {
  transform: translateY(0) scale(1);
}

.wow-dialog__glow {
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(120deg, rgba(255, 99, 132, 0.35), rgba(255, 183, 77, 0.25), rgba(0, 217, 255, 0.25));
  filter: blur(18px);
  opacity: 0.7;
  z-index: 0;
}

.wow-dialog__icon {
  position: relative;
  z-index: 1;
  font-size: 2.4rem;
  margin-bottom: 0.3rem;
  text-shadow: 0 0 18px rgba(255, 99, 132, 0.6);
}

.wow-dialog__title {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  letter-spacing: 0.3px;
}

.wow-dialog__message {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.wow-dialog__actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.wow-dialog__close {
  background: linear-gradient(135deg, #ff6b6b, #ff8c42);
  border: none;
  color: #ffffff;
  font-weight: 800;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(255, 107, 107, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wow-dialog__close:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(255, 107, 107, 0.5);
}

.wow-dialog__close:focus {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}

/* Navbar Styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  padding: 0.82rem 0;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  filter: saturate(0.8);
}

.nav-stats {
  display: flex;
  gap: 0.72rem;
  justify-content: center;
  align-items: center;
  position: relative;
  padding-right: 48px; /* keep space for settings button */
}

.nav-stats .stat-item {
  min-width: 166px;
  padding: 0.6rem 0.82rem 0.68rem;
  border-radius: 18px;
  border: 1px solid rgba(126, 228, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(7, 14, 28, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 30px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.28rem;
  text-shadow: none;
  filter: saturate(0.94);
  white-space: nowrap;
}

.nav-stats .stat-label {
  color: rgba(223, 251, 255, 0.56);
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.nav-stats .stat-value {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.28rem;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.nav-stats .currency-symbol {
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-0.06rem);
}

.nav-stats .stat-item--balance .currency-symbol {
  color: rgba(145, 238, 255, 0.84);
}

.nav-stats .stat-item--profit .currency-symbol {
  color: rgba(147, 255, 201, 0.84);
}

.header-investor-badge {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 0;
  max-width: none;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
}

.header-investor-badge-metrics {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: nowrap;
}

.header-investor-badge-pill {
  min-width: max-content;
  flex: 0 0 auto;
  padding: 0.34rem 0.64rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.34rem;
  white-space: nowrap;
}

.header-investor-badge-pill--accent {
  min-width: 138px;
  border-color: rgba(0, 217, 255, 0.24);
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.18), rgba(91, 137, 255, 0.08));
}

.header-investor-badge-pill-label {
  color: rgba(223, 251, 255, 0.62);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-investor-badge-pill-value {
  color: #f3fbff;
  flex: 0 0 auto;
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
}

.header-investor-badge-pill--accent .header-investor-badge-pill-value {
  color: #8cefff;
  text-shadow: 0 0 14px rgba(0, 217, 255, 0.24);
}

.header-investor-badge[data-state="empty"] .header-investor-badge-pill-value {
  color: rgba(243, 251, 255, 0.72);
  text-shadow: none;
}

#total-balance {
  color: #00d9ff;
  display: inline-block;
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  text-shadow:
    0 0 14px rgba(0, 217, 255, 0.2),
    0 0 24px rgba(0, 217, 255, 0.08);
  filter: saturate(0.9);
}

#total-profit {
  color: #00ff88;
  display: inline-block;
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  text-shadow:
    0 0 14px rgba(0, 255, 136, 0.18),
    0 0 24px rgba(0, 255, 136, 0.08);
  filter: saturate(0.9);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-logo-item {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 96px;
  width: auto;
  display: block;
  margin: -28px 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.nav-menu li a {
  color: #dcdcdc;
  text-decoration: none;
  font-size: clamp(0.68rem, 0.85vw, 0.88rem);
  transition: all 0.3s ease;
  padding: 0.32rem 0.45rem;
  border-radius: 5px;
  white-space: nowrap;
}

.nav-menu li a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.nav-menu li a.active {
  background: rgba(255, 255, 255, 0.3);
}

.nav-menu li a[data-section="profile"],
.nav-menu li a[data-section="leaderboard"] {
  position: relative;
}

.profile-nav-badge,
.leaderboard-nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: rgba(255, 56, 56, 0.96);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2rem;
  text-align: center;
  box-shadow: 0 0 16px rgba(255, 56, 56, 0.45);
  pointer-events: none;
}

.profile-notification-stack {
  position: fixed;
  top: calc(var(--app-navbar-height) + 12px);
  right: 18px;
  width: min(360px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1300;
  pointer-events: none;
}

.profile-notification-banner {
  position: relative;
  overflow: hidden;
  padding: 14px 42px 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(126, 255, 182, 0.38);
  background: linear-gradient(135deg, rgba(10, 74, 47, 0.78), rgba(22, 143, 93, 0.46));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(87, 255, 156, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
}

.profile-notification-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(132, 255, 189, 0.18), transparent 38%, rgba(255, 255, 255, 0.08));
  pointer-events: none;
}

.profile-notification-title {
  position: relative;
  color: #f4fff8;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.32rem;
}

.profile-notification-body {
  position: relative;
  color: rgba(244, 255, 248, 0.94);
  font-size: 0.93rem;
  line-height: 1.42;
}

.profile-notification-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f4fff8;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
}

.profile-notification-close:hover,
.profile-notification-close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.nav-settings {
  margin-left: 0;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 900px) {
  .profile-notification-stack {
    top: calc(var(--app-navbar-height) + 10px);
    right: 12px;
    left: 12px;
    width: auto;
  }
}

.settings-cog-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid rgba(120, 226, 255, 0.24);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 48%),
    linear-gradient(145deg, rgba(11, 22, 40, 0.96), rgba(7, 14, 26, 0.96));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.settings-cog-btn::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  opacity: 0.65;
  pointer-events: none;
}

.settings-cog-btn svg {
  width: 18px;
  height: 18px;
  fill: #dffbff;
  position: relative;
  z-index: 1;
}

.settings-cog-btn:hover,
.settings-cog-btn[aria-expanded="true"] {
  transform: translateY(-1px);
  border-color: rgba(0, 217, 255, 0.42);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.36), 0 0 18px rgba(0, 217, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.settings-menu {
  position: absolute;
  top: 50px;
  right: 0;
  width: 252px;
  padding: 0.56rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(0, 217, 255, 0.1), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(73, 168, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgb(17, 27, 44), rgb(7, 13, 23));
  border: 1px solid rgba(120, 226, 255, 0.18);
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.46), 0 0 32px rgba(0, 217, 255, 0.12);
  display: none;
  flex-direction: column;
  gap: 0.42rem;
  z-index: 1200;
  overflow: hidden;
  isolation: isolate;
}

.settings-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(176, 243, 255, 0.8), rgba(255, 255, 255, 0));
  opacity: 0.85;
}

.settings-menu::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 12px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 217, 255, 0.16), rgba(0, 217, 255, 0));
  pointer-events: none;
}

.settings-menu.is-open {
  display: flex;
}

.settings-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.56rem;
  padding: 0.5rem 0.58rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 226, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: rgba(242, 250, 255, 0.96);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.settings-menu-item:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 217, 255, 0.3);
  background: linear-gradient(180deg, rgba(0, 217, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 0 18px rgba(0, 217, 255, 0.12);
}

.settings-menu-copy {
  min-width: 0;
  flex: 1;
}

.settings-menu-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(120, 226, 255, 0.16);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.18), transparent 40%),
    linear-gradient(145deg, rgba(16, 29, 52, 0.95), rgba(8, 15, 27, 0.95));
  color: #8cecff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 20px rgba(0, 0, 0, 0.16);
}

.settings-menu-icon svg {
  width: 13px;
  height: 13px;
}

.settings-menu-icon-platform {
  color: #84efff;
}

.settings-menu-icon-account {
  color: #75d8ff;
}

.settings-menu-icon-language {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  border-radius: 9px;
  color: #a7f4ff;
}

.settings-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.48rem;
  padding: 0.46rem 0.54rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 226, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  color: rgba(232, 246, 255, 0.92);
}

.settings-label {
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.settings-menu-copy,
.settings-label,
.settings-menu select {
  line-height: 1.2;
}

.settings-select {
  min-width: 0;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(10, 22, 38, 0.98), rgba(5, 12, 22, 0.98));
  color: rgba(241, 251, 255, 0.96);
  border: 1px solid rgba(120, 226, 255, 0.18);
  border-radius: 11px;
  padding: 0.44rem 1.8rem 0.44rem 0.68rem;
  font-weight: 600;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(148, 239, 255, 0.92) 50%),
    linear-gradient(135deg, rgba(148, 239, 255, 0.92) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px),
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
}

.settings-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.settings-language-picker {
  position: relative;
  min-width: 88px;
  max-width: 88px;
  z-index: 8;
}

.settings-language-trigger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.38rem 0.38rem 0.38rem 0.42rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 226, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(10, 22, 38, 0.98), rgba(5, 12, 22, 0.98));
  color: rgba(241, 251, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.settings-language-trigger:hover,
.settings-language-picker.open .settings-language-trigger {
  border-color: rgba(0, 217, 255, 0.34);
  box-shadow: 0 0 16px rgba(0, 217, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(0, 217, 255, 0.14), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(10, 22, 38, 0.98), rgba(5, 12, 22, 0.98));
}

.settings-language-trigger-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.settings-language-current-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 26px;
  padding: 0 0.42rem;
  border-radius: 8px;
  background: rgba(0, 217, 255, 0.16);
  border: 1px solid rgba(0, 217, 255, 0.22);
  color: #8cf5ff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.settings-language-current-name {
  display: none;
}

.settings-language-chevron {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(189, 243, 255, 0.92);
  transition: transform 0.2s ease, background 0.2s ease;
}

.settings-language-chevron svg {
  width: 12px;
  height: 12px;
}

.settings-language-picker.open .settings-language-chevron {
  transform: rotate(180deg);
  background: rgba(0, 217, 255, 0.14);
}

.settings-language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(120, 226, 255, 0.16);
  background:
    radial-gradient(circle at top left, rgba(0, 217, 255, 0.1), transparent 40%),
    linear-gradient(180deg, rgb(15, 26, 43), rgb(7, 13, 23));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36), 0 0 20px rgba(0, 217, 255, 0.12);
  overflow: hidden;
  isolation: isolate;
  z-index: 30;
}

.settings-language-picker.open .settings-language-menu {
  display: flex;
}

.settings-language-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.46rem 0.54rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(236, 248, 255, 0.94);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.settings-language-option:hover,
.settings-language-option[aria-selected="true"] {
  transform: translateY(-1px);
  background: rgba(0, 217, 255, 0.12);
  border-color: rgba(0, 217, 255, 0.24);
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.1);
}

.settings-language-option-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.settings-language-option-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 0.36rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(165, 241, 255, 0.95);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.settings-language-option-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.settings-language-option-check {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8cf5ff;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.settings-language-option-check svg {
  width: 14px;
  height: 14px;
}

.settings-language-option[aria-selected="true"] .settings-language-option-check {
  opacity: 1;
  transform: scale(1);
}

.settings-chip-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.38rem;
}

.settings-chip {
  border-radius: 10px;
  border: 1px solid rgba(120, 226, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  color: rgba(237, 248, 255, 0.96);
  padding: 0.42rem 0.42rem;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.settings-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 217, 255, 0.28);
  background: rgba(0, 217, 255, 0.1);
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.12);
}

.settings-logout-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.62rem;
  border: 1.5px solid rgba(0, 217, 255, 0.3);
  border-radius: 12px;
  padding: 0.62rem 0.82rem;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  color: #00d9ff;
  background: rgba(0, 217, 255, 0.15);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.settings-logout-btn:hover {
  transform: translateY(-1px);
  background: rgba(0, 217, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.5);
}

.settings-logout-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-logout-icon svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {
  .settings-menu {
    width: min(248px, calc(100vw - 20px));
    right: -4px;
  }
}

/* ===== Leaderboard ===== */
#leaderboard-section {
  padding-top: 0;
}

.leaderboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
  color: #ffffff;
}

.leaderboard-header-copy {
  min-width: 0;
}

.leaderboard-header h2 {
  font-size: 0.96rem;
  font-weight: 700;
  color: #f1f1ff;
  margin: 0;
}

.leaderboard-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.68);
}

.leaderboard-loaded {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.22rem 0.62rem;
  font-size: 0.75rem;
  color: #e6e6ff;
  white-space: nowrap;
}

.leaderboard-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.leaderboard-top-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 0.6rem;
}

.leaderboard-card {
  background: rgba(15, 18, 32, 0.35);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.58rem 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.leaderboard-card.gold { border-color: rgba(255, 209, 102, 0.5); }
.leaderboard-card.silver { border-color: rgba(200, 210, 230, 0.6); }
.leaderboard-card.bronze { border-color: rgba(255, 177, 102, 0.5); }

.leaderboard-tier {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffd166;
}

.leaderboard-card.silver .leaderboard-tier { color: #cbd3e3; }
.leaderboard-card.bronze .leaderboard-tier { color: #ffb066; }

.leaderboard-card-name {
  font-weight: 700;
  font-size: 0.84rem;
}

.leaderboard-card-meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
}

.leaderboard-popular {
  justify-content: center;
  min-height: 100%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(20, 30, 70, 0.35));
  border: 1px solid rgba(0, 217, 255, 0.3);
  color: #e8faff;
}

.leaderboard-popular-tag {
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  color: #7fe6ff;
  font-weight: 700;
}

.leaderboard-popular-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.leaderboard-popular-meta {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
}

.leaderboard-pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0 0 0.55rem;
  padding: 0.52rem 0.72rem;
  border-radius: 14px;
  background: rgba(8, 11, 22, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-wrap: wrap;
}

.leaderboard-pagination-left,
.leaderboard-pagination-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.leaderboard-pagination-left label,
.leaderboard-pagination-info {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.72);
}

.leaderboard-pagination-left select {
  min-width: 68px;
  padding: 0.24rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 8, 18, 0.88);
  color: #ffffff;
}

.leaderboard-table {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 0.28rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
  overflow-x: auto;
}

.leaderboard-table table {
  width: 100%;
  border-collapse: collapse;
  color: #ffffff;
  font-size: 0.72rem;
}

.leaderboard-table thead th {
  text-align: left;
  padding: 0.34rem 0.38rem;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 400;
  white-space: nowrap;
}

.leaderboard-table tbody td {
  padding: 0.34rem 0.38rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.leaderboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.leaderboard-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font: inherit;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.leaderboard-sort-btn:hover {
  color: #ffffff;
}

.leaderboard-sort-btn.active {
  color: #7fe6ff;
}

.leaderboard-sort-indicator {
  font-size: 0.62rem;
  min-width: 0.62rem;
  text-align: center;
}

.leaderboard-rank {
  font-weight: 700;
  color: #ffd166;
}

.leaderboard-like {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.leaderboard-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  justify-content: center;
  width: 1.72rem;
  height: 1.72rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(60, 233, 214, 0.42);
  background: linear-gradient(135deg, rgba(12, 78, 79, 0.18), rgba(38, 185, 171, 0.12));
  color: #56f1de;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(56, 235, 216, 0), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.leaderboard-like-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 246, 230, 0.76);
  box-shadow: 0 0 12px rgba(56, 235, 216, 0.22), 0 0 24px rgba(56, 235, 216, 0.14);
  color: #8ffff0;
}

.leaderboard-like-btn.active {
  background: linear-gradient(135deg, rgba(20, 146, 138, 0.34), rgba(72, 245, 223, 0.18));
  border-color: rgba(94, 247, 228, 0.84);
  box-shadow: 0 0 14px rgba(56, 235, 216, 0.26), 0 0 28px rgba(56, 235, 216, 0.18);
  color: #b8fff6;
}

.leaderboard-like-btn.pending,
.leaderboard-like-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.leaderboard-like-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.86rem;
  height: 0.86rem;
  line-height: 1;
}

.leaderboard-like-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.leaderboard-like-count {
  min-width: 1rem;
  font-weight: 700;
  color: #a7fff2;
}

@media (max-width: 900px) {
  .leaderboard-summary-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-top-cards {
    grid-template-columns: 1fr;
  }

  .leaderboard-popular {
    min-height: auto;
  }

  .leaderboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .leaderboard-pagination-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
}

.container {
  text-align: center;
  color: white;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

.section {
  display: none;
  min-height: calc(100vh - var(--app-navbar-offset));
}

.section.active {
  display: block;
}

#dashboard-section.active {
  display: block;
}

#dashboard-section .dashboard-grid > .chart-container,
#dashboard-section .dashboard-grid > .performance-chart-container,
#dividends-section > .chart-container {
  margin-top: 0;
}

#dividends-section.active {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

#stocks-section {
  padding-top: 0;
  margin-top: -2rem;
}

#deposits-section,
#dividends-section {
  padding-top: 0;
  margin-top: 0;
}

#deposits-section > .panel-zone:first-child {
  margin-top: 0 !important;
}

h1 {
  font-size: 3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

p {
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  width: 100%;
  align-items: start;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Chart Styles - WOW 3D Effect */
.chart-container {
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  padding: 1.5rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 10px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 300px;
  height: 380px;
  transform: none;
  transition: none;
  position: relative;
  z-index: 100; /* keep pie chart above nearby panels/popups */
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* === Dashboard Metrics Overlay (top-right of Balance pie chart) === */
.dashboard-metrics-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem 0.9rem 1rem;
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 18px;
  box-shadow:
    0 10px 28px rgba(0,0,0,0.45),
    0 4px 12px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  min-width: 220px;
  z-index: 120;
}

.dashboard-metrics-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(102,126,234,0.35), rgba(118,75,162,0.35));
  mix-blend-mode: overlay;
  opacity: 0.35;
  pointer-events: none;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.6rem 0.4rem 0.6rem;
  background: linear-gradient(180deg, rgba(41, 64, 102, 0.98), rgba(22, 34, 58, 0.98));
  border: 1px solid rgba(128, 223, 255, 0.22);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 24px rgba(1, 5, 12, 0.34),
    0 0 14px rgba(0, 217, 255, 0.06);
  position: relative;
  overflow: visible;
}

.metric-row::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(126, 228, 255, 0.14), rgba(255, 255, 255, 0));
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.metric-row:hover::after {
  opacity: 1;
}

.metric-label {
  color: rgba(220, 220, 220, 0.9);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

.settings-missing-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(127,230,255,0.36);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(127,230,255,0.16));
  color: rgba(255,255,255,0.92);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  box-shadow: 0 0 10px rgba(127,230,255,0.12);
  flex: 0 0 auto;
}

.settings-missing-tip[hidden] {
  display: none !important;
}

.settings-missing-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  max-width: 280px;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 12, 24, 0.995), rgba(14, 18, 32, 0.995));
  border: 1px solid rgba(127,230,255,0.34);
  color: rgba(242,248,255,0.96);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.08s linear, transform 0.08s linear;
  box-shadow: 0 14px 34px rgba(0,0,0,0.5), 0 0 18px rgba(127,230,255,0.14);
  z-index: 40;
}

.settings-missing-tip:hover::after,
.settings-missing-tip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.settings-missing-tip:focus-visible {
  outline: 2px solid rgba(127,230,255,0.38);
  outline-offset: 2px;
}

.metric-value {
  font-size: 0.75rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  color: #dcdcdc;
  text-shadow:
    0 0 10px rgba(255,255,255,0.25),
    1px 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.metric-value.positive { color: #00ff88; text-shadow: 0 0 10px rgba(0,255,136,0.45); }
.metric-value.warning { color: #ffc107; text-shadow: 0 0 10px rgba(255,193,7,0.4); }
.metric-value.accent { color: #00d9ff; text-shadow: 0 0 10px rgba(0,217,255,0.4); }

@media (max-width: 900px) {
  .dashboard-metrics-overlay {
    position: static;
    margin-top: 0.8rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem;
  }
  .metric-row { flex: 1 1 calc(50% - 0.5rem); }
}

.chart-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  border-radius: 25px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Wide Panel Container */
.wide-panel-container {
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  padding: 1.5rem;
  box-shadow: none;
  border: none;
  transform: none;
  transition: none;
  position: relative;
  margin-top: 2rem;
  width: calc(100% + 10px);
  margin-left: -5px;
  min-height: auto;
}

.wide-panel-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  border-radius: 25px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.wide-panel-container:hover::before {
  opacity: 0;
}

.wide-panel-container:hover {
  transform: none;
  box-shadow: none;
}

.wide-panel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* fit 5 zones on one row */
  gap: 1mm; /* ultra-tight spacing between the 5 zones */
  width: 100%;
  height: auto;
  align-items: start;
}

.panel-zone {
  background:
    radial-gradient(circle at 14% 10%, rgba(120, 226, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(28, 44, 74, 0.98), rgba(15, 25, 44, 0.98));
  border-radius: 15px;
  border: 1px solid rgba(128, 223, 255, 0.2);
  box-shadow:
    0 22px 40px rgba(3, 8, 18, 0.42),
    0 0 18px rgba(0, 217, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(4, 10, 20, 0.3);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Metrics panel adjustments */
.metrics-panel-zone {
  padding: calc(0.85rem + 5mm) 0.7rem 0.9rem 0.7rem; /* add ~5mm top spacing above title */
  display: flex;
}

.metrics-panel {
  display: flex;
  flex-direction: column;
  gap: 0.2rem; /* halve spacing between metric rows */
  width: 100%;
}

.metrics-panel .panel-zone-title {
  margin-bottom: 0.55rem;
}

@media (max-width: 1350px) {
  .wide-panel-grid {
    grid-template-columns: repeat(2, 1fr); /* responsive fallback */
    row-gap: 1.2rem;
  }
}

/* Shrink the Deposits tab panel by ~20% in both width and height */
#deposits-section .panel-zone {
  transform: scale(0.9);
  transform-origin: top center;
}

.panel-zone:hover {
  background:
    radial-gradient(circle at 14% 10%, rgba(120, 226, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(28, 44, 74, 0.98), rgba(15, 25, 44, 0.98));
  transform: none;
}

.panel-zone-tall {
  height: 230px;
}

/* Deposits Breakdown */
.panel-zone-title {
  color: #dcdcdc;
  font-size: 1.1rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
  text-align: center;
}

.deposits-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0; /* remove spacing between allocation items */
  width: 100%;
  padding: 0.5rem;
  height: 100%;
}

/* Narrow + centered version inside Deposits tab */
#deposits-section .deposits-breakdown {
  width: 50%; /* previous width (will be overridden below) */
  margin: 0.5rem auto 1rem auto;
}

#deposits-section .deposits-breakdown .breakdown-item {
  justify-content: space-between; /* restore default alignment */
  text-align: left; /* restore default text alignment */
  gap: 2px;
}

#deposits-section .deposits-breakdown .breakdown-label,
#deposits-section .deposits-breakdown .breakdown-value,
#deposits-section .deposits-breakdown .breakdown-value-white {
  display: inline-block;
  text-align: left; /* restore left alignment */
}

/* === Deposits Section: Full-width Money Invested panel === */
/* Override earlier shrink & width constraints to match table / total panel width */
#deposits-section .panel-zone {
  transform: none !important; /* remove scale(0.9) shrink */
  width: 100%;
  max-width: 768px; /* align with deposits table max width (reduced by 20%) */
  margin-left: auto;
  margin-right: auto;
}
#deposits-section .deposits-breakdown {
  width: 100% !important; /* fill full available width inside panel */
  margin: 0.5rem 0 1rem 0 !important; /* remove auto centering gaps */
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
#deposits-section .deposits-breakdown .breakdown-item {
  padding-left: 0.8rem;
  padding-right: 0.8rem;
}

/* Embedded Total Deposits row: match panel background and increase font size */
#deposits-section .deposits-breakdown .breakdown-item.total-deposits-row {
  /* Use same background treatment as panel */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 255, 255, 0.1);
}
#deposits-section .deposits-breakdown .breakdown-item.total-deposits-row .breakdown-label {
  font-size: 1.1rem; /* +2 steps over 0.9rem */
  font-weight: 400; /* regular, not bold */
}
#deposits-section .deposits-breakdown .breakdown-item.total-deposits-row .breakdown-value,
#deposits-section .deposits-breakdown .breakdown-item.total-deposits-row .breakdown-value-white {
  font-size: 1.2rem; /* +2 steps over 1.0rem */
  font-weight: 700;
}

/* Deposits table: amount values should be white */
#deposits-section td[data-field="amount"] {
  color: #ffffff;
}

/* Deposits table: header 'Account' – use consistent muted color */
#deposits-section table.stocks-table thead tr th[data-column="account"] {
  color: rgba(255, 255, 255, 0.7);
}

/* Deposits table: center Account, Amount, Currency text */
#deposits-section td[data-field="account"],
#deposits-section td[data-field="amount"],
#deposits-section td[data-field="currency"] {
  text-align: center;
}

/* Align Total Deposits panel and Deposits table to reduced width */
#deposits-section .deposits-total,
#deposits-section .stocks-table {
  max-width: 768px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Increase font sizes for the 5 rows in Deposits tab */
#deposits-section .deposits-breakdown .breakdown-label {
  font-size: 0.9rem; /* was 0.7rem */
}

#deposits-section .deposits-breakdown .breakdown-value,
#deposits-section .deposits-breakdown .breakdown-value-white {
  font-size: 1rem; /* was 0.8rem */
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: linear-gradient(180deg, rgba(41, 64, 102, 0.98), rgba(22, 34, 58, 0.98));
  border-radius: 10px;
  border: 1px solid rgba(128, 223, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 24px rgba(1, 5, 12, 0.34),
    0 0 14px rgba(0, 217, 255, 0.06);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  gap: 2px;
  min-height: 36px;
}

/* Balance panel: increase row height by ~15% */
.wide-panel-grid .panel-zone:first-child .breakdown-item {
  min-height: 41px; /* 36px * 1.15 ≈ 41.4px */
  padding: 0.368rem 2.5mm; /* horizontal padding ~2.5mm */
}

/* Money invested panel: increase each row height by ~1.4mm */
.wide-panel-grid .panel-zone:nth-child(2) .breakdown-item {
  min-height: calc(36px + 1.4mm);
  padding-top: calc(0.32rem + 0.18mm);
  padding-bottom: calc(0.32rem + 0.18mm);
}

/* Balance panel: reduce left/right gutters to ~1mm */
.wide-panel-grid .panel-zone:first-child {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}
.wide-panel-grid .panel-zone:first-child .deposits-breakdown {
  padding-left: 0;
  padding-right: 0;
}

/* Money invested panel (2nd): match ~2.5mm gutters and row padding */
.wide-panel-grid .panel-zone:nth-child(2) {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}
.wide-panel-grid .panel-zone:nth-child(2) .deposits-breakdown {
  padding-left: 0;
  padding-right: 0;
}
.wide-panel-grid .panel-zone:nth-child(2) .breakdown-item {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}

/* Profit panel (3rd): match ~2.5mm gutters and row padding */
.wide-panel-grid .panel-zone:nth-child(3) {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}
.wide-panel-grid .panel-zone:nth-child(3) .profit-box {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}

/* Total return panel (4th): match ~2.5mm gutters and row padding */
.wide-panel-grid .panel-zone:nth-child(4) {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}
.wide-panel-grid .panel-zone:nth-child(4) .profit-box {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}

/* Profit panel: increase each row height by ~1.4mm */
.wide-panel-grid .panel-zone:nth-child(3) .profit-box {
  min-height: calc(36px + 1.4mm);
  padding-top: calc(0.2rem + 0.18mm);
  padding-bottom: calc(0.2rem + 0.18mm);
}

/* Total return panel: increase each row height by ~1.4mm */
.wide-panel-grid .panel-zone:nth-child(4) .profit-box {
  min-height: calc(36px + 1.4mm);
  padding-top: calc(0.2rem + 0.18mm);
  padding-bottom: calc(0.2rem + 0.18mm);
}

/* === Deposits Page: Reduce Money Invested panel height (only duplicate panel) === */
/* Apply ~15% vertical reduction while preserving font sizes/content scale */
#deposits-section .panel-zone .deposits-breakdown .breakdown-item {
  min-height: 31px; /* 36px * 0.85 ≈ 30.6px */
  padding-top: 0.27rem; /* 0.32rem * 0.85 ≈ 0.272rem */
  padding-bottom: 0.27rem;
}
/* Reduce panel vertical padding itself by 15% (keep horizontal) */
#deposits-section .panel-zone {
  padding-top: 0.85rem; /* was 1rem */
  padding-bottom: 0.85rem;
  /* Width reduction by ~20% while keeping content scale */
  max-width: 768px; /* 960px * 0.8 */
  width: 100%;
}

/* === Profit Split Grid === */
.profit-split-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr; /* two columns */
  gap: 0.25rem; /* tighter spacing between columns */
  width: 100%;
}

.profit-col {
  display: flex;
  flex-direction: column;
  gap: 0; /* no space between rows, matches Balance/Money Invested */
}

/* Combined column: label + value on one row */
.profit-col.combined .profit-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.profit-col.combined .profit-label {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #dcdcdc;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.7rem; /* align with previous label size */
}

.profit-col.combined .profit-value {
  color: #00d9ff;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 217, 255, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem; /* match previous profit value emphasis */
}

.profit-box {
  background: linear-gradient(180deg, rgba(41, 64, 102, 0.98), rgba(22, 34, 58, 0.98));
  border: 1px solid rgba(128, 223, 255, 0.22);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #dcdcdc;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 24px rgba(1, 5, 12, 0.34),
    0 0 14px rgba(0, 217, 255, 0.06);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  line-height: 1.03;
}

.profit-box:hover {
  background: linear-gradient(180deg, rgba(35, 54, 86, 0.98), rgba(20, 32, 56, 0.98));
  border-color: rgba(128, 223, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(1, 5, 12, 0.38),
    0 0 12px rgba(0, 217, 255, 0.06);
}

.profit-col.brokers .profit-box.profit-label {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #dcdcdc;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.7rem; /* align with breakdown-label */
}

.profit-col.profits .profit-box {
  color: #00d9ff;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 217, 255, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem; /* match breakdown-value emphasis */
}

.profit-col.returns .profit-box {
  color: #00ff88;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 255, 136, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.8rem; /* same emphasis as profit values */
  justify-content: space-between;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.profit-col.returns .profit-label {
  color: #dcdcdc;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.7rem;
}

.profit-col.returns .profit-value {
  color: #00ff88;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 255, 136, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.8rem;
}

/* Title above the returns column */
.profit-column-title {
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin: 0.1rem 0 0.2rem 0; /* tight spacing */
  text-align: center;
}

.breakdown-item-compact {
  gap: 0px;
}

.breakdown-item:hover {
  background: rgba(20, 26, 38, 0.95);
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.08);
}

.breakdown-label {
  color: rgba(220, 220, 220, 0.9);
  font-size: 0.7rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.breakdown-value {
  color: #00d9ff;
  font-size: 0.8rem;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 217, 255, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.3);
  text-align: right;
  white-space: nowrap;
}

.breakdown-value-white {
  color: #dcdcdc !important;
  font-weight: 400;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.breakdown-value-profit {
  text-align: right;
  white-space: nowrap;
  display: inline-block;
  width: 140px;
  font-variant-numeric: tabular-nums;
}

#dashboard-section .wide-panel-grid .panel-zone-title {
  margin-bottom: 0.74rem;
  color: rgba(238, 247, 255, 0.76);
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: none;
}

#dashboard-section .wide-panel-grid > .panel-zone {
  align-self: start;
}

#dashboard-section .wide-panel-grid .deposits-breakdown {
  gap: 0.18rem;
  padding: 0.08rem 0;
  height: auto;
}

#dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) {
  align-self: start;
  min-height: 112px;
  padding: 0.92rem 1.02rem 0.96rem;
}

#dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) .breakdown-item,
#dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) .profit-box {
  min-height: 28px;
  padding: 0.34rem 0;
  border-radius: 0;
  align-items: baseline;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) .breakdown-item:not(:last-child),
#dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) .profit-box:not(:last-child) {
  border-bottom: 1px solid rgba(126, 228, 255, 0.08) !important;
}

#dashboard-section .wide-panel-grid .breakdown-label,
#dashboard-section .wide-panel-grid .profit-label {
  color: rgba(215, 234, 247, 0.72);
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: none;
}

#dashboard-section .wide-panel-grid .breakdown-value,
#dashboard-section .wide-panel-grid .breakdown-value-white,
#dashboard-section .wide-panel-grid .breakdown-value-profit,
#dashboard-section .wide-panel-grid .profit-value {
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  white-space: nowrap;
}

#dashboard-section .wide-panel-grid .breakdown-value {
  color: #86e9ff;
  text-shadow: 0 0 12px rgba(0, 217, 255, 0.14);
}

#dashboard-section .wide-panel-grid .breakdown-value-white {
  color: rgba(245, 250, 255, 0.94) !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.05) !important;
}

#dashboard-section .wide-panel-grid .profit-col.combined .profit-box,
#dashboard-section .wide-panel-grid .profit-col.returns .profit-box {
  gap: 0.34rem;
}

#dashboard-section .wide-panel-grid .profit-col.profits .profit-box {
  font-size: inherit;
}

#dashboard-section .metrics-panel-zone {
  padding-top: 1rem;
  align-self: start;
}

#dashboard-section .metrics-panel {
  gap: 0.16rem;
}

#dashboard-section .metrics-panel .metric-row {
  min-height: auto;
  padding: 0.48rem 0.62rem 0.52rem;
  border-radius: 12px;
}

#dashboard-section .metrics-panel .metric-label {
  color: rgba(215, 234, 247, 0.72);
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.12;
  text-transform: uppercase;
  text-shadow: none;
}

#dashboard-section .metrics-panel .metric-value {
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  text-shadow: none;
}

.chart-container:hover {
  transform: none;
  box-shadow: none;
}

.chart-container:hover::before {
  opacity: 0;
}

.chart-container h2 {
  color: #dcdcdc;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
}

#balance-pie-chart {
  max-width: 250px;
  max-height: 250px;
  margin: 0 auto;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4));
  position: relative;
  z-index: 101; /* ensure canvas renders above decorations */
}

/* Performance Chart Styles */
.performance-chart-container {
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  padding: 1.5rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 10px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: none;
  transition: none;
  position: relative;
  margin-top: 1.5rem;
  height: 380px;
  display: flex;
  flex-direction: column;
}

.performance-chart-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  border-radius: 25px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.performance-chart-container:hover {
  transform: none;
  box-shadow: none;
}

.performance-chart-container:hover::before {
  opacity: 0;
}

.chart-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
  flex-shrink: 0;
}

.chart-header h2 {
  color: #dcdcdc;
  font-size: 1.3rem;
  font-weight: 700;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.performance-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  border: 2px solid;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  min-width: 100px;
  justify-content: center;
}

.performance-badge.positive {
  background: rgba(240, 235, 255, 0.95);
  border-color: rgba(0, 255, 136, 0.6);
  color: #00ff88;
  text-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.performance-badge.negative {
  background: rgba(240, 235, 255, 0.95);
  border-color: rgba(255, 107, 107, 0.6);
  color: #d32f2f;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.performance-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.time-range-selector {
  display: flex;
  gap: 0.2rem;
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: 0;
  flex-wrap: wrap;
  align-items: center;
}

.time-btn {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease;
  min-width: auto;
  box-shadow: none;
}

.time-btn:hover,
.time-btn:focus-visible {
  background: rgba(229, 231, 235, 0.22);
  color: #ffffff;
  transform: none;
  box-shadow: none;
  outline: none;
}

.time-btn.active {
  background: rgba(229, 231, 235, 0.32);
  color: #ffffff;
  box-shadow: none;
  transform: none;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-checkbox {
  cursor: pointer;
  transition: opacity 0.3s ease;
  user-select: none;
}

.legend-checkbox:hover {
  opacity: 0.8;
}

.legend-toggle {
  cursor: pointer;
  width: 14px;
  height: 14px;
  accent-color: white;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
}

.legend-checkbox:has(.legend-toggle:not(:checked)) .legend-color {
  opacity: 0.3;
}

.legend-checkbox:has(.legend-toggle:not(:checked)) .legend-label {
  opacity: 0.5;
}

.legend-label {
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

#performance-chart {
  width: 100%;
  flex: 1;
  min-height: 0;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

#dashboard-section .performance-chart-container {
  isolation: isolate;
}

#dashboard-section .performance-chart-tooltip {
  --tooltip-accent: var(--theme-accent-2, #00d9ff);
  --tooltip-arrow-x: 36px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 12;
  width: min(250px, calc(100% - 18px));
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 4px, 0) scale(0.98);
  transform-origin: var(--tooltip-arrow-x) 100%;
  transition: opacity 0.12s ease, transform 0.12s ease;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.34));
}

#dashboard-section .performance-chart-tooltip.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

#dashboard-section .performance-chart-tooltip.is-below {
  transform: translate3d(0, -4px, 0) scale(0.98);
  transform-origin: var(--tooltip-arrow-x) 0%;
}

#dashboard-section .performance-chart-tooltip.is-visible.is-below {
  transform: translate3d(0, 0, 0) scale(1);
}

#dashboard-section .performance-chart-tooltip::after {
  content: '';
  position: absolute;
  left: var(--tooltip-arrow-x);
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: rgba(8, 16, 31, 0.94);
  border-right: 1px solid rgba(126, 228, 255, 0.28);
  border-bottom: 1px solid rgba(126, 228, 255, 0.28);
  transform: translateX(-50%) rotate(45deg);
  backdrop-filter: blur(18px) saturate(155%);
  box-shadow: 5px 5px 14px rgba(0, 0, 0, 0.2);
}

#dashboard-section .performance-chart-tooltip.is-below::after {
  top: -5px;
  bottom: auto;
  border: 0;
  border-left: 1px solid rgba(126, 228, 255, 0.28);
  border-top: 1px solid rgba(126, 228, 255, 0.28);
  box-shadow: -5px -5px 14px rgba(0, 0, 0, 0.18);
}

#dashboard-section .performance-tooltip-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  padding: 0.56rem 0.7rem 0.62rem;
  color: rgba(246, 250, 255, 1);
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 217, 255, 0.14), transparent 40%),
    linear-gradient(145deg, rgba(14, 30, 54, 0.96), rgba(6, 13, 28, 0.94));
  border: 1px solid rgba(126, 228, 255, 0.26);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 14px 28px rgba(0, 0, 0, 0.26),
    0 0 18px rgba(0, 217, 255, 0.08);
  backdrop-filter: blur(18px) saturate(155%);
}

#dashboard-section .performance-tooltip-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 34%),
    linear-gradient(90deg, transparent, rgba(126, 228, 255, 0.05), transparent);
  pointer-events: none;
}

#dashboard-section .performance-tooltip-card::after {
  content: '';
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  top: 0;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, #36e4ff, #7b8cff, #ffcc3d);
  box-shadow: 0 0 10px rgba(54, 228, 255, 0.3);
}

#dashboard-section .performance-tooltip-card > * {
  position: relative;
  z-index: 1;
}

#dashboard-section .performance-tooltip-balance,
#dashboard-section .performance-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.42rem;
}

#dashboard-section .performance-tooltip-date {
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.62);
  white-space: nowrap;
}

#dashboard-section .performance-tooltip-balance {
  margin-top: 0.34rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(126, 228, 255, 0.12);
  color: rgba(218, 236, 248, 0.9);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

#dashboard-section .performance-tooltip-balance span {
  color: rgba(215, 234, 247, 0.8);
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: none;
}

#dashboard-section .performance-tooltip-balance strong {
  color: #ffffff;
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

#dashboard-section .performance-tooltip-series-list {
  display: grid;
  gap: 0;
  margin-top: 0.24rem;
}

#dashboard-section .performance-tooltip-row {
  min-height: 18px;
  padding: 0.22rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#dashboard-section .performance-tooltip-row + .performance-tooltip-row {
  border-top: 1px solid rgba(126, 228, 255, 0.08);
}

#dashboard-section .performance-tooltip-series {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-width: 0;
  color: rgba(231, 244, 255, 0.95);
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: none;
}

#dashboard-section .performance-tooltip-dot {
  width: 0.46rem;
  height: 0.46rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--tooltip-row-color, #36e4ff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tooltip-row-color, #36e4ff) 60%, transparent);
}

#dashboard-section .performance-tooltip-percent {
  color: rgba(244, 250, 255, 0.98);
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

#dashboard-section .performance-tooltip-row--positive .performance-tooltip-percent {
  color: #36f59a;
  text-shadow: 0 0 14px rgba(54, 245, 154, 0.26);
}

#dashboard-section .performance-tooltip-row--negative .performance-tooltip-percent {
  color: #ff7a88;
  text-shadow: 0 0 14px rgba(255, 122, 136, 0.24);
}

#dashboard-section .performance-tooltip-row--neutral .performance-tooltip-percent {
  color: #9decff;
}

#dashboard-section .performance-tooltip-empty {
  color: rgba(220, 236, 246, 0.74);
  font-size: 0.78rem;
  padding: 0.18rem 0 0.06rem;
}

/* Table Header Styles */
.table-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
  gap: 8px;
  align-items: center;
}

.add-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

@keyframes add-btn-pulse-anim {
  0%   { box-shadow: 0 0 0 0 rgba(79, 195, 247, 0.7); transform: scale(1); }
  40%  { box-shadow: 0 0 0 8px rgba(79, 195, 247, 0); transform: scale(1.15); }
  70%  { box-shadow: 0 0 0 12px rgba(79, 195, 247, 0); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 0 rgba(79, 195, 247, 0); transform: scale(1); }
}

.add-btn-pulse {
  animation: add-btn-pulse-anim 0.55s ease-out;
  outline: 2px solid rgba(79, 195, 247, 0.6);
  outline-offset: 2px;
}

.dividends-add-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.dividends-top-controls-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.monthly-broker-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.monthly-broker-filter label {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 600;
}

.monthly-broker-filter .settings-select {
  min-width: 150px;
}

@media (max-width: 768px) {
  .dividends-top-controls-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .monthly-broker-filter {
    width: 100%;
    justify-content: space-between;
  }

  .monthly-broker-filter .settings-select {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* Import button – glowing pill */
.import-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 199, 116, 0.22), rgba(56, 139, 253, 0.22));
  border: 1.5px solid rgba(0, 199, 116, 0.35);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  box-shadow: 0 0 12px rgba(0, 199, 116, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.import-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 199, 116, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.import-btn:hover {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(0, 199, 116, 0.55);
  box-shadow: 0 0 22px rgba(0, 199, 116, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(0, 199, 116, 0.32), rgba(56, 139, 253, 0.28));
}

.import-btn:hover::before {
  opacity: 1;
}

.import-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0 8px rgba(0, 199, 116, 0.2);
}

.import-btn svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.import-btn:hover svg {
  transform: translateY(2px);
  animation: import-bounce 0.6s ease;
}

@keyframes import-bounce {
  0%   { transform: translateY(-4px); }
  40%  { transform: translateY(3px); }
  70%  { transform: translateY(-1px); }
  100% { transform: translateY(2px); }
}

/* Delete-selected button (red variant of import-btn) */
.delete-selected-btn {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.22), rgba(255, 107, 107, 0.22));
  border-color: rgba(220, 53, 69, 0.4);
  box-shadow: 0 0 12px rgba(220, 53, 69, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.delete-selected-btn:hover {
  border-color: rgba(220, 53, 69, 0.6);
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.35), rgba(255, 107, 107, 0.3));
  box-shadow: 0 0 22px rgba(220, 53, 69, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.delete-selected-btn:hover svg {
  transform: none;
  animation: none;
}
.delete-selected-btn::before {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.08), transparent 60%);
}

/* Select-all / row-select checkbox column */
.select-all-th,
.select-td {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding: 0.25rem 0.3rem;
}
.select-all-th input[type="checkbox"],
.select-td input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #00c774;
}

/* Toolbar layout */
#dividends-monthly-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dividend-import-btn {
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at top left, rgba(120, 255, 214, 0.26), transparent 48%),
    linear-gradient(135deg, rgba(0, 199, 116, 0.34), rgba(56, 139, 253, 0.3));
  border-color: rgba(120, 255, 214, 0.48);
  box-shadow: 0 0 20px rgba(0, 199, 116, 0.22), 0 10px 24px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dividend-import-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(6px) scale(0.94);
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #dffef4;
  background: rgba(4, 19, 26, 0.92);
  border: 1px solid rgba(120, 255, 214, 0.5);
  box-shadow: 0 0 20px rgba(0, 199, 116, 0.28), 0 0 36px rgba(56, 139, 253, 0.18);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.3s ease;
}

.dividend-import-btn:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(152, 255, 224, 0.75);
  box-shadow: 0 0 28px rgba(0, 199, 116, 0.34), 0 12px 28px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.dividend-import-btn:hover::after,
.dividend-import-btn:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.dividend-import-btn svg {
  width: 15px;
  height: 15px;
}

.dividend-import-btn:hover svg {
  transform: translateY(0);
  animation: import-float 0.7s ease;
}

.dividend-import-btn:focus-visible {
  outline: none;
  border-color: rgba(180, 255, 232, 0.88);
  box-shadow: 0 0 0 3px rgba(120, 255, 214, 0.18), 0 0 28px rgba(0, 199, 116, 0.3), 0 10px 24px rgba(0, 0, 0, 0.26);
}

.dividend-import-btn[hidden] {
  display: none;
}

/* Animated spinner shown while importing */
.import-spinner {
  width: 18px;
  height: 18px;
  display: block;
  animation: spin 0.8s linear infinite;
  color: inherit;
}

@keyframes import-float {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-3px) scale(1.08); }
  65% { transform: translateY(1px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}

.refresh-btn {
  background: rgba(138, 43, 226, 0.15);
  border: 1.5px solid rgba(138, 43, 226, 0.3);
  color: #9b59b6;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.refresh-btn svg {
  width: 16px;
  height: 16px;
}

.refresh-btn.is-refreshing {
  cursor: wait;
  opacity: 0.92;
}

.refresh-btn:disabled:not(.is-refreshing) {
  cursor: not-allowed;
  opacity: 0.48;
  background: rgba(138, 43, 226, 0.08);
  border-color: rgba(138, 43, 226, 0.18);
  color: rgba(155, 89, 182, 0.55);
  box-shadow: none;
}

.refresh-btn.is-refreshing svg {
  animation: spin 0.9s linear infinite;
}

.refresh-btn:hover:not(:disabled) {
  background: rgba(138, 43, 226, 0.25);
  box-shadow: 0 0 12px rgba(138, 43, 226, 0.3);
  border-color: rgba(138, 43, 226, 0.5);
}

.refresh-btn:active svg {
  animation: spin 0.6s ease-in-out;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.export-btn {
  position: relative;
  background: rgba(0, 217, 255, 0.15);
  border: 1.5px solid rgba(0, 217, 255, 0.3);
  color: #00d9ff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Hover tooltip for export-btn */
.export-btn[data-instant-tip]::after {
  content: attr(data-instant-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: rgba(14, 20, 42, 0.95);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid rgba(0, 217, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 217, 255, 0.1);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.export-btn[data-instant-tip]::before {
  content: '';
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: rgba(0, 217, 255, 0.3);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s;
}

.export-btn[data-instant-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.export-btn[data-instant-tip]:hover::before {
  opacity: 1;
}

.export-btn svg {
  width: 16px;
  height: 16px;
}

.export-btn:hover {
  background: rgba(0, 217, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.5);
}

.download-data-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#download-data-card .download-data-actions {
  justify-content: center;
  margin-top: -0.08rem;
}

#download-data-card .download-menu .export-btn {
  margin-left: 0;
}

#download-data-card .download-menu-popup {
  left: 50%;
  transform: translateX(-50%);
}

.download-menu {
  position: relative;
  display: inline-flex;
}

.download-menu-popup {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(0, 217, 255, 0.18);
  background: rgba(10, 18, 34, 0.94);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34), 0 0 22px rgba(0, 217, 255, 0.12);
  backdrop-filter: blur(18px);
  z-index: 25;
}

.download-menu.open .download-menu-popup {
  display: flex;
}

.download-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.download-menu-item:hover {
  background: rgba(0, 217, 255, 0.12);
  border-color: rgba(0, 217, 255, 0.24);
  transform: translateY(-1px);
}

.download-menu-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.download-menu-ext {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 217, 255, 0.78);
  font-family: monospace;
  white-space: nowrap;
}

/* Floating Add Button */
.floating-add-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--stocks-row-grad-start) 0%, var(--stocks-row-grad-end) 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 999;
  opacity: 0;
}

.floating-add-btn.visible {
  display: flex;
  animation: fadeInUp 0.3s ease forwards;
}

.floating-add-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.floating-add-btn:active {
  transform: scale(0.95) rotate(90deg);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table Styles */
table thead tr {
  position: sticky;
  top: 0;
  z-index: 6;
  background: inherit;
}

table thead th {
  position: sticky;
  top: 0;
  z-index: 7;
  background: inherit;
}

.stocks-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.stocks-table thead {
  background: var(--stocks-row-grad-start);
}

.stocks-table th {
  padding: 10px 12px 12px;
  text-align: left;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-shadow: none;
}

.stocks-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.stocks-table th.sortable:hover {
  color: #64ffda;
  background: rgba(255, 255, 255, 0.06);
}

.sort-icon {
  display: inline;
  font-size: 0.7rem;
  opacity: 0.5;
  margin-left: 0.2rem;
  vertical-align: baseline;
  transition: opacity 0.2s ease;
}

.stocks-table th.sortable:hover .sort-icon {
  opacity: 1;
}

.stocks-table th.sorted-asc .sort-icon::after {
  content: '';
}

.stocks-table th.sorted-desc .sort-icon::after {
  content: '';
}

.stocks-table td {
  padding: 0.5rem;
  text-align: left;
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 400 !important;
}

.stocks-table tbody td,
.stocks-table tbody td * ,
.stocks-table input,
.stocks-table select {
  font-weight: 400 !important;
}

.stocks-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.15);
}

.stocks-table input {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  width: 100%;
  font-size: 0.75rem;
  border-radius: 3px;
}

.stocks-table input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

#stocks-section #stocks-tbody td[data-field='shares'].shares-editing-cell {
  padding: 0;
}

#stocks-section #stocks-tbody td[data-field='shares'] input.shares-editing-input {
  display: block;
  width: 80%;
  max-width: 100%;
  height: 100%;
  min-height: 2.25rem;
  margin: 0;
  border-radius: 0;
  box-sizing: border-box;
}

.stocks-table select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  width: 100%;
  font-size: 0.75rem;
  border-radius: 3px;
  cursor: pointer;
}

/* Match table input colors to Stocks table */
#dividends-table input,
#dividends-table select,
#dividends-monthly-table input,
#dividends-monthly-table select,
#stocks-gains-table input,
#stocks-gains-table select,
#withdrawals-table input,
#withdrawals-table select {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  width: 100%;
  font-size: 0.75rem;
  border-radius: 3px;
}

.table-inline-editor {
  display: block;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.5rem;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 3px;
}

.table-inline-editor::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.table-inline-editor:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.table-inline-date-input,
.table-inline-datetime-input {
  color-scheme: dark;
}

.table-inline-datetime-input {
  min-width: 14rem;
}

.banymay-date-input {
  cursor: pointer;
  padding-right: 2.35rem !important;
  border-radius: 10px !important;
  background-image:
    linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(59, 130, 246, 0.16)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 18px rgba(2, 6, 23, 0.18);
  letter-spacing: 0.01em;
}

.banymay-date-input:focus {
  border-color: rgba(125, 211, 252, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.banymay-date-input::-webkit-calendar-picker-indicator {
  display: none;
  opacity: 0;
}

.banymay-date-picker-popover {
  position: absolute;
  z-index: 12000;
  width: 276px;
  max-width: calc(100vw - 16px);
  color: #eef6ff;
  font-family: inherit;
}

.banymay-date-picker-popover[hidden] {
  display: none !important;
}

.bdp-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.28), transparent 34%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.26), transparent 38%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
  box-shadow: 0 20px 46px rgba(2, 6, 23, 0.44), 0 8px 18px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(16px);
}

.bdp-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem 0.2rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bdp-close,
.bdp-nav-btn,
.bdp-title,
.bdp-footer-btn,
.bdp-day,
.bdp-month,
.bdp-year {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.bdp-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: rgba(226, 232, 240, 0.86);
  font-size: 0.95rem;
  line-height: 1;
}

.bdp-close:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #fff;
}

.bdp-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(1.8rem, auto);
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.65rem 0.45rem;
}

.bdp-nav-btn,
.bdp-title {
  min-height: 1.85rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.bdp-nav-btn {
  min-width: 1.85rem;
  font-size: 0.95rem;
  font-weight: 900;
}

.bdp-nav-btn--minor {
  color: rgba(226, 232, 240, 0.68);
}

.bdp-title {
  width: 100%;
  padding: 0 0.48rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.bdp-nav-btn:hover,
.bdp-title:hover,
.bdp-footer-btn:hover,
.bdp-day:hover,
.bdp-month:hover,
.bdp-year:hover {
  transform: translateY(-1px);
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 7px 16px rgba(2, 6, 23, 0.22);
}

.bdp-body {
  padding: 0 0.65rem 0.5rem;
}

.bdp-weekdays,
.bdp-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.18rem;
}

.bdp-weekdays {
  margin-bottom: 0.22rem;
  color: rgba(203, 213, 225, 0.58);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.bdp-day,
.bdp-month,
.bdp-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(241, 245, 249, 0.92);
  font-weight: 800;
}

.bdp-day {
  width: 100%;
  min-height: 1.72rem;
  border-radius: 8px;
  font-size: 0.68rem;
  line-height: 1;
}

.bdp-day.is-muted {
  color: rgba(148, 163, 184, 0.58);
  background: rgba(255, 255, 255, 0.035);
}

.bdp-day.is-today {
  border-color: rgba(125, 211, 252, 0.7);
}

.bdp-day.is-selected,
.bdp-month.is-selected,
.bdp-year.is-selected {
  color: #05111f;
  background: linear-gradient(135deg, #7dd3fc, #86efac);
  box-shadow: 0 12px 24px rgba(34, 197, 94, 0.22);
}

.bdp-month-grid,
.bdp-year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.32rem;
}

.bdp-month,
.bdp-year {
  min-height: 2.1rem;
  border-radius: 10px;
  font-size: 0.74rem;
}

.bdp-time-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0.65rem 0.5rem;
  padding: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.44);
}

.bdp-time-label {
  margin-right: auto;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bdp-time-field {
  width: 2.45rem;
  min-height: 1.75rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font: inherit;
  font-weight: 900;
  text-align: center;
}

.bdp-time-field:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.72);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.bdp-time-separator {
  color: rgba(226, 232, 240, 0.65);
  font-weight: 900;
}

.bdp-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.52rem 0.65rem 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.22);
}

.bdp-footer-btn {
  min-height: 1.85rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(241, 245, 249, 0.88);
  font-size: 0.62rem;
  font-weight: 900;
}

.bdp-footer-btn--primary {
  color: #052e16;
  background: linear-gradient(135deg, #86efac, #7dd3fc);
}

@media (max-width: 520px) {
  .banymay-date-picker-popover {
    left: 8px !important;
    right: 8px;
    width: calc(100vw - 16px) !important;
  }

  .bdp-card {
    border-radius: 16px;
  }
}

#snapshots-tbody td[data-field='datetime'] .table-inline-datetime-input {
  min-width: 15rem;
}

#dividends-table input:focus,
#dividends-table select:focus,
#dividends-monthly-table input:focus,
#dividends-monthly-table select:focus,
#stocks-gains-table input:focus,
#stocks-gains-table select:focus,
#withdrawals-table input:focus,
#withdrawals-table select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.sector-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.sector-option {
  padding: 8px 10px;
  cursor: pointer;
  color: white;
  font-size: 0.8rem;
}

.sector-option.sector {
  font-weight: 700;
}

.sector-option.subsector {
  font-weight: 400;
  padding-left: 18px;
  opacity: 0.95;
}

.stocks-table select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.stocks-table select option {
  background: var(--stocks-row-grad-start);
  color: white;
  padding: 0.5rem;
}

.deposits-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 1rem auto;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  width: 100%;
}

/* Match width with Deposits table container */
#deposits-section .deposits-total,
#deposits-section .stocks-table {
  max-width: 768px;
}

/* Center both elements to align widths visually */
#deposits-section .deposits-total,
#deposits-section .stocks-table {
  margin-left: auto;
  margin-right: auto;
}

.deposits-total span:first-child {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.deposits-total span:last-child {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: none;
}

.action-buttons {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
}

.action-menu {
  position: relative;
  display: inline-flex;
}

.action-menu-toggle {
  border: none;
  background: transparent;
  border-radius: 10px;
  width: 34px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.action-menu-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  padding: 0.5rem;
  border-radius: 14px;
  background: radial-gradient(120% 140% at 20% -10%, rgba(0, 199, 116, 0.18), rgba(10, 14, 24, 0.95)),
    linear-gradient(160deg, rgba(24, 28, 42, 0.98), rgba(10, 14, 24, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: none;
  z-index: 25;
  backdrop-filter: blur(12px);
}

.action-menu-panel.open {
  display: grid;
  gap: 0.35rem;
}

.action-menu-item {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.action-menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.action-menu-item.delete-btn:hover {
  background: rgba(244, 67, 54, 0.15);
  color: #ff8b84;
}

.edit-btn,
.delete-btn {
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.edit-btn svg,
.delete-btn svg {
  display: block;
}

.edit-btn:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
}

.delete-btn:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.5);
}

/* Risk Info Icon & Tooltip */
.risk-header {
  position: relative;
}

.info-icon {
  cursor: help;
  display: inline-block;
  margin-left: 0.3rem;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  vertical-align: middle;
}

.info-icon:hover {
  color: white;
}

.info-icon svg {
  display: inline-block;
  vertical-align: middle;
}

.tooltip {
  display: none;
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 1rem;
  min-width: 190px;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: none;
}

.tooltip.show {
  display: block;
}

.tooltip-title {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.tooltip-item {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.risk-indicator {
  margin-right: 0.5rem;
  font-size: 1rem;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
  text-align: center;
}

.modal-content.account-modal {
  background: radial-gradient(140% 180% at 20% -20%, rgba(0, 199, 116, 0.2), rgba(12, 16, 28, 0.98)),
    linear-gradient(160deg, rgba(20, 24, 38, 0.98), rgba(8, 12, 20, 0.98));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-content.account-modal .modal-title,
.modal-content.account-modal .modal-message {
  color: rgba(255, 255, 255, 0.92);
}

.modal-content.account-modal.is-warning {
  background: radial-gradient(140% 180% at 20% -20%, rgba(100, 255, 218, 0.2), rgba(12, 16, 28, 0.98)),
    linear-gradient(160deg, rgba(20, 24, 38, 0.98), rgba(8, 12, 20, 0.98));
}

.modal-content.account-modal.is-success {
  background: radial-gradient(140% 180% at 20% -20%, rgba(0, 199, 116, 0.28), rgba(12, 16, 28, 0.98)),
    linear-gradient(160deg, rgba(20, 24, 38, 0.98), rgba(8, 12, 20, 0.98));
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-icon {
  margin-bottom: 1.5rem;
}

.modal-title {
  color: #333;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.modal-message {
  color: #666;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.modal-message strong {
  color: #333;
  font-weight: 600;
}

.modal-content.account-modal .modal-message strong {
  color: #64ffda;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn-cancel {
  background: rgba(0, 0, 0, 0.05);
  color: #666;
}

.modal-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.modal-btn-confirm {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.modal-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.modal-content.account-modal .modal-btn-confirm {
  background: linear-gradient(135deg, #6a7cff, #8d6bff);
  box-shadow: 0 6px 18px rgba(106, 124, 255, 0.35);
}

.modal-content.account-modal.is-warning .modal-btn-confirm {
  background: linear-gradient(135deg, #64ffda, #00c9a7);
  box-shadow: 0 6px 18px rgba(100, 255, 218, 0.35);
  color: #0a1628;
}

.modal-content.account-modal.is-success .modal-btn-confirm {
  background: linear-gradient(135deg, #00c774, #00a85f);
  box-shadow: 0 6px 18px rgba(0, 199, 116, 0.35);
}

/* Admin Section Styles */
/* ===== Admin WOW Redesign ===== */
.admin-hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 22px;
  padding: 1rem 1.25rem;
  box-shadow: 0 16px 42px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.28);
  margin: 0 auto 1.5rem auto;
  max-width: 980px;
}
.admin-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}
.admin-subtitle {
  margin-top: 0.25rem;
  color: rgba(255,255,255,0.85);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.admin-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  padding: 0.85rem 0.8rem 0.9rem 0.8rem;
}

.admin-table-panel {
  grid-column: 1 / -1;
}

/* Make Admin snapshots header sticky during scroll */
.admin-table-panel .table-container {
  max-height: 360px; /* scroll area height */
  overflow: auto;
  border-radius: 12px;
}
.admin-table-panel .data-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table-panel .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(10px);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.2);
}
.admin-table-panel .data-table th,
.admin-table-panel .data-table td {
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 0.8rem;
}

.admin-actions,
.admin-danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-danger-actions { margin-top: 0.5rem; }

.admin-range {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
}
.admin-label { color: rgba(255,255,255,0.9); font-size: 0.8rem; }
.admin-input {
  background: #232323;
  color: #fff;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 120px;
}

/* ===== Admin Dashboard (Screenshot Layout) ===== */
#admin-section .admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

#admin-section .admin-sidebar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1rem 0.85rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#admin-section .admin-sidebar-header {
  padding: 0.25rem 0.5rem 0.4rem 0.5rem;
}

#admin-section .admin-sidebar-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.3px;
  color: #e6e9ff;
}

#admin-section .admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#admin-section .admin-side-item {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#admin-section .admin-side-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

#admin-section .admin-side-item.active {
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.25), rgba(102, 126, 234, 0.35));
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 16px rgba(0, 217, 255, 0.2);
}

#admin-section .admin-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

#admin-section .admin-hero-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

#admin-section .admin-hero-card h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: #ffffff;
}

#admin-section .admin-hero-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

#admin-section .admin-pill-row {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

#admin-section .admin-pill {
  background: rgba(0, 217, 140, 0.15);
  color: #68ffb7;
  border: 1px solid rgba(104, 255, 183, 0.35);
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
}

#admin-section .admin-pill--neutral {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.16);
}

#admin-section .admin-pill--error {
  background: rgba(255, 107, 107, 0.15);
  color: #ffb3b3;
  border-color: rgba(255, 107, 107, 0.3);
}

#admin-section .admin-finance-toolbar {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

#admin-section .admin-view--finance .admin-hero-card {
  padding: 0.42rem 0.7rem;
}

#admin-section .admin-view--finance .admin-pill-row {
  margin-top: 0;
  gap: 0.32rem;
}

#admin-section .admin-view--finance .admin-pill {
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
}

#admin-section .admin-view--finance .admin-finance-toolbar {
  margin-top: 0;
  gap: 0.38rem;
  align-items: center;
}

#admin-section .admin-view--finance .admin-range-toggle {
  padding: 0.14rem;
}

#admin-section .admin-view--finance .admin-range-btn {
  padding: 0.22rem 0.5rem;
  font-size: 0.66rem;
}

#admin-section .admin-range-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  background: rgba(8, 12, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

#admin-section .admin-range-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#admin-section .admin-range-btn:hover {
  color: #ffffff;
}

#admin-section .admin-range-btn.active {
  background: linear-gradient(135deg, rgba(104, 255, 183, 0.22), rgba(76, 202, 255, 0.22));
  color: #ffffff;
  transform: translateY(-1px);
}

#admin-section .admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 0.8rem;
}

#admin-section .admin-kpi-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
  overflow: visible;
}

#admin-section .admin-kpi-info {
  position: absolute;
  top: 0.42rem;
  right: 0.45rem;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  padding: 0;
}

#admin-section .admin-kpi-info::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(8, 12, 24, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  pointer-events: none;
  z-index: 30;
}

#admin-section .admin-kpi-info::before {
  content: "";
  position: absolute;
  top: calc(100% + 3px);
  right: 6px;
  width: 10px;
  height: 10px;
  background: rgba(8, 12, 24, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  transform: rotate(45deg) translateY(-4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  pointer-events: none;
  z-index: 29;
}

#admin-section .admin-kpi-info:hover::after,
#admin-section .admin-kpi-info:hover::before,
#admin-section .admin-kpi-info:focus-visible::after,
#admin-section .admin-kpi-info:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#admin-section .admin-kpi-info:focus-visible {
  outline: 2px solid rgba(0, 217, 255, 0.55);
  outline-offset: 2px;
}

#admin-section .admin-kpi-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

#admin-section .admin-kpi-value {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
}

#admin-section .admin-kpi-delta {
  font-size: 0.7rem;
  font-weight: 600;
}

#admin-section .admin-kpi-delta.positive {
  color: #7dffb6;
}

#admin-section .admin-kpi-delta.negative {
  color: #ff8b8b;
}

#admin-section .admin-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 0.9rem;
}

#admin-section .admin-chart-card {
  background: rgba(12, 16, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 0.85rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#admin-section .admin-chart-card--wide {
  grid-column: span 1;
}

#admin-section .admin-chart-header {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 600;
}

#admin-section .admin-chart-body {
  flex: 1;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
}

#admin-section .admin-chart-body--canvas {
  padding: 0.45rem;
  align-items: stretch;
  justify-content: stretch;
}

#admin-section .admin-chart-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 250px;
}

#admin-section .admin-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

#admin-section .admin-finance-charts {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

#admin-section .admin-finance-charts .admin-chart-card:nth-child(-n+2) {
  margin-top: 4mm;
}

#admin-section .admin-finance-charts .admin-chart-canvas-wrap {
  min-height: 213px;
}

#admin-section .admin-chart-body.muted {
  border-style: dashed;
}

#admin-section .admin-chart-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.08), rgba(0, 217, 255, 0.06));
  border-radius: 10px;
}

#admin-section .admin-view {
  display: none;
}

#admin-section .admin-view.active {
  display: block;
}

#admin-section .admin-users-summary {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

#admin-section .admin-summary-chip {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cfefff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

#admin-section .admin-summary-chip.positive {
  border-color: rgba(104, 255, 183, 0.42);
  color: #9dffd0;
  background: rgba(31, 190, 115, 0.14);
}

#admin-section .admin-summary-chip.warning {
  border-color: rgba(255, 199, 107, 0.45);
  color: #ffd98e;
  background: rgba(255, 180, 55, 0.14);
}

#admin-section .admin-support-hero,
#admin-section .admin-ops-panel,
#admin-section .admin-support-detail {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(1, 153, 198, 0.24), transparent 36%),
    linear-gradient(145deg, rgba(8, 15, 30, 0.96), rgba(10, 18, 34, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

#admin-section .admin-support-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 24px;
  padding: 0.85rem 1.05rem;
  margin-bottom: 0.8rem;
}

#admin-section .admin-support-hero h2 {
  margin: 0.08rem 0 0;
  color: #ffffff;
  font-size: clamp(1.2rem, 1.7vw, 1.65rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

#admin-section .admin-support-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  max-width: 760px;
}

#admin-section .admin-support-refresh,
#admin-section .admin-support-open,
#admin-section .admin-support-note-form button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0199c6, #58a306);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px rgba(1, 153, 198, 0.24);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#admin-section .admin-support-refresh {
  padding: 0.7rem 1.05rem;
  white-space: nowrap;
}

#admin-section .admin-support-open {
  padding: 0.38rem 0.72rem;
  font-size: 0.72rem;
}

#admin-section .admin-support-refresh:hover,
#admin-section .admin-support-open:hover,
#admin-section .admin-support-note-form button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 18px 38px rgba(88, 163, 6, 0.25);
}

#admin-section .admin-ops-eyebrow {
  display: inline-flex;
  color: #7ee7ff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#admin-section .admin-users-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

#admin-section .admin-info-card {
  background: rgba(12, 16, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#admin-section .admin-info-card h4 {
  margin: 0 0 0.35rem 0;
  color: #ffffff;
  font-size: 0.85rem;
}

#admin-section .admin-info-card p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

#admin-section .admin-users-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

#admin-section .admin-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#admin-section .admin-filter label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

#admin-section .admin-filter input,
#admin-section .admin-filter select {
  background: rgba(10, 14, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  font-size: 0.8rem;
}

#admin-section .admin-users-table {
  background: rgba(12, 16, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

#admin-section .admin-users-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

#admin-section .admin-users-table thead th {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
  padding: 0.6rem 0.55rem;
  font-weight: 400;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#admin-section .admin-users-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

#admin-section .admin-users-table thead th.sortable:hover {
  color: #7ee7ff;
  background: rgba(255, 255, 255, 0.12);
}

#admin-section .admin-users-table thead th.sortable .sort-icon {
  display: inline-block;
  margin-left: 0.25rem;
  opacity: 0.56;
}

#admin-section .admin-users-table thead th.sorted-asc,
#admin-section .admin-users-table thead th.sorted-desc {
  color: #ffffff;
}

#admin-section .admin-users-table tbody td {
  padding: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

#admin-section #admin-users-pagination-wrapper {
  margin: 0.35rem 0 0.95rem;
}

#admin-section .admin-users-table tbody tr.highlight {
  background: rgba(19, 64, 143, 0.55);
}

#admin-section .admin-users-table tbody tr {
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

#admin-section .admin-users-table tbody tr:hover,
#admin-section .admin-users-table tbody tr.selected {
  background: rgba(1, 153, 198, 0.12);
  box-shadow: inset 3px 0 0 rgba(88, 163, 6, 0.85);
}

#admin-section .user-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

#admin-section .user-name {
  color: #ffffff;
  font-weight: 600;
}

#admin-section .user-email {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
}

#admin-section .plan-badge,
#admin-section .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

#admin-section .plan-badge.paid {
  background: rgba(0, 217, 255, 0.2);
  color: #9de8ff;
  border: 1px solid rgba(0, 217, 255, 0.4);
}

#admin-section .plan-badge.trial {
  background: rgba(255, 196, 0, 0.2);
  color: #ffdf7e;
  border: 1px solid rgba(255, 196, 0, 0.35);
}

#admin-section .plan-badge.expired {
  background: rgba(255, 170, 120, 0.18);
  color: #ffc392;
  border: 1px solid rgba(255, 170, 120, 0.34);
}

#admin-section .plan-badge.free {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

#admin-section .status-badge.active {
  background: rgba(0, 217, 140, 0.2);
  color: #8cffc8;
  border: 1px solid rgba(0, 217, 140, 0.35);
}

#admin-section .status-badge.inactive {
  background: rgba(255, 120, 120, 0.16);
  color: #ffb1b1;
  border: 1px solid rgba(255, 120, 120, 0.32);
}

#admin-section .support-health-badge,
#admin-section .admin-ops-badge,
#admin-section .admin-support-issue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
}

#admin-section .support-health-badge {
  min-width: 54px;
  padding: 0.28rem 0.55rem;
}

#admin-section .support-health-badge.positive,
#admin-section .admin-ops-badge.positive,
#admin-section .admin-support-issue.positive {
  border-color: rgba(104, 255, 183, 0.45);
  color: #9dffd0;
  background: rgba(55, 206, 129, 0.16);
}

#admin-section .support-health-badge.warning,
#admin-section .admin-ops-badge.warning,
#admin-section .admin-support-issue.warning {
  border-color: rgba(255, 199, 107, 0.45);
  color: #ffdc93;
  background: rgba(255, 185, 78, 0.16);
}

#admin-section .support-health-badge.negative,
#admin-section .admin-ops-badge.negative,
#admin-section .admin-support-issue.negative {
  border-color: rgba(255, 120, 120, 0.46);
  color: #ffb1b1;
  background: rgba(255, 96, 96, 0.16);
}

#admin-section .admin-support-system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

#admin-section .admin-ops-panel {
  border-radius: 22px;
  padding: 1rem;
  min-height: 220px;
}

#admin-section .admin-ops-panel--score {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#admin-section .admin-ops-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

#admin-section .admin-ops-badge {
  padding: 0.22rem 0.55rem;
}

#admin-section .admin-ops-score {
  color: #ffffff;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.95;
  text-shadow: 0 12px 40px rgba(1, 153, 198, 0.28);
}

#admin-section .admin-ops-panel--score p {
  margin: 0.6rem 0 0;
  color: rgba(255, 255, 255, 0.68);
}

#admin-section .admin-ops-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 330px;
  overflow: auto;
  padding-right: 0.1rem;
}

#admin-section .admin-ops-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.72rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#admin-section .admin-ops-row.positive {
  border-color: rgba(104, 255, 183, 0.24);
}

#admin-section .admin-ops-row.warning {
  border-color: rgba(255, 199, 107, 0.3);
}

#admin-section .admin-ops-row.negative {
  border-color: rgba(255, 120, 120, 0.32);
}

#admin-section .admin-ops-row strong {
  display: block;
  color: #ffffff;
  font-size: 0.82rem;
  margin-bottom: 0.18rem;
}

#admin-section .admin-ops-row span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.74rem;
  line-height: 1.35;
}

#admin-section .admin-ops-row em {
  align-self: flex-start;
  color: #9de8ff;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

#admin-section .admin-ops-empty,
#admin-section .admin-support-detail-empty {
  color: rgba(255, 255, 255, 0.56);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}

#admin-section .admin-support-detail {
  border-radius: 24px;
  padding: 1.1rem;
  margin-top: 1rem;
}

#admin-section .admin-support-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

#admin-section .admin-support-detail-header h3 {
  margin: 0.15rem 0 0.2rem;
  color: #ffffff;
  font-size: 1.25rem;
}

#admin-section .admin-support-detail-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
}

#admin-section .admin-support-dossier-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

#admin-section .admin-support-dossier-grid div {
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#admin-section .admin-support-dossier-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

#admin-section .admin-support-dossier-grid strong {
  color: #ffffff;
  font-size: 0.9rem;
}

#admin-section .admin-support-dossier-grid strong.positive {
  color: #9dffd0;
}

#admin-section .admin-support-dossier-grid strong.warning {
  color: #ffdc93;
}

#admin-section .admin-support-dossier-grid strong.negative {
  color: #ffb1b1;
}

#admin-section .admin-support-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

#admin-section .admin-support-issue {
  padding: 0.3rem 0.58rem;
}

#admin-section .admin-support-detail-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

#admin-section .admin-support-detail-columns h4 {
  margin: 0 0 0.65rem;
  color: #ffffff;
}

#admin-section .admin-support-timeline,
#admin-section .admin-support-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#admin-section .admin-support-timeline-item,
#admin-section .admin-support-note {
  position: relative;
  padding: 0.78rem 0.85rem 0.78rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#admin-section .admin-support-timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 4px;
  height: calc(100% - 1.7rem);
  border-radius: 99px;
  background: rgba(1, 153, 198, 0.8);
}

#admin-section .admin-support-timeline-item.positive::before {
  background: #58a306;
}

#admin-section .admin-support-timeline-item.warning::before {
  background: #ffc76b;
}

#admin-section .admin-support-timeline-item.negative::before {
  background: #ff7777;
}

#admin-section .admin-support-timeline-item strong,
#admin-section .admin-support-note p {
  display: block;
  margin: 0 0 0.2rem;
  color: #ffffff;
  font-size: 0.82rem;
}

#admin-section .admin-support-timeline-item span,
#admin-section .admin-support-timeline-item small,
#admin-section .admin-support-note small {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
}

#admin-section .admin-support-note-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

#admin-section .admin-support-note-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 86px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.22);
  padding: 0.75rem;
  font: inherit;
  outline: none;
}

#admin-section .admin-support-note-form textarea:focus {
  border-color: rgba(1, 153, 198, 0.65);
  box-shadow: 0 0 0 4px rgba(1, 153, 198, 0.12);
}

#admin-section .admin-support-note-form button {
  align-self: flex-start;
  padding: 0.55rem 0.9rem;
}

#admin-section #admin-support-note-status {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

@media (max-width: 1180px) {
  #admin-section .admin-users-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #admin-section .admin-support-system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #admin-section .admin-support-dossier-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  #admin-section .admin-support-hero,
  #admin-section .admin-support-detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  #admin-section .admin-support-system-grid,
  #admin-section .admin-users-cards,
  #admin-section .admin-support-detail-columns {
    grid-template-columns: 1fr;
  }

  #admin-section .admin-support-dossier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#admin-section td.positive {
  color: #7dffb6;
  font-weight: 600;
}

#admin-section td.negative {
  color: #ff8b8b;
  font-weight: 600;
}

#admin-section .admin-section-title {
  color: #ffffff;
  font-size: 1.1rem;
  margin: 0 0 1rem 0;
}

#admin-section .admin-settings-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(100, 255, 218, 0.18), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(1, 153, 198, 0.28), transparent 32%),
    linear-gradient(145deg, rgba(8, 15, 30, 0.96), rgba(10, 18, 34, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

#admin-section .admin-settings-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.08) 48%, transparent 56% 100%);
  opacity: 0.42;
}

#admin-section .admin-settings-hero h2 {
  margin: 0.12rem 0 0.22rem;
  color: #ffffff;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

#admin-section .admin-settings-hero p {
  margin: 0;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
  line-height: 1.5;
}

#admin-section .admin-settings-hero-orb {
  position: relative;
  z-index: 1;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  font-size: 2.35rem;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.34), transparent 22%),
    linear-gradient(135deg, rgba(100, 255, 218, 0.24), rgba(1, 153, 198, 0.32));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 42px rgba(1, 153, 198, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#admin-section .admin-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 1rem;
  align-items: stretch;
}

#admin-section .admin-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* Admin trial settings card */
.admin-settings-card {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  background:
    radial-gradient(circle at 0% 10%, rgba(88, 163, 6, 0.18), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(1, 153, 198, 0.28), transparent 36%),
    linear-gradient(145deg, rgba(12, 18, 34, 0.96), rgba(8, 12, 25, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  padding: 1.15rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.admin-settings-card::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.admin-settings-card-glow {
  position: absolute;
  right: -80px;
  top: -100px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(100, 255, 218, 0.26), transparent 62%);
  filter: blur(6px);
  pointer-events: none;
}

.admin-settings-card-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.admin-settings-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 16px;
  font-size: 1.45rem;
  line-height: 1;
  background: linear-gradient(135deg, rgba(100, 255, 218, 0.24), rgba(1, 153, 198, 0.22));
  border: 1px solid rgba(100, 255, 218, 0.26);
  box-shadow: 0 14px 30px rgba(1, 153, 198, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.admin-settings-eyebrow {
  display: block;
  margin-bottom: 0.18rem;
  color: #7ee7ff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-settings-card-title {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.admin-settings-card-desc {
  margin: 0.26rem 0 0;
  max-width: 620px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.48;
}

.admin-settings-badge {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.66rem;
  border-radius: 999px;
  color: #9dffd0;
  background: rgba(55, 206, 129, 0.14);
  border: 1px solid rgba(104, 255, 183, 0.34);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.admin-trial-preview-card {
  position: relative;
  z-index: 1;
  margin: 0.4rem 0 1rem;
  padding: 1rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 16%, rgba(100, 255, 218, 0.22), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 16px 36px rgba(0, 0, 0, 0.18);
}

.admin-trial-preview-label,
.admin-trial-preview-card small {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-trial-preview-card strong {
  display: block;
  margin: 0.2rem 0 0.24rem;
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: -0.07em;
  text-shadow: 0 16px 44px rgba(100, 255, 218, 0.22);
}

.admin-trial-preview-card small {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.admin-trial-inputs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0.7rem;
}

.admin-trial-unit {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.42rem;
  padding: 0.78rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.admin-trial-unit input {
  width: 100%;
  min-width: 0;
  background: rgba(5, 10, 22, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0.68rem 0.52rem;
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: -0.04em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.admin-trial-unit input::-webkit-outer-spin-button,
.admin-trial-unit input::-webkit-inner-spin-button {
  margin: 0;
}

.admin-trial-unit input:focus {
  border-color: rgba(100, 255, 218, 0.58);
  outline: none;
  background: rgba(7, 14, 28, 0.92);
  box-shadow: 0 0 0 4px rgba(100, 255, 218, 0.1), 0 14px 28px rgba(1, 153, 198, 0.14);
}

.admin-trial-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 900;
}

.admin-trial-unit small {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.admin-trial-sep {
  display: none;
  font-size: 1.3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  margin: 0 0.1rem;
  padding-bottom: 1rem;
}

.admin-trial-meta-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.admin-trial-meta-grid div,
.admin-settings-insight {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.admin-trial-meta-grid div {
  padding: 0.75rem 0.82rem;
}

.admin-trial-meta-grid span,
.admin-settings-insight span {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.24rem;
}

.admin-trial-meta-grid strong {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
}

.admin-trial-note {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  background: rgba(1, 153, 198, 0.12);
  border: 1px solid rgba(126, 231, 255, 0.18);
}

.admin-trial-note p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-settings-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

#admin-section #admin-settings-save {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.18rem;
  background: linear-gradient(135deg, #0199c6, #58a306);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 34px rgba(1, 153, 198, 0.26);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#admin-section #admin-settings-save:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 20px 42px rgba(88, 163, 6, 0.26);
}

.admin-settings-insights {
  display: grid;
  gap: 0.72rem;
}

.admin-settings-insight {
  position: relative;
  overflow: hidden;
  padding: 0.92rem 1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(1, 153, 198, 0.14), transparent 38%),
    rgba(12, 16, 30, 0.9);
}

.admin-settings-insight::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.9rem;
  width: 4px;
  height: calc(100% - 1.8rem);
  border-radius: 99px;
  background: linear-gradient(180deg, #0199c6, #58a306);
}

.admin-settings-insight span {
  color: #7ee7ff;
}

.admin-settings-insight strong {
  display: block;
  color: #ffffff;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.admin-settings-insight p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  line-height: 1.45;
}

#admin-section .admin-settings-status {
  min-height: 1em;
  font-size: 0.78rem;
  font-weight: 800;
}

#admin-section .admin-settings-status.success {
  color: #7dffb6;
}

#admin-section .admin-settings-status.error {
  color: #ff8b8b;
}

@media (max-width: 980px) {
  #admin-section .admin-settings-layout {
    grid-template-columns: 1fr;
  }

  #admin-section .admin-settings-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  #admin-section .admin-settings-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  #admin-section .admin-settings-hero-orb {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 1.85rem;
  }

  .admin-settings-card-header,
  .admin-settings-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-settings-badge {
    margin-left: 0;
  }

  .admin-trial-inputs,
  .admin-trial-meta-grid,
  #admin-section .admin-settings-insights {
    grid-template-columns: 1fr;
  }
}

/* Compact corrective pass for Admin trial settings */
#admin-section .admin-view--settings {
  text-align: left;
}

#admin-section .admin-view--settings .admin-settings-hero {
  min-height: auto;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.78rem 0.95rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 0%, rgba(126, 231, 255, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(8, 15, 30, 0.96), rgba(10, 18, 34, 0.88));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#admin-section .admin-view--settings .admin-settings-hero::after {
  opacity: 0.16;
}

#admin-section .admin-view--settings .admin-settings-hero h2 {
  margin: 0.08rem 0 0.12rem;
  font-size: clamp(1.08rem, 1.45vw, 1.34rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

#admin-section .admin-view--settings .admin-settings-hero p {
  max-width: 660px;
  font-size: 0.76rem;
  line-height: 1.38;
}

#admin-section .admin-view--settings .admin-settings-hero-orb {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  font-size: 1.35rem;
  box-shadow: 0 10px 24px rgba(1, 153, 198, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

#admin-section .admin-view--settings .admin-settings-layout {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 0.75rem;
  align-items: start;
}

#admin-section .admin-view--settings .admin-settings-form {
  gap: 0.75rem;
}

#admin-section .admin-view--settings .admin-settings-card {
  min-height: auto;
  border-radius: 18px;
  padding: 0.86rem;
  background:
    radial-gradient(circle at 0 0, rgba(88, 163, 6, 0.16), transparent 30%),
    radial-gradient(circle at 100% 0, rgba(1, 153, 198, 0.17), transparent 32%),
    linear-gradient(145deg, rgba(12, 18, 34, 0.96), rgba(8, 12, 25, 0.93));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#admin-section .admin-view--settings .admin-settings-card--trial {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(158px, 190px);
  grid-template-areas:
    "header header"
    "inputs preview"
    "note note"
    "actions actions";
  gap: 0.56rem 0.65rem;
  align-items: stretch;
}

#admin-section .admin-view--settings .admin-settings-card--flags {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.56rem;
  align-items: stretch;
}

#admin-section .admin-view--settings .admin-settings-card--flags .admin-settings-card-header,
#admin-section .admin-view--settings .admin-settings-card--flags .admin-flag-row,
#admin-section .admin-view--settings .admin-settings-card--flags .admin-settings-actions {
  grid-area: auto;
}

#admin-section .admin-view--settings .admin-settings-card-glow {
  width: 150px;
  height: 150px;
  right: -54px;
  top: -66px;
  opacity: 0.72;
}

#admin-section .admin-view--settings .admin-settings-card-header {
  grid-area: header;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.58rem;
  margin-bottom: 0;
}

#admin-section .admin-view--settings .admin-settings-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 1rem;
}

#admin-section .admin-view--settings .admin-settings-eyebrow {
  margin-bottom: 0.12rem;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
}

#admin-section .admin-view--settings .admin-settings-card-title {
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

#admin-section .admin-view--settings .admin-settings-card-desc {
  max-width: 560px;
  margin-top: 0.16rem;
  font-size: 0.68rem;
  line-height: 1.3;
}

#admin-section .admin-view--settings .admin-settings-badge {
  padding: 0.24rem 0.5rem;
  font-size: 0.62rem;
}

#admin-section .admin-view--settings .admin-trial-preview-card {
  grid-area: preview;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "label"
    "value"
    "subtitle";
  align-content: center;
  justify-items: end;
  text-align: right;
  min-height: 0;
  height: 100%;
  column-gap: 0;
  row-gap: 0.08rem;
  margin: 0;
  padding: 0.56rem 0.64rem;
  border-radius: 15px;
}

#admin-section .admin-view--settings .admin-trial-preview-label {
  grid-area: label;
  font-size: 0.62rem;
}

#admin-section .admin-view--settings .admin-trial-preview-card strong {
  grid-area: value;
  margin: 0;
  font-size: clamp(1.25rem, 2.1vw, 1.78rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

#admin-section .admin-view--settings .admin-trial-preview-card small {
  grid-area: subtitle;
  font-size: 0.64rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-transform: none;
}

#admin-section .admin-view--settings .admin-trial-inputs {
  grid-area: inputs;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 0.42rem;
}

#admin-section .admin-view--settings .admin-trial-unit {
  gap: 0.24rem;
  padding: 0.42rem;
  border-radius: 13px;
}

#admin-section .admin-view--settings .admin-trial-unit input {
  min-height: 34px;
  padding: 0.34rem 0.38rem;
  border-radius: 10px;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

#admin-section .admin-view--settings .admin-trial-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

#admin-section .admin-view--settings .admin-trial-unit small {
  font-size: 0.6rem;
}

#admin-section .admin-view--settings .admin-settings-insight span {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

#admin-section .admin-view--settings .admin-trial-note {
  grid-area: note;
  gap: 0.5rem;
  margin-top: 0;
  padding: 0.5rem 0.62rem;
  border-radius: 14px;
}

#admin-section .admin-view--settings .admin-trial-note p {
  font-size: 0.68rem;
  line-height: 1.35;
}

#admin-section .admin-view--settings .admin-flag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.64rem 0.7rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(34, 51, 82, 0.58), rgba(20, 31, 54, 0.56));
  border: 1px solid rgba(126, 228, 255, 0.12);
  cursor: pointer;
}

#admin-section .admin-view--settings .admin-flag-copy strong {
  display: block;
  color: rgba(248, 251, 255, 0.98);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#admin-section .admin-view--settings .admin-flag-copy p {
  margin: 0.16rem 0 0;
  color: rgba(214, 227, 241, 0.72);
  font-size: 0.65rem;
  line-height: 1.34;
}

#admin-section .admin-view--settings .admin-flag-control {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  justify-self: end;
}

#admin-section .admin-view--settings .admin-flag-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#admin-section .admin-view--settings .admin-flag-slider {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(109, 128, 152, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.26);
  transition: background 0.18s ease, border-color 0.18s ease;
}

#admin-section .admin-view--settings .admin-flag-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease;
}

#admin-section .admin-view--settings .admin-flag-control input:checked + .admin-flag-slider {
  background: linear-gradient(135deg, rgba(0, 166, 255, 0.82), rgba(54, 245, 154, 0.72));
  border-color: rgba(126, 228, 255, 0.28);
}

#admin-section .admin-view--settings .admin-flag-control input:checked + .admin-flag-slider::before {
  transform: translateX(20px);
}

#admin-section .admin-view--settings .admin-flag-chip {
  min-width: 42px;
  padding: 0.28rem 0.48rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(223, 232, 242, 0.82);
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-align: center;
}

#admin-section .admin-view--settings .admin-flag-chip.is-active,
#admin-section .admin-view--settings .admin-flag-control input:checked + .admin-flag-slider + .admin-flag-chip {
  background: rgba(54, 245, 154, 0.14);
  color: #75ffc0;
}

.global-construction-notice {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: min(calc(100vw - 28px), 520px);
  padding: 0.48rem 0.8rem;
  border: 1px solid rgba(255, 92, 92, 0.34);
  border-radius: 999px;
  background: rgba(34, 7, 7, 0.82);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  color: #ff8f8f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  pointer-events: none;
}

#admin-section .admin-view--settings .admin-settings-actions {
  grid-area: actions;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
  margin-top: 0.72rem;
  gap: 0.56rem;
  margin-top: 0;
}

#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags) {
  position: relative;
  min-height: 44px;
  min-width: 176px;
  padding: 0.82rem 1.18rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  color: #f7fbff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow:
    0 16px 34px rgba(4, 10, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    filter 180ms ease;
}

#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags)::before,
#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags)::before {
  inset: 1px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 58%);
  z-index: -1;
}

#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags)::after {
  top: -42%;
  left: -26%;
  width: 58%;
  height: 190%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  transform: rotate(18deg);
  opacity: 0.72;
}

#admin-section .admin-view--settings #admin-settings-save-trial {
  background:
    radial-gradient(circle at top left, rgba(115, 255, 210, 0.28), rgba(115, 255, 210, 0) 36%),
    linear-gradient(135deg, #16394d 0%, #102334 52%, #0b1724 100%);
  border-color: rgba(117, 255, 192, 0.28);
}

#admin-section .admin-view--settings #admin-settings-save-flags {
  background:
    radial-gradient(circle at top left, rgba(255, 188, 92, 0.3), rgba(255, 188, 92, 0) 36%),
    linear-gradient(135deg, #4d2616 0%, #30170f 52%, #1a1212 100%);
  border-color: rgba(255, 183, 92, 0.3);
}

#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags):hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 22px 40px rgba(4, 10, 24, 0.44),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  filter: saturate(1.08);
}

#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags):hover::after {
  transform: translateX(26%) rotate(18deg);
}

#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags):active {
  transform: translateY(0);
  box-shadow:
    0 12px 24px rgba(4, 10, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags):focus-visible {
  outline: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 4px rgba(120, 218, 255, 0.22),
    0 18px 36px rgba(4, 10, 24, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#admin-section .admin-view--settings #admin-settings-save {
  min-height: 36px;
  padding: 0.5rem 0.86rem;
  font-size: 0.76rem;
}

#admin-section .admin-view--settings .admin-settings-status {
  font-size: 0.7rem;
}

#admin-section .admin-view--settings .admin-settings-insights {
  gap: 0.55rem;
}

#admin-section .admin-view--settings .admin-settings-insight {
  padding: 0.7rem 0.78rem 0.7rem 0.92rem;
  border-radius: 15px;
}

#admin-section .admin-view--settings .admin-settings-insight::before {
  top: 0.7rem;
  height: calc(100% - 1.4rem);
}

#admin-section .admin-view--settings .admin-settings-insight strong {
  font-size: 0.78rem;
  margin-bottom: 0.18rem;
}

#admin-section .admin-view--settings .admin-settings-insight p {
  font-size: 0.66rem;
  line-height: 1.34;
}

@media (max-width: 960px) {
  #admin-section .admin-view--settings .admin-settings-layout {
    grid-template-columns: 1fr;
  }

  #admin-section .admin-view--settings .admin-settings-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #admin-section .admin-view--settings .admin-settings-hero {
    flex-direction: row;
    align-items: center;
    padding: 0.72rem;
  }

  #admin-section .admin-view--settings .admin-settings-hero-orb {
    display: none;
  }

  #admin-section .admin-view--settings .admin-settings-card-header {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  #admin-section .admin-view--settings .admin-settings-badge {
    grid-column: 2;
    justify-self: flex-start;
    margin-left: 0;
  }
}

@media (min-width: 431px) and (max-width: 640px) {
  #admin-section .admin-view--settings .admin-settings-card-header {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  #admin-section .admin-view--settings .admin-settings-badge {
    grid-column: auto;
    justify-self: end;
  }
}

@media (max-width: 430px) {
  #admin-section .admin-view--settings .admin-settings-hero {
    align-items: flex-start;
  }

  #admin-section .admin-view--settings .admin-settings-card {
    padding: 0.78rem;
  }

  #admin-section .admin-view--settings .admin-settings-card--trial {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "preview"
      "inputs"
      "note"
      "actions";
  }

  #admin-section .admin-view--settings .admin-trial-preview-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "value"
      "subtitle";
    justify-items: start;
    text-align: left;
  }

  #admin-section .admin-view--settings .admin-trial-inputs,
  #admin-section .admin-view--settings .admin-settings-insights {
    grid-template-columns: 1fr;
  }

  #admin-section .admin-view--settings .admin-settings-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  #admin-section .admin-view--settings :is(#admin-settings-save-trial, #admin-settings-save-flags) {
    width: 100%;
    justify-content: center;
  }

  .global-construction-notice {
    top: max(10px, env(safe-area-inset-top));
    max-width: calc(100vw - 18px);
    padding: 0.44rem 0.7rem;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 640px) {
  #admin-section .admin-view--settings .admin-flag-row {
    grid-template-columns: 1fr;
  }

  #admin-section .admin-view--settings .admin-flag-control {
    justify-self: stretch;
    justify-content: space-between;
  }
}

/* ===== Settings Page ===== */
#settings-section .settings-page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#settings-section {
  --settings-soft-white: rgba(255, 255, 255, 0.85);
}

#settings-section .settings-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  scroll-margin-top: calc(var(--app-navbar-offset) + 8px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

#settings-section .settings-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 1rem;
}

#settings-section .settings-summary {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

#settings-section .settings-card summary::-webkit-details-marker {
  display: none;
}

#settings-section .settings-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--settings-soft-white);
}

#settings-section .settings-sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.2rem;
}

#account-settings-card .settings-sub,
#download-data-card .settings-sub,
#fi-metrics-formulas-card .settings-sub {
  display: none;
}

#account-settings-card[open] .settings-sub,
#download-data-card[open] .settings-sub,
#fi-metrics-formulas-card[open] .settings-sub {
  display: block;
}

#settings-section .settings-chevron {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--settings-soft-white);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

#settings-section details[open] .settings-chevron {
  transform: rotate(180deg);
}

#settings-section .settings-content {
  margin-top: 0.75rem;
}

#settings-section #download-data-card[open] {
  padding-bottom: 0.55rem;
}

#settings-section #download-data-card .settings-content {
  margin-top: 0.35rem;
}

#settings-section .settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

#settings-section .fi-formulas-card {
  border-color: rgba(122, 200, 255, 0.24);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(122, 200, 255, 0.05) inset;
}

#settings-section .fi-formula-library {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#settings-section .fi-formula-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1rem;
  align-items: end;
  padding: 1.25rem;
  border-radius: 22px;
  border: 1px solid rgba(127, 230, 255, 0.18);
  background:
    radial-gradient(circle at top right, rgba(100, 255, 218, 0.16), transparent 38%),
    radial-gradient(circle at bottom left, rgba(122, 200, 255, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(6, 14, 28, 0.96), rgba(12, 22, 40, 0.86));
}

#settings-section .fi-formula-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.06), transparent 68%);
  pointer-events: none;
}

#settings-section .fi-formula-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(127, 230, 255, 0.24);
  background: rgba(7, 18, 35, 0.82);
  color: #9fe8ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#settings-section .fi-formula-hero h3 {
  margin: 0.75rem 0 0;
  color: var(--settings-soft-white);
  font-size: 1.3rem;
  line-height: 1.2;
}

#settings-section .fi-formula-hero p {
  margin: 0;
  color: rgba(228, 239, 252, 0.8);
  font-size: 0.86rem;
  line-height: 1.7;
}

#settings-section .fi-formula-coverage {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

#settings-section .fi-formula-coverage-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(18, 24, 39, 0.86), rgba(9, 14, 24, 0.96));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

#settings-section .fi-formula-coverage-kicker {
  color: #7fe6ff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#settings-section .fi-formula-coverage-card h4 {
  margin: 0;
  color: var(--settings-soft-white);
  font-size: 0.9rem;
  line-height: 1.35;
}

#settings-section .fi-formula-coverage-card p {
  margin: 0;
  color: rgba(225, 234, 246, 0.76);
  font-size: 0.76rem;
  line-height: 1.55;
}

#settings-section .fi-formula-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

#settings-section .fi-formula-legend-item {
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  color: rgba(236, 242, 250, 0.86);
  font-size: 0.77rem;
  line-height: 1.45;
}

#settings-section .fi-formula-section {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(7, 12, 24, 0.82), rgba(16, 21, 36, 0.68));
}

#settings-section .fi-formula-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.95rem;
}

#settings-section .fi-formula-section-kicker {
  color: #7fe6ff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#settings-section .fi-formula-section-head h4 {
  margin: 0;
  color: var(--settings-soft-white);
  font-size: 1rem;
}

#settings-section .fi-formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

#settings-section .fi-formula-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 100%;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(127, 230, 255, 0.08), transparent 34%),
    linear-gradient(145deg, rgba(20, 26, 42, 0.9), rgba(8, 12, 22, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

#settings-section .fi-formula-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

#settings-section .fi-formula-card--wide {
  grid-column: span 2;
}

#settings-section .fi-formula-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

#settings-section .fi-formula-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--settings-soft-white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

#settings-section .fi-formula-chip--dashboard {
  background: rgba(122, 200, 255, 0.14);
  color: #9fe8ff;
}

#settings-section .fi-formula-chip--profile {
  background: rgba(100, 255, 218, 0.12);
  color: #96ffe0;
}

#settings-section .fi-formula-chip--projection {
  background: rgba(255, 193, 7, 0.12);
  color: #ffd86d;
}

#settings-section .fi-formula-chip--global {
  background: rgba(255, 122, 162, 0.12);
  color: #ffb4ca;
}

#settings-section .fi-formula-chip--percent,
#settings-section .fi-formula-chip--annual,
#settings-section .fi-formula-chip--cashflow,
#settings-section .fi-formula-chip--warning,
#settings-section .fi-formula-chip--input,
#settings-section .fi-formula-chip--target {
  color: rgba(235, 242, 255, 0.88);
}

#settings-section .fi-formula-card h5 {
  margin: 0;
  color: var(--settings-soft-white);
  font-size: 1rem;
  line-height: 1.3;
}

#settings-section .fi-formula-copy,
#settings-section .fi-formula-note {
  margin: 0;
  color: rgba(222, 231, 245, 0.78);
  font-size: 0.8rem;
  line-height: 1.6;
}

#settings-section .fi-formula-note {
  color: rgba(159, 232, 255, 0.8);
}

#settings-section .fi-formula-stack {
  display: grid;
  gap: 0.65rem;
}

#settings-section .fi-formula-item {
  display: grid;
  gap: 0.35rem;
}

#settings-section .fi-formula-item-label {
  color: var(--settings-soft-white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#settings-section .fi-formula-equation {
  padding: 0.78rem 0.88rem;
  border-radius: 14px;
  border: 1px solid rgba(127, 230, 255, 0.16);
  background: rgba(4, 10, 20, 0.82);
  color: var(--settings-soft-white);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.76rem;
  line-height: 1.65;
  word-break: break-word;
}

#settings-section .fi-formula-glossary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

#settings-section .fi-formula-glossary span {
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(235, 241, 250, 0.78);
  font-size: 0.72rem;
  line-height: 1.35;
}

#settings-section .settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

@media (max-width: 980px) {
  #settings-section .fi-formula-coverage,
  #settings-section .fi-formula-hero,
  #settings-section .fi-formula-grid {
    grid-template-columns: 1fr;
  }

  #settings-section .fi-formula-card--wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  #settings-section .fi-formula-section,
  #settings-section .fi-formula-card,
  #settings-section .fi-formula-hero {
    padding: 0.9rem;
  }

  #settings-section .fi-formula-legend {
    grid-template-columns: 1fr;
  }

  #settings-section .fi-formula-hero h3 {
    font-size: 1.08rem;
  }
}

#settings-section .settings-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 0.6rem;
}

#settings-section .settings-row label {
  color: var(--settings-soft-white);
  font-size: 0.78rem;
}

#settings-section .settings-row input,
#settings-section .settings-row select {
  background: rgba(12, 14, 26, 0.9);
  color: var(--settings-soft-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
}

#settings-section .settings-row select,
#settings-section .settings-row select option,
.country-select,
.country-select option {
  background: #0b1220;
  color: #c7c9d1;
}

#settings-section .settings-row--inline {
  align-items: center;
}

#settings-section .settings-inline {
  display: grid;
  grid-template-columns: 140px minmax(0, 180px);
  gap: 0.5rem;
  max-width: 340px;
  align-items: center;
}

#settings-section .settings-inline input {
  width: 100%;
  max-width: 180px;
}

#settings-section .settings-edit-btn {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.4rem 1.2rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7ac8ff, #6b7bff);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(103, 132, 255, 0.35);
}

#settings-section .settings-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

#settings-section .settings-action-btn {
  align-self: flex-start;
  padding: 0.4rem 1.2rem;
  border-radius: 10px;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#settings-section .settings-action-btn.save,
#settings-section .settings-action-btn.edit {
  box-shadow: 0 8px 18px rgba(103, 132, 255, 0.35);
}

#settings-section .settings-action-btn.save {
  background: linear-gradient(135deg, #7ac8ff, #6b7bff);
  box-shadow: 0 8px 18px rgba(103, 132, 255, 0.35);
}

#settings-section .settings-action-btn.edit {
  background: linear-gradient(135deg, #36b8b0, #21837f);
  box-shadow: 0 8px 18px rgba(33, 131, 127, 0.26);
}

#settings-section .settings-action-btn.cancel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

#settings-section .settings-action-btn.edit,
#settings-section .settings-action-btn.cancel {
  display: none;
}

#settings-section .settings-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  justify-content: center;
}

#platform-settings-card .settings-action-btn {
  padding: 0.5rem 1.15rem;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 217, 255, 0.3);
  background: rgba(0, 217, 255, 0.15);
  color: #00d9ff;
  box-shadow: none;
  transition: all 0.3s ease;
}

#platform-settings-card .settings-action-btn.save,
#platform-settings-card .settings-action-btn.edit,
#platform-settings-card .settings-action-btn.cancel {
  border: 1.5px solid rgba(0, 217, 255, 0.3);
  background: rgba(0, 217, 255, 0.15);
  color: #00d9ff;
  box-shadow: none;
}

#platform-settings-card .settings-action-btn:hover {
  background: rgba(0, 217, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.5);
}

#platform-settings-card .settings-action-btn.save:hover,
#platform-settings-card .settings-action-btn.edit:hover,
#platform-settings-card .settings-action-btn.cancel:hover {
  background: rgba(0, 217, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.5);
}

#platform-settings-card .settings-action-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.18), 0 0 12px rgba(0, 217, 255, 0.3);
}

#settings-investing-result {
  display: none;
}

#settings-section .settings-meta-item.muted {
  color: rgba(255, 255, 255, 0.6);
}

#settings-section .settings-placeholder {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  margin: 0.2rem 0 0.4rem 0;
}

/* ── Contact Form ── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 520px;
}

.contact-form-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 0.6rem;
}

.contact-form-row--full {
  grid-template-columns: 100px 1fr;
  align-items: start;
}

.contact-form-row label {
  color: var(--settings-soft-white);
  font-size: 0.78rem;
  white-space: nowrap;
}

.contact-form-row input,
.contact-form-row select,
.contact-form-row textarea {
  background: rgba(12, 14, 26, 0.9);
  color: var(--settings-soft-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.contact-form-row input:focus,
.contact-form-row select:focus,
.contact-form-row textarea:focus {
  outline: none;
  border-color: rgba(122, 200, 255, 0.6);
}

.contact-form-row select,
.contact-form-row select option {
  background: #0b1220;
  color: #c7c9d1;
}

.contact-form-row textarea {
  resize: vertical;
  min-height: 80px;
}

.contact-form-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.25rem;
  padding-left: calc(100px + 0.6rem);
}

.contact-form-status {
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
  padding-left: calc(100px + 0.6rem);
}

.contact-form-status.success {
  color: #6be08a;
}

.contact-form-status.error {
  color: #ff6b6b;
}

#settings-section #contact-submit-btn.settings-action-btn.save {
  padding: 0.5rem 1.15rem;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 217, 255, 0.3);
  background: rgba(0, 217, 255, 0.15);
  color: #00d9ff;
  box-shadow: none;
  transition: all 0.3s ease;
}

#settings-section #contact-submit-btn.settings-action-btn.save:hover {
  background: rgba(0, 217, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.5);
}

#settings-section #contact-submit-btn.settings-action-btn.save:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.18), 0 0 12px rgba(0, 217, 255, 0.3);
}

/* ── Contact Confirmation Dialog ── */
.contact-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.contact-confirm-overlay.visible {
  opacity: 1;
}

.contact-confirm-dialog {
  background: linear-gradient(135deg, rgba(28, 36, 52, 0.97), rgba(16, 20, 32, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 2rem 2.4rem;
  max-width: 420px;
  width: 90vw;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.contact-confirm-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #22c55e);
  color: #fff;
  font-size: 1.8rem;
  line-height: 56px;
  font-weight: 700;
}

.contact-confirm-title {
  color: var(--settings-soft-white);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.contact-confirm-body {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0 0 1.4rem;
}

.contact-confirm-btn {
  padding: 0.5rem 2.4rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7ac8ff, #6b7bff);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(103, 132, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.contact-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(103, 132, 255, 0.45);
}

#settings-section .chart-history-panel {
  background: linear-gradient(135deg, rgba(28, 36, 52, 0.9), rgba(20, 26, 38, 0.95));
  border-radius: 18px;
  padding: 1rem 1.2rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 40px rgba(0, 0, 0, 0.25);
}

.chart-history-controls {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr auto 1fr;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.chart-history-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-history-search input {
  background: transparent;
  border: none;
  color: var(--settings-soft-white);
  outline: none;
  width: 100%;
}

.chart-history-id-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-history-id-range input {
  width: 90px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--settings-soft-white);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
}

.range-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: var(--settings-soft-white);
  cursor: pointer;
}

.icon-btn.danger {
  background: rgba(244, 67, 54, 0.22);
  border-color: rgba(244, 67, 54, 0.4);
}

.icon-btn.active {
  background: rgba(255, 255, 255, 0.2);
}

.chart-history-reset {
  border: 1.5px solid rgba(255, 176, 32, 0.34);
  background: rgba(255, 176, 32, 0.14);
  color: #ffd48c;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.3s ease;
}

.chart-history-reset:hover {
  background: rgba(255, 176, 32, 0.22);
  box-shadow: 0 0 12px rgba(255, 176, 32, 0.28);
  border-color: rgba(255, 176, 32, 0.56);
}

.chart-history-reset:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 176, 32, 0.16), 0 0 12px rgba(255, 176, 32, 0.28);
}

.chart-history-date-range {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.date-pill {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.25rem 0.5rem;
}

.date-pill input {
  background: transparent;
  border: none;
  color: var(--settings-soft-white);
  outline: none;
}

.chart-history-table-wrap {
  max-height: 360px;
  overflow: auto;
  border-radius: 12px;
}

.chart-history-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--settings-soft-white);
}

.chart-history-empty-row td {
  padding: 1rem 0.75rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.62);
  font-style: italic;
}

.chart-history-table thead th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-weight: 400;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.chart-history-table tbody td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

.chart-history-table .chart-history-action {
  width: 32px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(244, 67, 54, 0.25);
  color: var(--settings-soft-white);
  cursor: pointer;
}

@media (max-width: 1100px) {
  .chart-history-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .chart-history-date-range {
    justify-content: flex-start;
  }
}

#settings-section .account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 1.2rem 1.8rem;
}

#settings-section .account-col {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

#settings-section .account-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  align-items: center;
  gap: 0.6rem;
}

#settings-section .account-row label {
  color: var(--settings-soft-white);
  font-size: 0.8rem;
}

#settings-section .account-row input {
  background: #1c1c1c;
  color: var(--settings-soft-white);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
}

#settings-section .account-row input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05);
}

#settings-section .account-row input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05);
}

#settings-section .account-row--password .account-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

#settings-section .account-eye {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1c1c1c;
  color: var(--settings-soft-white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#settings-section .account-eye:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#settings-section .account-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

#settings-section .account-btn {
  align-self: flex-start;
  border: none;
  border-radius: 10px;
  padding: 0.4rem 1.2rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#settings-section .account-btn.save {
  background: linear-gradient(135deg, #6a7cff, #8d6bff);
}

#settings-section .account-btn.edit {
  background: linear-gradient(135deg, #36b8b0, #21837f);
  box-shadow: 0 8px 18px rgba(33, 131, 127, 0.26);
}

#settings-section .account-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

#settings-section .account-btn.danger {
  background: linear-gradient(135deg, #d96d6d, #b95353);
  box-shadow: 0 8px 18px rgba(185, 83, 83, 0.24);
}

#account-settings-card .account-btn {
  align-self: flex-start;
  padding: 0.5rem 1.15rem;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 217, 255, 0.3);
  background: rgba(0, 217, 255, 0.15);
  color: #00d9ff;
  box-shadow: none;
  transition: all 0.3s ease;
}

#account-settings-card .account-btn.save,
#account-settings-card .account-btn.edit,
#account-settings-card .account-btn.cancel {
  border: 1.5px solid rgba(0, 217, 255, 0.3);
  background: rgba(0, 217, 255, 0.15);
  color: #00d9ff;
  box-shadow: none;
}

#account-settings-card .account-btn.save:hover,
#account-settings-card .account-btn.edit:hover,
#account-settings-card .account-btn.cancel:hover {
  background: rgba(0, 217, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.5);
}

#account-settings-card .account-btn.danger {
  border: 1.5px solid rgba(255, 92, 92, 0.32);
  background: rgba(255, 92, 92, 0.14);
  color: #ff7f7f;
  box-shadow: none;
}

#account-settings-card .account-btn.danger:hover {
  background: rgba(255, 92, 92, 0.22);
  box-shadow: 0 0 12px rgba(255, 92, 92, 0.34);
  border-color: rgba(255, 92, 92, 0.55);
}

#account-settings-card .account-btn:focus-visible {
  outline: none;
}

#account-settings-card .account-btn.save:focus-visible,
#account-settings-card .account-btn.edit:focus-visible,
#account-settings-card .account-btn.cancel:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.18), 0 0 12px rgba(0, 217, 255, 0.3);
}

#account-settings-card .account-btn.danger:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 92, 92, 0.18), 0 0 12px rgba(255, 92, 92, 0.34);
}

#settings-section .billing-settings-card {
  border-color: rgba(0, 217, 255, 0.18);
  background:
    radial-gradient(circle at top right, rgba(0, 217, 255, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
}

#settings-section .billing-panel {
  display: grid;
  gap: 0.95rem;
}

#settings-section .billing-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 0.9rem;
  align-items: stretch;
}

#settings-section .billing-hero {
  position: relative;
  overflow: hidden;
  min-height: 184px;
  padding: 1.08rem;
  border-radius: 16px;
  border: 1px solid rgba(127, 230, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(10, 29, 47, 0.96), rgba(9, 20, 34, 0.94) 52%, rgba(8, 34, 30, 0.9)),
    linear-gradient(145deg, rgba(6, 14, 28, 0.96), rgba(14, 22, 38, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 20px 48px rgba(0, 0, 0, 0.32);
  text-align: left;
}

#settings-section .billing-hero-glow {
  display: none;
}

#settings-section .billing-hero-top,
#settings-section .billing-hero-main {
  position: relative;
  z-index: 1;
}

#settings-section .billing-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.72rem;
}

#settings-section .billing-kicker,
#settings-section .billing-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#settings-section .billing-kicker {
  padding: 0.34rem 0.7rem;
  border: 1px solid rgba(127, 230, 255, 0.22);
  background: rgba(0, 217, 255, 0.1);
  color: #9fe8ff;
}

#settings-section .billing-status-pill {
  padding: 0.38rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(235, 242, 255, 0.9);
}

#settings-section .billing-status-pill.active,
#settings-section .billing-status-pill.paid,
#settings-section .billing-status-pill.trialing {
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.15);
  color: #7ef0bd;
}

#settings-section .billing-status-pill.canceling,
#settings-section .billing-status-pill.past_due {
  border-color: rgba(255, 193, 7, 0.36);
  background: rgba(255, 193, 7, 0.14);
  color: #ffd86d;
}

#settings-section .billing-status-pill.expired,
#settings-section .billing-status-pill.canceled,
#settings-section .billing-status-pill.unpaid,
#settings-section .billing-status-pill.error {
  border-color: rgba(255, 92, 92, 0.34);
  background: rgba(255, 92, 92, 0.14);
  color: #ff9c9c;
}

#settings-section .billing-status-pill.loading {
  border-color: rgba(0, 217, 255, 0.26);
  color: #9fe8ff;
}

#settings-section .billing-status-pill.free {
  border-color: rgba(127, 230, 255, 0.28);
  background: rgba(0, 217, 255, 0.1);
  color: #9fe8ff;
}

#settings-section .billing-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
}

#settings-section .billing-plan-copy {
  min-width: 0;
}

#settings-section .billing-hero-main h3 {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.18rem;
  line-height: 1.18;
}

#settings-section .billing-hero-main p {
  margin: 0.42rem 0 0;
  color: rgba(229, 238, 248, 0.76);
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 520px;
}

#settings-section .billing-price-block {
  min-width: 126px;
  padding: 0.62rem 0.78rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.24);
  text-align: right;
}

#settings-section .billing-price {
  display: block;
  color: #ffffff;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1;
}

#settings-section .billing-price-period {
  display: block;
  margin-top: 0.28rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.75rem;
  font-weight: 700;
}

#settings-section .billing-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

#settings-section .billing-detail-card {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 0.86rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(18, 24, 39, 0.82), rgba(8, 12, 22, 0.92));
  display: grid;
  align-content: start;
  gap: 0.38rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#settings-section .billing-detail-card[hidden] {
  display: none !important;
}

#settings-section .billing-detail-card--access {
  border-color: rgba(127, 230, 255, 0.22);
  background: linear-gradient(145deg, rgba(9, 30, 48, 0.9), rgba(6, 21, 31, 0.95));
}

#settings-section .billing-overview-grid > .billing-detail-card--access {
  min-height: 184px;
  padding: 1.08rem;
  align-content: center;
  gap: 0.52rem;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 42px rgba(0, 0, 0, 0.26);
}

#settings-section .billing-detail-card.is-active.billing-detail-card--access {
  border-color: rgba(52, 211, 153, 0.38);
  background: linear-gradient(145deg, rgba(9, 40, 39, 0.92), rgba(6, 21, 31, 0.96));
}

#settings-section .billing-detail-card.is-warning.billing-detail-card--access {
  border-color: rgba(255, 193, 7, 0.4);
  background: linear-gradient(145deg, rgba(52, 38, 12, 0.82), rgba(8, 12, 22, 0.94));
}

#settings-section .billing-detail-card.is-expired {
  border-color: rgba(255, 92, 92, 0.32);
  background: linear-gradient(145deg, rgba(48, 16, 22, 0.82), rgba(8, 12, 22, 0.94));
}

#settings-section .billing-detail-card.is-muted {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(18, 24, 39, 0.66), rgba(8, 12, 22, 0.86));
}

#settings-section .billing-detail-card.full-span {
  grid-column: 1 / -1;
  min-height: 86px;
}

#settings-section .billing-detail-label {
  color: rgba(159, 232, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#settings-section .billing-detail-card strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

#settings-section .billing-detail-card--access strong {
  font-size: 1.2rem;
  line-height: 1.18;
}

#settings-section .billing-detail-note {
  color: rgba(229, 238, 248, 0.68);
  font-size: 0.74rem;
  line-height: 1.45;
}

#settings-section .billing-alert {
  padding: 0.72rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 193, 7, 0.32);
  background: rgba(255, 193, 7, 0.12);
  color: #ffd86d;
  font-size: 0.78rem;
  line-height: 1.5;
}

#settings-section .billing-alert.error {
  border-color: rgba(255, 92, 92, 0.34);
  background: rgba(255, 92, 92, 0.12);
  color: #ff9c9c;
}

#settings-section .billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
  align-items: center;
}

#settings-section .billing-btn {
  min-height: 38px;
  padding: 0.54rem 1.05rem;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

#settings-section .billing-btn:hover {
  transform: translateY(-1px);
}

#settings-section .billing-btn:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

#settings-section .billing-btn.primary {
  color: #03121f;
  background: linear-gradient(135deg, #7fe6ff, #34d399);
  box-shadow: 0 10px 24px rgba(0, 217, 255, 0.22);
}

#settings-section .billing-btn.success {
  color: #052214;
  background: linear-gradient(135deg, #86efac, #22c55e);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.22);
}

#settings-section .billing-btn.ghost {
  color: #9fe8ff;
  border-color: rgba(0, 217, 255, 0.28);
  background: rgba(0, 217, 255, 0.1);
}

#settings-section .billing-btn.danger {
  color: #ff9c9c;
  border-color: rgba(255, 92, 92, 0.32);
  background: rgba(255, 92, 92, 0.12);
}

#settings-section .billing-btn.ghost:hover,
#settings-section .billing-btn.danger:hover {
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.16);
}

#settings-section .billing-footnotes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: rgba(229, 238, 248, 0.7);
  font-size: 0.74rem;
}

#settings-section .billing-footnotes span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  color: rgba(226, 255, 241, 0.86);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.16);
}

@media (max-width: 680px) {
  #settings-section .billing-overview-grid,
  #settings-section .billing-hero-main,
  #settings-section .billing-detail-grid {
    grid-template-columns: 1fr;
  }

  #settings-section .billing-hero,
  #settings-section .billing-overview-grid > .billing-detail-card--access {
    min-height: auto;
  }

  #settings-section .billing-price-block {
    text-align: left;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ===== My Profile Page ===== */
#profile-section .profile-page {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.2rem;
  align-items: start;
  margin-top: 0.75rem;
}

/* ===== FFI Global Cost-of-Living Bar ===== */
#profile-section .ffi-bar-wrap {
  grid-column: 1 / -1;
  position: relative;
  margin-top: -5mm;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(120,100,255,0.12) 50%, rgba(0,220,255,0.08) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 0.7rem 1rem 0.55rem;
  box-shadow:
    0 8px 32px rgba(31,38,135,0.37),
    inset 0 0 60px rgba(255,255,255,0.04),
    0 0 20px rgba(120,100,255,0.15);
  overflow: visible;
}

#profile-section .ffi-bar-title {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 0.42rem;
  letter-spacing: 0.03em;
  text-shadow: 0 0 12px rgba(127,230,255,0.4);
}

#profile-section .ffi-bar-track {
  display: flex;
  height: 22px;
  border-radius: 11px;
  margin-top: 1.55rem;
  overflow: visible;
  background: rgba(0,0,0,0.25);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.35),
    0 0 14px rgba(120,100,255,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  position: relative;
}

#profile-section .ffi-seg {
  height: 100%;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  border-right: 1px solid rgba(0,0,0,0.15);
}

#profile-section .ffi-bar-user-marker {
  z-index: 5;
}

#profile-section .ffi-seg:last-child { border-right: none; }

#profile-section .ffi-seg:hover {
  transform: scaleY(1.35);
  filter: brightness(1.3) saturate(1.2);
  z-index: 2;
  box-shadow: 0 0 10px rgba(255,255,255,0.25);
}

#profile-section .ffi-seg--active {
  box-shadow:
    0 0 8px rgba(127,230,255,0.7),
    inset 0 0 6px rgba(255,255,255,0.3);
  border: 1.5px solid rgba(127,230,255,0.9);
  z-index: 3;
  animation: ffi-pulse 2s ease-in-out infinite;
}

@keyframes ffi-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(127,230,255,0.7), inset 0 0 6px rgba(255,255,255,0.3); }
  50% { box-shadow: 0 0 18px rgba(127,230,255,0.9), inset 0 0 10px rgba(255,255,255,0.4); }
}

#profile-section .ffi-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.22rem;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
}

#profile-section .ffi-bar-tooltip {
  position: absolute;
  top: 2.28rem;
  left: 50%;
  transform: translate(-50%, -100%) translateY(2px);
  background: rgba(15,10,40,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(127,230,255,0.35);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  color: #e0f0ff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45), 0 0 12px rgba(127,230,255,0.2);
  z-index: 30;
}

#profile-section .ffi-bar-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) translateY(-2px);
}

#profile-section .ffi-progress-wrap {
  grid-column: 1 / -1;
  position: relative;
  margin-top: -0.5rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(130,255,195,0.08) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 0.7rem 1rem 0.6rem;
  box-shadow:
    0 10px 34px rgba(14, 38, 58, 0.34),
    inset 0 0 48px rgba(255,255,255,0.05),
    0 0 20px rgba(122,255,188,0.14);
}

#profile-section .ffi-progress-track {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 18px;
  border-radius: 999px;
  overflow: visible;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.18),
    0 0 14px rgba(122,255,188,0.08);
}

#profile-section .ffi-progress-seg {
  flex: 1;
  height: 100%;
  border-right: 1px solid rgba(255,255,255,0.12);
}

#profile-section .ffi-progress-seg:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

#profile-section .ffi-progress-seg:last-of-type {
  border-right: none;
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

#profile-section .ffi-progress-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.98), rgba(127,230,255,0.92) 48%, rgba(74,190,255,0.88) 100%);
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow:
    0 0 0 4px rgba(127,230,255,0.12),
    0 0 12px rgba(127,230,255,0.32),
    0 4px 8px rgba(0,0,0,0.24);
  z-index: 3;
  animation: ffi-progress-bumper 3.2s ease-in-out infinite;
}

#profile-section #ffi-progress-marker {
  width: 26px;
  height: 32px;
  top: 50%;
  margin-left: -13px;
  margin-top: -29px;
  transform: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter:
    drop-shadow(0 5px 8px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 3px rgba(52, 211, 153, 0.12));
  animation: ffi-progress-arrow-bumper 5.6s ease-in-out infinite;
  z-index: 4;
}

#profile-section .ffi-progress-marker--aux {
  width: 10px;
  height: 10px;
  border-width: 1.5px;
  animation: none;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.08),
    0 0 8px rgba(255,255,255,0.14),
    0 2px 4px rgba(0,0,0,0.18);
  z-index: 2;
}

#profile-section .ffi-progress-marker--essential {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.98), rgba(248,252,255,0.92) 52%, rgba(214,230,242,0.85) 100%);
  border-color: rgba(255,255,255,0.92);
}

#profile-section .ffi-progress-marker--rent {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.98), rgba(206,237,255,0.9) 50%, rgba(150,209,245,0.82) 100%);
  border-color: rgba(230,246,255,0.9);
}

#profile-section .ffi-progress-marker::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  width: 2px;
  height: 9px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(127,230,255,0.88));
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(127,230,255,0.28);
}

#profile-section #ffi-progress-marker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  right: auto;
  bottom: auto;
  width: 23px;
  height: 29px;
  transform: translateX(-50%);
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(113, 236, 165, 0.78) 0%, rgba(34, 181, 107, 0.88) 46%, rgba(10, 95, 66, 0.95) 100%);
  clip-path: polygon(31% 0%, 69% 0%, 69% 46%, 93% 46%, 50% 100%, 7% 46%, 31% 46%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -5px 9px rgba(0, 48, 35, 0.34),
    0 0 0 1px rgba(134, 239, 172, 0.16),
    0 0 5px rgba(52, 211, 153, 0.1);
}

#profile-section .ffi-progress-marker--aux::before {
  height: 7px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.62));
  box-shadow: 0 0 4px rgba(255,255,255,0.18);
}

#profile-section .ffi-progress-marker::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: rgba(15,10,40,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(127,230,255,0.35);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  color: #e0f0ff;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s linear, transform 0.08s linear;
  box-shadow: 0 4px 18px rgba(0,0,0,0.38), 0 0 10px rgba(127,230,255,0.16);
  z-index: 12;
}

#profile-section .ffi-progress-marker:hover::after,
#profile-section .ffi-progress-marker:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#profile-section .ffi-progress-marker-core {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 0 6px rgba(255,255,255,0.85);
}

#profile-section #ffi-progress-marker .ffi-progress-marker-core {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 3px;
  height: 13px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.03));
  box-shadow: none;
}

#profile-section .ffi-progress-marker--aux .ffi-progress-marker-core {
  width: 3px;
  height: 3px;
  box-shadow: 0 0 4px rgba(255,255,255,0.8);
}

@keyframes ffi-progress-bumper {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      0 0 0 4px rgba(127,230,255,0.12),
      0 0 12px rgba(127,230,255,0.32),
      0 4px 8px rgba(0,0,0,0.24);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.04);
    box-shadow:
      0 0 0 5px rgba(127,230,255,0.1),
      0 0 16px rgba(127,230,255,0.42),
      0 5px 10px rgba(0,0,0,0.28);
  }
}

@keyframes ffi-progress-arrow-bumper {
  0%, 100% {
    margin-top: -29px;
    filter:
      drop-shadow(0 5px 8px rgba(0, 0, 0, 0.34))
      drop-shadow(0 0 3px rgba(52, 211, 153, 0.1));
  }
  50% {
    margin-top: -30px;
    filter:
      drop-shadow(0 6px 9px rgba(0, 0, 0, 0.36))
      drop-shadow(0 0 4px rgba(52, 211, 153, 0.12));
  }
}

#profile-section .ffi-progress-labels {
  margin-top: 0.28rem;
}

#profile-section .ffi-progress-caption {
  margin-top: 0.28rem;
  color: rgba(235,255,244,0.84);
  font-size: 0.72rem;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(118,255,184,0.16);
}

#profile-section .profile-sidebar {
  position: relative;
  z-index: 6;
  overflow: visible;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: stretch;
}

#profile-section .profile-block-title {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

#profile-section .profile-block {
  text-align: left;
  position: relative;
  overflow: visible;
}

#profile-section .profile-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.25rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  position: relative;
  overflow: visible;
  z-index: 1;
}

#profile-section .profile-kv:hover,
#profile-section .profile-kv:focus-within {
  z-index: 20;
}

#profile-section .profile-key {
  opacity: 0.9;
}

#profile-section .profile-key--with-info {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

#profile-section .profile-info-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(127,230,255,0.36);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(127,230,255,0.16));
  color: rgba(255,255,255,0.92);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  box-shadow: 0 0 10px rgba(127,230,255,0.12);
}

#profile-section .profile-info-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  max-width: 280px;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 12, 24, 0.995), rgba(14, 18, 32, 0.995));
  border: 1px solid rgba(127,230,255,0.34);
  color: rgba(242,248,255,0.96);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.08s linear, transform 0.08s linear;
  box-shadow: 0 14px 34px rgba(0,0,0,0.5), 0 0 18px rgba(127,230,255,0.14);
  z-index: 40;
}

#profile-section .profile-info-tip:hover::after,
#profile-section .profile-info-tip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

#profile-section .profile-value {
  color: #f4f4ff;
  font-weight: 700;
  white-space: nowrap;
}

#profile-section .profile-value.positive {
  color: #7dffb6;
}

#profile-section .profile-value.accent {
  color: #7fe6ff;
}

#profile-section .profile-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

#profile-section .profile-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  padding: 1rem 1.1rem 1.1rem 1.1rem;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

#profile-section .profile-card--secondary {
  padding: 0.8rem 1.1rem;
}

#profile-section .profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

#profile-section .profile-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

#profile-section .profile-collapse-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  cursor: pointer;
}

#profile-section .profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

#profile-section .profile-summary-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

#profile-section .profile-summary-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  font-weight: 600;
}

#profile-section .profile-summary-value {
  color: #7fe6ff;
  font-size: 0.95rem;
  font-weight: 700;
}

#profile-dividends-at-retirement {
  color: #4ade80;
}

#profile-dividends-at-retirement-contrib {
  color: #4ade80;
}

#profile-sp500-at-retirement,
#profile-sp500-at-retirement-contrib {
  color: #ffc107;
}

#profile-section .profile-table {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

#profile-section .profile-table-row {
  display: grid;
  grid-template-columns: 0.6fr 0.9fr 0.8fr repeat(6, 0.9fr);
  gap: 0.4rem;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
}

#profile-section .profile-table-head {
  color: rgba(127, 230, 255, 0.95);
  font-weight: 700;
  font-size: 0.7rem;
}

#profile-section .profile-chart {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 0.8rem 0.9rem 0.9rem 0.9rem;
  display: grid;
  gap: 0.6rem;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

#profile-section .profile-chart-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(45, 52, 66, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.2rem;
  width: fit-content;
  margin: 0 auto;
}

#profile-section .profile-chart-toggle-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

#profile-section .profile-chart-toggle-btn.is-active {
  background: rgba(127, 230, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(127, 230, 255, 0.4);
}

#profile-section .profile-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
}

#profile-section .profile-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#profile-section .profile-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7fe6ff;
  box-shadow: 0 0 10px rgba(127, 230, 255, 0.6);
}

#profile-section .profile-chart-graph {
  position: relative;
  height: 210px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(34, 40, 52, 0.65), rgba(25, 30, 40, 0.55)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 24px);
  overflow: hidden;
}

#profile-section .profile-chart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#profile-section .profile-chart-graph::after {
  display: none;
}

#profile-section .profile-chart-tooltip {
  position: absolute;
  right: auto;
  bottom: auto;
  background: rgba(34, 40, 52, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.35rem 0.55rem;
  color: #ffffff;
  font-size: 0.72rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  text-align: left;
  z-index: 2;
  pointer-events: none;
  width: fit-content;
  max-width: none;
  line-height: 1.1;
  display: inline-grid;
  gap: 0.25rem;
  white-space: nowrap;
}

#profile-section .profile-tooltip-row {
  display: inline-flex;
  justify-content: space-between;
  gap: 0.45rem;
}

#profile-section .profile-chart-axis {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
  padding: 0 0.2rem;
}

#profile-section .profile-axis-label {
  min-width: 40px;
  text-align: center;
}

#profile-section .profile-tooltip-value {
  color: #7fe6ff;
  font-weight: 700;
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  #profile-section .profile-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #profile-section .profile-table-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #settings-section .account-grid {
    grid-template-columns: 1fr;
  }
  #settings-section .account-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #settings-section .settings-grid {
    grid-template-columns: 1fr;
  }
  #settings-section .settings-row {
    grid-template-columns: 1fr;
  }
  #settings-section .settings-inline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  #admin-section .admin-layout {
    grid-template-columns: 1fr;
  }
  #admin-section .admin-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  #admin-section .admin-sidebar-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  #admin-section .admin-chart-card--wide {
    grid-column: span 1;
  }
  #admin-section .admin-charts-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  #admin-section .admin-finance-toolbar {
    align-items: stretch;
  }
  #admin-section .admin-range-toggle {
    width: 100%;
    justify-content: center;
  }
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ===== Dividends Page Spacing (compact) ===== */
#dividends-section .chart-container {
  margin-top: 0.75rem !important;
  margin-bottom: 0.25rem !important;
  z-index: 1;
}
#dividends-section.monthly-view .chart-container {
  margin-top: 0.75rem !important;
}
#dividends-section.annual-view .chart-container {
  margin-top: 0.75rem !important;
}
#dividends-section .chart-container h2 {
  margin-top: 0 !important;
}
#dividends-section #dividends-monthly-table {
  margin-top: 0.25rem !important;
}
#dividends-section #dividends-annual-subpage {
  margin-top: 0.25rem !important;
}
#dividends-section .table-header {
  margin-top: 0.3rem !important;
  margin-bottom: 0 !important;
  position: relative;
  z-index: 2;
}

#deposits-section .table-header.deposits-toolbar {
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 768px;
  margin-top: 0.12rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 0.5rem !important;
  position: relative;
  z-index: 2;
}

#deposits-section .deposits-toolbar-left,
#deposits-section .deposits-toolbar-right {
  display: flex;
  align-items: center;
}

#deposits-section .deposits-toolbar-right {
  margin-left: 0;
}

#deposits-section .deposits-view-switch .allocation-option,
#dividends-section .dividends-switch .allocation-option,
#dividends-section .chart-type-switch .allocation-option {
  min-width: 112px;
  justify-content: center;
  padding-top: 0.44rem;
  padding-bottom: 0.44rem;
}

#deposits-section .deposits-view-switch,
#dividends-section .dividends-switch,
#dividends-section .chart-type-switch {
  padding-top: 0.19rem;
  padding-bottom: 0.19rem;
}

#dividends-section .chart-type-switch {
  transform: none;
}

#deposits-section .deposits-chart-card {
  width: 100%;
  max-width: 768px;
  min-height: 410px;
  height: 410px;
  margin: 0 auto 0.35rem auto;
  z-index: 1;
}

#deposits-section .deposits-chart-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

#deposits-section .deposits-chart-benchmark {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

#deposits-section .deposits-chart-header .dividends-chart-title {
  color: rgba(220, 220, 220, 0.9);
}

#deposits-section .deposits-chart-type-switch .allocation-option,
#dividends-section .chart-type-switch .allocation-option {
  color: rgba(220, 220, 220, 0.72);
}

#deposits-section .deposits-chart-type-switch .allocation-option.active,
#deposits-section .deposits-chart-type-switch .allocation-option:not(.active):hover,
#dividends-section .chart-type-switch .allocation-option.active,
#dividends-section .chart-type-switch .allocation-option:not(.active):hover {
  color: rgba(220, 220, 220, 0.9);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#deposits-section .deposits-chart-benchmark-label {
  color: rgba(220, 220, 220, 0.9);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#deposits-section .deposits-chart-benchmark-value {
  color: #79f2a3;
  font-size: 1rem;
  font-weight: 800;
  text-shadow: 0 0 16px rgba(121, 242, 163, 0.28);
}

#deposits-section .deposits-chart-meta {
  margin-bottom: 0.85rem;
  color: rgba(220, 220, 220, 0.9);
  font-size: 0.82rem;
  font-weight: 500;
}

#deposits-section .deposits-chart-canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

#deposits-section .deposits-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

#deposits-section .deposits-view-panel {
  width: 100%;
}

#deposits-section #deposits-chart-view {
  margin-bottom: 0.35rem;
}

@media (max-width: 768px) {
  #deposits-section .table-header.deposits-toolbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  #deposits-section .deposits-toolbar-left,
  #deposits-section .deposits-toolbar-right {
    width: auto;
    justify-content: center;
  }

  #deposits-section .deposits-view-switch .allocation-option {
    min-width: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #deposits-section .deposits-chart-card {
    min-height: 450px;
    height: 450px;
  }

  #deposits-section .deposits-chart-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #deposits-section .deposits-chart-header .chart-type-toggle-inline,
  #deposits-section .deposits-chart-header .dividends-chart-title,
  #deposits-section .deposits-chart-benchmark {
    grid-column: 1;
  }

  #deposits-section .deposits-chart-header .chart-type-toggle-inline,
  #deposits-section .deposits-chart-header .dividends-chart-title {
    justify-self: center;
  }

  #deposits-section .deposits-chart-benchmark {
    justify-self: stretch;
    align-items: flex-start;
  }
}

/* Monthly year filter dropdown */
/* monthly-year-filter and deposits-broker-filter styles removed – now uses column-filter-toggle/menu */

/* ── Monthly Dividends Pagination ── */
.monthly-pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.25rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}
.monthly-pagination-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #a0a0a0;
}
.monthly-pagination-left label {
  font-weight: 600;
  letter-spacing: 0.02em;
}
#monthly-page-size,
#admin-users-page-size {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  border: 1px solid rgba(100, 255, 218, 0.25);
  border-radius: 8px;
  padding: 0.3rem 1.8rem 0.3rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364ffda' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px;
}
#monthly-page-size:hover,
#monthly-page-size:focus,
#admin-users-page-size:hover,
#admin-users-page-size:focus {
  border-color: rgba(100, 255, 218, 0.5);
  box-shadow: 0 0 8px rgba(100, 255, 218, 0.15);
}
#monthly-page-size option,
#admin-users-page-size option {
  background: #1a2236;
  color: #e0e0e0;
}
.monthly-pagination-info {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 0.25rem;
}
.monthly-pagination-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.monthly-page-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #e0e0e0;
  border: 1px solid rgba(100, 255, 218, 0.18);
  border-radius: 6px;
  min-width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0 0.35rem;
}
.monthly-page-btn:hover:not(:disabled) {
  background: rgba(100, 255, 218, 0.12);
  border-color: rgba(100, 255, 218, 0.4);
  color: #64ffda;
}
.monthly-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.monthly-page-btn.monthly-page-num.active {
  background: rgba(100, 255, 218, 0.18);
  border-color: rgba(100, 255, 218, 0.5);
  color: #64ffda;
  box-shadow: 0 0 8px rgba(100, 255, 218, 0.15);
}
.monthly-page-numbers {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

#deposits-section #deposits-pagination-wrapper {
  max-width: 768px;
  width: 100%;
  margin: 0.55rem auto;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
  gap: 0.75rem 1.15rem;
}

#deposits-section #deposits-pagination-wrapper .monthly-pagination-left,
#deposits-section #deposits-pagination-wrapper .monthly-pagination-right {
  justify-content: center;
}

@media (max-width: 820px) {
  #deposits-section #deposits-pagination-wrapper {
    flex-direction: column;
    align-items: center;
  }
}

.btn-danger {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: #1b1b1b;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.snapshots-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.snapshots-stats.compact {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-card.mini {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
}
.stat-card.mini .stat-label { font-size: 0.8rem; }
.stat-card.mini span:last-child { font-size: 1.1rem; }

@media (max-width: 980px) {
  .admin-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-hero { padding: 0.8rem 1rem; }
}

.stat-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
}

.stat-card span:last-child {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}

#snapshots-tbody tr {
  background: rgba(255, 255, 255, 0.05);
}

#snapshots-tbody tr:hover {
  background: rgba(255, 255, 255, 0.1);
}

.delete-snapshot-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.delete-snapshot-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Dividends Table Styles */
#dividends-table {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0 6px;
  background: transparent;
  table-layout: fixed;
}

#dividends-table thead {
  background: transparent;
}

#dividends-table th {
  padding: 8px 8px 10px;
  text-align: center;
  vertical-align: middle;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
  background: var(--stocks-row-grad-start);
  text-shadow: none;
}

#dividends-table td {
  padding: 4px 4px;
  text-align: center;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.7);
  border: none;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

#dividends-table tbody tr {
  background: var(--stocks-row-grad-start);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

#dividends-table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

/* Round corners on first/last cells in each row */
#dividends-table tbody tr td:first-child {
  border-radius: 10px 0 0 10px;
}
#dividends-table tbody tr td:last-child {
  border-radius: 0 10px 10px 0;
  white-space: nowrap;
  overflow: visible;
}
#withdrawals-table {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0 0;
}

/* Withdrawals summary panel */
.withdrawals-summary-panel {
  max-width: 960px;
  margin: 0 auto 1.2rem auto;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 0.85rem 1rem 0.9rem 1rem;
  box-shadow: 0 14px 36px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.3);
}
.withdrawals-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.withdrawals-summary-item {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 0.6rem 0.75rem 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.withdrawals-summary-item .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}
.withdrawals-summary-item .value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 6px rgba(255,255,255,0.35);
}
@media (max-width: 600px) {
  .withdrawals-summary-item { padding: 0.55rem 0.65rem; }
  .withdrawals-summary-item .value { font-size: 0.95rem; }
}

/* Constrain withdrawals table to match summary panel width */
#withdrawals-table {
  max-width: 960px;
}

/* Withdrawals table header grid */
#withdrawals-table thead tr {
  display: grid;
  grid-template-columns: 50px 1.2fr 1fr 1.2fr 0.9fr 1fr 90px;
  gap: 8px;
}

#withdrawals-table thead th {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Withdrawals header labels: match Stocks/Deposits style */
#withdrawals-section #withdrawals-table thead th {
  text-align: left;
  background: var(--stocks-row-grad-start);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 10px 12px 12px;
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;
  white-space: nowrap;
}

/* Withdrawals sortable header hover – match Stocks */
#withdrawals-section #withdrawals-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, background 0.2s ease;
}
#withdrawals-section #withdrawals-table thead th.sortable:hover {
  color: #64ffda;
  background: rgba(255, 255, 255, 0.06);
}

/* Withdrawals table body rows: card-row style matching Stocks/Deposits */
#withdrawals-table-body tr {
  display: grid;
  grid-template-columns: 50px 1.2fr 1fr 1.2fr 0.9fr 1fr 90px;
  gap: 3px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.476), rgba(0, 0, 0, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  min-height: unset;
  align-items: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

#withdrawals-table-body tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

/* Withdrawals table cells: match Stocks/Deposits td */
#withdrawals-table-body td {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: none;
  line-height: 1.05;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#withdrawals-table-body td.action-buttons {
  justify-content: center;
  overflow: visible;
}

#withdrawals-table-body td select,
#withdrawals-table-body td input {
  min-width: 0;
  max-width: 100%;
}

#withdrawals-section .floating-add-btn {
  bottom: 40px;
  right: 40px;
}

#dividends-section .chart-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 1rem 1.25rem 5rem;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  border: 1px solid rgba(255, 255, 255, 0.18);
  width: 100%;
  max-width: 100%;
  min-height: 420px;
}

/* Dashboard: match fintech blue panel look */
#dashboard-section .chart-container,
#dashboard-section .performance-chart-container {
  backdrop-filter: blur(18px) saturate(145%);
  border-radius: 22px;
  box-shadow:
    0 20px 54px rgba(3, 8, 18, 0.48),
    0 0 24px rgba(0, 217, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(128, 223, 255, 0.18);
}

/* Withdrawals table input/select styles (shared with deposits) */

#dividends-table td[contenteditable='true'] {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: text;
}

#dividends-table td[contenteditable='true']:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

#dividends-table .year-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.3rem 0.25rem;
  width: 100%;
  max-width: 100%;
  font-size: 0.82rem;
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-appearance: none;
}

#dividends-table .year-select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

#dividends-table .year-select option {
  background: var(--stocks-row-grad-start);
  color: white;
  padding: 0.5rem;
}

#dividends-table .monthly-dividend {
  color: #64ffda;
  font-weight: 600;
}

#dividends-table .editable {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 0.14rem 0.16rem;
  min-height: 0.84rem;
  line-height: 1.2;
  box-sizing: border-box;
  text-align: left;
  margin: 0;
}

#dividends-table .editable:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

#dividends-table .year-cell {
  font-weight: 500;
  vertical-align: middle;
  padding: 0.24rem 0.18rem !important;
}

#dividends-table .annual-dividend-cell {
  font-weight: 500;
  vertical-align: middle;
  padding: 0.24rem 0.18rem !important;
}

#dividends-table .year-select {
  height: 1rem;
  line-height: 1.2;
  padding: 0.18rem 0.22rem;
  box-sizing: border-box;
}

#dividends-table .delete-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#dividends-table .delete-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

#dividends-table .save-icon-btn,
#dividends-table .cancel-icon-btn,
#dividends-table .delete-icon-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: all 0.2s ease;
  opacity: 0.7;
}

#dividends-table .save-icon-btn:hover {
  opacity: 1;
  transform: scale(1.2);
  color: #4caf50;
}

#dividends-table .edit-icon-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: all 0.2s ease;
  opacity: 0.7;
}

#dividends-table .edit-icon-btn:hover {
  opacity: 1;
  transform: scale(1.2);
  color: #4fc3f7;
}

#dividends-table .cancel-icon-btn:hover,
#dividends-table .delete-icon-btn:hover {
  opacity: 1;
  transform: scale(1.2);
  color: #ff6b6b;
}

#dividends-table tr.editing {
  background: rgba(102, 126, 234, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    background: rgba(102, 126, 234, 0.1);
  }
  50% {
    background: rgba(102, 126, 234, 0.2);
  }
}

/* Dividends Monthly Table: modern card-row style */
#dividends-monthly-table {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0 4px;
  background: transparent;
  table-layout: auto;
}

#dividends-monthly-table thead {
  background: transparent;
}

#dividends-monthly-table th {
  padding: 10px 6px 12px;
  text-align: center;
  vertical-align: middle;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
  background: var(--stocks-row-grad-start);
  text-shadow: none;
  white-space: nowrap;
}

#dividends-monthly-table td {
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.7);
  border: none;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
}

#dividends-monthly-table th .th-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

#dividends-monthly-table .column-filter-toggle {
  position: absolute;
  top: 50%;
  right: 2px;
  margin-left: 0;
  padding: 0 2px;
  transform: translateY(-50%);
}

#dividends-monthly-table .select-all-th,
#dividends-monthly-table .select-td,
#dividends-monthly-table td[data-field="withdraw"],
#dividends-monthly-table td.action-buttons {
  text-align: center;
}

#dividends-monthly-table tbody tr {
  background: var(--stocks-row-grad-start);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

#dividends-monthly-table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

/* Round corners on first/last cells in each row */
#dividends-monthly-table tbody tr td:first-child {
  border-radius: 10px 0 0 10px;
}
#dividends-monthly-table tbody tr td:last-child {
  border-radius: 0 10px 10px 0;
}

/* Uniform height for all monthly-table edit controls */
#dividends-monthly-table .editing td {
  vertical-align: middle;
  padding-top: 1px;
  padding-bottom: 1px;
}

:is(#dividends-monthly-table, #stocks-gains-table) .editing td {
  vertical-align: middle;
  padding-top: 1px;
  padding-bottom: 1px;
}

:is(#dividends-monthly-table, #stocks-gains-table) .editing input:not(.withdraw-checkbox),
:is(#dividends-monthly-table, #stocks-gains-table) .editing select {
  display: block;
  width: 100%;
  min-height: 17px;
  height: 36px;
  max-height: 36px;
  margin: 0;
  padding: 6px 10px;
  font-size: 0.82rem;
  line-height: 22px;
  vertical-align: middle;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-sizing: border-box;
}

:is(#dividends-monthly-table, #stocks-gains-table) .editing td[contenteditable='true'],
:is(#dividends-monthly-table, #stocks-gains-table) .editing .editable {
  min-height: 36px;
  height: 36px;
  padding: 6px 10px;
  font-size: 0.82rem;
  line-height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-sizing: border-box;
}

:is(#dividends-monthly-table, #stocks-gains-table) .editing input:not(.withdraw-checkbox):focus,
:is(#dividends-monthly-table, #stocks-gains-table) .editing select:focus,
:is(#dividends-monthly-table, #stocks-gains-table) .editing td[contenteditable='true']:focus,
:is(#dividends-monthly-table, #stocks-gains-table) .editing .editable:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

:is(#dividends-monthly-table, #stocks-gains-table) .tax-percent-input {
  width: 70px;
}

:is(#dividends-monthly-table, #stocks-gains-table) .monthly-date-picker {
  position: relative;
  width: 110px;
}

:is(#dividends-monthly-table, #stocks-gains-table) .monthly-date-trigger {
  width: 100%;
  height: 36px;
  min-width: 0;
  text-align: left;
  padding: 6px 28px 6px 8px;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.82rem;
  line-height: 22px;
  box-sizing: border-box;
}

:is(#dividends-monthly-table, #stocks-gains-table) .monthly-date-trigger:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

:is(#dividends-monthly-table, #stocks-gains-table) .monthly-date-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.8);
  transform: translateY(-30%);
  pointer-events: none;
}

:is(#dividends-monthly-table, #stocks-gains-table) .monthly-date-picker-popup {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 400;
  width: 190px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #1a2035;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

:is(#dividends-monthly-table, #stocks-gains-table) .monthly-date-picker-popup[hidden] {
  display: none;
}

:is(#dividends-monthly-table, #stocks-gains-table) .mdp-year-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 4px;
}

:is(#dividends-monthly-table, #stocks-gains-table) .mdp-year-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

:is(#dividends-monthly-table, #stocks-gains-table) .mdp-prev-year,
:is(#dividends-monthly-table, #stocks-gains-table) .mdp-next-year {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

:is(#dividends-monthly-table, #stocks-gains-table) .mdp-prev-year:hover,
:is(#dividends-monthly-table, #stocks-gains-table) .mdp-next-year:hover {
  background: rgba(255, 255, 255, 0.18);
}

:is(#dividends-monthly-table, #stocks-gains-table) .mdp-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

:is(#dividends-monthly-table, #stocks-gains-table) .mdp-month {
  padding: 5px 2px;
  font-size: 0.75rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

:is(#dividends-monthly-table, #stocks-gains-table) .mdp-month:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

:is(#dividends-monthly-table, #stocks-gains-table) .mdp-month.mdp-month--selected {
  background: #4fc3f7;
  border-color: #4fc3f7;
  color: #111;
  font-weight: 600;
}

:is(#dividends-monthly-table, #stocks-gains-table) .editing select {
  padding-right: 30px;
}

:is(#dividends-monthly-table, #stocks-gains-table) .editing td[data-field="country"] {
  min-width: 130px;
}

:is(#dividends-monthly-table, #stocks-gains-table) .editing td[contenteditable='true'],
:is(#dividends-monthly-table, #stocks-gains-table) .editing .editable {
  overflow: hidden;
  white-space: nowrap;
}

#dividends-monthly-table .withdraw-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #4fc3f7;
}

/* Dividends tables: sortable header hover */
#dividends-table th.sortable,
#dividends-monthly-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
#dividends-table th.sortable:hover,
#dividends-monthly-table th.sortable:hover {
  color: #64ffda;
  background: rgba(255, 255, 255, 0.06);
}

/* Stocks Gains Table: match screenshot style */
#stocks-gains-table {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0 0;
  display: block;
  overflow: visible;
}

/* Stock Gains header grid (11 columns) */
#stocks-gains-table thead {
  display: block;
  width: 100%;
  position: relative;
  z-index: 10;
}

#stocks-gains-table thead tr {
  display: grid;
  grid-template-columns: 0.4fr 1fr 0.95fr 1.45fr 0.95fr 0.95fr 0.85fr 1fr 1fr 0.95fr 0.75fr;
  gap: 4px;
  /* match body row: border(1px) + padding(4px) = 5px each side */
  padding: 0 5px;
}

/* Stock Gains header labels: match Stocks style */
#stocks-gains-section #stocks-gains-table thead th {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  text-align: center;
  background: var(--stocks-row-grad-start);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 10px 2px 12px;
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* Stock Gains sortable header hover */
#stocks-gains-section #stocks-gains-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: color 0.2s ease, background 0.2s ease;
}
#stocks-gains-section #stocks-gains-table thead th.sortable:hover {
  color: #64ffda;
  background: rgba(255, 255, 255, 0.06);
}

#stocks-gains-section #stocks-gains-table thead th .th-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
}

#stocks-gains-section #stocks-gains-table .column-filter-toggle[data-field^='stock-gain-'] {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 3;
  transform: translateY(-50%);
  margin-left: 0;
  flex: 0 0 auto;
}

#stocks-gains-section #stocks-gains-table thead th:has(.column-filter-toggle[data-field^='stock-gain-']) {
  padding-right: 22px;
  padding-left: 22px;
}

#stocks-gains-section #stocks-gains-table .column-filter-menu[data-field^='stock-gain-'] {
  background: #141b2a;
  backdrop-filter: none;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.42);
  z-index: 400;
}

/* Stock Gains body grid rows: card-row style */
#stocks-gains-table tbody {
  display: block;
  width: 100%;
  overflow: visible;
}

#stocks-gains-table-body {
  overflow: visible;
}

#stocks-gains-table-body tr {
  display: grid;
  grid-template-columns: 0.4fr 1fr 0.95fr 1.45fr 0.95fr 0.95fr 0.85fr 1fr 1fr 0.95fr 0.75fr;
  gap: 4px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.476), rgba(0, 0, 0, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  min-height: unset;
  align-items: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
  overflow: visible;
  position: relative;
  z-index: 1;
}

#stocks-gains-table-body tr.action-menu-open {
  z-index: 260;
}

#stocks-gains-table-body tr.editing {
  z-index: 420;
}

#stocks-gains-table-body tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

/* Stock Gains cells: match Stocks td */
#stocks-gains-table-body td {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  line-height: 1.05;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

#stocks-gains-table-body td[data-field="symbol"] {
  min-height: 18px;
  cursor: text;
}

#stocks-gains-section #stocks-gains-table thead th[data-column="country"],
#stocks-gains-table-body td[data-field="country"] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

#stocks-gains-table-body td[data-field="country"] {
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}

#stocks-gains-table-body tr.editing td[data-field="date"] {
  overflow: visible;
}

#stocks-gains-table-body td.action-buttons {
  overflow: visible;
}

#stocks-gains-table-body .action-menu {
  overflow: visible;
}

#stocks-gains-table-body .action-menu-panel {
  top: auto;
  bottom: calc(100% + 8px);
  z-index: 300;
}

/* Edit-mode: inputs/selects fit within their cell */
#stocks-gains-table-body td input,
#stocks-gains-table-body td select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 3px 4px;
  font-size: 0.75rem;
}

#stocks-gains-table-body td[contenteditable="true"] {
  cursor: text;
  border-radius: 4px;
  outline: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 4px;
  box-sizing: border-box;
  font-size: 0.75rem;
}

#stocks-gains-table .edit-icon-btn,
#stocks-gains-table .delete-icon-btn,
#stocks-gains-table .save-icon-btn,
#stocks-gains-table .cancel-icon-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  transition: all 0.2s ease;
  opacity: 0.8;
}

#stocks-gains-table .edit-icon-btn:hover,
#stocks-gains-table .save-icon-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  color: #4fc3f7;
}

#stocks-gains-table .delete-icon-btn:hover,
#stocks-gains-table .cancel-icon-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  color: #ff6b6b;
}

#stocks-gains-table .tax-percent-input {
  width: 100% !important;
  padding: 3px 4px !important;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.75rem;
  box-sizing: border-box;
}

#stocks-gains-table .withdraw-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #4fc3f7;
}

/* ===== Taxes panels ===== */
.taxes-page {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#taxes-section .settings-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

#taxes-section .settings-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 1rem;
}

#taxes-section .settings-card summary::-webkit-details-marker {
  display: none;
}

#taxes-section .settings-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

#taxes-section .settings-sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.2rem;
}

#taxes-section .settings-chevron {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

#taxes-section details[open] .settings-chevron {
  transform: rotate(180deg);
}

#taxes-section .settings-content {
  margin-top: 0.75rem;
}

#taxes-section .taxes-empty {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  padding: 0.5rem 0.1rem 0.2rem;
}

.taxes-panels {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

#taxes-section .taxes-panel {
  background: linear-gradient(135deg, rgba(24, 28, 42, 0.96), rgba(16, 20, 32, 0.98)) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35) !important;
  overflow: hidden !important;
  max-width: 490px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

#taxes-section .taxes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem !important;
  cursor: pointer;
  color: #e6e9f2;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)) !important;
}

#taxes-section .taxes-panel-title {
  font-size: 1rem;
  letter-spacing: 0.3px;
}

#taxes-section .taxes-panel-toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  color: #fff;
  font-size: 0.9rem;
}

#taxes-section .taxes-panel-body {
  padding: 0.7rem 1.1rem 1rem !important;
}

#taxes-section .taxes-panel-body.is-collapsed {
  display: none;
}

#taxes-section .taxes-table {
  width: 100% !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  border-collapse: collapse !important;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.2)) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

#taxes-section .taxes-table th,
#taxes-section .taxes-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
}

#taxes-section .taxes-table thead th {
  color: #ffffff;
  font-weight: 400;
  background: rgba(255, 255, 255, 0.12);
}

#taxes-section .taxes-table tbody tr {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#taxes-section .taxes-table tfoot td {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 700;
  color: #ffffff;
}
}

/* Brand / Navbar logo styles */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.4px;
  color: #ffffff;
  text-shadow: 0 1px 12px rgba(102, 126, 234, 0.45);
}

/* Optional: slightly enlarge on hover for a premium feel */
.brand-link:hover .brand-logo {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.brand-link:hover .brand-title {
  filter: brightness(1.15);
}

/* ===== Guided Tour ===== */
/* ===== Guided Tour – Premium ===== */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  pointer-events: none;
}

.tour-overlay.active {
  pointer-events: auto;
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1000000;
}

.tour-highlight {
  position: fixed;
  z-index: 1000001;
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.62),
    0 0 0 3px rgba(100, 160, 255, 0.6),
    0 0 24px rgba(100, 160, 255, 0.22),
    inset 0 0 0 1px rgba(100, 160, 255, 0.1);
  pointer-events: none;
  transition:
    top 0.4s cubic-bezier(.4, 0, .2, 1),
    left 0.4s cubic-bezier(.4, 0, .2, 1),
    width 0.4s cubic-bezier(.4, 0, .2, 1),
    height 0.4s cubic-bezier(.4, 0, .2, 1);
  animation: tourPulse 2.5s ease-in-out infinite;
}

@keyframes tourPulse {
  0%, 100% {
    box-shadow:
      0 0 0 9999px rgba(0, 0, 0, 0.62),
      0 0 0 3px rgba(100, 160, 255, 0.6),
      0 0 24px rgba(100, 160, 255, 0.22),
      inset 0 0 0 1px rgba(100, 160, 255, 0.1);
  }
  50% {
    box-shadow:
      0 0 0 9999px rgba(0, 0, 0, 0.62),
      0 0 0 4px rgba(100, 180, 255, 0.85),
      0 0 36px rgba(100, 160, 255, 0.35),
      inset 0 0 0 1px rgba(100, 160, 255, 0.18);
  }
}

/* Bubble */
.tour-bubble {
  position: fixed;
  z-index: 1000002;
  background: rgba(14, 20, 42, 0.96);
  border: 1px solid rgba(100, 160, 255, 0.25);
  border-radius: 14px;
  padding: 1.3rem 1.5rem 1.1rem;
  max-width: 370px;
  width: 90vw;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(100, 160, 255, 0.06);
  color: #e0e6f0;
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  animation: tourBubbleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
}

@keyframes tourBubbleIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Arrow – bubble BELOW target (points UP) */
.tour-bubble--below::before {
  content: '';
  position: absolute;
  top: -7px;
  left: var(--arrow-x, 36px);
  width: 14px;
  height: 14px;
  background: rgba(14, 20, 42, 0.96);
  border-top: 1px solid rgba(100, 160, 255, 0.25);
  border-left: 1px solid rgba(100, 160, 255, 0.25);
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
}

/* Arrow – bubble ABOVE target (points DOWN) */
.tour-bubble--above::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: var(--arrow-x, 36px);
  width: 14px;
  height: 14px;
  background: rgba(14, 20, 42, 0.96);
  border-bottom: 1px solid rgba(100, 160, 255, 0.25);
  border-right: 1px solid rgba(100, 160, 255, 0.25);
  transform: rotate(45deg);
  border-radius: 0 0 3px 0;
}

/* Step badge */
.tour-bubble-step {
  display: inline-block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64a0ff;
  background: rgba(100, 160, 255, 0.1);
  border: 1px solid rgba(100, 160, 255, 0.18);
  border-radius: 20px;
  padding: 0.15rem 0.65rem;
  margin-bottom: 0.65rem;
  font-weight: 700;
}

.tour-bubble-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.45rem;
  line-height: 1.3;
}

.tour-bubble-text {
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 1rem;
}

.tour-bubble-text strong {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

/* Actions row */
.tour-bubble-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.tour-btn-skip {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

.tour-btn-skip:hover {
  color: rgba(255, 255, 255, 0.65);
}

.tour-btn-next {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.35);
}

.tour-btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}

/* Progress dots */
.tour-progress {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tour-progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.3s;
}

.tour-progress-dot.active {
  background: #3b82f6;
  width: 18px;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.tour-progress-dot.done {
  background: rgba(100, 180, 255, 0.45);
}

/* ===== Paywall Modal ===== */
.paywall-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: paywallFadeIn 0.3s ease;
}

@keyframes paywallFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes paywallSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.paywall-modal {
  position: relative;
  background: rgba(14, 18, 36, 0.92);
  border: 1px solid rgba(100, 255, 218, 0.18);
  border-radius: 22px;
  padding: 2.5rem 2rem 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  backdrop-filter: blur(24px);
  box-shadow:
    0 0 60px rgba(100, 255, 218, 0.08),
    0 24px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: paywallSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.paywall-modal-glow {
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(100, 255, 218, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.paywall-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
  z-index: 2;
}

.paywall-modal-close:hover {
  color: #ffffff;
}

.paywall-modal-icon {
  font-size: 2.8rem;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.paywall-modal-title {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  position: relative;
  z-index: 1;
}

.paywall-modal-subtitle {
  margin: 0 0 1.4rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.paywall-modal-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.paywall-price-amount {
  font-size: 2.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #64ffda, #00d9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.paywall-price-period {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.paywall-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.6rem;
  text-align: left;
  position: relative;
  z-index: 1;
}

.paywall-features-list li {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.paywall-feature-check {
  color: #64ffda;
  font-weight: 700;
  font-size: 0.95rem;
}

.paywall-cta-btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0e1224;
  cursor: pointer;
  background: linear-gradient(135deg, #64ffda, #00d9ff);
  box-shadow: 0 4px 20px rgba(100, 255, 218, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  z-index: 1;
}

.paywall-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(100, 255, 218, 0.35);
}

.paywall-cta-btn:active {
  transform: translateY(0);
}

.paywall-modal-footer {
  margin: 0.8rem 0 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
}

/* ===== Paywall Dashboard Banner ===== */
.paywall-banner {
  position: relative;
  margin-bottom: 1rem;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(14, 18, 36, 0.85);
  border: 1px solid rgba(100, 255, 218, 0.15);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.paywall-banner-glow {
  position: absolute;
  top: -50%;
  right: -10%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(100, 255, 218, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.paywall-banner-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.paywall-banner-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 0;
}

.paywall-banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.paywall-banner-title {
  display: block;
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 700;
}

.paywall-banner-text {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.1rem;
}

.paywall-banner-btn {
  flex-shrink: 0;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0e1224;
  cursor: pointer;
  background: linear-gradient(135deg, #64ffda, #00d9ff);
  box-shadow: 0 2px 12px rgba(100, 255, 218, 0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.paywall-banner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(100, 255, 218, 0.3);
}

@media (max-width: 500px) {
  .paywall-banner-content {
    flex-direction: column;
    text-align: center;
  }
  .paywall-banner-left {
    flex-direction: column;
  }
  .paywall-banner-btn {
    width: 100%;
  }
}

/* ===========================================================
   Legal pages (Terms & Conditions / Privacy Policy)
   =========================================================== */
.legal-body {
  padding-top: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(102, 126, 234, 0.28), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(118, 75, 162, 0.25), transparent 65%),
    linear-gradient(180deg, #0b1020 0%, #0a0f1c 50%, #070a14 100%);
  color: #e8ecf6;
  min-height: 100vh;
  font-family: 'Manrope', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.legal-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.85), rgba(10, 14, 28, 0.55));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
}

.legal-brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.28));
}

.legal-brand-logo {
  height: 110px;
  width: auto;
  display: block;
  margin: -35px 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.legal-brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
}

.legal-topnav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legal-nav-link {
  color: rgba(232, 236, 246, 0.78);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.legal-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.legal-nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.legal-nav-cta {
  margin-left: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 10px 24px rgba(102, 126, 234, 0.45);
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.legal-nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(102, 126, 234, 0.55);
}

.legal-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.legal-toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.legal-toc-inner {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.1rem 1rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.legal-toc-eyebrow {
  margin: 0 0 0.55rem 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: rgba(232, 236, 246, 0.55);
  font-weight: 700;
}

.legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.legal-toc-list a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  color: rgba(232, 236, 246, 0.72);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.legal-toc-list a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.legal-toc-list a.active {
  color: #fff;
  background: rgba(102, 126, 234, 0.16);
  border-left-color: #8aa1ff;
}

.legal-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2.4rem 2.4rem 2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.legal-hero {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.4rem;
  margin-bottom: 1.6rem;
}

.legal-eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 0.74rem;
  color: #8aa1ff;
}

.legal-title {
  margin: 0 0 0.8rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #cdd5ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.1rem;
}

.legal-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.22), rgba(118, 75, 162, 0.22));
  border: 1px solid rgba(138, 161, 255, 0.35);
  font-size: 0.74rem;
  font-weight: 700;
  color: #cfd9ff;
  letter-spacing: 0.04em;
}
.legal-pill.subtle {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(232, 236, 246, 0.7);
}

.legal-lede {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(232, 236, 246, 0.85);
}

.legal-section {
  padding: 1.6rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  scroll-margin-top: 100px;
}
.legal-section:first-of-type {
  border-top: none;
  padding-top: 0.4rem;
}

.legal-section h2 {
  margin: 0 0 0.8rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

.legal-section p,
.legal-section li {
  color: rgba(232, 236, 246, 0.82);
  line-height: 1.72;
  font-size: 0.95rem;
}

.legal-section p { margin: 0 0 0.7rem; }

.legal-section a {
  color: #8aa1ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(138, 161, 255, 0.5);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.legal-section a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.legal-list {
  margin: 0.2rem 0 0.9rem 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.legal-list li::marker { color: #8aa1ff; }

.legal-section.emphasis {
  background: linear-gradient(135deg, rgba(255, 169, 89, 0.07), rgba(255, 105, 105, 0.05));
  border: 1px solid rgba(255, 169, 89, 0.18);
  border-radius: 16px;
  padding: 1.4rem 1.4rem 1rem;
  margin-top: 1rem;
}
.legal-section.emphasis h2 {
  color: #ffd29c;
}

.legal-note {
  margin-top: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 0.88rem;
  color: rgba(232, 236, 246, 0.78);
}

.legal-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0.5rem 0 0.9rem;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}
.legal-table th,
.legal-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
.legal-table thead th {
  background: rgba(255, 255, 255, 0.04);
  color: #cfd9ff;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.74rem;
}
.legal-table tbody tr:last-child td { border-bottom: none; }
.legal-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.legal-section code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  font-size: 0.85em;
  color: #cdd5ee;
}

.legal-card-footer {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: rgba(232, 236, 246, 0.6);
  font-size: 0.85rem;
}
.legal-card-footer-nav {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.legal-card-footer-nav a {
  color: rgba(232, 236, 246, 0.78);
  text-decoration: none;
  font-weight: 600;
}
.legal-card-footer-nav a:hover { color: #fff; }

@media (max-width: 980px) {
  .legal-shell {
    grid-template-columns: 1fr;
    padding: 1.6rem 1rem 3rem;
    gap: 1.4rem;
  }
  .legal-toc {
    position: static;
    max-height: none;
  }
  .legal-card {
    padding: 1.6rem 1.2rem;
  }
  .legal-topbar {
    padding: 0.7rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* ===========================================================
   Cookie consent banner
   =========================================================== */
.cookie-consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  display: none;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(20, 24, 40, 0.92), rgba(10, 14, 28, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #e8ecf6;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 980px;
  margin: 0 auto;
}
.cookie-consent.is-visible { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

.cookie-consent-text { flex: 1 1 320px; min-width: 240px; }
.cookie-consent-text strong { color: #fff; }
.cookie-consent-text a {
  color: #8aa1ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(138, 161, 255, 0.55);
}
.cookie-consent-text a:hover { color: #fff; border-bottom-color: #fff; }

.cookie-consent-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cookie-btn {
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.05rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cookie-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 10px 22px rgba(102, 126, 234, 0.4);
}
.cookie-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(102, 126, 234, 0.55); }
.cookie-btn.ghost {
  color: rgba(232, 236, 246, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.cookie-btn.ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

@media (max-width: 600px) {
  .cookie-consent { left: 8px; right: 8px; bottom: 8px; padding: 0.85rem; }
  .cookie-consent-actions { width: 100%; }
  .cookie-btn { flex: 1 1 0; }
}

/* ===========================================================
   Auth pages: legal links footer (login / register / etc.)
   =========================================================== */
.legal-links-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: clamp(0.56rem, 0.9vw, 0.72rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.6);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.legal-links-footer > * {
  white-space: normal;
}
@media (max-width: 480px) {
  .legal-links-footer {
    font-size: 0.58rem;
  }
  .legal-links-footer .sep {
    margin: 0 0.2rem;
  }
}
.legal-links-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  overflow-wrap: anywhere;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.legal-links-footer a:hover {
  color: #fff;
  border-bottom-color: #fff;
}
.legal-links-footer .sep {
  margin: 0 0.45rem;
  opacity: 0.5;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
  margin-top: 0.2rem;
}
.consent-row input[type='checkbox'] {
  margin-top: 0.18rem;
  flex-shrink: 0;
  accent-color: #8aa1ff;
  width: 16px;
  height: 16px;
}
.consent-row a {
  color: #b9c5ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(185, 197, 255, 0.5);
}
.consent-row a:hover { color: #fff; border-bottom-color: #fff; }

/* ===========================================================
   App-wide footer with legal links
   =========================================================== */
.app-footer {
  margin: 3rem auto 1.2rem;
  padding: 1rem 1.4rem;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}
.app-footer-nav { display: inline-flex; gap: 1rem; flex-wrap: wrap; }
.app-footer-nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.18s ease;
}
.app-footer-nav a:hover { color: #fff; }


/* =============================================================
   THEME VARIANTS
   - .theme-blue   : the original / current navy fintech look
   - .theme-purple : a "demential" fintech aurora violet
   - .theme-dark   : an electric obsidian fintech canvas
   Each theme overrides the global --stocks-row-grad-* tokens so
   downstream gradients (allocation switch, table rows, charts,
   profile cards, etc.) follow the chosen palette automatically.
   ============================================================= */

/* ---------- Active chip baseline (works in any theme) ---------- */
.settings-chip {
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.2s ease, transform 0.15s ease;
}
.settings-chip:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.settings-chip.active {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ---------- BLUE (default — current production look) ---------- */
body.theme-blue {
  --stocks-row-grad-start: rgba(20, 26, 38, 0.98);
  --stocks-row-grad-end: rgba(14, 18, 28, 0.98);
  --theme-accent: #6b8cff;
  --theme-accent-2: #00d9ff;
  background-color: #0e1220;
  background-image:
    radial-gradient(ellipse 80% 55% at 12% -8%, rgba(102, 126, 234, 0.32), transparent 62%),
    radial-gradient(ellipse 60% 45% at 100% 14%, rgba(0, 217, 255, 0.20), transparent 65%),
    radial-gradient(ellipse 65% 55% at 50% 112%, rgba(56, 139, 253, 0.20), transparent 62%);
  background-attachment: fixed;
}
body.theme-blue ::selection { background: rgba(102, 126, 234, 0.45); color: #fff; }
body.theme-blue .settings-chip[data-theme="blue"].active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.85), rgba(0, 217, 255, 0.7));
  border-color: rgba(122, 200, 255, 0.7);
  box-shadow: 0 0 14px rgba(102, 126, 234, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: #fff;
}
body.theme-blue #dashboard-section .chart-container,
body.theme-blue #dashboard-section .performance-chart-container {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(0, 217, 255, 0.16), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(107, 140, 255, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(22, 36, 61, 0.96), rgba(10, 17, 31, 0.98));
  border: 1px solid rgba(128, 223, 255, 0.2);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow:
    0 24px 54px rgba(3, 8, 18, 0.48),
    0 0 30px rgba(0, 217, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(4, 10, 20, 0.35);
}
body.theme-blue #dashboard-section .wide-panel-container {
  position: relative;
  overflow: visible;
  background: transparent;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
}
body.theme-blue #dashboard-section .chart-container::before,
body.theme-blue #dashboard-section .performance-chart-container::before {
  opacity: 0.46;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.28), rgba(107, 140, 255, 0.4), rgba(255, 255, 255, 0.1));
}
body.theme-blue #dashboard-section .wide-panel-container::before {
  display: none;
}
body.theme-blue #dashboard-section .chart-container::after,
body.theme-blue #dashboard-section .performance-chart-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 18%),
    radial-gradient(circle at 82% 16%, rgba(126, 228, 255, 0.12), transparent 18%);
  pointer-events: none;
}
body.theme-blue #dashboard-section .wide-panel-container::after {
  display: none;
}
body.theme-blue #dashboard-section .chart-container:hover,
body.theme-blue #dashboard-section .performance-chart-container:hover {
  transform: translateY(-2px);
  border-color: rgba(130, 224, 255, 0.32);
  box-shadow:
    0 30px 62px rgba(3, 8, 18, 0.56),
    0 0 36px rgba(0, 217, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(4, 10, 20, 0.42);
}
body.theme-blue #dashboard-section .wide-panel-container:hover {
  transform: none;
}
body.theme-blue #dashboard-section .chart-container:hover::before,
body.theme-blue #dashboard-section .performance-chart-container:hover::before {
  opacity: 0.72;
}
#dashboard-section .chart-container h2,
#dashboard-section .chart-header .perf-title-wrap > span:first-child,
#dashboard-section .panel-zone-title,
#dashboard-section .metrics-panel .panel-zone-title {
  color: rgba(238, 247, 255, 0.76);
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: none;
}

#dashboard-section .chart-header .perf-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.62rem;
  flex-wrap: wrap;
}

#dashboard-section #performance-return {
  margin-left: 0 !important;
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem !important;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

#dashboard-section .chart-legend .legend-label,
#dashboard-section .dashboard-metrics-overlay .metric-label {
  color: rgba(215, 234, 247, 0.72);
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.12;
  text-transform: uppercase;
  text-shadow: none;
}

#dashboard-section .dashboard-metrics-overlay .metric-value {
  font-family: "SF Mono", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  text-shadow: none;
}

#dashboard-section .time-btn {
  font-family: "Aptos", "Segoe UI Variable Display", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

body.theme-blue #dashboard-section .chart-container h2,
body.theme-blue #dashboard-section .chart-header .perf-title-wrap > span:first-child,
body.theme-blue #dashboard-section .panel-zone-title,
body.theme-blue #dashboard-section .metrics-panel .panel-zone-title {
  color: rgba(240, 249, 255, 0.97);
  text-shadow: 0 0 24px rgba(119, 213, 255, 0.14), 0 2px 8px rgba(0, 0, 0, 0.42);
}
body.theme-blue #dashboard-section .chart-header > span,
body.theme-blue #dashboard-section .chart-legend,
body.theme-blue #dashboard-section .legend-label,
body.theme-blue #dashboard-section .metric-label,
body.theme-blue #dashboard-section .breakdown-label,
body.theme-blue #dashboard-section .profit-col.combined .profit-label,
body.theme-blue #dashboard-section .profit-col.brokers .profit-box.profit-label,
body.theme-blue #dashboard-section .profit-col.returns .profit-label {
  color: rgba(215, 234, 247, 0.88);
}
body.theme-blue #dashboard-section .time-range-selector {
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.theme-blue #dashboard-section .time-btn {
  background: transparent;
  border: 0;
  color: rgba(234, 246, 255, 0.84);
  box-shadow: none;
}
body.theme-blue #dashboard-section .time-btn:hover {
  background: rgba(229, 231, 235, 0.22);
  color: #ffffff;
  box-shadow: none;
}
body.theme-blue #dashboard-section .time-btn.active {
  background: rgba(229, 231, 235, 0.32);
  color: #fff;
  box-shadow: none;
}
body.theme-blue #dashboard-section .legend-item {
  color: rgba(232, 246, 255, 0.92);
}
body.theme-blue #dashboard-section .legend-toggle {
  accent-color: #7ee6ff;
}
body.theme-blue #dashboard-section .legend-color {
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.16);
}
body.theme-blue #dashboard-section .panel-zone {
  background:
    radial-gradient(circle at 14% 10%, rgba(120, 226, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(28, 44, 74, 0.98), rgba(15, 25, 44, 0.98));
  border: 1px solid rgba(128, 223, 255, 0.2);
  border-radius: 18px;
  box-shadow:
    0 22px 40px rgba(3, 8, 18, 0.42),
    0 0 18px rgba(0, 217, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(4, 10, 20, 0.3);
}
body.theme-blue #dashboard-section .panel-zone:hover {
  background:
    radial-gradient(circle at 14% 10%, rgba(120, 226, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(28, 44, 74, 0.98), rgba(15, 25, 44, 0.98));
  box-shadow:
    0 22px 40px rgba(3, 8, 18, 0.42),
    0 0 18px rgba(0, 217, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(128, 223, 255, 0.2);
}
body.theme-blue #dashboard-section .breakdown-item,
body.theme-blue #dashboard-section .profit-box,
body.theme-blue #dashboard-section .metric-row {
  background:
    linear-gradient(180deg, rgba(41, 64, 102, 0.98), rgba(22, 34, 58, 0.98));
  border-color: rgba(128, 223, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 24px rgba(1, 5, 12, 0.34),
    0 0 14px rgba(0, 217, 255, 0.06);
}
body.theme-blue #dashboard-section .breakdown-item:hover,
body.theme-blue #dashboard-section .profit-box:hover,
body.theme-blue #dashboard-section .metric-row:hover {
  background:
    linear-gradient(180deg, rgba(41, 64, 102, 0.98), rgba(22, 34, 58, 0.98));
  border-color: rgba(128, 223, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 24px rgba(1, 5, 12, 0.34),
    0 0 14px rgba(0, 217, 255, 0.06);
}
body.theme-blue #dashboard-section .metric-row::after {
  background: linear-gradient(90deg, rgba(126, 228, 255, 0.16), rgba(255, 255, 255, 0));
}
body.theme-blue #dashboard-section #balance-pie-chart {
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.34)) drop-shadow(0 0 18px rgba(0, 217, 255, 0.08));
}

/* ---------- PURPLE — fintech aurora violet ---------- */
body.theme-purple {
  --stocks-row-grad-start: rgba(28, 12, 54, 0.98);
  --stocks-row-grad-end: rgba(15, 5, 36, 0.98);
  --theme-accent: #c026d3;
  --theme-accent-2: #7c3aed;
  background-color: #0a0218;
  background-image:
    radial-gradient(ellipse 75% 55% at 10% -10%, rgba(217, 70, 239, 0.42), transparent 60%),
    radial-gradient(ellipse 65% 50% at 100% 16%, rgba(124, 58, 237, 0.40), transparent 65%),
    radial-gradient(ellipse 55% 60% at 50% 108%, rgba(192, 38, 211, 0.32), transparent 62%),
    radial-gradient(ellipse 40% 30% at 82% 72%, rgba(168, 85, 247, 0.22), transparent 70%),
    linear-gradient(180deg, #15052e 0%, #07011a 100%);
  background-attachment: fixed;
}
body.theme-purple ::selection { background: rgba(192, 38, 211, 0.5); color: #fff; }
body.theme-purple .settings-chip[data-theme="purple"].active {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.9), rgba(124, 58, 237, 0.9));
  border-color: rgba(232, 121, 249, 0.8);
  box-shadow: 0 0 18px rgba(192, 38, 211, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  color: #fff;
}
body.theme-purple .nav-stats .stat-item { text-shadow: 0 0 12px rgba(192, 38, 211, 0.45); }
body.theme-purple .settings-cog-btn:hover {
  box-shadow: 0 0 18px rgba(192, 38, 211, 0.55);
}
body.theme-purple *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d946ef, #7c3aed) !important;
  border-radius: 8px;
}

/* ---------- DARK — electric obsidian fintech ---------- */
body.theme-dark {
  --stocks-row-grad-start: rgba(7, 9, 14, 0.98);
  --stocks-row-grad-end: rgba(3, 4, 8, 0.98);
  --theme-accent: #22d3ee;
  --theme-accent-2: #a3e635;
  background-color: #04060a;
  background-image:
    /* faint cyan grid for the "trading terminal" feel */
    linear-gradient(rgba(34, 211, 238, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.05) 1px, transparent 1px),
    /* aurora */
    radial-gradient(ellipse 70% 50% at 8% -5%, rgba(34, 211, 238, 0.26), transparent 60%),
    radial-gradient(ellipse 60% 45% at 100% 18%, rgba(163, 230, 53, 0.16), transparent 65%),
    radial-gradient(ellipse 70% 60% at 50% 108%, rgba(56, 189, 248, 0.20), transparent 60%),
    radial-gradient(ellipse 35% 35% at 82% 72%, rgba(34, 211, 238, 0.12), transparent 70%);
  background-size: 56px 56px, 56px 56px, auto, auto, auto, auto;
  background-attachment: fixed;
}
body.theme-dark ::selection { background: rgba(34, 211, 238, 0.5); color: #02060a; }
body.theme-dark .settings-chip[data-theme="dark"].active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.9), rgba(163, 230, 53, 0.78));
  border-color: rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  color: #02060a;
}
body.theme-dark .nav-stats .stat-item { text-shadow: 0 0 12px rgba(34, 211, 238, 0.45); }
body.theme-dark .settings-cog-btn:hover {
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
}
body.theme-dark *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #22d3ee, #0ea5b7) !important;
  border-radius: 8px;
}

/* Early-bootstrap support: same rules also match when class is on <html> */
html.theme-blue   { background-color: #0e1220; }
html.theme-purple { background-color: #0a0218; }
html.theme-dark   { background-color: #04060a; }

/* =============================================================
   Mobile Web Polish — smartphone-first app shell
   ============================================================= */
@media (max-width: 768px) {
  html {
    overflow-x: hidden;
    scroll-padding-top: 88px;
  }

  body {
    width: 100%;
    overflow-x: hidden;
    padding-top: 0;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
    background-size: auto;
    -webkit-text-size-adjust: 100%;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
      radial-gradient(circle at 16% 8%, rgba(0, 217, 255, 0.14), transparent 34%),
      radial-gradient(circle at 92% 2%, rgba(102, 126, 234, 0.18), transparent 38%),
      linear-gradient(180deg, rgba(4, 8, 18, 0.15), rgba(4, 8, 18, 0.45));
  }

  .navbar {
    position: sticky;
    top: 0;
    z-index: 1100;
    padding: calc(0.55rem + env(safe-area-inset-top)) 0 0.48rem;
    background: linear-gradient(180deg, rgba(7, 13, 26, 0.94), rgba(8, 14, 28, 0.82));
    border-bottom-color: rgba(126, 228, 255, 0.18);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    overflow: visible;
  }

  .nav-container {
    width: 100%;
    max-width: none;
    padding: 0 0.75rem;
    gap: 0.72rem;
    align-items: stretch;
    filter: none;
  }

  .nav-stats {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 52px;
    grid-template-areas:
      "balance profit settings"
      "badge badge badge";
    column-gap: 0.52rem;
    row-gap: 0.52rem;
    align-items: stretch;
    justify-content: stretch;
    margin-bottom: 0.4rem;
    padding-right: 0;
    position: relative;
    z-index: 2;
    overflow: visible;
  }

  .nav-stats > .stat-item:first-of-type {
    grid-area: balance;
  }

  .nav-stats > .stat-item:nth-of-type(2) {
    grid-area: profit;
  }

  .nav-stats .stat-item {
    min-width: 0;
    min-height: 56px;
    padding: 0.62rem 0.64rem 0.66rem;
    border: 1px solid rgba(126, 228, 255, 0.17);
    border-radius: 16px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
      rgba(7, 14, 28, 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.24);
    gap: 0.22rem;
    line-height: 1;
    text-align: left;
    text-shadow: none;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 2;
  }

  .nav-stats .stat-label {
    font-size: 0.53rem;
    letter-spacing: 0.12em;
  }

  .nav-stats .stat-value {
    gap: 0.22rem;
  }

  .header-investor-badge {
    grid-area: badge;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-left: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    gap: 0.34rem;
    z-index: 1;
  }

  .header-investor-badge-metrics {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    gap: 0.36rem;
    width: 100%;
  }

  .header-investor-badge-pill {
    min-width: 0;
    width: 100%;
    padding: 0.34rem 0.5rem;
    border-radius: 12px;
  }

  .header-investor-badge-pill--accent {
    min-width: 0;
  }

  .header-investor-badge-pill-label {
    font-size: 0.48rem;
  }

  .header-investor-badge-pill-value {
    font-size: 0.78rem;
  }

  #total-balance,
  #total-profit {
    font-size: clamp(1.02rem, 4.25vw, 1.18rem);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-stats .currency-symbol {
    font-size: 0.7rem;
  }

  .nav-settings {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    grid-area: settings;
    align-self: stretch;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-width: 52px;
    visibility: visible;
    opacity: 1;
    z-index: 3;
  }

  .settings-cog-btn {
    display: inline-flex;
    width: 52px;
    height: 100%;
    min-height: 54px;
    border-radius: 16px;
  }

  .settings-menu {
    top: calc(100% + 10px);
    right: 0;
    z-index: 1300;
    width: min(248px, calc(100vw - 1.5rem));
    max-height: min(72vh, 560px);
    overflow-y: auto;
  }

  .nav-menu {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    z-index: 1001;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.42rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
    border: 1px solid rgba(126, 228, 255, 0.18);
    border-radius: 22px;
    background:
      radial-gradient(circle at 10% 0%, rgba(0, 217, 255, 0.18), transparent 38%),
      linear-gradient(180deg, rgba(10, 17, 33, 0.96), rgba(6, 10, 21, 0.92));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    scroll-snap-type: x proximity;
  }

  .nav-menu::-webkit-scrollbar,
  .time-range-selector::-webkit-scrollbar,
  .chart-legend::-webkit-scrollbar {
    display: none;
  }

  .nav-menu li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .nav-logo-item {
    display: none;
  }

  .nav-menu li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.55rem 0.86rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(234, 246, 255, 0.86);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.01em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .nav-menu li a:hover,
  .nav-menu li a.active {
    transform: none;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.22), rgba(107, 140, 255, 0.25));
    border-color: rgba(126, 228, 255, 0.32);
    color: #ffffff;
    box-shadow: 0 0 18px rgba(0, 217, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  .container {
    width: 100%;
    max-width: none;
    padding: 0 0.75rem 1.2rem;
  }

  .section {
    min-height: auto;
  }

  h1 {
    font-size: clamp(1.8rem, 9vw, 2.45rem);
    margin-bottom: 1.15rem;
  }

  p {
    font-size: 1rem;
  }

  #stocks-section,
  #deposits-section,
  #dividends-section {
    margin-top: 0;
    padding-top: 0.35rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .dashboard-grid > *,
  .wide-panel-grid > *,
  .chart-container,
  .performance-chart-container,
  .panel-zone {
    min-width: 0;
  }

  #dashboard-section .chart-container,
  #dashboard-section .performance-chart-container,
  .chart-container,
  .performance-chart-container,
  .panel-zone,
  #settings-section .settings-card,
  #profile-section .profile-card,
  .withdrawals-summary-panel,
  .leaderboard-header,
  .leaderboard-card,
  .leaderboard-popular,
  .taxes-page .settings-card {
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(3, 8, 18, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .chart-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 338px;
    margin-top: 0.4rem;
    padding: 1rem;
  }

  #dashboard-section .chart-container {
    min-height: 372px;
  }

  .chart-container h2,
  .chart-header h2,
  #dashboard-section .chart-header .perf-title-wrap,
  #dashboard-section .panel-zone-title {
    font-size: 1rem;
    line-height: 1.25;
  }

  #balance-pie-chart {
    width: min(76vw, 300px) !important;
    height: min(76vw, 300px) !important;
    max-width: 300px;
    max-height: 300px;
  }

  .dashboard-metrics-overlay {
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.72rem;
    border-radius: 18px;
  }

  .metric-row {
    flex: 1 1 100%;
    min-height: 42px;
    padding: 0.45rem 0.55rem;
  }

  .metric-label {
    font-size: 0.66rem;
  }

  .metric-value {
    font-size: 0.76rem;
  }

  .settings-missing-tip::after {
    left: auto;
    right: -10px;
    min-width: min(250px, calc(100vw - 48px));
  }

  .performance-chart-container {
    height: 430px;
    min-height: 430px;
    margin-top: 0;
    padding: 1rem;
  }

  .chart-header {
    gap: 0.65rem;
    margin-bottom: 0.55rem;
  }

  .chart-header h2 {
    width: 100%;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: wrap;
  }

  .performance-badge {
    min-width: 82px;
    padding: 0.38rem 0.7rem;
    font-size: 0.86rem;
    border-width: 1px;
  }

  .time-range-selector,
  .chart-legend {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .time-range-selector {
    gap: 0.32rem;
    padding: 0.22rem 0 0.12rem;
  }

  .time-btn {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 36px;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    font-size: 0.78rem;
  }

  .chart-legend {
    gap: 0.75rem;
    padding: 0.12rem 0 0.35rem;
  }

  .legend-item,
  .legend-checkbox {
    flex: 0 0 auto;
  }

  #performance-chart {
    min-height: 245px;
  }

  .wide-panel-container {
    width: 100%;
    margin: 0.9rem 0 0;
    padding: 0;
    min-height: auto;
  }

  .wide-panel-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    height: auto;
    align-items: stretch;
  }

  .panel-zone,
  #deposits-section .panel-zone {
    width: 100%;
    max-width: 100%;
    padding: 0.88rem;
    transform: none !important;
    min-width: 0;
    overflow: visible;
    isolation: isolate;
  }

  .panel-zone-tall {
    height: auto;
    min-height: 190px;
  }

  .deposits-breakdown {
    padding: 0;
  }

  .breakdown-item,
  .profit-box {
    min-width: 0;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
  }

  .breakdown-label,
  .profit-col.combined .profit-label,
  .profit-col.brokers .profit-box.profit-label,
  .profit-col.returns .profit-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.76rem;
  }

  .breakdown-value,
  .breakdown-value-white,
  .profit-col.combined .profit-value,
  .profit-col.returns .profit-value {
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
  }

  .profit-col.profits .profit-box {
    font-size: 0.86rem;
  }

  .breakdown-value-profit,
  .profit-value {
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profit-col.combined .profit-box,
  .profit-col.returns .profit-box {
    gap: 0.38rem;
  }

  #dashboard-section .chart-container h2,
  #dashboard-section .chart-header .perf-title-wrap > span:first-child,
  #dashboard-section .wide-panel-grid .panel-zone-title {
    font-size: 0.56rem;
    margin-bottom: 0.54rem;
    letter-spacing: 0.12em;
  }

  #dashboard-section .metrics-panel-zone {
    padding-top: 0.82rem;
  }

  #dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) .breakdown-item,
  #dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) .profit-box {
    padding: 0.3rem 0;
  }

  #dashboard-section .wide-panel-grid .breakdown-label,
  #dashboard-section .wide-panel-grid .profit-label {
    font-size: 0.58rem;
  }

  #dashboard-section .wide-panel-grid .breakdown-value,
  #dashboard-section .wide-panel-grid .breakdown-value-white,
  #dashboard-section .wide-panel-grid .breakdown-value-profit,
  #dashboard-section .wide-panel-grid .profit-value {
    font-size: 0.76rem;
  }

  #dashboard-section .metrics-panel .metric-row {
    padding: 0.38rem 0.5rem 0.42rem;
  }

  #dashboard-section .metrics-panel .metric-label {
    font-size: 0.52rem;
  }

  #dashboard-section .metrics-panel .metric-value {
    font-size: 0.74rem;
  }

  .profit-split-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .table-header,
  #stocks-section .table-header,
  #deposits-section .table-header.deposits-toolbar,
  #dividends-section .table-header {
    width: 100%;
    max-width: 100%;
    justify-content: center !important;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin: 0.45rem auto 0.75rem !important;
  }

  .add-btn,
  .refresh-btn,
  .export-btn,
  .dividend-import-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    margin-left: 0;
  }

  .import-btn,
  .delete-selected-btn {
    min-height: 42px;
    border-radius: 14px;
    padding: 0.55rem 0.8rem;
  }

  .stocks-last-updated {
    order: 20;
    width: 100%;
    text-align: center;
    font-size: 0.72rem;
    opacity: 0.78;
  }

  .stocks-table,
  #withdrawals-table,
  #stocks-gains-table,
  #dividends-table,
  #dividends-monthly-table,
  .chart-history-table,
  #users-table,
  .leaderboard-table table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-radius: 18px;
    background: rgba(7, 14, 28, 0.35);
    border: 1px solid rgba(126, 228, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 34px rgba(0, 0, 0, 0.26);
  }

  .stocks-table::-webkit-scrollbar,
  #withdrawals-table::-webkit-scrollbar,
  #stocks-gains-table::-webkit-scrollbar,
  #dividends-table::-webkit-scrollbar,
  #dividends-monthly-table::-webkit-scrollbar,
  .chart-history-table::-webkit-scrollbar,
  #users-table::-webkit-scrollbar,
  .leaderboard-table table::-webkit-scrollbar {
    height: 8px;
  }

  .stocks-table::-webkit-scrollbar-thumb,
  #withdrawals-table::-webkit-scrollbar-thumb,
  #stocks-gains-table::-webkit-scrollbar-thumb,
  #dividends-table::-webkit-scrollbar-thumb,
  #dividends-monthly-table::-webkit-scrollbar-thumb,
  .chart-history-table::-webkit-scrollbar-thumb,
  #users-table::-webkit-scrollbar-thumb,
  .leaderboard-table table::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 217, 255, 0.7), rgba(107, 140, 255, 0.7));
  }

  #stocks-section .stocks-table thead,
  #stocks-section .stocks-table tbody {
    display: block;
    min-width: 1060px;
  }

  #deposits-section .stocks-table thead,
  #deposits-section .stocks-table tbody {
    display: block;
    min-width: 720px;
  }

  #withdrawals-table thead,
  #withdrawals-table tbody {
    display: block;
    min-width: 760px;
  }

  #stocks-gains-table thead,
  #stocks-gains-table tbody {
    min-width: 980px;
  }

  #dividends-table thead,
  #dividends-table tbody,
  #dividends-monthly-table thead,
  #dividends-monthly-table tbody,
  .chart-history-table thead,
  .chart-history-table tbody,
  #users-table thead,
  #users-table tbody {
    width: 100%;
    min-width: 620px;
  }

  #dividends-monthly-table thead,
  #dividends-monthly-table tbody,
  .chart-history-table thead,
  .chart-history-table tbody {
    min-width: 900px;
  }

  .stocks-table th,
  .stocks-table td,
  #dividends-table th,
  #dividends-table td,
  #dividends-monthly-table th,
  #dividends-monthly-table td,
  .chart-history-table th,
  .chart-history-table td,
  #users-table th,
  #users-table td {
    font-size: 0.76rem;
  }

  .floating-add-btn,
  #withdrawals-section .floating-add-btn {
    right: 18px;
    bottom: calc(98px + env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
  }

  .allocation-switch-wrapper {
    margin: 0.9rem 0 0.8rem;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.2rem;
  }

  .allocation-switch {
    min-width: max-content;
    padding: 0.28rem;
  }

  .allocation-option {
    min-height: 40px;
    padding: 0.48rem 0.85rem;
    font-size: 0.78rem;
  }

  .allocation-container.vertical-layout {
    gap: 0.9rem;
  }

  .allocation-list-vertical {
    gap: 0.55rem;
  }

  .allocation-pie-wrapper.square-pie {
    width: 100%;
    max-width: 360px;
    min-height: 340px;
    margin-inline: auto;
  }

  #allocation-pie-chart {
    max-width: 100%;
  }

  #deposits-section .deposits-chart-card,
  #dividends-section .chart-container {
    width: 100%;
    max-width: 100%;
    height: 430px;
    min-height: 430px;
    padding: 1rem;
  }

  #deposits-section .deposits-chart-header,
  .dividends-chart-header {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .monthly-pagination-wrapper,
  .leaderboard-pagination-wrapper,
  #deposits-section #deposits-pagination-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .monthly-pagination-left,
  .monthly-pagination-right,
  .leaderboard-pagination-left,
  .leaderboard-pagination-right {
    justify-content: center;
    flex-wrap: wrap;
  }

  #settings-section .settings-page,
  .taxes-page {
    max-width: 100%;
    gap: 0.75rem;
  }

  #settings-section .settings-card,
  #taxes-section .settings-card {
    padding: 0.85rem;
  }

  #settings-section .settings-card summary,
  #taxes-section .settings-card summary {
    gap: 0.7rem;
  }

  #settings-section .settings-title {
    font-size: 0.9rem;
  }

  #settings-section .settings-grid,
  #settings-section .account-grid,
  #settings-section .settings-row,
  #settings-section .account-row,
  #settings-section .settings-inline {
    grid-template-columns: 1fr;
  }

  #settings-section .settings-actions,
  #settings-section .account-actions,
  .download-data-actions,
  .chart-history-controls,
  .chart-history-id-range,
  .chart-history-date-range {
    width: 100%;
    justify-content: stretch;
  }

  #platform-settings-card .settings-action-btn,
  #account-settings-card .account-btn,
  .chart-history-reset,
  .download-menu,
  .download-menu .export-btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  #settings-section input,
  #settings-section select,
  .chart-history-search,
  .chart-history-id-range input,
  .date-pill {
    min-height: 42px;
    width: 100%;
  }

  #profile-section .profile-page,
  #settings-section .account-grid,
  #admin-section .admin-layout {
    grid-template-columns: 1fr;
  }

  #profile-section .profile-page {
    width: 100%;
    max-width: 100%;
    gap: 0.78rem;
    margin-top: 0.25rem;
  }

  #profile-section .profile-page > *,
  #profile-section .profile-main,
  #profile-section .profile-sidebar {
    min-width: 0;
  }

  #profile-section .ffi-bar-wrap {
    margin-top: 0;
  }

  #profile-section .ffi-bar-wrap,
  #profile-section .ffi-progress-wrap,
  #profile-section .profile-sidebar,
  #profile-section .profile-card,
  #profile-section .profile-table,
  #profile-section .profile-chart {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #profile-section .ffi-bar-wrap,
  #profile-section .ffi-progress-wrap {
    padding: 0.72rem 0.7rem 0.62rem;
    overflow: visible;
  }

  #profile-section .ffi-bar-title,
  #profile-section .ffi-progress-caption {
    font-size: 0.72rem;
    line-height: 1.28;
  }

  #profile-section .ffi-bar-track {
    height: 18px;
    margin-top: 1.1rem;
  }

  #profile-section .ffi-bar-labels {
    gap: 0.18rem;
    font-size: 0.52rem;
    line-height: 1.15;
  }

  #profile-section .ffi-bar-labels span {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
  }

  #profile-section .ffi-bar-tooltip,
  #profile-section .ffi-progress-marker::after {
    max-width: calc(100vw - 2rem);
    white-space: normal;
    text-align: center;
  }

  #profile-section .profile-sidebar {
    padding: 0.82rem;
    gap: 0.85rem;
  }

  #profile-section .profile-kv {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  #profile-section .profile-key,
  #profile-section .profile-key--with-info {
    min-width: 0;
  }

  #profile-section .profile-value {
    min-width: 0;
    max-width: 100%;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #profile-section .profile-card {
    padding: 0.9rem;
  }

  #profile-section .profile-card-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #profile-section .profile-collapse-btn {
    flex: 0 0 auto;
  }

  #profile-section .profile-summary-grid,
  .withdrawals-summary,
  .leaderboard-summary-grid,
  .leaderboard-top-cards,
  #admin-section .admin-stats-grid,
  #admin-section .admin-charts-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  #profile-section .profile-table {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.6rem;
  }

  #profile-section .profile-table-row {
    min-width: 760px;
    grid-template-columns: repeat(9, minmax(78px, 1fr));
  }

  #profile-section .profile-table-row + .profile-table-row {
    margin-top: 0.4rem;
  }

  #profile-section .profile-chart {
    padding: 0.75rem;
  }

  #profile-section .profile-chart-graph {
    height: 198px;
  }

  #profile-section .profile-chart-toggle,
  #profile-section .profile-chart-legend {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  #profile-section .profile-chart-axis {
    gap: 0.42rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.6rem;
  }

  #profile-section .profile-chart-tooltip {
    max-width: calc(100vw - 2.25rem);
    white-space: normal;
    line-height: 1.25;
  }

  #admin-section .admin-sidebar {
    padding: 0.75rem;
  }

  #admin-section .admin-sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  #admin-section .admin-side-item {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  #admin-section .admin-main,
  #admin-section .admin-hero-card,
  .admin-panel {
    padding: 0.9rem;
  }

  .leaderboard-header,
  .leaderboard-pagination-wrapper,
  .leaderboard-table {
    width: 100%;
  }

  .leaderboard-header {
    align-items: stretch;
    text-align: left;
  }

  .modal-content {
    width: calc(100vw - 1.5rem);
    max-width: 420px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.25rem;
    border-radius: 20px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-btn {
    width: 100%;
  }

  .profile-notification-stack {
    top: calc(82px + env(safe-area-inset-top));
    right: 0.75rem;
    left: 0.75rem;
  }

  .cookie-consent {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  #admin-section .admin-view--users .admin-users-summary {
    justify-content: flex-start;
  }

  #admin-section .admin-view--users .admin-users-table {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  #admin-section .admin-view--users #users-table {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  #admin-section .admin-view--users #users-table thead {
    display: none;
  }

  #admin-section .admin-view--users #users-table tbody {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 0.7rem;
  }

  #admin-section .admin-view--users #users-table tr {
    display: grid;
    gap: 0.55rem;
    padding: 0.82rem 0.78rem;
    border: 1px solid rgba(126, 228, 255, 0.16);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(12, 16, 30, 0.96), rgba(8, 13, 26, 0.9));
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
    cursor: pointer;
  }

  #admin-section .admin-view--users #users-table tbody tr.highlight,
  #admin-section .admin-view--users #users-table tbody tr.selected,
  #admin-section .admin-view--users #users-table tbody tr:hover {
    border-color: rgba(126, 228, 255, 0.4);
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(126, 228, 255, 0.14);
  }

  #admin-section .admin-view--users #users-table td {
    display: grid;
    grid-template-columns: minmax(88px, 108px) minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
    padding: 0;
    border-bottom: none;
    font-size: 0.78rem;
  }

  #admin-section .admin-view--users #users-table td::before {
    content: attr(data-label);
    color: rgba(126, 228, 255, 0.8);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.25;
    text-transform: uppercase;
  }

  #admin-section .admin-view--users #users-table td[data-field="user"] .user-cell {
    gap: 0.18rem;
  }

  #admin-section .admin-view--users #users-table td[data-field="actions"],
  #admin-section .admin-view--users #users-table td[colspan] {
    grid-template-columns: 1fr;
  }

  #admin-section .admin-view--users #users-table td[data-field="actions"]::before,
  #admin-section .admin-view--users #users-table td[colspan]::before {
    display: none;
  }

  #admin-section .admin-view--users #users-table .admin-support-open {
    width: 100%;
    text-align: center;
  }

  #admin-section #admin-users-pagination-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  #admin-section #admin-users-pagination-wrapper .monthly-pagination-left,
  #admin-section #admin-users-pagination-wrapper .monthly-pagination-right {
    width: 100%;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  #admin-section #admin-users-pagination-wrapper .monthly-pagination-right {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding-inline: 0.62rem;
  }

  .nav-stats {
    column-gap: 0.4rem;
    row-gap: 0.52rem;
    margin-bottom: 0.52rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
    grid-template-areas:
      "balance profit settings"
      "badge badge badge";
  }

  .nav-stats .stat-item {
    min-height: 50px;
    padding: 0.56rem 0.48rem 0.6rem;
    border-radius: 15px;
    gap: 0.16rem;
  }

  .nav-stats .stat-label {
    font-size: 0.48rem;
    letter-spacing: 0.11em;
  }

  .nav-stats .stat-value {
    gap: 0.18rem;
  }

  .header-investor-badge {
    padding: 0;
    border-radius: 0;
  }

  .header-investor-badge-pill {
    padding: 0.3rem 0.38rem;
  }

  .header-investor-badge-pill-label {
    font-size: 0.45rem;
  }

  .header-investor-badge-pill-value {
    font-size: 0.7rem;
  }

  #total-balance,
  #total-profit {
    font-size: clamp(0.96rem, 3.9vw, 1.06rem);
  }

  .nav-stats .currency-symbol {
    font-size: 0.64rem;
  }

  .nav-settings {
    justify-self: stretch;
    min-width: 44px;
  }

  #dashboard-section .chart-container h2,
  #dashboard-section .chart-header .perf-title-wrap > span:first-child,
  #dashboard-section .wide-panel-grid .panel-zone-title {
    font-size: 0.52rem;
    margin-bottom: 0.48rem;
    letter-spacing: 0.11em;
  }

  #dashboard-section .metrics-panel-zone {
    padding-top: 0.72rem;
  }

  #dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) .breakdown-item,
  #dashboard-section .wide-panel-grid > .panel-zone:nth-child(-n+4) .profit-box {
    padding: 0.26rem 0;
  }

  #dashboard-section .wide-panel-grid .breakdown-label,
  #dashboard-section .wide-panel-grid .profit-label {
    font-size: 0.55rem;
  }

  #dashboard-section .wide-panel-grid .breakdown-value,
  #dashboard-section .wide-panel-grid .breakdown-value-white,
  #dashboard-section .wide-panel-grid .breakdown-value-profit,
  #dashboard-section .wide-panel-grid .profit-value {
    font-size: 0.74rem;
  }

  #dashboard-section .metrics-panel .metric-row {
    padding: 0.34rem 0.44rem 0.38rem;
  }

  #dashboard-section .metrics-panel .metric-label {
    font-size: 0.49rem;
  }

  #dashboard-section .metrics-panel .metric-value {
    font-size: 0.7rem;
  }

  .settings-cog-btn {
    width: 44px;
    height: 100%;
    min-height: 50px;
    border-radius: 15px;
  }

  .nav-menu {
    padding: 0.42rem;
    border-radius: 20px;
  }

  .nav-menu li a {
    min-height: 40px;
    padding: 0.5rem 0.72rem;
    font-size: 0.72rem;
  }

  .container {
    padding-inline: 0.58rem;
  }

  .chart-container,
  .performance-chart-container,
  .panel-zone,
  #settings-section .settings-card,
  #profile-section .profile-card,
  .withdrawals-summary-panel {
    border-radius: 18px;
  }

  #dashboard-section .chart-container {
    min-height: 348px;
  }

  #balance-pie-chart {
    width: min(72vw, 270px) !important;
    height: min(72vw, 270px) !important;
  }

  .performance-chart-container {
    height: 405px;
    min-height: 405px;
  }

  #performance-chart {
    min-height: 220px;
  }

  .metric-row {
    flex-basis: 100%;
  }

  .time-btn {
    min-width: 40px;
    min-height: 34px;
    padding: 0.4rem 0.58rem;
    font-size: 0.72rem;
  }

  .breakdown-item,
  .profit-box {
    padding: 0.5rem 0.55rem;
  }

  .floating-add-btn,
  #withdrawals-section .floating-add-btn {
    right: 14px;
    width: 50px;
    height: 50px;
  }

  .allocation-option {
    padding-inline: 0.72rem;
  }

  #deposits-section .deposits-chart-card,
  #dividends-section .chart-container {
    height: 405px;
    min-height: 405px;
  }

  #profile-section .profile-summary-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  #profile-section .profile-summary-item {
    padding: 0.58rem;
  }

  #profile-section .profile-kv {
    grid-template-columns: 1fr;
    gap: 0.12rem;
  }

  #profile-section .profile-value {
    text-align: left;
  }

  #profile-section .profile-info-tip::after {
    left: 50%;
    min-width: min(220px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    transform: translate(-50%, 4px);
  }

  #profile-section .profile-info-tip:hover::after,
  #profile-section .profile-info-tip:focus-visible::after {
    transform: translate(-50%, 0);
  }

  #profile-section .ffi-progress-wrap {
    padding-top: 0.86rem;
  }

  #profile-section #ffi-progress-marker {
    width: 22px;
    height: 28px;
    margin-left: -11px;
    margin-top: -26px;
  }

  #profile-section #ffi-progress-marker::before {
    width: 20px;
    height: 25px;
  }

  #profile-section .profile-chart-graph {
    height: 180px;
  }

  #profile-section .profile-chart-toggle-btn {
    padding: 0.24rem 0.55rem;
  }

  .profile-notification-stack {
    top: calc(78px + env(safe-area-inset-top));
  }
}

@media (hover: none) and (pointer: coarse) {
  .nav-menu li a,
  .time-btn,
  .add-btn,
  .refresh-btn,
  .export-btn,
  .import-btn,
  .settings-cog-btn,
  .allocation-option,
  .monthly-page-btn,
  .leaderboard-like-btn {
    touch-action: manipulation;
  }

  .chart-container:hover,
  .performance-chart-container:hover,
  .panel-zone:hover,
  .breakdown-item:hover,
  .profit-box:hover,
  #stocks-tbody tr:hover,
  #deposits-tbody tr:hover,
  #withdrawals-table-body tr:hover,
  #stocks-gains-table-body tr:hover,
  #dividends-table tbody tr:hover {
    transform: none;
  }
}
