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

:root {
  /* Dark theme (default) */
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e2e8f0;
  --muted: #7c8394;
  --buy: #22c55e;
  --sell: #ef4444;
  --accent: #6366f1;
  --accent-hover: #4f52e0;
  --brand: #1f3478;
  --brand-light: #4a5fb0;
  --shadow: 0 20px 60px rgba(0,0,0,.4);
  --logo-filter: brightness(0) invert(1) opacity(0.95);
}

:root[data-theme="light"] {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #d8dde6;
  --text: #1a1d27;
  --muted: #6b7280;
  --buy: #16a34a;
  --sell: #dc2626;
  --accent: #1f3478;
  --accent-hover: #162558;
  --brand: #1f3478;
  --brand-light: #4a5fb0;
  --shadow: 0 4px 16px rgba(31, 52, 120, .08);
  --logo-filter: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

header {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

header::before {
  content: "";
  display: block;
  width: 56px;
  height: 56px;
  background: url("logo-eta.png") center/contain no-repeat;
  flex-shrink: 0;
  filter: var(--logo-filter);
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

header h1::after {
  content: "by European Trading Academy AG";
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Form */
.trade-form { display: flex; flex-direction: column; gap: 12px; }

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.field.full { flex: 100%; }

label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}

input:focus, select:focus {
  border-color: var(--accent);
}

/* Buttons */
.btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  transition: opacity .15s;
}

.btn:hover { opacity: .85; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  align-self: flex-start;
}

.btn-delete {
  background: transparent;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 13px;
  border-radius: 4px;
  transition: all .15s;
}

.btn-delete:hover {
  color: #fff;
  background: var(--sell);
}

/* Aktions-Spalte (letzte Spalte) bleibt beim horizontalen Scrollen sichtbar */
.table-wrapper table th:last-child,
.table-wrapper table td:last-child {
  position: sticky;
  right: 0;
  background: var(--surface);
  z-index: 1;
  border-left: 1px solid var(--border);
}
.table-wrapper table tr:hover td:last-child {
  background: rgba(99,102,241,.06);
}
.row-planned td:last-child { background: rgba(245,158,11,.06); }
.row-deleted td:last-child { background: rgba(239,68,68,.06); }
.row-mentor  td:last-child { background: rgba(99,102,241,.10); }

/* Tables */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .05em;
}

td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

.symbol { font-weight: 600; letter-spacing: .03em; }
.notes { color: var(--muted); max-width: 200px; }

.datetime-cell { white-space: nowrap; }
.time-sub {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}
.dt-line {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 12px;
}
.dt-line + .dt-line { margin-top: 2px; }
.dt-tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .05em;
  margin-right: 3px;
}
.dt-tag-exec { color: var(--accent); }
.dt-edit-btn {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.dt-edit-btn:hover {
  color: var(--accent);
}
.dt-edit-pencil {
  font-size: 10px;
  opacity: .4;
  margin-left: 4px;
}
.dt-edit-btn:hover .dt-edit-pencil { opacity: 1; }

/* Tradeplanung: Stop/Ziel-Plausibilität gegenüber Richtung */
.input-error {
  border-color: var(--sell, #ef4444) !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, .25);
}
.plan-validation-msg {
  font-size: 11px;
  color: var(--sell, #ef4444);
  margin-top: 4px;
  min-height: 0;
}
.plan-validation-msg:empty { display: none; }

.price-adjusted {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  cursor: help;
  letter-spacing: .02em;
}
.price-adjusted small { font-size: 10px; }

/* Badges */
.badge {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
}

.badge-buy     { background: rgba(34,197,94,.15);  color: var(--buy); }
.badge-sell    { background: rgba(239,68,68,.15);  color: var(--sell); }
.badge-initial { background: rgba(99,102,241,.15); color: #a5b4fc; }

/* Positions */
#positions-table table td:first-child { font-weight: 600; }

.pos-qty  { color: var(--text); }
.pos-avg  { color: var(--muted); }

.clickable-pos { cursor: pointer; }
.clickable-pos:hover td { background: rgba(99,102,241,.08) !important; }

.pos-direction {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: 8px;
}
.pos-long  { background: rgba(34,197,94,.15);  color: var(--buy); }
.pos-short { background: rgba(239,68,68,.15);  color: var(--sell); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color .15s;
}

.modal-close:hover { color: var(--text); }

.modal-info {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.modal-info-item { display: flex; flex-direction: column; gap: 4px; }

.modal-info-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.modal-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.field-suffix {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: #c7d2fe;
  background: rgba(99,102,241,.12);
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.field-suffix.crv-warn {
  color: var(--sell);
  background: rgba(239,68,68,.12);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.empty, .loading {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
}

/* Navigation */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: color .15s;
  margin-bottom: -1px;
}

.tab-link:hover { color: var(--text); }

.tab-link.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
}

/* Mode Toggle */
.mode-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mode-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.mode-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Currency display */
.currency-label { font-size: 12px; color: transparent; }
.currency-display {
  display: flex;
  align-items: center;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
}

/* Futures Config page */
.futures-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}

.futures-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.futures-category { margin-bottom: 28px; }

.category-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.futures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.futures-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s;
  user-select: none;
}

.futures-card:hover { border-color: var(--muted); }

.futures-card input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.futures-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.futures-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.futures-symbol {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.favorite-toggle {
  background: transparent;
  border: none;
  color: var(--border);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  transition: color .15s, transform .15s;
}

.favorite-toggle:hover { color: var(--muted); transform: scale(1.15); }
.favorite-toggle.active { color: #fbbf24; }
.favorite-toggle.active:hover { color: #f59e0b; }

.futures-name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.futures-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.futures-mult-wrap {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.futures-mult-input {
  width: 60px;
  padding: 2px 5px;
  font-size: 11px;
  height: auto;
  background: var(--surface);
}

.futures-currency {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(99,102,241,.15);
  border-radius: 3px;
  padding: 1px 5px;
}

.futures-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(99,102,241,.05);
}

.futures-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.save-status {
  font-size: 13px;
  font-weight: 500;
}

/* Risk Manager */
.risk-header { display: flex; flex-direction: column; gap: 16px; }

/* Account Summary */
.account-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.account-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.account-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.account-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.account-stat.current .account-value {
  font-size: 26px;
  color: #a5b4fc;
}

.account-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.account-value.pnl small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.pnl-pos { color: var(--buy) !important; }
.pnl-neg { color: var(--sell) !important; }

/* Dynamic Risk Management */
.dynamic-risk {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dyn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dyn-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.dyn-multiplier-badge {
  font-size: 12px;
  color: var(--muted);
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 6px;
  padding: 4px 10px;
}

.dyn-multiplier-badge strong {
  color: #a5b4fc;
  font-weight: 700;
  margin: 0 2px;
}

.dyn-multiplier-badge small {
  margin-left: 6px;
  opacity: .7;
}

/* Equity Chart */
.equity-chart {
  position: relative;
  height: 60px;
  background: rgba(99,102,241,.04);
  border-radius: 6px;
  overflow: visible;
}

.equity-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.equity-line {
  fill: none;
  stroke: #a5b4fc;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.equity-area {
  fill: rgba(99,102,241,.15);
  stroke: none;
}

.equity-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
}

.equity-marker::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* Equity bounds (Low / Aktuell / High) */
.equity-bounds {
  position: relative;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.bound { display: flex; flex-direction: column; gap: 1px; }

.bound-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 10px;
}

.bound-value { font-weight: 600; color: var(--text); }

.bound-current {
  position: absolute;
  text-align: center;
  top: 0;
}

.bound-current .bound-label,
.bound-current .bound-value { color: #a5b4fc; }

.bound-high { text-align: right; }
.pnl-pos small, .pnl-neg small { color: inherit !important; opacity: .8; }

/* Per-trade P&L cell */
.pnl-cell {
  font-weight: 600;
  white-space: nowrap;
}
.pnl-cell .dash { color: var(--muted); font-weight: 400; }

.stop-cell { color: var(--muted); font-size: 12px; white-space: nowrap; }
.stop-cell .dash { color: var(--border); }

.target-cell { color: var(--muted); font-size: 12px; white-space: nowrap; }
.target-cell .dash { color: var(--border); }

.leverage-cell { white-space: nowrap; }
.leverage-cell .dash { color: var(--border); }

.leverage {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.lev-low  { color: var(--muted); background: var(--bg); }
.lev-mid  { color: #f59e0b; background: rgba(245,158,11,.12); }
.lev-high { color: var(--sell); background: rgba(239,68,68,.15); }

/* R-Multiple */
.r-cell { white-space: nowrap; }
.r-cell .dash { color: var(--border); }

.r-multiple {
  display: inline-block;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

.r-green  { color: var(--buy);  background: rgba(34,197,94,.12); }
.r-orange { color: #f59e0b;     background: rgba(245,158,11,.15); }
.r-red    { color: var(--sell); background: rgba(239,68,68,.15); }
.r-broken {
  color: #fff;
  background: var(--sell);
  box-shadow: 0 0 0 2px rgba(239,68,68,.4);
  animation: pulse-red 1.5s ease-in-out infinite;
}

.r-plan-only {
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  font-weight: 500;
}

.crv-plan {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239,68,68,.4); }
  50%      { box-shadow: 0 0 0 4px rgba(239,68,68,.2); }
}

/* ── Marktanalyse ─────────────────────────────────────────────── */

.market-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.market-tab {
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
}

.market-tab:hover { color: var(--text); border-color: var(--muted); }

.market-tab.active {
  color: var(--text);
  background: rgba(99,102,241,.1);
  border-color: var(--accent);
}

.market-tab-edge {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 3px;
}

.market-tab.active .market-tab-edge {
  background: var(--bg);
  color: var(--accent);
}

.market-tab {
  cursor: grab;
  user-select: none;
}

.market-tab:active {
  cursor: grabbing;
}

.market-tab-grip {
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  opacity: .5;
  letter-spacing: -2px;
  margin-right: -2px;
}

.market-tab:hover .market-tab-grip {
  opacity: .9;
}

.market-tab.dragging {
  opacity: .4;
  cursor: grabbing;
}

.market-tab.drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

.market-tab.is-training {
  border-color: rgba(245, 158, 11, .7);
  border-width: 2px;
  padding: 7px 13px; /* kompensiert die 1px dickere Border */
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .15);
}

.market-tab.is-training:hover {
  border-color: rgba(245, 158, 11, 1);
}

.market-tab.is-training.active {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, 1);
}

.market-tab-badge {
  font-size: 12px;
  line-height: 1;
}

.market-delete-blocked {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: help;
}

.trades-filter-form-compact {
  margin: 12px 0 12px 0;
}
.trades-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.trades-filter-search {
  flex: 1 1 220px;
  min-width: 180px;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}
.trades-filter-mini {
  font-size: 12px;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  max-width: 170px;
  min-width: 120px;
}
.trades-filter-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.trades-filter-more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.trades-filter-more[hidden] { display: none; }
.col-filter-row[hidden] { display: none; }
.trades-filter-more .field { margin: 0; }
.trades-filter-more label,
.trades-filter-form-compact label {
  color: var(--text);
  opacity: .92;
  font-weight: 600;
}
.trades-filter-more select,
.trades-filter-more select[multiple],
.trades-filter-more input[type="text"],
.trades-filter-more input[type="date"] {
  width: 100%;
  font-size: 13px;
  padding: 6px 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-sizing: border-box;
}
.trades-filter-more .date-range { display: flex; gap: 6px; align-items: center; }
.trades-filter-more .date-range input { flex: 1; min-width: 0; }
.trades-filter-more .gear-check span { color: var(--text); }

.btn-disabled-soft { opacity: .45; }
.btn-disabled-soft:hover { opacity: .65; }

/* Plan-Verwerf-Kategorien als Quick-Pick-Pills */
.discard-cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.discard-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all .12s;
  user-select: none;
}
.discard-cat-pill input[type="radio"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border);
  border-radius: 50%;
  margin: 0;
  cursor: pointer;
}
.discard-cat-pill:hover {
  border-color: var(--accent);
}
.discard-cat-pill:has(input:checked) {
  background: rgba(99, 102, 241, .14);
  border-color: var(--accent);
  color: var(--text);
}
.discard-cat-pill:has(input:checked) input[type="radio"] {
  border-color: var(--accent);
  background: radial-gradient(circle at center, var(--accent) 0 4px, transparent 5px);
}

th.sortable { padding: 0 !important; }
th.sortable .sort-link {
  display: block;
  padding: 8px 10px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
th.sortable .sort-link:hover { background: rgba(255,255,255,.04); }
th.sorted-asc, th.sorted-desc { background: rgba(99,102,241,.08); }
th.sortable .sort-arrow {
  font-size: 9px;
  margin-left: 2px;
  color: var(--accent);
  vertical-align: middle;
}

.col-filter-row th {
  padding: 4px 4px !important;
  background: var(--bg) !important;
  border-bottom: 1px solid var(--border);
}
.col-filter-row input {
  width: 100%;
  min-width: 50px;
  font-size: 11px;
  padding: 3px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  box-sizing: border-box;
}
.trades-pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 14px 0 4px 0;
}
.trades-pagination-info {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.training-hint {
  margin: 0 0 12px 0;
  padding: 10px 14px;
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .3);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}

.market-add-form {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.market-add-form input {
  width: 160px;
  font-size: 13px;
  padding: 6px 10px;
}

.market-card { padding: 20px 24px; }

.market-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 16px;
}

.btn-delete-large {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 12px;
  padding: 6px 12px;
}
.btn-delete-large:hover { color: var(--sell); border-color: var(--sell); }

/* Gauge */
.gauge-container {
  position: relative;
  max-width: 360px;
  margin: 0 auto 32px;
  text-align: center;
}

.gauge-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.gauge-arc {
  fill: none;
  stroke-width: 14;
  stroke-linecap: butt;
}

.gauge-arc-red   { stroke: var(--sell); }
.gauge-arc-grey  { stroke: var(--border); }
.gauge-arc-green { stroke: var(--buy); }

.gauge-needle {
  transform-origin: 100px 100px;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}

.gauge-value {
  margin-top: -10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gauge-pct {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.5px;
  transition: color .3s;
}

.gauge-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.edge-pos     { color: var(--buy); }
.edge-neg     { color: var(--sell); }
.edge-neutral { color: var(--muted); }

/* Levels & Arrow Buttons */
.levels {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
}

.level-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}

.level-label {
  font-size: 14px;
  font-weight: 600;
}

.level-tf {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.arrow-group {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.arrow-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 52px;
  height: 52px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  padding: 0;
}

.arrow-btn:hover {
  border-color: var(--muted);
  transform: translateY(-1px);
}

.arrow-glyph {
  font-size: 26px;
  color: var(--muted);
  line-height: 1;
  transition: color .15s;
}

.arrow-btn:hover .arrow-glyph { color: var(--text); }

.arrow-btn.selected {
  background: rgba(99,102,241,.15);
  border-color: var(--accent);
}
.arrow-btn.selected .arrow-glyph { color: #a5b4fc; }

.arrow-up.selected         { background: rgba(34,197,94,.18);  border-color: var(--buy); }
.arrow-up.selected .arrow-glyph,
.arrow-up_diag.selected .arrow-glyph { color: var(--buy); }
.arrow-up_diag.selected    { background: rgba(34,197,94,.10);  border-color: rgba(34,197,94,.5); }

.arrow-down.selected       { background: rgba(239,68,68,.18); border-color: var(--sell); }
.arrow-down.selected .arrow-glyph,
.arrow-down_diag.selected .arrow-glyph { color: var(--sell); }
.arrow-down_diag.selected  { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.5); }

.arrow-side.selected       { background: rgba(124,131,148,.18); border-color: var(--muted); }
.arrow-side.selected .arrow-glyph { color: var(--text); }

.arrow-glyph-inline {
  display: inline-block;
  font-size: 16px;
  margin-right: 4px;
  color: var(--text);
}

/* Kompakte Level-Auswahl */
.levels-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.level-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.level-cell .level-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: space-between;
}

.level-cell .level-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.level-cell .level-tf {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.arrow-select {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s;
}

.arrow-select-up        { border-left-color: var(--buy); }
.arrow-select-up_diag   { border-left-color: rgba(34,197,94,.55); }
.arrow-select-side      { border-left-color: var(--muted); }
.arrow-select-down_diag { border-left-color: rgba(239,68,68,.55); }
.arrow-select-down      { border-left-color: var(--sell); }

@media (max-width: 720px) {
  .levels-compact { grid-template-columns: 1fr; }
}

/* Zeitebenen-Gewichtung Grid */
.tf-weights-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 520px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.tf-weights-header,
.tf-weights-row {
  display: grid;
  grid-template-columns: 1fr 130px 130px;
  gap: 12px;
  align-items: center;
}

.tf-weights-header {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.tf-label {
  font-size: 13px;
  font-weight: 600;
}

.tf-weight-input {
  padding: 5px 8px;
  font-size: 13px;
}

.tf-weights-sum {
  font-size: 12px;
  color: var(--muted);
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.tf-weights-sum span:first-child {
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 11px;
}

.tf-weights-sum span:not(:first-child) {
  font-weight: 700;
  color: var(--text);
  text-align: left;
  padding-left: 10px;
}

.tf-weights-sum .sum-warn {
  color: #f59e0b;
}

/* ── Analytics ──────────────────────────────────────────────────────────── */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Chart-Container */
.chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.analytics-chart {
  width: 100%;
  height: 180px;
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
}

.pnl-dot {
  cursor: pointer;
  transition: r .1s;
}
.pnl-dot:hover {
  r: 5;
  stroke: var(--text);
  stroke-width: 1;
}

/* Gang-Checkboxes (Akademie-Strategien) */
.gear-checks {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gear-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.gear-check input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}
.gear-check:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Onboarding-Widget */
.onboarding-card {
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(99,102,241,.02));
}
[data-theme="light"] .onboarding-card {
  background: linear-gradient(135deg, rgba(31,52,120,.04), rgba(31,52,120,.01));
}
.onboarding-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.onboarding-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 180px;
}
.onboarding-progress-bar {
  width: 180px;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.onboarding-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width .3s;
}
.onboarding-progress-text {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.onboarding-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color .15s;
}
.onboarding-step:hover {
  border-color: var(--accent);
}
.onboarding-step.is-done {
  opacity: 0.65;
}
.onboarding-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--border);
  color: var(--muted);
}
.onboarding-step.is-done .onboarding-step-icon {
  background: var(--buy);
  color: white;
}
.onboarding-step-body {
  flex: 1;
}
.onboarding-step-label {
  font-size: 13px;
}
.onboarding-step-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.dot-tooltip {
  position: fixed;
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: Consolas, Menlo, monospace;
  color: var(--text);
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  fill: rgba(99,102,241,.18);
  stroke: none;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px;
}

.axis-low, .axis-high { font-variant-numeric: tabular-nums; font-weight: 600; }
.axis-baseline { color: var(--muted); }

/* Trade-Verteilung */
.dist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dist-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.dist-toggle .mode-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* Erwartungswert */
.expectancy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.expectancy-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

.block-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
  font-weight: 600;
}

.exp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 14px;
  gap: 8px;
}

.exp-row strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.exp-row small {
  font-size: 11px;
  color: var(--muted);
  margin-left: 8px;
}

.exp-row.exp-total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 12px;
  font-size: 16px;
}

.exp-row.exp-total strong { font-size: 18px; }

/* ── Auth ──────────────────────────────────────────────────────────────── */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  object-fit: contain;
  filter: var(--logo-filter);
}

