/* SolarIQ marketing — animated dashboards section.
   Slots between hero and "How it works". Two variations live in DOM at
   once; .is-active swaps which is visible (no DOM teardown on toggle). */

/* ── Section shell ───────────────────────────────────────────── */
.mk-dash-section {
  background: var(--canvas-soft);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.mk-dash-inner {
  max-width: var(--mk-shell-max);
  margin: 0 auto;
  padding: 56px 32px;
}
.mk-dash-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.mk-dash-head-text {
  max-width: none;
}
.mk-dash-head .mk-h2 { margin-bottom: 14px; }
.mk-dash-head .mk-lead { margin-bottom: 0; }

.mk-vartabs {
  display: inline-flex;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 3px;
  gap: 0;
}
.mk-vartab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--ls-caption-upper);
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast);
}
.mk-vartab:hover { color: var(--ink); }
.mk-vartab.is-active {
  background: var(--ink);
  color: var(--canvas);
}

/* ── Strategy primer: 3 cards explaining the receipt columns ── */
.mk-strategies {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.mk-strategy {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 16px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mk-strategy-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-bottom: 2px;
}
.mk-strategy-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--ink);
  margin: 0;
}
.mk-strategy-body {
  font-size: 13.5px;
  color: var(--body);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 720px) {
  .mk-strategies { grid-template-columns: 1fr; gap: 10px; }
  .mk-strategy { padding: 14px 16px; }
}

/* ── P&L receipt: 3 strategies × 2 days table ────────────────── */
.mk-pl-receipt {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 18px 22px 16px;
  margin-bottom: 22px;
  overflow-x: auto;
}
.mk-pl-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 18px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.mk-pl-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--muted);
}
.mk-pl-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted-soft);
}
.mk-pl-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.mk-pl-table thead th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--muted);
  text-align: right;
  padding: 0 10px 10px;
  white-space: nowrap;
  border-bottom: 1px solid var(--hairline);
}
.mk-pl-table thead th.mk-pl-corner {
  text-align: left;
  color: var(--muted-soft);
}
.mk-pl-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.mk-pl-table tbody th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  padding: 12px 10px;
  white-space: nowrap;
  border-bottom: 1px solid var(--hairline-soft);
}
.mk-pl-table tbody th .mk-pl-row-sub {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}
.mk-pl-table tbody tr:last-child th,
.mk-pl-table tbody tr:last-child td { border-bottom: none; }

.mk-pl-cell {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline-soft);
  text-align: right;
}
.mk-pl-btn {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--rounded-md);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.mk-pl-btn:hover {
  background: var(--canvas-soft);
  border-color: var(--hairline-strong);
}
.mk-pl-btn .unit {
  font-size: 10px;
  color: var(--muted-soft);
  margin-left: 3px;
  font-weight: 400;
}
.mk-pl-btn.is-active {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}
.mk-pl-btn.is-active .unit { color: var(--muted-soft); }
.mk-pl-btn.is-negative { color: #cf2d56; }
.mk-pl-btn.is-active.is-negative { color: #ff9bb0; }

@media (max-width: 720px) {
  .mk-pl-head { gap: 8px; }
  .mk-pl-table thead th,
  .mk-pl-table tbody th { font-size: 10px; padding: 6px 8px; }
  .mk-pl-btn { font-size: 13px; padding: 7px 8px; }
  .mk-pl-btn .unit { font-size: 9px; }
}

/* ── Stacked rows layout (only variation now) ────────────── */
.mk-dash-B { display: block; }

/* Shared control bar sits above both variations ─────────────── */
.mk-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 18px;
  margin-bottom: 22px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
}
.mk-controls .mk-daypick { flex-shrink: 0; }
.mk-controls .mk-now-chip { flex-shrink: 0; }
.mk-controls .mk-action-bar {
  display: inline-flex; align-items: center; gap: 12px;
  flex: 1 1 240px;
  min-width: 0;
}
.mk-controls .mk-playbtn { margin-left: auto; flex-shrink: 0; }
.mk-controls .mk-action-detail {
  font-size: 12.5px;
  color: var(--body);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mk-daypick-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--muted);
}

