/* Módulo DCA — portfólios de análise */

.dca-page {
  padding-bottom: 100px;
}

.dca-overview-page .dashboard-wrap {
  max-width: var(--shell-max);
  margin: 0 auto;
}

.dca-free-banner {
  margin: 0 16px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.06);
  font-size: 0.65rem;
  line-height: 1.4;
  color: #86efac;
}

/* Balance header — estilo CMC */
.dca-balance-section {
  padding: 8px 16px 14px;
}

.dca-portfolio-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 40px;
}

.dca-portfolio-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  flex: 1;
  min-width: 0;
  text-align: left;
  line-height: 1.2;
}

.dca-portfolio-picker-btn #picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.picker-icon {
  font-size: 1rem;
  opacity: 0.9;
  flex-shrink: 0;
}

.picker-chevron {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 2px;
}

.picker-settings-btn {
  border: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.12rem;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.picker-settings-btn:hover,
.picker-settings-btn:focus-visible {
  color: var(--gold);
  border-color: rgba(201, 169, 98, 0.45);
}

.dca-action-list-item.danger strong {
  color: #f87171;
}

.dca-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dca-balance-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.dca-balance-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  min-width: 0;
}

.dca-eye-btn,
.dca-add-btn {
  border: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.12rem;
  color: var(--text);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dca-add-btn {
  font-size: 1.35rem;
  font-weight: 300;
}

.dca-change-row {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.dca-change-row.positive { color: var(--green, #10b981); }
.dca-change-row.negative { color: #f87171; }

.dca-pnl-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.dca-pnl-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.dca-pnl-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dca-pnl-value {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dca-pnl-row.positive .dca-pnl-value { color: var(--green, #10b981); }
.dca-pnl-row.negative .dca-pnl-value { color: #f87171; }

.dca-pnl-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.dca-pnl-row.positive .dca-pnl-hint { color: rgba(16, 185, 129, 0.85); }
.dca-pnl-row.negative .dca-pnl-hint { color: rgba(248, 113, 113, 0.85); }

.change-arrow {
  font-size: 0.65rem;
}

small.positive { color: var(--green, #10b981); }
small.negative { color: #f87171; }

/* Tabs */
.dca-main-tabs,
.dca-sub-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 10px;
}

.dca-main-tabs {
  border-bottom: 1px solid var(--border);
}

.dca-main-tab,
.dca-sub-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
}

.dca-main-tab.active {
  color: var(--blue, #3b82f6);
  border-bottom-color: var(--blue, #3b82f6);
}

.dca-sub-tab {
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.dca-sub-tab.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--blue, #3b82f6);
}

.dca-sub-tab.soon,
.dca-main-tab.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dca-period-tabs {
  display: flex;
  gap: 4px;
  margin: 0 16px 8px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.dca-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 16px 8px;
}

.dca-chart-toolbar .dca-period-tabs {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.btn-chart-refresh {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.dca-period-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
}

.dca-period-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dca-portfolio-chart {
  margin-top: 0;
}

.dca-portfolio-chart .chart-wrap {
  height: 180px;
}

/* Holdings table */
.holdings-table-head {
  display: grid;
  grid-template-columns: 1fr 0.75fr 0.75fr 0.85fr 0.65fr 36px;
  gap: 6px;
  align-items: center;
  padding: 8px 16px;
}

#view-holdings .col-consolidated,
#view-holdings .consolidated-cell {
  display: block;
  text-align: right;
}

.consolidated-cell small {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.pf-import-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.pf-import-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.holdings-table-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.holdings-row-body {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 0.75fr 0.75fr 0.85fr 0.65fr;
  gap: 6px;
  align-items: center;
  padding: 8px 0 8px 16px;
  text-decoration: none;
  color: inherit;
}

.holdings-row-body:active {
  background: rgba(59, 130, 246, 0.06);
}

.holdings-alert-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  flex-shrink: 0;
  margin-right: 8px;
  font-size: 1rem;
  text-decoration: none;
  opacity: 0.72;
  border-radius: 8px;
  align-self: center;
}

.holdings-alert-btn:hover,
.holdings-alert-btn:focus-visible {
  opacity: 1;
  background: rgba(59, 130, 246, 0.12);
}

.holdings-head-action {
  width: 36px;
}

.holdings-table-head {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.holdings-table-head span:not(:first-child) {
  text-align: right;
}

.holdings-table-head .sortable {
  text-align: right;
  color: var(--blue, #3b82f6);
}

.holdings-table-row:active {
  background: transparent;
}

.holdings-table-row:last-child .holdings-row-body {
  border-bottom: none;
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.asset-cell strong {
  font-size: 0.88rem;
}

.asset-icon-img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
}

.asset-icon-fallback {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(201, 169, 98, 0.25);
  color: #c9a962;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.price-cell,
.avg-price-cell,
.return-cell,
.holdings-cell {
  text-align: right;
}

.price-cell strong,
.avg-price-cell strong,
.return-cell strong,
.holdings-cell strong {
  display: block;
  font-size: 0.82rem;
}

.price-cell small,
.avg-price-cell small,
.return-cell small,
.holdings-cell small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.return-cell strong.positive,
.return-cell small.positive {
  color: #10b981;
}

.return-cell strong.negative,
.return-cell small.negative {
  color: #ef4444;
}

.avg-price-cell strong {
  font-weight: 600;
}

/* Bottom sheet — seletor de portfólios */
.dca-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dca-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 78vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dca-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin: 10px auto 6px;
}

.dca-sheet-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.dca-sheet-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.dca-sheet-summary-right {
  text-align: right;
}

.dca-sheet-summary-right strong {
  display: block;
  font-size: 1rem;
}

.dca-sheet-summary-right small {
  display: block;
  font-size: 0.68rem;
  margin-top: 2px;
}

.dca-sheet-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}

.sheet-portfolio-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.sheet-portfolio-row.active {
  background: rgba(59, 130, 246, 0.08);
}

.sheet-portfolio-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.sheet-portfolio-icon.all {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue, #3b82f6);
}

.sheet-portfolio-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.sheet-portfolio-values {
  text-align: right;
}

.sheet-portfolio-values strong {
  display: block;
  font-size: 0.82rem;
}

.sheet-portfolio-values small {
  display: block;
  font-size: 0.65rem;
  margin-top: 2px;
}

.dca-sheet-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.dca-sheet-title {
  margin: 0 16px 12px;
  font-size: 0.95rem;
}

.dca-sheet-compact .dca-sheet-title {
  margin-top: 4px;
}

.dca-action-list {
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dca-action-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dca-action-list-item strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.dca-action-list-item small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.dca-action-list-item .action-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tx-pnl-line.green { color: #10b981; }
.tx-pnl-line.red { color: #ef4444; }

.sheet-pick-symbol {
  font-weight: 700;
  min-width: 3rem;
}
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sheet-pick-name {
  flex: 1;
  font-weight: 700;
  font-size: 0.88rem;
}

.sheet-pick-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Floating actions — removido da UI; mantido sheet footer */
.dca-action-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--blue, #3b82f6);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.dca-action-btn.primary {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

.modal-hint {
  margin: -4px 0 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stablecoin-keep-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.stablecoin-keep-row .pf-import-toggle {
  flex-shrink: 0;
  max-width: 52%;
}

.sell-keep-hint {
  margin: 0 !important;
  flex: 1;
  min-width: 140px;
  line-height: 1.35;
}

#buy-extra-panel {
  margin-top: 14px;
  padding-top: 2px;
}

#buy-portfolio-balance-field {
  margin-top: 12px;
}

#buy-balance-panel {
  margin-top: 10px;
}

#buy-balance-panel .modal-hint,
#buy-balance-panel .tx-available-hint {
  margin-top: 8px;
}

.analyze-intro {
  margin: 0 16px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.analysis-card {
  display: block;
  margin: 0 16px 10px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.analysis-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.analysis-card-head .asset-cell small {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.analysis-metrics div {
  background: rgba(148, 163, 184, 0.06);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.analysis-metrics span {
  display: block;
  font-size: 0.58rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.analysis-metrics strong {
  font-size: 0.78rem;
}

.analysis-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.signal-pill {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.signal-pill.positive {
  color: var(--green, #10b981);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.signal-pill.negative {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

.dca-section-highlight {
  animation: dca-section-pulse 1.8s ease-out;
}

@keyframes dca-section-pulse {
  0% { background: rgba(59, 130, 246, 0.14); }
  100% { background: transparent; }
}

.dca-search-page {
  max-width: 520px;
  margin: 0 auto;
}

.dca-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.dca-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.search-hint {
  margin: 0 16px 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.search-results {
  padding-bottom: 24px;
}

.search-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.search-result-symbol {
  font-weight: 800;
  min-width: 52px;
}

.search-result-name {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Transação estilo CMC */
.dca-tx-page .dashboard-wrap {
  max-width: var(--shell-max);
  margin: 0 auto;
}

.tx-asset-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.tx-asset-head small {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.tx-change-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue, #3b82f6);
  text-decoration: none;
  min-width: 48px;
  text-align: right;
}

.tx-type-tabs {
  display: flex;
  gap: 4px;
  margin: 12px 16px;
  padding: 4px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tx-type-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.tx-type-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tx-inline-field {
  margin: 0.75rem 0;
}

.tx-inline-field label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.tx-inline-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.88rem;
}

.tx-available-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--gold);
}

.search-result-link {
  text-decoration: none;
  color: inherit;
}

.search-result-link:hover {
  background: rgba(201, 169, 98, 0.08);
}

.tx-type-tab.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tx-amount-panel {
  padding: 24px 16px 12px;
  text-align: center;
}

.tx-amount-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.tx-amount-row input {
  border: none;
  background: transparent;
  font-size: 2.4rem;
  font-weight: 800;
  width: min(220px, 55vw);
  text-align: right;
  color: var(--text);
  outline: none;
}

.tx-amount-row span {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 700;
}

.tx-price-ref {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tx-unit-price-block {
  margin: 0.85rem 0 0.35rem;
}

.tx-unit-price-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.tx-unit-price-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.tx-unit-price-header input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.tx-price-inline-wrap {
  margin-bottom: 0.35rem;
}

.tx-price-inline-wrap.hidden {
  display: none;
}

.tx-price-inline-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
}

.tx-zero-hint {
  margin: 10px 0 12px;
  font-size: 0.72rem;
  color: var(--gold);
  line-height: 1.35;
}

.tx-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.tx-meta-chip {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--text);
}

.tx-notes-field {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.tx-notes-field.hidden {
  display: none;
}

.tx-submit {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 24px;
  padding: 14px;
  font-size: 0.88rem;
}

.dca-intro {
  padding: 0 16px 12px;
  text-align: center;
}

.dca-intro h1 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.dca-intro p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dca-free-banner {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  font-size: 0.72rem;
  line-height: 1.45;
  color: #a7f3d0;
}

.dca-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px 12px;
}

.dca-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.dca-feature strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.dca-feature.soon {
  opacity: 0.65;
}

.dca-section {
  padding: 0 16px 16px;
}

.dca-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 10px;
}

.dca-section-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dca-holdings-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
}

.btn-toolbar {
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
}

.dca-modal-wide {
  max-width: 520px;
}

.sell-history-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}

.sell-history-panel {
  margin-top: 0;
}

.sell-preview-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.sell-preview-panel small {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.sell-preview-panel strong {
  font-size: 0.85rem;
}

.sell-preview-panel strong.green { color: #10b981; }
.sell-preview-panel strong.red { color: #ef4444; }

.sell-split-list {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(201, 169, 98, 0.08);
  border: 1px solid rgba(201, 169, 98, 0.25);
  font-size: 0.78rem;
  line-height: 1.45;
}

.sell-split-list p {
  margin: 0.25rem 0;
}

.sell-history-table-wrap {
  max-height: 60vh;
  overflow: auto;
  margin: 0.5rem 0 1rem;
}

.sell-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.sell-history-table th,
.sell-history-table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.sell-history-table th {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sell-history-table tfoot td {
  border-bottom: none;
  padding-top: 0.75rem;
}

.sell-history-table .pnl-green { color: #10b981; }
.sell-history-table .pnl-red { color: #ef4444; }

.history-item.sell-item .history-item-head strong {
  color: #f59e0b;
}

.dca-section-head h2 {
  margin: 0;
  font-size: 0.92rem;
}

.btn-dca-primary {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  color: #1a1208;
  background: linear-gradient(90deg, var(--gold-start, #c9a962), var(--gold-end, #e8d5a3));
}

.btn-dca-primary.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-dca-secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.portfolio-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}

.portfolio-card:active {
  border-color: rgba(59, 130, 246, 0.45);
}

.portfolio-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.portfolio-card-head strong {
  font-size: 0.9rem;
}

.portfolio-type-badge {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.portfolio-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.72rem;
}

.portfolio-card-meta span {
  color: var(--text-muted);
}

.portfolio-card-meta strong {
  display: block;
  color: var(--text);
  margin-top: 2px;
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 15, 28, 0.92);
  backdrop-filter: blur(8px);
}

.detail-topbar #btn-delete-asset {
  flex-shrink: 0;
  font-size: 0.68rem;
  padding: 6px 10px;
}

.detail-topbar #asset-title {
  flex: 1;
  text-align: center;
}

.back-link-btn {
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  text-decoration: none;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 12px;
}

.stat-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.stat-mini-card.wide {
  grid-column: 1 / -1;
}

.stat-mini-card small {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.stat-mini-card strong {
  font-size: 1rem;
}

.stat-mini-card strong.green { color: var(--green); }
.stat-mini-card strong.red { color: #f87171; }
.stat-mini-card strong.gold { color: var(--gold-start, #c9a962); }

.stat-dual-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.stat-dual-item {
  flex: 1;
  min-width: 0;
}

.stat-dual-item-right {
  text-align: right;
}

.stat-dual-item small {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.stat-dual-item strong {
  font-size: 1rem;
  word-break: break-word;
}

.stat-dual-item strong.green { color: var(--green); }
.stat-dual-item strong.red { color: #f87171; }

.holding-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}

.holding-row-symbol {
  font-weight: 800;
  font-size: 0.95rem;
}

.holding-row-name {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.holding-row-values {
  text-align: right;
  font-size: 0.75rem;
}

.chart-panel {
  margin: 0 16px 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.chart-panel h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
}

.allocation-sector-panel {
  margin-top: 4px;
}

.chart-panel-hint {
  margin: -4px 0 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.chart-wrap {
  position: relative;
  height: 200px;
}

.chart-empty {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.history-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.history-item p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.history-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-tx-action {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.btn-tx-action.danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}

.tx-portfolio-tag {
  color: var(--gold) !important;
  font-size: 0.68rem !important;
  margin-bottom: 2px !important;
}

.portfolio-breakdown-table {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.portfolio-breakdown-head,
.portfolio-breakdown-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  font-size: 0.75rem;
}

.portfolio-breakdown-head {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portfolio-breakdown-row {
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--border);
}

.portfolio-breakdown-row:hover {
  background: rgba(201, 169, 98, 0.06);
}

.portfolio-breakdown-name {
  font-weight: 600;
}

.alert-inline.success {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.alert-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.alert-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.alert-item-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.alert-badge {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 999px;
}

.alert-badge.on {
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
}

.alert-badge.off {
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.dca-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.dca-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.dca-modal {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 12px 12px;
  padding: 16px;
}

.dca-modal h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.form-field .tx-unit-price-block {
  margin-bottom: 0;
}

.form-field .tx-unit-price-header {
  margin-bottom: 4px;
}

.form-field .tx-price-inline-wrap input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg);
  font-size: 0.85rem;
}

.form-field label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.modal-actions button {
  flex: 1;
}

.alert-inline {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.portfolio-manage-section {
  margin-top: 0;
}

.portfolio-manage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-dca-danger-outline {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: transparent;
  color: #f87171;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-dca-danger {
  border: none;
  background: #dc2626;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-dca-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hidden { display: none !important; }