.auth-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.5px;
  text-align: center;
  margin-bottom: 4px;
}

.auth-brand {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 28px;
}

.auth-headline {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-btn {
  margin-top: 8px;
  padding: 10px 16px;
  font-size: 14px;
  align-self: stretch;
}

.auth-error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}

.auth-foot {
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.auth-foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.auth-foot a:hover { text-decoration: underline; }

/* User-Pill in Nav */
.user-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
}

.user-pill-name {
  font-weight: 600;
  color: var(--text);
}

.user-pill-role {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 1px 6px;
  border-radius: 3px;
}

.role-mentor { background: rgba(99,102,241,.18); color: #c7d2fe; }
.role-admin  { background: rgba(245,158,11,.18); color: #fbbf24; }

.user-pill-icon {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  padding: 0 4px;
  border-left: 1px solid var(--border);
  margin-left: 2px;
  padding-left: 8px;
  transition: color .15s;
}
.user-pill-icon:hover { color: var(--text); }

.user-pill-logout-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: var(--sell, #ef4444);
  border: 1px solid var(--sell, #ef4444);
  border-radius: 6px;
  transition: filter .15s, transform .05s;
}
.user-pill-logout-btn:hover { filter: brightness(1.15); }
.user-pill-logout-btn:active { transform: translateY(1px); }

/* Legacy alias falls noch irgendwo verwendet */
.user-pill-logout { color: var(--muted); text-decoration: none; }
.user-pill-logout:hover { color: var(--sell); }

/* Account-Switcher Pill (vor user-pill) */
.account-pill-form {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 4px 2px 8px;
  font-size: 12px;
}
.account-pill-form + .user-pill { margin-left: 8px; }

/* Tabellen-Suchfeld (Client-side Filter) */
.table-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.table-filter {
  flex: 1;
  max-width: 320px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.table-filter:focus {
  border-color: var(--accent);
}
.table-filter-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.account-pill-select {
  background: transparent;
  color: var(--text);
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 4px 4px 0;
  outline: none;
  cursor: pointer;
}
.account-pill-select:focus {
  outline: 1px solid var(--accent);
  border-radius: 3px;
}
.account-pill-manage {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  padding: 0 4px;
  border-left: 1px solid var(--border);
  margin-left: 2px;
  padding-left: 8px;
  transition: color .15s;
}
.account-pill-manage:hover { color: var(--accent); }

/* App-Footer */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  margin-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}
.app-footer-brand strong { color: var(--text); }
.app-footer-links { display: flex; gap: 16px; }
.app-footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.app-footer-links a:hover { color: var(--accent); }

/* Theme-Toggle */
.theme-toggle {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.theme-opt {
  flex: 1 1 160px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.theme-opt:hover { border-color: var(--brand-light); }
.theme-opt.active {
  border-color: var(--accent);
  background: rgba(99,102,241,.08);
}
[data-theme="light"] .theme-opt.active { background: rgba(31,52,120,.06); }
.theme-opt-icon {
  font-size: 18px;
  line-height: 1;
}
.theme-opt-label {
  font-weight: 600;
  font-size: 14px;
}
.theme-opt-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Rollen-Tabs */
.tab-link-role {
  background: rgba(99,102,241,.10);
  border-color: rgba(99,102,241,.4);
  color: #c7d2fe;
}
.tab-link-role:hover { background: rgba(99,102,241,.18); }

/* Inline Forms (Admin Tabelle) */
.inline-form {
  display: inline;
  margin: 0;
}
.inline-form select {
  font-size: 12px;
  padding: 3px 6px;
  width: auto;
  min-width: 100px;
}

/* Invite-Code Anzeige */
.invite-code {
  background: var(--bg);
  border: 1px solid var(--accent);
  color: #c7d2fe;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  letter-spacing: .15em;
  font-size: 14px;
}

.invite-link {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 3px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  margin-right: 6px;
}

.invite-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* View-as Banner */
.view-as-banner {
  background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(99,102,241,.2));
  border-bottom: 2px solid #f59e0b;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.view-as-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

.view-as-icon {
  font-size: 18px;
}

.view-as-info strong {
  color: #fbbf24;
  font-weight: 700;
}

.view-as-info em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 6px;
}

.view-as-back-btn {
  font-size: 12px;
  padding: 6px 14px;
}

/* Trade-Historie-Header & Deleted Trades */
.trade-hist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.link-deleted {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  transition: color .15s;
}
.link-deleted:hover { color: var(--sell); border-color: var(--sell); }

.btn-delete-confirm {
  background: var(--sell);
  color: #fff;
  font-weight: 600;
}
.btn-delete-confirm:hover { background: #dc2626; }

.row-deleted {
  opacity: .85;
  background: rgba(239,68,68,.04);
}
.row-deleted td {
  text-decoration: line-through;
  text-decoration-color: rgba(239,68,68,.4);
}
.row-deleted .delete-reason {
  text-decoration: none;
  color: #fbbf24;
  font-size: 12px;
  font-style: italic;
}

.mentor-correction-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(245,158,11,.18);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,.4);
  margin-right: 6px;
  font-style: normal;
}

/* Trade-Status (Geplant / Ausgeführt) */
.badge-executed {
  background: rgba(34,197,94,.15);
  color: var(--buy);
}
.badge-planned {
  background: rgba(245,158,11,.15);
  color: #f59e0b;
}

.status-cell {
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.status-cell .exec-time {
  font-size: 10px;
  color: var(--muted);
}

.row-planned {
  opacity: .9;
  background: rgba(245,158,11,.04);
}

.row-planned td:not(.status-cell) {
  font-style: italic;
  color: var(--muted);
}

.btn-confirm-trade {
  background: rgba(34,197,94,.15);
  color: var(--buy);
  border: 1px solid rgba(34,197,94,.4);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.btn-confirm-trade:hover {
  background: rgba(34,197,94,.25);
}

/* Filter-Tabs */
.hist-filters {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}

.filter-btn {
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}

.filter-btn:hover { color: var(--text); }

.filter-btn.active {
  background: var(--accent);
  color: #fff;
}

.filter-btn span {
  font-size: 10px;
  font-weight: 700;
  opacity: .7;
  background: rgba(255,255,255,.15);
  padding: 1px 6px;
  border-radius: 3px;
}

.filter-btn:not(.active) span {
  background: var(--surface);
}

/* Form Actions Split (Plan / Ausgeführt) */
.form-actions-split {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.form-actions-split .btn { flex: 1; min-width: 200px; }

/* Mentor-Vergleichs-Tabelle (Tages-Report) */
.market-block {
  margin-bottom: 28px;
  padding-bottom: 12px;
}

.market-block-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 6px 12px;
  background: rgba(99,102,241,.10);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  display: inline-block;
}

.comparison-table .arrow-cell {
  font-size: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.row-mentor {
  background: rgba(99,102,241,.10);
  border-bottom: 2px solid var(--accent) !important;
}

.row-mentor td { font-weight: 600; }

.comparison-row.match-match    td { background: rgba(34,197,94,.05); }
.comparison-row.match-partial  td { background: rgba(245,158,11,.06); }
.comparison-row.match-mismatch td { background: rgba(239,68,68,.06); }
.comparison-row.match-absent   td { opacity: .5; }

.match-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.match-match    { background: rgba(34,197,94,.15);  color: var(--buy); }
.match-partial  { background: rgba(245,158,11,.15); color: #f59e0b; }
.match-mismatch { background: rgba(239,68,68,.15);  color: var(--sell); }
.match-absent   { background: var(--bg);            color: var(--muted); }
.match-noref    { background: rgba(124,131,148,.10);color: var(--muted); }

/* Verteilungs-Bar */
.dist-bar {
  display: flex;
  width: 100%;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
.dist-bar > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 4px;
  white-space: nowrap;
}
.dist-bar-match    { background: var(--buy); }
.dist-bar-partial  { background: #f59e0b; }
.dist-bar-mismatch { background: var(--sell); }
.dist-bar-absent   { background: var(--muted); opacity: .55; }

/* Custom-Period-Form */
.period-custom-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.period-custom-form input[type="date"] {
  padding: 5px 8px;
  font-size: 13px;
  width: auto;
}

/* ── Calendar Heatmap ────────────────────────────────────────────────── */

.cal-heatmap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.cal-grid {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cal-row-labels {
  display: grid;
  grid-template-rows: repeat(7, 14px);
  gap: 3px;
  font-size: 10px;
  color: var(--muted);
}

.cal-weeks {
  display: flex;
  gap: 3px;
}

.cal-week {
  display: grid;
  grid-template-rows: repeat(7, 14px);
  gap: 3px;
}

.cal-cell {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--bg);
  cursor: default;
}

.cal-empty { background: rgba(124,131,148,.10); }
.cal-zero  { background: rgba(124,131,148,.25); }
.cal-pos   { background: color-mix(in srgb, var(--buy)  calc(var(--intensity, 0.5) * 100%), rgba(34,197,94,.12)); }
.cal-neg   { background: color-mix(in srgb, var(--sell) calc(var(--intensity, 0.5) * 100%), rgba(239,68,68,.12)); }

.cal-cell:hover { outline: 1px solid var(--text); }

.cal-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* ── Wochentags-Bars ─────────────────────────────────────────────────── */

.dow-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.dow-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dow-bar-track {
  width: 100%;
  height: 120px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.dow-bar {
  width: 100%;
  border-radius: 4px;
  min-height: 2px;
  transition: height .3s ease;
}

.dow-bar.dow-pos {
  margin-top: auto;
  background: var(--buy);
  background: linear-gradient(to top, var(--buy), rgba(34,197,94,.7));
}

.dow-bar.dow-neg {
  margin-bottom: auto;
  background: var(--sell);
  background: linear-gradient(to bottom, var(--sell), rgba(239,68,68,.7));
}

.dow-bar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.dow-bar-value {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dow-bar-meta {
  font-size: 10px;
  color: var(--muted);
}

/* ── R-Multiple-Histogramm ──────────────────────────────────────────── */

.r-hist {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.r-hist-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.r-hist-track {
  width: 100%;
  height: 120px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  padding: 3px;
}

.r-hist-bar {
  width: 100%;
  border-radius: 3px;
  min-height: 2px;
  transition: height .3s ease;
}

.r-hist-pos { background: linear-gradient(to top, var(--buy),  rgba(34,197,94,.7)); }
.r-hist-neg { background: linear-gradient(to top, var(--sell), rgba(239,68,68,.7)); }

.r-hist-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.r-hist-label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .dow-bars { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .r-hist { grid-template-columns: repeat(4, 1fr); }
  .r-hist-label { font-size: 9px; }
}

/* Tagesanalyse-Save-Block */
.daily-save-block {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.daily-save-info { font-size: 12px; }

.daily-save-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.daily-save-done    { background: rgba(34,197,94,.15); color: var(--buy); }
.daily-save-pending { background: rgba(245,158,11,.15); color: #f59e0b; }
.daily-save-none    { background: var(--bg); color: var(--muted); border: 1px dashed var(--border); }

.daily-save-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.daily-save-form input[type="text"] { flex: 1; min-width: 240px; }
.daily-save-form button { white-space: nowrap; }

.daily-tick {
  display: inline-block;
  font-size: 18px;
  color: var(--buy);
  font-weight: 700;
  cursor: help;
}

.daily-tick-missing {
  display: inline-block;
  font-size: 16px;
  color: var(--border);
  cursor: help;
}

/* Trade-ID-Zelle */
.trade-id-cell {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  user-select: all;
}
.row-planned .trade-id-cell { color: #f59e0b; }
.row-deleted .trade-id-cell { color: var(--sell); text-decoration: none; }

/* Tagesanalysen-Verlauf Heatmap */
.daily-history-card {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.daily-history-card summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.daily-history-card summary::-webkit-details-marker { display: none; }
.daily-history-card summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  transition: transform .15s;
}
.daily-history-card[open] summary::before { transform: rotate(90deg); }

.edge-heatmap-block {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Edge-basierte Farben für die Heatmap */
.edge-cal-strong-neg { background: #b91c1c; }     /* sehr dunkles rot */
.edge-cal-neg        { background: rgba(239,68,68,.55); }
.edge-cal-neutral    { background: rgba(124,131,148,.45); }
.edge-cal-pos        { background: rgba(34,197,94,.55); }
.edge-cal-strong-pos { background: #15803d; }     /* sattes dunkelgrün */
.edge-cal-empty      { background: rgba(124,131,148,.10); }

.edge-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.edge-heatmap-legend .cal-cell { cursor: default; }

/* Konfig-Section */
.config-details summary {
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  user-select: none;
}
.config-details summary::-webkit-details-marker { display: none; }
.config-details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  transition: transform .15s;
}
.config-details[open] summary::before { transform: rotate(90deg); }

.config-form { padding-top: 8px; }

/* Gauge + Gear Layout (kompakt) */
.gauge-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.gauge-row .gauge-container {
  margin: 0;
  flex: 0 0 280px;
  max-width: 280px;
}

.gear-display {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex: 1 1 320px;
  min-width: 280px;
}

.gear-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 80px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 6px;
  background: var(--bg);
  transition: all .4s;
}

.gear-num {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.gear-badge .gear-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.gear-1 { background: rgba(124,131,148,.10); border-color: rgba(124,131,148,.4); }
.gear-2 { background: rgba(99,102,241,.12);  border-color: rgba(99,102,241,.4); }
.gear-3 { background: rgba(99,102,241,.20);  border-color: rgba(99,102,241,.6); }
.gear-4 { background: rgba(99,102,241,.32);  border-color: rgba(99,102,241,.8); }
.gear-5 {
  background: linear-gradient(135deg, rgba(99,102,241,.45), rgba(34,197,94,.35));
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(99,102,241,.3);
}

.gear-2 .gear-num,
.gear-3 .gear-num { color: #c7d2fe; }
.gear-4 .gear-num,
.gear-5 .gear-num { color: #fff; }

.gear-strategies {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gear-strategies-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.strategy-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strategy-list li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  background: var(--surface);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.strategy-list strong { font-size: 14px; color: var(--text); font-weight: 600; }
.strategy-list small  { font-size: 11px; color: var(--muted); }

/* Gear thresholds */
.gear-thresholds {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 480px;
}

.gear-row-static {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

.gear-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  min-width: 70px;
  text-align: center;
  border: 1px solid var(--border);
}

.gear-range {
  font-size: 13px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gear-range input[type="number"] {
  width: 70px;
  padding: 4px 8px;
  font-size: 13px;
}

/* Gear-Strategy Mapping */
.gear-mapping {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gear-mapping-row {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}

.strategy-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.strategy-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}

.strategy-check input { accent-color: var(--accent); margin: 0; }
.strategy-check:has(input:checked) {
  border-color: var(--accent);
  background: rgba(99,102,241,.12);
  color: #c7d2fe;
}

/* Strategy catalog */
.strategy-catalog {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.strategy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-edit-form {
  display: flex;
  gap: 6px;
  flex: 1;
  align-items: center;
}

.strategy-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.strategy-name-input { flex: 0 0 200px; padding: 6px 10px; font-size: 13px; }
.strategy-desc-input { flex: 1; padding: 6px 10px; font-size: 13px; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Markt-Produkte */
.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.product-stock { border-left: 3px solid var(--buy); }
.product-future { border-left: 3px solid var(--accent); }

.product-type-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.product-symbol {
  font-weight: 700;
  letter-spacing: .03em;
}

.product-mult {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 3px;
}

.product-remove-form { display: inline; margin: 0; }

.product-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 16px;
  line-height: 1;
  transition: color .15s;
}
.product-remove:hover { color: var(--sell); }

.product-add-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.product-add-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  min-width: 280px;
}

.product-add-form select,
.product-add-form input { flex: 1; }

/* Trade-Plan integriert */
.trade-plan-block { margin-top: 8px; }

.trade-plan-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.trade-plan-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.suggested-strategy {
  font-size: 13px;
  color: var(--muted);
}
.suggested-strategy strong {
  color: var(--text);
  font-weight: 600;
}
.suggested-strategy small {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
  opacity: .8;
}

/* Produkte-Aufklapper innerhalb Markt-Card */
.products-details {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.products-details summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
  user-select: none;
  transition: color .15s;
}
.products-details summary::-webkit-details-marker { display: none; }
.products-details summary:hover { color: var(--text); }

.products-summary-text::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform .15s;
}
.products-details[open] .products-summary-text::before { transform: rotate(90deg); }

.products-summary-text {
  font-weight: 500;
}

.products-count {
  font-size: 11px;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.products-body { margin-top: 16px; }

/* Konfig-Card */
.config-card .config-details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.config-card .config-details summary strong {
  font-size: 14px;
  font-weight: 600;
}

/* Trade-Plan-Meta kompakt */
.trade-plan-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.trade-plan-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 120px;
}

.trade-plan-stat .account-label {
  font-size: 10px;
}

.trade-plan-stat .account-value { font-size: 16px; }
.trade-plan-stat .account-sub   { font-size: 10px; }

/* Strategy-Tag in Trade-Historie */
.strategy-cell { white-space: nowrap; }
.strategy-cell .dash { color: var(--border); }

.strategy-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99,102,241,.12);
  color: #c7d2fe;
  border: 1px solid rgba(99,102,241,.3);
}

/* Action-Tag in Trade-Historie */
.action-cell { white-space: nowrap; }
.action-cell .dash { color: var(--border); }

.action-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.action-open-long   { background: rgba(34,197,94,.18);  color: var(--buy);  border: 1px solid rgba(34,197,94,.4); }
.action-open-short  { background: rgba(239,68,68,.18);  color: var(--sell); border: 1px solid rgba(239,68,68,.4); }
.action-close-long  { background: rgba(245,158,11,.15); color: #f59e0b;     border: 1px solid rgba(245,158,11,.35); }
.action-close-short { background: rgba(245,158,11,.15); color: #f59e0b;     border: 1px solid rgba(245,158,11,.35); }
.action-reverse     { background: rgba(168,85,247,.15); color: #c084fc;     border: 1px solid rgba(168,85,247,.35); }

/* Gang-Zelle in Trade-Historie */
.gear-cell { white-space: nowrap; }
.gear-cell .dash { color: var(--border); }
.gear-cell .gear-pill {
  font-size: 11px;
  padding: 2px 8px;
  min-width: 36px;
}

/* Account-Config: Ledger detail row */
.ledger-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ledger-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ledger-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ledger-value {
  font-size: 14px;
  font-weight: 600;
}

.currency-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.risk-account-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field-auto { flex: 0 0 auto; min-width: unset; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.calc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}

.risk-result {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 14px;
}

.risk-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 120px;
}

.risk-stat.highlight {
  border-color: var(--accent);
  background: rgba(99,102,241,.08);
}

.risk-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.risk-stat-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.risk-stat.highlight .risk-stat-value { color: #a5b4fc; }

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

#save-settings-btn.saved { background: rgba(34,197,94,.2); color: var(--buy); }