.mk-console {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  overflow: hidden;
}
.mk-console-bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas-soft);
}
.mk-daypick {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  white-space: nowrap;
}
.mk-daypick-wrap {
  position: relative;
  display: inline-flex; align-items: center;
}
.mk-daypick-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 7px 30px 7px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color var(--t-fast);
}
.mk-daypick-select:hover { border-color: var(--hairline-strong); }
.mk-daypick-select:focus {
  outline: none;
  border-color: var(--ink);
}
.mk-daypick-wrap::after {
  content: "";
  position: absolute;
  right: 11px; top: 50%;
  width: 10px; height: 6px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23807d72' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat;
  pointer-events: none;
}
.mk-daypick-total {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--semantic-success);
  font-variant-numeric: tabular-nums;
}
.mk-daypick-total.is-negative { color: #cf2d56; }

/* Mode picker — Aggressive / Balanced / No Optimizer ────────── */
.mk-modepick {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.mk-modepick-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--muted);
  margin-right: 4px;
}
.mk-mode-btn {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 6px 11px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--ls-caption-upper);
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.mk-mode-btn:hover { color: var(--ink); border-color: var(--hairline-strong); }
.mk-mode-btn.is-active {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}

.mk-now-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink);
  color: var(--canvas);
  padding: 6px 12px;
  border-radius: var(--rounded-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.mk-now-chip-dot {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(245, 78, 0, 0.18);
  animation: mk-pulse 1.6s ease-in-out infinite;
}
@keyframes mk-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245, 78, 0, 0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(245, 78, 0, 0.05); }
}
.mk-now-time { font-variant-numeric: tabular-nums; font-weight: 500; }
.mk-now-slot { color: var(--muted-soft); }

.mk-playbtn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--rounded-md);
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.mk-playbtn:hover { border-color: var(--ink); }
.mk-playbtn-ico {
  width: 14px; height: 14px;
  display: inline-flex;
}
.mk-playbtn-ico svg { width: 100%; height: 100%; fill: var(--ink); }

/* ── Console KPI row ───────────────────────────────────────── */
.mk-console-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--hairline);
}
.mk-kpi {
  padding: 18px 22px;
  display: flex; flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--hairline);
  background: var(--surface-card);
}
.mk-kpi:last-child { border-right: 0; }
.mk-kpi.is-featured {
  background: var(--ink);
  color: var(--canvas);
}
.mk-kpi-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--muted);
}
.mk-kpi.is-featured .mk-kpi-label { color: var(--muted-soft); }
.mk-kpi-val {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: var(--ls-display-md);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 6px;
}
.mk-kpi.is-featured .mk-kpi-val { color: var(--canvas); }
.mk-kpi-val.is-positive { color: var(--canvas); }
.mk-kpi-val.is-negative { color: #f08fb0; }
.mk-kpi-val .unit {
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0;
}
.mk-kpi.is-featured .mk-kpi-val .unit { color: var(--muted-soft); }

/* ── Console body ───────────────────────────────────────── */
.mk-console-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 0;
}
.mk-console-main {
  padding: 22px 22px 20px;
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 18px;
}
.mk-console-side {
  padding: 22px 22px 20px;
  display: flex; flex-direction: column; gap: 22px;
  background: var(--canvas-soft);
}

.mk-panel-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 10px;
}
.mk-panel-title {
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--ink);
}
.mk-panel-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  margin-left: auto;
}

.mk-chart {
  position: relative;
  height: 280px;
}
.mk-chart canvas { display: block; }
.mk-chart-sm { height: 150px; }

/* SoC pill below the price chart — 10 bars filled by rounding the
   current slot's SoC to the nearest 10%. Borrows the panel-head label
   typography so it reads as a peer to the chart's caption. */
.mk-soc-pill-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.mk-soc-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-pill);
  background: var(--surface-card);
}
.mk-soc-pill-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
}
.mk-soc-bars {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.mk-soc-bars span {
  width: 8px;
  height: 18px;
  border-radius: 2px;
  background: var(--hairline);
  transition: background-color 0.2s ease;
}
.mk-soc-bars span.is-on { background: var(--ink); }
.mk-soc-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
  font-size: 13px;
  min-width: 40px;
  text-align: right;
}

