:root{
  color-scheme: dark;
  --bg: #0c0f14;
  --panel: #12161d;
  --panel-raised: #161b23;
  --border: #232937;
  --border-soft: #1a2029;
  --text: #e8e6df;
  --text-dim: #8890a0;
  --text-faint: #68718a;
  --gold: #c9a13b;
  --gold-bright: #e0b94a;
  --pos: #4f9d74;
  --pos-bright: #6bc593;
  --neg: #c1584e;
  --neg-bright: #d97267;
  --radius: 3px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*{ box-sizing: border-box; }

/* ---------- Custom scrollbars ---------- */
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{
  background: var(--border);
  border-radius: 6px;
  border: 2px solid var(--panel);
}
::-webkit-scrollbar-thumb:hover{ background: #333c50; }
::-webkit-scrollbar-corner{ background: transparent; }
.params-panel, .content, .table-wrap{
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

html, body{
  margin:0; padding:0; height:100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Background texture: faint horizontal scan lines evoke a price-chart grid without drawing a literal chart */
body{
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-image:
    linear-gradient(var(--bg), var(--bg)),
    repeating-linear-gradient(180deg, rgba(201,161,59,0.018) 0px, rgba(201,161,59,0.018) 1px, transparent 1px, transparent 34px);
}

.app-shell{ height:100vh; height:100dvh; display:flex; flex-direction:column; }
@media (max-width: 900px){
  body{ height:auto; overflow:auto; }
  .app-shell{ height:auto; }
}

/* ---------- Topbar ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.topbar-brand{ display:flex; align-items:center; gap:12px; }
.mark{
  color: var(--gold);
  line-height:1;
  display:flex;
}
.mark svg{ width:22px; height:22px; }
.brand-title{ font-weight:600; font-size:15px; letter-spacing:0.01em; }
.brand-sub{ font-family: var(--font-mono); font-size:11px; color: var(--text-dim); margin-top:2px; letter-spacing:0.03em; }

.topbar-status{
  display:flex; align-items:center; gap:8px;
  font-family: var(--font-mono); font-size:12px; color: var(--text-dim);
}
.dot{ width:7px; height:7px; border-radius:50%; display:inline-block; }
.dot-off{ background: var(--text-faint); }
.dot-on{ background: var(--pos-bright); box-shadow: 0 0 6px var(--pos-bright); }

/* ---------- Global view switch (Backtest / Monte Carlo) ---------- */
.main-tabs{
  display:flex; gap:1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.main-tab{
  flex: 1;
  display:flex; align-items:center; justify-content:center; gap:8px;
  background: var(--panel);
  border: none;
  padding: 11px 12px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.main-tab svg{ width:15px; height:15px; }
.main-tab:hover{ color: var(--text); background: var(--panel-raised); }
.main-tab.active{
  background: var(--bg);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--border);
  z-index: 0;
}
.gpage{ display:none; flex:1; min-height:0; }
.gpage.active{ display:flex; flex-direction:column; }

/* ---------- Layout ---------- */
.layout{
  flex:1; min-height:0; display:grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1px;
  background: var(--border);
}

.panel{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.params-panel{
  min-width: 0;
  padding: 20px;
  overflow-y: auto;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border);
  display:flex; flex-direction:column; gap: 4px;
}

.panel-header{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 12px;
}
.panel-header h2{
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-dim); font-weight:600; margin:0;
}
.panel-sub{ font-family: var(--font-mono); font-size:11px; color: var(--text-faint); }
.panel-actions{ display:flex; align-items:center; gap: 8px; }

/* ---------- Sidebar tabs ---------- */
.tabs{
  display:flex; gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar{ display:none; }
.tab{
  flex: 1;
  min-width: max-content;
  white-space: nowrap;
  display:flex; align-items:center; justify-content:center; gap:6px;
  background: var(--panel-raised);
  border: none;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 9px 5px;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.tab svg{ width:13px; height:13px; }
.tab:first-child{ border-radius: var(--radius) 0 0 var(--radius); }
.tab:last-child{ border-radius: 0 var(--radius) var(--radius) 0; }
.tab:hover{ color: var(--text-dim); }
.tab.active{
  background: var(--bg);
  color: var(--gold-bright);
}
.tab-page{ display: none; }
.tab-page.active{ display: block; }

.group{
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.group:last-of-type{ border-bottom:none; }
.group-title{
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold); font-weight:600; margin: 0 0 10px 0;
}

.field{ display:flex; flex-direction:column; gap:5px; margin-bottom:10px; min-width:0; }
.field span{ font-size:11.5px; color: var(--text-dim); }
.field input, .field select{
  width: 100%;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 9px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.field input::placeholder{ color: var(--text-faint); }
.field input[type="checkbox"]{ accent-color: var(--gold-bright); }
.field input:disabled{ opacity: 0.45; cursor: not-allowed; }
.field span svg{ width:12px; height:12px; vertical-align:-2px; margin-right:5px; }
.field input:focus, .field select:focus{
  outline: none;
  border-color: var(--gold);
}
.field-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; min-width:0; }

.ladder-row{
  display:flex; align-items:center; gap:6px; margin-bottom:6px; min-width:0;
}
.ladder-row input{
  width: 72px; min-width:0; flex-shrink:1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 9px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.ladder-row input:focus{ outline:none; border-color: var(--gold); }
.ladder-row input:first-child{ flex:1.2; }
.ladder-arrow{
  font-size: 10.5px; color: var(--text-dim); white-space:nowrap;
  font-family: var(--font-mono);
}
.ladder-remove{
  width: 26px; height: 26px; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; line-height:1; cursor:pointer; padding:0;
}
.ladder-remove:hover{ color: #e05c5c; border-color: #e05c5c; }
.btn-ladder-add{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  background: transparent; color: var(--gold);
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 6px 10px; font-size: 12px; cursor:pointer; margin-bottom:10px;
}
.btn-ladder-add:hover{ border-color: var(--gold); }

.checkbox-field{ flex-direction:row; align-items:center; gap:8px; }
.checkbox-field input{ width:auto; padding:0; }

.day-pills{ display:flex; flex-wrap:wrap; gap:6px; transition: opacity 0.15s; }
.day-pills.disabled{ opacity: 0.45; pointer-events: none; }
.day-pill{
  display:inline-flex; align-items:center; gap:5px;
  background: var(--panel-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 12px; color: var(--text-dim);
  cursor: pointer; user-select: none;
}
.day-pill input{ width:auto; padding:0; accent-color: var(--gold-bright); }
.day-pill:hover{ border-color: var(--gold); }

#capitalControls.disabled{ opacity: 0.5; pointer-events: none; transition: opacity 0.15s; }

.hint{
  font-size: 11px; color: var(--text-faint); line-height:1.5;
  margin: -2px 0 12px 0;
}
.hint code{
  background: var(--panel-raised); padding:1px 4px; border-radius:2px;
  font-family: var(--font-mono); color: var(--gold);
}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.12s ease;
  letter-spacing: 0.01em;
}
.btn svg{ width:14px; height:14px; }
.btn-secondary{
  background: var(--panel-raised); color: var(--text);
  width: 100%;
}
.btn-secondary:hover{ border-color: var(--gold); }
.btn-primary{
  background: var(--gold); color: #16130a; border-color: var(--gold);
}
.btn-primary:hover:not(:disabled){ background: var(--gold-bright); }
.btn-primary:disabled{
  background: var(--panel-raised); color: var(--text-faint); border-color: var(--border);
  cursor: not-allowed;
}
.btn-bundled{
  width: 100%;
  background: var(--panel-raised);
  color: var(--gold-bright);
  border-color: var(--gold);
  margin: 4px 0 14px;
  padding: 11px 16px;
}
.btn-bundled:hover:not(:disabled){ background: var(--gold); color: #16130a; }
.btn-bundled:disabled{ opacity: 0.45; cursor: not-allowed; }
.bundled-divider{
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.btn-ghost{
  background: transparent; color: var(--gold); border-color: var(--border);
  padding: 6px 12px; font-size: 11.5px;
}
.btn-ghost:hover{ border-color: var(--gold); }

.bottom-actions{
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
}

.btn-generate{
  width: 100%;
  padding: 13px 16px;
  padding-bottom: calc(13px + env(safe-area-inset-bottom, 0px));
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: sticky;
  bottom: 0;
  box-shadow: 0 -12px 18px -10px rgba(0,0,0,0.55);
}
.btn-generate.loading .btn-label::after{
  content: "";
}

.progress{
  margin-top: 10px;
}
.progress-track{
  height: 6px;
  border-radius: 999px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-bar{
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.15s ease;
}
.progress-label{
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* ---------- Content ---------- */
.content{
  min-width: 0;
  padding: 20px 28px 40px;
  overflow-y: auto;
  display:flex; flex-direction:column; gap:18px;
}
@media (max-width: 900px){
  .layout{ grid-template-columns: 1fr; }
  .params-panel{ overflow-y: visible; border-right: none; }
  .content{ overflow-y: visible; padding-bottom: 40px; }
  .btn-generate{ position: static; margin-top: 16px; box-shadow: none; }
}

.summary-panel{ padding: 18px 22px; }
.summary-text{
  margin:0; font-family: var(--font-mono); font-size: 12.5px;
  color: var(--text-dim); line-height:1.7;
}
.summary-text b{ color: var(--gold-bright); font-weight:600; }

.empty-state{
  flex:1;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 14px;
  color: var(--text-faint);
  padding: 80px 20px;
}
.empty-mark{ color: var(--text-faint); display:flex; }
.empty-mark svg{ width:42px; height:42px; }
.empty-state p{ font-size: 12.5px; max-width: 320px; text-align:center; }

.results{ display:flex; flex-direction:column; gap:18px; }

/* ---------- Stat grid ---------- */
.stat-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
}
@media (max-width: 700px){ .stat-grid{ grid-template-columns: repeat(2,1fr);} }

.stat-card{
  background: var(--panel);
  padding: 16px 18px;
  border-left: 2px solid transparent;
}
.stat-card.pos{ border-left-color: var(--pos); }
.stat-card.neg{ border-left-color: var(--neg); }
.stat-card.neutral{ border-left-color: var(--gold); }
.stat-label{
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint); margin-bottom: 8px;
}
.stat-value{
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  color: var(--text);
}
.stat-value.pos{ color: var(--pos-bright); }
.stat-value.neg{ color: var(--neg-bright); }
.stat-sub{
  display:block;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-top: 4px;
}
.stat-verdict{ letter-spacing: 0; line-height: 1.45; }

.bw-big{ font-size: 24px; }
.bw-worst{ color: var(--neg-bright); font-size: 11px; margin-top: 6px; }

/* ---------- Chart ---------- */
.chart-panel{ padding: 18px 22px; position: relative; }
#equityChart{ width:100%; display:block; }

.chart-tooltip{
  position: absolute;
  pointer-events: none;
  display: none;
  z-index: 5;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
}
.chart-tooltip .tt-date{ color: var(--text-faint); }
.chart-tooltip .tt-r{ font-weight: 600; }
.chart-tooltip .tt-r.pos{ color: var(--pos-bright); }
.chart-tooltip .tt-r.neg{ color: var(--neg-bright); }

.dataset-meta{
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  word-break: break-word;
}
.dataset-meta .meta-file-list{
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
}
.dataset-meta .meta-file{
  color: var(--text-dim);
  font-size: 10px;
}
.dataset-meta .meta-tz{
  color: var(--text-faint);
  font-style: italic;
}
.dataset-actions{
  margin-top: 8px;
  display: flex;
}
.dataset-actions .btn-ghost{
  margin-left: auto;
  color: var(--text-dim);
}
.dataset-actions .btn-ghost:hover:not(:disabled){
  border-color: var(--neg);
  color: var(--neg-bright);
}
.dataset-actions .btn-ghost:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Two column ---------- */
.two-col{ display:grid; grid-template-columns: 1fr 1fr; gap:18px; }
@media (max-width: 700px){ .two-col{ grid-template-columns: 1fr; } }
.two-col .panel{ padding: 16px 20px; }
.three-col{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap:18px; align-items:start; }
@media (max-width: 900px){ .three-col{ grid-template-columns: 1fr; } }
.three-col .panel{ padding: 16px 20px; }

.breakdown-list{ display:flex; flex-direction:column; gap:10px; }
.breakdown-row{
  display:flex; justify-content:space-between; align-items:center;
  font-family: var(--font-mono); font-size:12px;
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
}
.breakdown-row:last-child{ border-bottom:none; }
.breakdown-row .label{ color: var(--text-dim); text-transform:capitalize; }
.breakdown-row .value{ color: var(--text); }
.breakdown-row .value.pos{ color: var(--pos-bright); }
.breakdown-row .value.neg{ color: var(--neg-bright); }
.breakdown-row .value .dim{ color: var(--text-faint); }
.breakdown-row .value .avg{ font-weight:600; }
.breakdown-row .value .avg.pos{ color: var(--pos-bright); }
.breakdown-row .value .avg.neg{ color: var(--neg-bright); }

/* ---------- Monthly calendar ---------- */
.cal-nav{
  display:flex; align-items:center; gap:8px;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text);
  font-weight:600;
}
.cal-nav button{
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius);
  width: 24px; height: 24px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; padding:0;
}
.cal-nav button svg{ width:14px; height:14px; }
.cal-nav button:hover{ color: var(--gold); border-color: var(--gold); }
.cal-nav button:disabled{ opacity:0.35; cursor:not-allowed; }
.cal-total{
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-dim);
  margin: -2px 0 10px 0;
}
.cal-total.pos{ color: var(--pos-bright); }
.cal-total.neg{ color: var(--neg-bright); }
.cal-grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.cal-dow{
  text-align:center;
  font-size: 10px; font-weight:600;
  color: var(--text-faint);
  text-transform:uppercase; letter-spacing:0.06em;
  padding: 3px 0 7px 0;
}
.cal-day{
  background: var(--panel-raised);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  min-height: 52px;
  padding: 5px 6px;
  display:flex; flex-direction:column; gap:4px;
  align-items:flex-start;
}
.cal-day.empty{ background: transparent; border-color: transparent; }
.cal-day.week-total{
  background: var(--panel);
  border-color: var(--border);
}
.cal-val.cal-flat{
  background: transparent;
  color: var(--text-faint);
  font-weight: 400;
}
.cal-val.cal-extra{
  background: transparent;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 9px;
  padding: 0 1px;
}
.cal-num{ font-size: 10.5px; color: var(--text-faint); line-height: 1; }
.cal-val{
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--text);
  font-weight:600;
  margin-top: auto;
  max-width: 100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  line-height: 1.3;
}

/* ---------- Table ---------- */
.trade-panel{ padding: 18px 22px; }
.export-progress{
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-raised);
}
.export-progress .progress-track{ margin-top: 0; }
.export-progress .progress-label{ margin-top: 6px; }
.trade-panel .table-wrap{
  overflow-x:auto;
  margin: 0 -23px -19px -23px;
}
.table-wrap{
  overflow-x:auto;
  margin: 0 -1px -1px -1px;
}
table{
  width:100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
thead th{
  text-align:left;
  padding: 10px 14px;
  background: var(--panel-raised);
  color: var(--text-faint);
  font-weight:600; font-size:10.5px;
  text-transform:uppercase; letter-spacing:0.06em;
  border-bottom: 1px solid var(--border);
  position: sticky; top:0;
}
tbody td{
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  white-space: nowrap;
}
tbody td.num{ text-align: right; }
tbody tr:hover{ background: var(--panel-raised); }
.dir-long{ color: var(--pos-bright); }
.dir-short{ color: var(--neg-bright); }
.r-pos{ color: var(--pos-bright); font-weight:600; }
.r-neg{ color: var(--neg-bright); font-weight:600; }
.reason-tag{
  font-size:10px; text-transform:uppercase; letter-spacing:0.04em;
  padding: 2px 6px; border-radius:2px; background: var(--panel-raised);
  color: var(--text-dim);
}

/* ---------- Toasts ---------- */
.toasts{
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(400px, calc(100vw - 32px));
}
.toast{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font-mono);
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
  animation: toast-in 0.18s ease-out;
}
@keyframes toast-in{
  from{ transform: translateY(8px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce){
  .toast{ animation: none; }
}
.toast-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toast-title{
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.toast-error .toast-title{ color: var(--neg-bright); }
.toast-info .toast-title{ color: var(--gold-bright); }
.toast-success .toast-title{ color: var(--pos-bright); }
.toast-body{
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
  word-break: break-word;
}
.toast-close{
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.toast-close:hover{ color: var(--text); border-color: var(--text-faint); }

/* ---------- Monte Carlo ---------- */
.mc-panel{ padding: 18px 22px; position: relative; }
.mc-summary{ margin-bottom: 14px; }
.mc-variant{
  border-top: 1px solid var(--border-soft);
  padding: 16px 0;
}
.mc-variant:first-of-type{ border-top: none; padding-top: 0; }
.mc-variant-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mc-variant-head h3{
  font-size: 13px;
  color: var(--gold-bright);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.03em;
}
.mc-callout-row{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.mc-callout{
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.mc-callout.pos{ border-left-color: var(--pos); }
.mc-callout.neg{ border-left-color: var(--neg); }
.mc-callout-value{
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.mc-callout.pos .mc-callout-value{ color: var(--pos-bright); }
.mc-callout.neg .mc-callout-value{ color: var(--neg-bright); }
.mc-callout.neutral .mc-callout-value{ color: var(--gold-bright); }
.mc-callout-label{
  margin-top: 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.mc-actual{
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.mc-accounts{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.mc-acct-cell{
  background: var(--panel-raised);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.mc-acct-cell span{
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.mc-acct-cell b{
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.mc-actual b{ font-family: var(--font-mono); font-weight: 600; }
.mc-table{ margin-bottom: 12px; }
.mc-table th, .mc-table td{ padding: 7px 12px; }
.mc-table thead th{ background: var(--panel-raised); }
.mc-row-label{
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-display);
}
.mc-hist-wrap{ width: 100%; }
.mc-hist{ width: 100%; display: block; }