/* ── 96-slot action strip ─────────────────────────────────── */
.mk-strip-wrap {
  display: flex; flex-direction: column; gap: 6px;
}
.mk-strip {
  display: grid;
  grid-template-columns: repeat(96, 1fr);
  height: 22px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  overflow: hidden;
  background: rgba(38,37,30,0.05);
}
.mk-strip-cell {
  background: rgba(38,37,30,0.06);
  transition: background 0.12s linear;
  position: relative;
}
.mk-strip-cell.is-now {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
  z-index: 2;
}
.mk-strip-axis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.mk-strip-axis span:nth-child(n+2) { text-align: center; }
.mk-strip-axis span:last-child { text-align: right; }

.mk-strip-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.3px;
}
.mk-strip-legend > span {
  display: inline-flex; align-items: center; gap: 6px;
}
.mk-strip-legend i {
  width: 10px; height: 10px;
  display: inline-block;
  border-radius: 2px;
}

/* ── Battery ring ─────────────────────────────────────────── */
.mk-ring-panel {
  display: flex; flex-direction: column; gap: 16px;
  align-items: flex-start;
}
.mk-ring {
  position: relative;
  width: 128px; height: 128px;
  align-self: center;
}
.mk-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mk-ring-track {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 6;
}
.mk-ring-circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.18s ease-out, stroke 0.18s linear;
}
.mk-ring-center {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
}
.mk-ring-pct {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: var(--ls-display-md);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mk-ring-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 2px;
}
.mk-ring-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

/* ── Action pill ──────────────────────────────────────────── */
.mk-action-block {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
  width: 100%;
}
.mk-action-pill {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border-radius: var(--rounded-sm);
  background: var(--surface-strong);
  color: var(--ink);
}
.mk-action-pill.is-dark { color: #fff; }
.mk-action-detail {
  font-size: 13px;
  color: var(--body);
  line-height: 1.5;
}

/* ── Row action banner (sits above the price chart) ────────── */
.mk-row-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--rounded-md);
}
.mk-row-action .mk-row-action-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--muted);
}
.mk-row-action .mk-action-pill { align-self: center; }
.mk-row-action .mk-action-detail {
  font-size: 13px;
  color: var(--body);
  line-height: 1.4;
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Inline play button (lives inside .mk-row-live) ────────── */
.mk-row-live-with-play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
}
.mk-row-live-with-play .mk-row-live-stat {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.mk-playbtn-inline {
  /* Override default playbtn so it sits naturally inside the chip */
  padding: 5px 10px 5px 8px;
  border-radius: var(--rounded-sm);
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}
.mk-playbtn-inline:hover { border-color: var(--ink); filter: brightness(1.1); }
.mk-playbtn-inline .mk-playbtn-ico svg { fill: var(--canvas); }

/* ── Variation B: stacked alternating rows ────────────────── */
.mk-dash-B { }
.mk-B-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  margin-bottom: 28px;
  padding: 12px 18px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
}
.mk-B-bar .mk-action-block { border-top: 0; padding-top: 0; flex-direction: row; align-items: center; gap: 12px; }
.mk-B-bar .mk-action-detail { margin: 0; }

.mk-row {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 36px;
  align-items: center;
  padding: 36px 0;
  border-top: 1px solid var(--hairline);
}
.mk-row:first-of-type { border-top: 0; padding-top: 14px; }
.mk-row.is-reverse { grid-template-columns: 5fr 7fr; }
.mk-row.is-reverse .mk-row-copy { order: 0; }
.mk-row.is-reverse .mk-row-vis  { order: 1; }
.mk-row:not(.is-reverse) .mk-row-copy { order: 1; }
.mk-row:not(.is-reverse) .mk-row-vis  { order: 0; }

/* Stacked variant: copy on top, vis full-width below. Used by the
   96-slot schedule row so the strip gets the whole shell width. */
.mk-row.mk-row-stack {
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}
.mk-row.mk-row-stack .mk-row-copy { order: 0; max-width: none; }
.mk-row.mk-row-stack .mk-row-vis  { order: 1; }

.mk-row-vis {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 22px 22px 20px;
}
.mk-row-copy {
  padding: 0 4px;
}
.mk-row-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--muted);
  margin-bottom: 12px;
  display: inline-block;
}
.mk-row-title {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 14px;
}
.mk-row-body {
  font-size: 15.5px;
  color: var(--body);
  line-height: 1.55;
  margin-bottom: 16px;
}
.mk-row-live {
  display: inline-flex; gap: 10px; align-items: center;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--body);
}
.mk-row-live strong {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ── Floating tweaks panel ────────────────────────────────── */
.mk-tweaks {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 260px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--rounded-lg);
  padding: 0;
  font-family: var(--font-sans);
  display: none;
  z-index: 60;
}
.mk-tweaks.is-open { display: block; }
.mk-tweaks header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}
.mk-tweaks-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--ink);
}
.mk-tweaks-close {
  background: transparent; border: 0;
  color: var(--muted);
  font-size: 18px; line-height: 1;
  cursor: pointer; padding: 2px 6px;
}
.mk-tweaks-close:hover { color: var(--ink); }
.mk-tweaks section {
  padding: 14px;
  border-bottom: 1px solid var(--hairline-soft);
}
.mk-tweaks section:last-child { border-bottom: 0; }
.mk-tweaks-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--muted);
  margin-bottom: 8px;
}
.mk-tweaks-radio {
  display: flex; flex-direction: column; gap: 4px;
}
.mk-tweaks-radio button {
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--body);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.mk-tweaks-radio button:hover { border-color: var(--hairline-strong); }
.mk-tweaks-radio button.is-active {
  background: var(--ink); color: var(--canvas);
  border-color: var(--ink);
}
.mk-tweaks-range {
  width: 100%;
  accent-color: var(--ink);
  margin: 0;
}
.mk-tweaks-range-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}
.mk-tweaks-days {
  display: flex; flex-direction: column; gap: 4px;
}
.mk-tweaks-days button {
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  padding: 7px 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--body);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.mk-tweaks-days button:hover { border-color: var(--hairline-strong); }
.mk-tweaks-days button.is-active {
  background: var(--ink); color: var(--canvas);
  border-color: var(--ink);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 880px) {
  .mk-console-grid { grid-template-columns: 1fr; }
  .mk-console-main { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .mk-console-kpis { grid-template-columns: repeat(2, 1fr); }
  .mk-kpi { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .mk-kpi:nth-child(odd) { border-right: 1px solid var(--hairline); }
  .mk-row, .mk-row.is-reverse {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .mk-row .mk-row-copy, .mk-row .mk-row-vis { order: 0; }
  .mk-console-bar {
    grid-template-columns: 1fr 1fr;
  }
  .mk-now-chip { justify-self: start; }
}

/* ── Mobile polish — review pass ─────────────────────────────
   The controls bar packs five widgets that all need to remain
   reachable on a phone. We rebuild it as a clear 2-row grid:
   row 1 = daypick + now-chip (status); row 2 = mode picker
   (full-width segmented control); row 3 = action + play (live).
   Section header tabs reflow neatly under the lead copy. */

@media (max-width: 720px) {
  /* Section header: stack tabs under copy, full-width segmented */
  .mk-dash-head { gap: 18px; }
  .mk-vartabs { width: 100%; }
  .mk-vartab { flex: 1; text-align: center; }

  /* P&L receipt: trim chrome. The original orientation still
     needs horizontal scroll between 521-720px since 4 columns
     don't comfortably fit. The transposed orientation (≤520px,
     applied by JS) is only 3 columns and fits without scroll. */
  .mk-pl-receipt { padding: 16px; }
  .mk-pl-table:not(.is-transposed) { min-width: 460px; }
  .mk-pl-hint { font-size: 11px; }
}

/* Transposed receipt (mobile) — rows = strategies, cols = days */
.mk-pl-table.is-transposed { min-width: 0; width: 100%; table-layout: fixed; }
.mk-pl-table.is-transposed thead th { padding: 6px 8px; }
.mk-pl-table.is-transposed .mk-pl-corner { width: 38%; }
.mk-pl-table.is-transposed .mk-pl-dayhead {
  text-align: center;
  font-size: 11px;
}
.mk-pl-table.is-transposed .mk-pl-daylabel {
  display: block;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  font-size: 10.5px;
}
.mk-pl-table.is-transposed .mk-pl-dayhead .mk-pl-row-sub {
  display: block;
  font-size: 9.5px;
  color: var(--muted-soft);
  margin-top: 2px;
  letter-spacing: 0.2px;
}
.mk-pl-table.is-transposed tbody th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-caption-upper);
  color: var(--ink);
  padding: 8px 10px;
  white-space: normal;
}
.mk-pl-table.is-transposed tbody th .mk-pl-dot {
  margin-right: 8px;
  flex-shrink: 0;
}
.mk-pl-table.is-transposed .mk-pl-cell { padding: 6px 6px; }
.mk-pl-table.is-transposed .mk-pl-btn {
  font-size: 14px;
  padding: 8px 6px;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.mk-pl-table.is-transposed .mk-pl-btn .unit { font-size: 9px; }

@media (max-width: 600px) {
  .mk-dash-inner { padding: 48px 20px; }
  .mk-dash-head { margin-bottom: 24px; }
  .mk-dash-head .mk-h2 { font-size: 24px; }
  .mk-dash-head .mk-lead { font-size: 15px; }

  /* Action banner on mobile: tighter, action label takes its own line */
  .mk-row-action { padding: 10px 12px; gap: 6px 10px; }
  .mk-row-action .mk-action-detail { font-size: 12.5px; width: 100%; }

  /* Inline play button + live chip on mobile: spread to edges */
  .mk-row-live-with-play {
    width: 100%;
    justify-content: space-between;
    padding: 6px 6px 6px 12px;
  }

  /* Console body: a touch tighter, charts shorter */
  .mk-console-bar { padding: 12px 16px; }
  .mk-console-main, .mk-console-side { padding: 16px; gap: 16px; }
  .mk-chart { height: 200px; }
  .mk-chart-sm { height: 130px; }

  /* KPIs: tighter padding so 2x2 doesn't dwarf the chart */
  .mk-kpi { padding: 12px 14px; gap: 4px; }
  .mk-kpi-val { font-size: 19px; }
  .mk-kpi-val .unit { font-size: 10px; }
  .mk-kpi-label { font-size: 10px; }

  /* Schedule strip: smaller cells, wrapping legend */
  .mk-strip { height: 18px; }
  .mk-strip-legend { gap: 8px 12px; font-size: 9.5px; }
  .mk-strip-axis { font-size: 9px; }

  /* Battery ring: shrink so the side stack doesn't feel sparse */
  .mk-ring { width: 108px; height: 108px; }
  .mk-ring-pct { font-size: 26px; }

  /* Panel head: stop the meta line from disappearing under the title */
  .mk-panel-head { gap: 8px; flex-wrap: wrap; }
  .mk-panel-meta { margin-left: 0; font-size: 10px; }
  .mk-panel-title { font-size: 11px; }

  /* Variation B rows: shrink visual + tighten copy */
  .mk-row { padding: 24px 0; }
  .mk-row:first-of-type { padding-top: 8px; }
  .mk-row-vis { padding: 16px 16px 14px; }
  .mk-row-title { font-size: 22px; letter-spacing: -0.3px; }
  .mk-row-body { font-size: 14.5px; margin-bottom: 14px; }
  .mk-row-live {
    display: flex; flex-wrap: wrap; gap: 6px 10px;
    padding: 9px 12px; font-size: 11.5px;
    width: 100%;
  }

  /* P&L receipt: keep scroll, hide hint that wraps under it */
  .mk-pl-receipt { padding: 14px; margin-bottom: 16px; }
  .mk-pl-head { gap: 6px; margin-bottom: 10px; }
  .mk-pl-eyebrow { font-size: 9.5px; }
}

@media (max-width: 420px) {
  /* KPI numbers can wrap their unit below at the tightest widths */
  .mk-kpi-val { flex-wrap: wrap; gap: 2px; }
}

/* Period subline that sits between the simulator H2 and the lead
   paragraph — answers "which last month?" without hard-coding a date
   into the headline. Filled by simulator.js's renderPeriod() using
   Intl.DateTimeFormat so the month name follows the active language. */
.mk-sim-period {
  margin-top: -20px;
  margin-bottom: 18px;
  font-size: 15px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0;
}

/* ── "Try it on your roof" simulator ────────────────────────────
   Two range sliders → two big EUR cards + uplift pill + bar
   chart. Sits in a mk-section-alt; visuals borrow the dashboard
   row card styling so the page reads as one piece.  Pre-baked
   dataset lives at window.MK_SIMULATOR (see simulator.js). */
.mk-sim {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 24px 24px 22px;
  display: grid;
  gap: 22px;
}

.mk-sim-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.mk-sim-field {
  display: grid;
  gap: 10px;
}
.mk-sim-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  letter-spacing: var(--ls-caption-upper);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.mk-sim-value {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}
.mk-sim-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--rounded-pill);
  background: linear-gradient(
    to right,
    var(--primary) 0%,
    var(--primary) calc(var(--mk-sim-fill, 0%)),
    var(--surface-strong) calc(var(--mk-sim-fill, 0%)),
    var(--surface-strong) 100%
  );
  outline: none;
  cursor: pointer;
}
.mk-sim-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--surface-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform var(--t-fast);
}
.mk-sim-range::-webkit-slider-thumb:hover { transform: scale(1.08); }
.mk-sim-range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--surface-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.mk-sim-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

.mk-sim-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.mk-sim-card {
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 18px 18px 16px;
  display: grid;
  gap: 8px;
}
.mk-sim-card-milp {
  background: rgba(245, 78, 0, 0.06);
  border-color: rgba(245, 78, 0, 0.30);
}
.mk-sim-card-eyebrow {
  font-size: 11px;
  letter-spacing: var(--ls-caption-upper);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.mk-sim-card-milp .mk-sim-card-eyebrow { color: var(--primary); }
.mk-sim-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--body);
  line-height: 1.4;
  min-height: 2.8em;
}
.mk-sim-card-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.mk-sim-amount-num {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.6px;
  color: var(--ink);
  font-family: var(--font-mono);
  line-height: 1;
}
.mk-sim-card-milp .mk-sim-amount-num { color: var(--primary); }
.mk-sim-amount-unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}
.mk-sim-card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.mk-sim-card-sep { color: var(--muted-soft); }

.mk-sim-uplift {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 14px 18px;
  background: rgba(31, 138, 101, 0.08);
  border: 1px solid rgba(31, 138, 101, 0.28);
  border-radius: var(--rounded-md);
}
.mk-sim-uplift-label {
  font-size: 12px;
  letter-spacing: var(--ls-caption-upper);
  text-transform: uppercase;
  color: var(--semantic-success);
  font-weight: 600;
}
.mk-sim-uplift-amount {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--semantic-success);
  font-family: var(--font-mono);
}
.mk-sim-uplift-pct {
  font-size: 13px;
  color: var(--semantic-success);
  font-weight: 500;
  font-family: var(--font-mono);
}

.mk-sim-chart {
  display: grid;
  gap: 10px;
}
.mk-sim-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 100px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.mk-sim-bar-name {
  color: var(--body);
  font-weight: 500;
}
.mk-sim-bar-track {
  position: relative;
  height: 12px;
  background: var(--surface-strong);
  border-radius: var(--rounded-pill);
  overflow: hidden;
}
.mk-sim-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: var(--rounded-pill);
  transition: width var(--t-fast) ease-out;
}
.mk-sim-bar-fill-none { background: var(--action-reduce-power); }
.mk-sim-bar-fill-milp { background: var(--primary); }
.mk-sim-bar-num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}

.mk-sim-foot {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding-top: 4px;
  border-top: 1px solid var(--hairline-soft);
  margin-top: 4px;
  padding-top: 14px;
}
.mk-sim-foot strong { color: var(--body); font-weight: 600; }
.mk-sim-foot-window { font-family: var(--font-mono); }
.mk-sim-disclaimer {
  font-size: 11.5px;
  color: var(--muted-soft);
  line-height: 1.45;
  margin-top: -4px;
}

@media (max-width: 640px) {
  .mk-sim { padding: 18px 16px 16px; gap: 18px; }
  .mk-sim-controls { grid-template-columns: 1fr; gap: 16px; }
  .mk-sim-results { grid-template-columns: 1fr; gap: 10px; }
  .mk-sim-card { padding: 14px 14px 12px; }
  .mk-sim-card-title { min-height: 0; }
  .mk-sim-amount-num { font-size: 32px; }
  .mk-sim-bar-row { grid-template-columns: 90px 1fr 80px; gap: 8px; font-size: 12px; }
  .mk-sim-bar-num { font-size: 12px; }
}
