/*
 * MineGrid Studio v72 - Signal Deck
 *
 * Independent visual system for the analysis workbench. This layer changes
 * composition and presentation only; scenario validation and calculation
 * contracts remain server-side and untouched.
 */

@font-face {
  font-family: "Signal Sans";
  src: url("./fonts/dm-sans-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Signal Sans";
  src: url("./fonts/dm-sans-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Signal Sans";
  src: url("./fonts/dm-sans-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Signal Serif";
  src: url("./fonts/source-serif-4-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Signal Serif";
  src: url("./fonts/source-serif-4-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Signal Serif";
  src: url("./fonts/source-serif-4-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

.cw.mg63 {
  --sd-paper: #f2eee5;
  --sd-paper-deep: #e9e2d5;
  --sd-surface: #fbf9f3;
  --sd-surface-soft: #f0ebe1;
  --sd-surface-raised: #e7e0d3;
  --sd-ink: #20231f;
  --sd-ink-soft: #41463f;
  --sd-muted: #676b62;
  --sd-faint: #686a60;
  --sd-line: #d4cdc0;
  --sd-line-strong: #afa696;
  --sd-accent: #c14d2d;
  --sd-accent-deep: #8a301a;
  --sd-accent-soft: #f4dfd5;
  --sd-green: #155a45;
  --sd-green-soft: #dcece4;
  --sd-solar: #c86e2a;
  --sd-solar-soft: #f7e3d0;
  --sd-blue: #315a7a;
  --sd-amber: #8b5d10;
  --sd-red: #a72e37;

  --fx-bg: var(--sd-paper);
  --fx-canvas: var(--sd-paper);
  --fx-surface: var(--sd-surface);
  --fx-surface-soft: var(--sd-surface-soft);
  --fx-surface-raised: var(--sd-surface-raised);
  --fx-ink: var(--sd-ink);
  --fx-ink-soft: var(--sd-ink-soft);
  --fx-muted: var(--sd-muted);
  --fx-faint: var(--sd-faint);
  --fx-line: var(--sd-line);
  --fx-line-strong: var(--sd-line-strong);
  --fx-accent: var(--sd-accent);
  --fx-accent-deep: var(--sd-accent-deep);
  --fx-accent-soft: var(--sd-accent-soft);
  --fx-green: var(--sd-green);
  --fx-green-soft: var(--sd-green-soft);
  --fx-solar: var(--sd-solar);
  --fx-solar-soft: var(--sd-solar-soft);
  --fx-amber: var(--sd-amber);
  --fx-red: var(--sd-red);
  --fx-red-soft: #f6e4e4;
  --fx-storage: var(--sd-blue);
  --fx-diesel: #6d7068;
  --fx-rail: var(--sd-ink);
  --fx-rail-soft: #353a33;
  --fx-rail-line: rgba(255, 255, 255, 0.12);
  --fx-radius: 3px;
  --fx-radius-small: 2px;
  --fx-shadow: 0 16px 38px rgba(52, 44, 30, 0.12);
  --fx-topbar: 54px;
  --fx-rail-width: 0px;
  --fx-inspector-width: clamp(322px, 24vw, 386px);
  --sd-nav-height: 64px;
  --sd-chrome-height: calc(var(--sd-nav-height) + var(--fx-topbar));

  --body: "Signal Sans", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --display: "Signal Serif", "Songti SC", "STSong", Georgia, serif;
  --number: "Signal Sans", "SFMono-Regular", "Cascadia Mono",
    "Roboto Mono", monospace;

  color: var(--sd-ink);
  background:
    radial-gradient(
      circle at 1px 1px,
      rgba(32, 35, 31, 0.055) 1px,
      transparent 0
    )
    0 0 / 26px 26px,
    var(--sd-paper);
  font-family: var(--body);
  font-size: 14px;
}

.cw.mg63 ::selection {
  color: var(--sd-ink);
  background: #ead0c3;
}

.cw.mg63 :where(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--sd-accent);
  outline-offset: 3px;
}

.cw.mg63 :where(
    .topbar,
    .app-sidebar,
    .view-intro,
    .panel-heading,
    .rail-head,
    .control-rail summary,
    .metric-label,
    .mode-switch,
    .button,
    .view-nav,
    .hero-score
  ) {
  -webkit-user-select: none;
  user-select: none;
}

/* Application shell: horizontal chapter index, command row, work surface. */

.cw.mg63 .app-shell {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: transparent;
}

.cw.mg63 .nav-backdrop {
  display: none !important;
}

.cw.mg63 .app-sidebar {
  position: sticky;
  top: 0;
  z-index: 110;
  display: flex;
  width: 100%;
  height: var(--sd-nav-height);
  min-height: var(--sd-nav-height);
  flex-direction: row;
  align-items: stretch;
  gap: clamp(18px, 2.4vw, 34px);
  padding: 0 clamp(16px, 2.4vw, 34px);
  overflow: visible;
  color: var(--sd-ink);
  background: rgba(248, 245, 237, 0.96);
  border: 0;
  border-bottom: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: 0 8px 28px rgba(55, 46, 31, 0.045);
  backdrop-filter: blur(18px) saturate(1.08);
}

.cw.mg63 .sidebar-head {
  display: flex;
  min-width: max-content;
  min-height: 0;
  align-items: center;
  padding: 0;
}

.cw.mg63 .brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--sd-ink);
}

.cw.mg63 .brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--sd-accent);
  background: transparent;
  border: 1px solid var(--sd-ink);
  border-radius: 2px;
  box-shadow: none;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cw.mg63 .brand-mark::after {
  right: -4px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: var(--sd-accent);
  border: 2px solid var(--sd-paper);
  border-radius: 0;
}

.cw.mg63 .brand-copy {
  display: grid;
  justify-items: start;
  gap: 1px;
  line-height: 1;
}

.cw.mg63 .brand-copy strong {
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.cw.mg63 .brand-copy small {
  display: block;
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.cw.mg63 .nav-close,
.cw.mg63 .sidebar-project,
.cw.mg63 .sidebar-label,
.cw.mg63 .sidebar-foot > p {
  display: none;
}

.cw.mg63 .sidebar-nav-block {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  align-items: stretch;
  margin: 0;
}

.cw.mg63 .view-nav {
  --indicator-x: 0px;
  --indicator-y: 0px;
  --indicator-width: 0px;
  --indicator-height: 0px;
  position: relative;
  top: auto;
  display: flex;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  flex-direction: row;
  gap: 2px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  scrollbar-width: none;
}

.cw.mg63 .view-nav::-webkit-scrollbar {
  display: none;
}

.cw.mg63 .view-tab-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: var(--indicator-width);
  height: var(--indicator-height);
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    to bottom,
    transparent calc(100% - 2px),
    var(--sd-accent) calc(100% - 2px)
  );
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: translate3d(var(--indicator-x), var(--indicator-y), 0);
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    height 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 120ms ease;
}

.cw.mg63 .view-tab-indicator.is-ready {
  opacity: 1;
}

.cw.mg63 .view-tab-indicator.is-immediate {
  transition: none;
}

.cw.mg63 .view-tab,
.cw.mg63 .view-tab:nth-child(n) {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: max-content;
  min-height: var(--sd-nav-height);
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 clamp(8px, 1vw, 15px);
  color: var(--sd-muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: clamp(9px, 0.75vw, 11px);
  font-weight: 500;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.cw.mg63 .view-tab:hover {
  color: var(--sd-ink);
  background: rgba(32, 35, 31, 0.035);
}

.cw.mg63 .view-tab.is-active,
.cw.mg63 .view-tab.is-active:nth-child(n) {
  color: var(--sd-ink);
  background: transparent;
}

.cw.mg63 .view-tab.is-active::after {
  display: none;
}

.cw.mg63 .view-tab-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: currentColor;
}

.cw.mg63 .view-tab-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cw.mg63 .view-tab-label {
  overflow: visible;
  width: auto;
  text-overflow: clip;
  white-space: nowrap;
}

.cw.mg63 .view-tab-meta {
  display: none;
}

.cw.mg63 .sidebar-foot {
  display: flex;
  min-width: max-content;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  border: 0;
}

.cw.mg63 .sidebar-local-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sd-muted);
  text-align: left;
}

.cw.mg63 .sidebar-local-state > span {
  width: 6px;
  height: 6px;
  background: var(--sd-green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(21, 90, 69, 0.1);
}

.cw.mg63 .sidebar-local-state div {
  display: grid;
  gap: 0;
}

.cw.mg63 .sidebar-local-state strong {
  color: var(--sd-ink-soft);
  font-size: 8px;
  font-weight: 500;
  white-space: nowrap;
}

.cw.mg63 .sidebar-local-state small {
  display: none;
}

.cw.mg63 .app-frame {
  width: 100%;
  min-width: 0;
  min-height: calc(100dvh - var(--sd-nav-height));
  overflow: visible;
  background:
    linear-gradient(rgba(32, 35, 31, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 35, 31, 0.024) 1px, transparent 1px),
    transparent;
  background-size: 52px 52px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .app-frame::before {
  display: none;
}

/* Scenario command row */

.cw.mg63 .topbar {
  position: sticky;
  top: var(--sd-nav-height);
  z-index: 100;
  display: flex;
  min-height: var(--fx-topbar);
  gap: 14px;
  margin: 0;
  padding: 8px clamp(16px, 2.4vw, 34px);
  color: var(--sd-ink);
  background: rgba(251, 249, 243, 0.96);
  border: 0;
  border-bottom: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: 0 10px 26px rgba(55, 46, 31, 0.035);
  backdrop-filter: blur(18px) saturate(1.08);
}

.cw.mg63 .nav-button {
  display: none !important;
}

.cw.mg63 .title-stack {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 0;
}

.cw.mg63 .scenario-title {
  width: min(620px, 48vw);
  min-height: 28px;
  padding: 2px 5px;
  margin: 0 0 0 -5px;
  overflow: hidden;
  color: var(--sd-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--display);
  font-size: clamp(17px, 1.4vw, 21px);
  font-weight: 600;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw.mg63 .scenario-title:hover {
  background: var(--sd-surface-soft);
  border-color: var(--sd-line);
}

.cw.mg63 .scenario-title:focus {
  color: var(--sd-ink);
  background: var(--sd-surface);
  border-color: var(--sd-accent);
  box-shadow: 0 0 0 3px rgba(193, 77, 45, 0.12);
}

.cw.mg63 .scenario-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cw.mg63 .scenario-meta-separator {
  width: 18px;
  height: 1px;
  background: var(--sd-line-strong);
}

.cw.mg63 .top-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.cw.mg63 .save-state {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  margin: 0 5px;
  color: var(--sd-muted);
  font-size: 9px;
  white-space: nowrap;
}

.cw.mg63 .save-state::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--sd-green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(21, 90, 69, 0.1);
}

.cw.mg63 .save-state.is-dirty::before {
  background: var(--sd-amber);
  box-shadow: 0 0 0 3px rgba(139, 93, 16, 0.11);
}

.cw.mg63 .save-state.is-error {
  color: var(--sd-red);
}

.cw.mg63 .save-state.is-error::before {
  background: var(--sd-red);
}

.cw.mg63 .mode-switch {
  display: inline-flex;
  min-height: 30px;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--sd-line-strong);
  border-radius: 2px;
  box-shadow: none;
  overflow: hidden;
}

.cw.mg63 .mode-button,
.cw.mg63 .mode-pro .mode-button,
.cw.mg63 .mode-simple .mode-button {
  min-height: 28px;
  padding: 3px 12px;
  color: var(--sd-muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: none;
  font-size: 9px;
  font-weight: 500;
}

.cw.mg63 .mode-button:last-child {
  border-right: 0;
}

.cw.mg63 .mode-button:hover {
  color: var(--sd-ink);
  background: var(--sd-surface-soft);
}

.cw.mg63 .mode-button.is-active,
.cw.mg63.mode-pro .mode-button[data-display-mode="pro"].is-active,
.cw.mg63.mode-simple
  .mode-button[data-display-mode="simple"].is-active {
  color: #fffaf4;
  background: var(--sd-ink);
  box-shadow: none;
}

.cw.mg63 .button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  color: var(--sd-ink-soft);
  background: transparent;
  border: 1px solid var(--sd-line-strong);
  border-radius: 2px;
  box-shadow: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.cw.mg63 .button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cw.mg63 .button:hover {
  color: var(--sd-ink);
  background: var(--sd-surface-soft);
  border-color: var(--sd-ink);
  transform: translateY(-1px);
}

.cw.mg63 .button:active {
  transform: translateY(0);
}

.cw.mg63 .button-primary {
  color: #fffaf4;
  background: var(--sd-accent);
  border-color: var(--sd-accent);
}

.cw.mg63 .button-primary:hover {
  color: #fffaf4;
  background: var(--sd-accent-deep);
  border-color: var(--sd-accent-deep);
}

.cw.mg63 .button-secondary,
.cw.mg63 .button-quiet {
  color: var(--sd-ink-soft);
  background: transparent;
  border-color: var(--sd-line-strong);
}

.cw.mg63 .button-small {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 8px;
}

.cw.mg63 .icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: var(--sd-ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
}

.cw.mg63 .icon-button:hover {
  background: var(--sd-surface-soft);
  border-color: var(--sd-line);
}

.cw.mg63 .icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Work surface and engineering register */

.cw.mg63 .workspace {
  position: relative;
  display: grid;
  min-height: calc(100dvh - var(--sd-chrome-height));
  grid-template-columns: minmax(0, 1fr) var(--fx-inspector-width);
  align-items: start;
  gap: 0;
}

.cw.mg63 .main-stage {
  order: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding:
    26px clamp(18px, 2.4vw, 38px)
    calc(100px + var(--calculation-dock-offset, 0px));
}

.cw.mg63 .panel-backdrop,
.cw.mg63 .nav-backdrop {
  background: rgba(32, 35, 31, 0.34);
  border: 0;
  backdrop-filter: blur(3px);
}

.cw.mg63 .panel-backdrop {
  display: none;
}

.cw.mg63 .control-rail {
  position: sticky;
  top: var(--sd-chrome-height);
  order: 2;
  width: var(--fx-inspector-width);
  height: calc(100dvh - var(--sd-chrome-height));
  max-height: none;
  margin: 0;
  padding: 22px 18px 34px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--sd-ink);
  background:
    linear-gradient(
      to bottom,
      rgba(32, 35, 31, 0.025) 1px,
      transparent 1px
    )
    0 0 / 100% 24px,
    rgba(248, 245, 237, 0.94);
  border: 0;
  border-left: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: none;
  transform: none;
  transition: none;
  scrollbar-width: thin;
  scrollbar-color: var(--sd-line-strong) transparent;
}

.cw.mg63 .control-rail > * {
  flex: 0 0 auto;
}

.cw.mg63 .rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px;
  padding: 0 0 16px;
  border-bottom: 2px solid var(--sd-ink);
}

.cw.mg63 .rail-head .eyebrow {
  color: var(--sd-accent);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cw.mg63 .rail-head h2 {
  margin: 5px 0 0;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(24px, 2vw, 31px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.cw.mg63 .rail-close {
  display: none;
  color: var(--sd-ink-soft);
  background: transparent;
  border-color: var(--sd-line);
}

.cw.mg63 .mode-mobile {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 3px;
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cw.mg63 .mode-mobile .mode-switch {
  margin-left: auto;
}

.cw.mg63 .scenario-editor,
.cw.mg63 .preset-section,
.cw.mg63 .control-group,
.cw.mg63 .simple-mode-guide {
  margin: 0;
  overflow: hidden;
  color: var(--sd-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .scenario-editor > summary,
.cw.mg63 .control-group > summary {
  display: flex;
  min-height: 51px;
  align-items: center;
  gap: 9px;
  padding: 12px 1px;
  cursor: pointer;
  list-style: none;
}

.cw.mg63 .scenario-editor > summary::-webkit-details-marker,
.cw.mg63 .control-group > summary::-webkit-details-marker {
  display: none;
}

.cw.mg63 .scenario-editor > summary::after,
.cw.mg63 .control-group > summary::after {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--sd-accent);
  content: "+";
  font-family: var(--display);
  font-size: 19px;
  line-height: 1;
}

.cw.mg63 .scenario-editor[open] > summary::after,
.cw.mg63 .control-group[open] > summary::after {
  content: "−";
}

.cw.mg63 .scenario-editor-label {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.cw.mg63 .scenario-editor-label strong,
.cw.mg63 .control-group > summary {
  color: var(--sd-ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.cw.mg63 .scenario-editor-label small {
  overflow: hidden;
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw.mg63 .control-group > summary em {
  margin-left: auto;
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cw.mg63 .section-count {
  min-height: 19px;
  padding: 2px 6px;
  color: var(--sd-faint);
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
  font-family: var(--number);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.cw.mg63 .scenario-editor-body,
.cw.mg63 .control-body {
  padding: 0 1px 17px;
  border: 0;
}

.cw.mg63 .field {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--sd-muted);
  font-size: 9px;
}

.cw.mg63 .field input,
.cw.mg63 .field select,
.cw.mg63 .field textarea,
.cw.mg63 .control-value input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 5px 0;
  color: var(--sd-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sd-line);
  border-radius: 0;
  font-family: var(--body);
  font-size: 10px;
}

.cw.mg63 .field input:focus,
.cw.mg63 .field select:focus,
.cw.mg63 .control-value input:focus {
  background: transparent;
  border-color: var(--sd-accent);
  outline: 0;
  box-shadow: 0 2px 0 var(--sd-accent);
}

.cw.mg63 .mode-rail-note,
.cw.mg63 .control-hint {
  margin: 8px 0 0;
  color: var(--sd-muted);
  font-size: 8px;
  line-height: 1.55;
}

.cw.mg63 .mode-rail-note.is-warning {
  padding: 9px 10px;
  color: #6d450b;
  background: #f7ead4;
  border: 0;
  border-left: 2px solid var(--sd-solar);
  border-radius: 0;
}

.cw.mg63 .preset-section {
  padding: 15px 1px 17px;
}

.cw.mg63 .section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--sd-ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.cw.mg63 .preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.cw.mg63 .preset-button {
  display: grid;
  min-width: 0;
  min-height: 58px;
  gap: 3px;
  padding: 9px 8px;
  color: var(--sd-ink-soft);
  text-align: left;
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 2px;
  box-shadow: none;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

.cw.mg63 .preset-button:hover,
.cw.mg63 .preset-button.is-active {
  color: var(--sd-accent-deep);
  background: var(--sd-accent-soft);
  border-color: #cf9d89;
}

.cw.mg63 .preset-button strong {
  overflow: hidden;
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw.mg63 .preset-button small {
  overflow: hidden;
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw.mg63 .control-group > summary {
  justify-content: flex-start;
}

.cw.mg63 .control-group > summary > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw.mg63 .control-item {
  padding: 12px 0 10px;
  border-top: 1px dashed var(--sd-line);
}

.cw.mg63 .control-item:first-child {
  padding-top: 2px;
  border-top: 0;
}

.cw.mg63 .control-head,
.cw.mg63 .control-label-row,
.cw.mg63 .control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.cw.mg63 .control-label {
  color: var(--sd-ink-soft);
  font-size: 9px;
  font-weight: 500;
}

.cw.mg63 .control-value {
  min-width: 88px;
}

.cw.mg63 .control-value input {
  min-height: 27px;
  padding: 3px 4px;
  text-align: right;
  font-family: var(--number);
  font-size: 9px;
  font-weight: 600;
}

.cw.mg63 .control-value span {
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
}

.cw.mg63 .range-shell {
  height: 34px;
  margin: 0;
  padding-top: 0;
}

.cw.mg63 .range-visual {
  top: 12px;
  right: 1px;
  left: 1px;
  height: 2px;
  overflow: visible;
  background: var(--sd-line);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .range-fill {
  height: 2px;
  background: var(--sd-accent);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .range-fill::after {
  display: none;
}

.cw.mg63 .range-ticks {
  inset: -4px 0;
  opacity: 0.7;
  background-image: linear-gradient(
    90deg,
    var(--sd-line-strong) 0 1px,
    transparent 1px
  );
  background-size: calc(100% / 10) 4px;
  background-repeat: repeat-x;
  background-position: bottom;
  mix-blend-mode: normal;
}

.cw.mg63 input[type="range"] {
  appearance: none;
  height: 34px;
  accent-color: var(--sd-accent);
}

.cw.mg63 input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
  border-radius: 0;
}

.cw.mg63 input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -6px;
  appearance: none;
  background:
    linear-gradient(135deg, transparent 47%, var(--sd-surface) 48%),
    var(--sd-accent);
  border: 1px solid var(--sd-accent-deep);
  border-radius: 1px;
  box-shadow:
    0 0 0 3px var(--sd-surface-soft),
    0 2px 7px rgba(49, 38, 26, 0.2);
  transform: rotate(45deg);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.cw.mg63 input[type="range"]::-moz-range-track {
  height: 2px;
  background: transparent;
}

.cw.mg63 input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background: var(--sd-accent);
  border: 1px solid var(--sd-accent-deep);
  border-radius: 1px;
  box-shadow:
    0 0 0 3px var(--sd-surface-soft),
    0 2px 7px rgba(49, 38, 26, 0.2);
  transform: rotate(45deg);
}

.cw.mg63 input[type="range"]:hover::-webkit-slider-thumb,
.cw.mg63 input[type="range"]:focus-visible::-webkit-slider-thumb,
.cw.mg63 .range-shell.is-dragging input[type="range"]::-webkit-slider-thumb {
  transform: rotate(45deg) scale(1.18);
  box-shadow:
    0 0 0 4px var(--sd-surface-soft),
    0 4px 12px rgba(49, 38, 26, 0.25);
}

.cw.mg63 .range-bubble {
  top: -17px;
  color: #fffaf4;
  background: var(--sd-ink);
  border: 0;
  border-radius: 1px;
  box-shadow: 0 5px 12px rgba(32, 35, 31, 0.18);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 600;
}

.cw.mg63 .range-bubble::after {
  background: var(--sd-ink);
  border: 0;
}

.cw.mg63 .range-scale,
.cw.mg63 .range-ticks {
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
}

.cw.mg63 .simple-mode-guide {
  margin: 15px 0 0;
  padding: 13px;
  background: var(--sd-accent-soft);
  border: 0;
  border-top: 2px solid var(--sd-accent);
  border-radius: 0;
}

.cw.mg63 .simple-mode-guide-kicker {
  color: var(--sd-accent-deep);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.cw.mg63 .simple-mode-guide strong {
  display: block;
  margin-top: 6px;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
}

.cw.mg63 .simple-mode-guide p {
  margin: 6px 0 10px;
  color: var(--sd-muted);
  font-size: 8px;
  line-height: 1.55;
}

.cw.mg63 .simple-mode-guide-button {
  min-height: 29px;
  padding: 5px 8px;
  color: #fffaf4;
  background: var(--sd-ink);
  border: 1px solid var(--sd-ink);
  border-radius: 1px;
  font-size: 8px;
}

.cw.mg63 .rail-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--sd-line);
}

.cw.mg63 .text-button {
  min-height: 28px;
  padding: 4px 6px;
  color: var(--sd-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 1px;
  font-size: 8px;
}

.cw.mg63 .text-button:hover {
  color: var(--sd-ink);
  background: var(--sd-surface-soft);
  border-color: var(--sd-line);
}

/* Analysis views */

.cw.mg63 .view {
  display: none;
  width: 100%;
  max-width: none;
  margin: 0;
}

.cw.mg63 .view.is-active {
  display: block;
  transform-origin: 50% 0;
  animation: fx-view-enter 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cw.mg63 .view.is-active > * {
  animation: fx-section-enter 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cw.mg63 .view.is-active > *:nth-child(2) {
  animation-delay: 28ms;
}

.cw.mg63 .view.is-active > *:nth-child(3) {
  animation-delay: 48ms;
}

.cw.mg63 .view.is-active > *:nth-child(4) {
  animation-delay: 64ms;
}

.cw.mg63 .view-intro {
  position: relative;
  display: flex;
  min-height: 130px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin: 0 0 14px;
  padding: 26px 22px 22px clamp(86px, 7vw, 122px);
  overflow: hidden;
  color: var(--sd-ink);
  background: transparent;
  border: 0;
  border-top: 2px solid var(--sd-ink);
  border-bottom: 1px solid var(--sd-line-strong);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .view-intro::before {
  top: 22px;
  left: 8px;
  color: var(--sd-accent);
  font-family: var(--display);
  font-size: clamp(42px, 4.5vw, 64px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.cw.mg63 .view-intro::after {
  top: 22px;
  bottom: 22px;
  left: clamp(68px, 5.7vw, 96px);
  width: 1px;
  background: var(--sd-line);
}

.cw.mg63 .view-intro > div:first-child {
  max-width: 860px;
}

.cw.mg63 .view-intro .eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--sd-accent);
}

.cw.mg63 .view-intro h1 {
  margin: 0 0 6px;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.cw.mg63 .view-intro p:not(.eyebrow) {
  max-width: 78ch;
  margin: 0;
  color: var(--sd-muted);
  font-size: 10px;
  line-height: 1.65;
  text-wrap: pretty;
}

.cw.mg63 .eyebrow {
  margin: 0;
  color: var(--sd-accent);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.cw.mg63 .panel-heading .eyebrow {
  display: block;
  margin-bottom: 4px;
}

.cw.mg63 .section-kicker,
.cw.mg63 .signal-label {
  display: block;
  margin: 0 0 5px;
  color: var(--sd-accent);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

/* Overview: an editorial decision brief rather than a dashboard card grid. */

.cw.mg63 #view-overview .overview-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.58fr) minmax(292px, 0.62fr);
  grid-template-areas:
    "copy score"
    "mix mix"
    "signal signal";
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: var(--sd-ink);
  background:
    linear-gradient(
      90deg,
      rgba(193, 77, 45, 0.025),
      transparent 46%
    ),
    var(--sd-surface);
  border: 0;
  border-top: 2px solid var(--sd-ink);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .overview-hero::before,
.cw.mg63 .overview-hero::after,
.cw.mg63 .hero-atmosphere,
.cw.mg63 .hero-aurora,
.cw.mg63 .hero-contour-map {
  display: none !important;
}

.cw.mg63 #overviewTrendChart .trend-flow,
.cw.mg63 #overviewTrendChart .trend-point-halo,
.cw.mg63 #overviewTrendChart .trend-scan,
.cw.mg63 #dailyChart .daily-scan,
.cw.mg63 #dailyChart .daily-load-glow,
.cw.mg63 .score-aura,
.cw.mg63 .score-tick-ring {
  display: none !important;
}

.cw.mg63 .hero-copy {
  grid-area: copy;
  display: flex;
  min-width: 0;
  min-height: 270px;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(22px, 2.4vw, 38px) clamp(6px, 2vw, 30px) 24px 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .hero-copy::before,
.cw.mg63 .hero-copy::after {
  display: none;
}

.cw.mg63 .brief-kicker {
  display: flex;
  min-height: 18px;
  align-items: center;
  gap: 8px;
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cw.mg63 .brief-live-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--sd-accent);
  border-radius: 0;
  box-shadow: none;
  transform: rotate(45deg);
}

.cw.mg63 .brief-period {
  margin-left: auto;
  color: var(--sd-faint);
  font-size: 8px;
}

.cw.mg63 .hero-copy h1 {
  max-width: none;
  margin: 18px 0 12px;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(46px, 5.6vw, 84px);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.cw.mg63 .hero-lede {
  max-width: 60ch;
  margin: 0;
  color: var(--sd-ink-soft);
  font-size: clamp(10px, 0.85vw, 12px);
  line-height: 1.72;
  text-wrap: pretty;
}

.cw.mg63 .hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 18px;
}

.cw.mg63 .health-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  color: var(--sd-muted);
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
  font-size: 8px;
  font-weight: 500;
  opacity: 0;
  animation: fx-chip-enter 220ms cubic-bezier(0.22, 1, 0.36, 1)
    forwards;
}

.cw.mg63 .health-tag::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  content: "";
  background: var(--sd-green);
  border-radius: 50%;
  box-shadow: none;
}

.cw.mg63 .health-tag.is-warning {
  color: #6d450b;
  background: transparent;
  border-color: #cfb17d;
}

.cw.mg63 .health-tag.is-warning::before {
  background: var(--sd-solar);
}

.cw.mg63 .health-tag.is-critical {
  color: var(--sd-red);
  background: transparent;
  border-color: #d7a3a7;
}

.cw.mg63 .health-tag.is-critical::before {
  background: var(--sd-red);
}

.cw.mg63 .hero-score {
  grid-area: score;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(22px, 2.4vw, 38px) 0 24px clamp(20px, 2.2vw, 34px);
  overflow: hidden;
  color: var(--sd-ink);
  text-align: left;
  background:
    linear-gradient(
      145deg,
      rgba(193, 77, 45, 0.11),
      transparent 58%
    ),
    transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .hero-score::before,
.cw.mg63 .hero-score::after {
  display: none;
}

.cw.mg63 .hero-score-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cw.mg63 .hero-score-label {
  color: var(--sd-ink-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cw.mg63 .hero-score-period {
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .brief-score {
  position: relative;
  display: flex;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  margin: clamp(28px, 4vw, 56px) 0 17px;
  padding: 0 0 15px;
  background: transparent;
  border: 0;
}

.cw.mg63 .brief-score::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: 1px;
  content: "";
  background: var(--sd-line-strong);
  border-radius: 0;
  mask: none;
  transform: none;
  filter: none;
}

.cw.mg63 .brief-score::after {
  display: none;
}

.cw.mg63 .score-value {
  position: relative;
  z-index: 2;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(54px, 6.4vw, 92px);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: -0.07em;
  font-variant-numeric: tabular-nums;
}

.cw.mg63 .score-value.is-refreshing {
  animation: fx-score-refresh 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cw.mg63 .score-unit {
  position: relative;
  z-index: 2;
  margin-top: 9px;
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.cw.mg63 .score-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: block;
  height: 3px;
  background: var(--sd-accent);
  border-radius: 0;
  clip-path: inset(0 calc(100% - var(--score-percent)) 0 0);
  transition: clip-path 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cw.mg63 .score-delta {
  min-height: 21px;
  align-self: flex-start;
  padding: 3px 7px;
  color: var(--sd-accent-deep);
  background: transparent;
  border: 1px solid #cf9d89;
  border-radius: 1px;
  font-size: 8px;
}

.cw.mg63 .score-delta.is-positive {
  color: var(--sd-green);
  background: transparent;
  border-color: #8fb4a4;
}

.cw.mg63 .score-delta.is-negative {
  color: var(--sd-red);
  background: transparent;
  border-color: #d7a3a7;
}

.cw.mg63 .hero-score > p {
  max-width: 32ch;
  margin: 11px 0 0;
  color: var(--sd-muted);
  font-size: 8px;
  line-height: 1.6;
}

.cw.mg63 .hero-mix {
  grid-area: mix;
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(110px, 1fr);
  grid-template-areas:
    "head head"
    "bar bar"
    "legend legend";
  gap: 9px 14px;
  padding: 16px 0 18px;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .mix-head {
  grid-area: head;
  display: flex;
  align-items: center;
  color: var(--sd-ink-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cw.mg63 .mix-head span:last-child {
  margin-left: auto;
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 500;
}

.cw.mg63 .mix-bar {
  grid-area: bar;
  display: flex;
  height: 9px;
  overflow: hidden;
  background: var(--sd-surface-soft);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .mix-segment.direct {
  background: var(--sd-green);
}

.cw.mg63 .mix-segment.storage {
  background: var(--sd-blue);
}

.cw.mg63 .mix-segment.inventory {
  background: #9b7942;
}

.cw.mg63 .mix-segment.diesel {
  background: var(--sd-diesel);
}

.cw.mg63 .mix-segment.unserved {
  background: var(--sd-red);
}

.cw.mg63 #mixBar .mix-segment {
  transform-origin: left center;
  animation: mix-grow 680ms var(--mix-delay, 420ms)
    cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes mix-grow {
  from {
    opacity: 0.55;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.cw.mg63 .mix-legend {
  grid-area: legend;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 8px;
  line-height: 1.45;
}

.cw.mg63 .mix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cw.mg63 .mix-legend i {
  width: 6px;
  height: 6px;
  border-radius: 0;
}

.cw.mg63 .hero-signal {
  grid-area: signal;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(200px, 0.23fr) minmax(0, 0.77fr);
  gap: 22px;
  align-items: stretch;
  margin: 12px 0 0;
  padding: 22px 24px 17px;
  overflow: hidden;
  background:
    linear-gradient(
      90deg,
      rgba(193, 77, 45, 0.035),
      transparent 36%
    ),
    var(--sd-surface);
  border: 1px solid var(--sd-line);
  border-top: 2px solid var(--sd-ink);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .hero-signal-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
}

.cw.mg63 .signal-heading {
  display: grid;
  gap: 10px;
}

.cw.mg63 .hero-signal-copy h2 {
  margin: 0;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(21px, 2vw, 30px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.cw.mg63 .hero-signal-copy h2::after {
  display: none;
}

.cw.mg63 .hero-signal-note {
  max-width: 34ch;
  margin: 0;
  color: var(--sd-muted);
  font-size: 8px;
  line-height: 1.6;
}

.cw.mg63 .hero-signal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin: 0;
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .hero-signal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cw.mg63 .hero-signal-legend i {
  width: 13px;
  height: 2px;
  border-radius: 0;
}

.cw.mg63 .hero-signal-chart {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
}

.cw.mg63 .hero-energy-map {
  width: 100%;
  height: clamp(158px, 14vw, 220px);
  overflow: visible;
}

.cw.mg63 .hero-chart-grid line {
  stroke: var(--sd-line);
  stroke-width: 1;
  stroke-dasharray: 2 7;
}

.cw.mg63 .hero-route {
  stroke-width: 2;
  filter: none;
  vector-effect: non-scaling-stroke;
}

.cw.mg63 #heroLoadPath {
  stroke-width: 1.2;
  opacity: 0.85;
}

.cw.mg63 #heroPvPath {
  stroke-width: 2.4;
}

.cw.mg63 #heroRenewablePath {
  stroke-width: 1.9;
}

.cw.mg63 .hero-data-path {
  opacity: 0;
}

.cw.mg63 .hero-data-path.is-drawing {
  animation: fx-hero-draw 980ms cubic-bezier(0.22, 1, 0.36, 1)
    forwards;
}

.cw.mg63 #heroPvPath.is-drawing {
  animation-delay: 60ms;
}

.cw.mg63 #heroRenewablePath.is-drawing {
  animation-delay: 120ms;
}

.cw.mg63 .hero-route-pulse {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 0.032 1;
  stroke-dashoffset: 1;
  opacity: 0;
  vector-effect: non-scaling-stroke;
}

.cw.mg63 .hero-route-pulse-warm {
  stroke: var(--sd-solar);
  stroke-width: 3.4;
  filter: drop-shadow(0 0 5px rgba(200, 110, 42, 0.5));
}

.cw.mg63 .hero-route-pulse-cool {
  stroke: var(--sd-green);
  stroke-width: 3.2;
  filter: drop-shadow(0 0 5px rgba(21, 90, 69, 0.44));
}

.cw.mg63 .hero-route-pulse-load {
  stroke: var(--sd-diesel);
  stroke-width: 2.1;
}

.cw.mg63 .hero-route-pulse.is-flowing {
  animation: fx-hero-pulse 2.45s cubic-bezier(0.4, 0, 0.2, 1) 2 both;
}

.cw.mg63 .hero-node {
  fill: var(--sd-surface);
  stroke: var(--sd-green);
  stroke-width: 1.2;
  filter: none;
  opacity: 0;
  animation: fx-node-in 280ms var(--hero-node-delay, 0ms)
    cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cw.mg63 .hero-node-ripple {
  fill: none;
  stroke: var(--sd-accent);
  stroke-width: 1;
  opacity: 0;
  animation: fx-node-ripple 1.05s var(--hero-node-delay, 0ms)
    cubic-bezier(0.2, 0.8, 0.2, 1) 2;
  transform-box: fill-box;
  transform-origin: center;
}

.cw.mg63 .hero-signal-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
}

/* Energy atlas */

.cw.mg63 .energy-atlas {
  margin: 14px 0 0;
  padding: 22px 24px 18px;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 55% 10%,
      rgba(193, 77, 45, 0.055),
      transparent 34%
    ),
    var(--sd-surface);
  border: 1px solid var(--sd-line);
  border-top: 2px solid var(--sd-ink);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .energy-atlas-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 12px;
}

.cw.mg63 .energy-atlas-head h2 {
  margin: 0 0 4px;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.cw.mg63 .energy-atlas-head p:not(.eyebrow) {
  max-width: 76ch;
  margin: 0;
  color: var(--sd-muted);
  font-size: 9px;
  line-height: 1.6;
}

.cw.mg63 .atlas-balance {
  display: grid;
  min-width: 196px;
  gap: 1px;
  padding: 9px 10px;
  color: var(--sd-ink-soft);
  text-align: right;
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
}

.cw.mg63 .atlas-balance span {
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.cw.mg63 .atlas-balance strong {
  color: var(--sd-green);
  font-size: 9px;
}

.cw.mg63 .atlas-balance small {
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 7px;
}

.cw.mg63 .atlas-balance.is-warning strong {
  color: var(--sd-red);
}

.cw.mg63 .atlas-rules line {
  stroke: var(--sd-line);
  stroke-width: 1;
  stroke-dasharray: 2 7;
}

.cw.mg63 .atlas-flow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.86;
}

.cw.mg63 .atlas-flow.is-direct {
  stroke: var(--sd-green);
}

.cw.mg63 .atlas-flow.is-storage {
  stroke: var(--sd-blue);
}

.cw.mg63 .atlas-flow.is-curtailment {
  stroke: var(--sd-solar);
}

.cw.mg63 .atlas-flow.is-diesel {
  stroke: var(--sd-diesel);
}

.cw.mg63 .atlas-flow-start.is-direct {
  fill: var(--sd-green);
}

.cw.mg63 .atlas-flow-start.is-storage {
  fill: var(--sd-blue);
}

.cw.mg63 .atlas-flow-start.is-curtailment {
  fill: var(--sd-solar);
}

.cw.mg63 .atlas-flow-start.is-diesel {
  fill: var(--sd-diesel);
}

.cw.mg63 .atlas-link-label {
  fill: var(--sd-muted);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 500;
}

.cw.mg63 .atlas-node rect {
  rx: 1px;
  fill: var(--sd-surface);
  stroke: var(--sd-line-strong);
  stroke-width: 1;
  filter: none;
}

.cw.mg63 .atlas-node-kicker {
  fill: var(--sd-accent);
  font-family: var(--number);
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.cw.mg63 .atlas-node-title {
  fill: var(--sd-muted);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 500;
}

.cw.mg63 .atlas-node-value {
  fill: var(--sd-ink);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.cw.mg63 .atlas-node-value tspan {
  fill: var(--sd-faint);
  font-size: 7px;
  font-weight: 500;
}

.cw.mg63 .atlas-node-detail {
  fill: var(--sd-faint);
  font-family: var(--number);
  font-size: 6px;
}

.cw.mg63 .atlas-node > path {
  fill: none;
  stroke: var(--mg-node-accent, var(--sd-accent));
  stroke-width: 2;
  stroke-linecap: round;
}

.cw.mg63 .atlas-unserved-badge rect {
  fill: var(--sd-accent-soft);
  stroke: #d7a3a7;
}

.cw.mg63 .atlas-unserved-badge circle {
  fill: var(--sd-red);
}

.cw.mg63 .atlas-unserved-badge text {
  fill: var(--sd-red);
  font-family: var(--body);
  font-size: 8px;
  font-weight: 600;
}

.cw.mg63 .atlas-mobile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--sd-line);
}

.cw.mg63 .atlas-mobile-row span {
  color: var(--sd-ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.cw.mg63 .atlas-mobile-row small {
  color: var(--sd-muted);
  font-size: 7px;
}

.cw.mg63 .atlas-mobile-row strong {
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.cw.mg63 .atlas-mobile-row > i {
  grid-column: 1 / -1;
  display: block;
  width: var(--atlas-mobile-width, 0%);
  height: 3px;
  background: var(--sd-green);
  border-radius: 0;
}

.cw.mg63 .atlas-mobile-row.is-solar > i {
  background: var(--sd-solar);
}

.cw.mg63 .atlas-mobile-row.is-storage > i {
  background: var(--sd-blue);
}

.cw.mg63 .atlas-mobile-row.is-diesel > i {
  background: var(--sd-diesel);
}

.cw.mg63 .atlas-mobile-row.is-curtailment > i {
  background: var(--sd-solar);
}

.cw.mg63 .atlas-mobile-load {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: end;
  margin-top: 11px;
  padding: 12px;
  background: var(--sd-green-soft);
  border-left: 3px solid var(--sd-green);
  border-radius: 0;
}

.cw.mg63 .atlas-mobile-load span {
  color: var(--sd-muted);
  font-size: 8px;
}

.cw.mg63 .atlas-mobile-load strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}

.cw.mg63 .atlas-mobile-load small {
  color: var(--sd-muted);
  font-size: 7px;
}

/* Insights and metric ledger */

.cw.mg63 .insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  overflow: visible;
  border-top: 1px solid var(--sd-line-strong);
  border-bottom: 1px solid var(--sd-line-strong);
}

.cw.mg63 .insight-card {
  min-width: 0;
  padding: 15px 16px 16px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .insight-card:last-child {
  border-right: 0;
}

.cw.mg63 .insight-card.is-warning {
  border-top: 0;
}

.cw.mg63 .insight-card.is-critical {
  border-top: 0;
}

.cw.mg63 .insight-card + .insight-card {
  border-left: 0;
}

.cw.mg63 .insight-card > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sd-accent);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cw.mg63 .insight-card > span::before {
  width: 4px;
  height: 4px;
  content: "";
  background: currentColor;
  border-radius: 0;
  transform: rotate(45deg);
}

.cw.mg63 .insight-card.is-warning > span::before {
  background: var(--sd-solar);
}

.cw.mg63 .insight-card.is-critical > span::before {
  background: var(--sd-red);
}

.cw.mg63 .insight-card p {
  margin: 8px 0 0;
  color: var(--sd-ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.cw.mg63 .metric-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 10px;
  padding: 0;
}

.cw.mg63 .metric-section-head h2 {
  margin: 0 0 2px;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.cw.mg63 .metric-section-head p {
  margin: 0;
  color: var(--sd-muted);
  font-size: 9px;
}

.cw.mg63 .metric-scope-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw.mg63 .metric-scope-actions > span {
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .metric-scope-toggle {
  min-height: 29px;
  padding: 5px 8px;
  color: var(--sd-accent-deep);
  background: transparent;
  border: 1px solid #cf9d89;
  border-radius: 1px;
  font-size: 8px;
}

.cw.mg63 .metric-scope-toggle:hover {
  color: #fffaf4;
  background: var(--sd-accent);
  border-color: var(--sd-accent);
  transform: none;
}

.cw.mg63 .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  background: transparent;
  border-top: 2px solid var(--sd-ink);
  border-bottom: 1px solid var(--sd-line-strong);
  border-radius: 0;
}

.cw.mg63 .metric-card,
.cw.mg63 .metric-card:nth-child(n) {
  position: relative;
  min-height: 132px;
  padding: 16px 17px 15px;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--sd-line);
  border-bottom: 1px solid var(--sd-line);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .metric-card:nth-child(4n) {
  border-right: 0;
}

.cw.mg63 .metric-card:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.cw.mg63 .metric-card::after {
  display: none;
}

.cw.mg63 .metric-card:hover {
  z-index: 1;
  background: rgba(193, 77, 45, 0.035);
  transform: none;
}

.cw.mg63 .metric-card:first-child {
  color: var(--sd-ink);
  background: var(--sd-accent-soft);
  border-color: var(--sd-line);
}

.cw.mg63 .metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sd-muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.cw.mg63 .metric-label i {
  width: 4px;
  height: 4px;
  background: var(--metric-color, var(--sd-accent));
  border-radius: 0;
  transform: rotate(45deg);
}

.cw.mg63 .metric-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 16px 0 7px;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(28px, 2.7vw, 42px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.cw.mg63 .metric-value small {
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 500;
}

.cw.mg63 .metric-note {
  color: var(--sd-muted);
  font-size: 8px;
  line-height: 1.5;
}

.cw.mg63 .metric-delta {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 2px 5px;
  color: var(--sd-muted);
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
  font-family: var(--number);
  font-size: 7px;
}

.cw.mg63 .metric-delta.is-positive {
  color: var(--sd-green);
}

.cw.mg63 .metric-delta.is-negative {
  color: var(--sd-red);
}

/* Evidence sheets */

.cw.mg63 .dashboard-grid,
.cw.mg63 .dashboard-grid-wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.cw.mg63 .dashboard-grid-wide {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
}

.cw.mg63 .panel,
.cw.mg63 .method-card,
.cw.mg63 .quality-summary-card {
  padding: 19px 20px;
  background: var(--sd-surface);
  border: 1px solid var(--sd-line);
  border-top: 2px solid var(--sd-ink);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .panel::before,
.cw.mg63 .panel::after,
.cw.mg63 .method-card::before,
.cw.mg63 .method-card::after,
.cw.mg63 .quality-summary-card::before,
.cw.mg63 .quality-summary-card::after {
  display: none;
}

.cw.mg63 .panel:hover {
  border-color: var(--sd-line);
}

.cw.mg63 .panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
}

.cw.mg63 .panel-heading > div:first-child {
  min-width: 0;
  flex: 1;
}

.cw.mg63 .panel-heading h2 {
  margin: 0;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(19px, 1.75vw, 26px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.cw.mg63 .unit-chip,
.cw.mg63 .status-pill,
.cw.mg63 .section-count {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 2px 6px;
  color: var(--sd-muted);
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
  font-family: var(--number);
  font-size: 7px;
  letter-spacing: 0.03em;
}

.cw.mg63 .status-pill {
  color: var(--sd-green);
  background: transparent;
  border-color: #8fb4a4;
}

.cw.mg63 .status-warning,
.cw.mg63 .status-pill.status-warning {
  color: #6d450b;
  background: transparent;
  border-color: #cfb17d;
}

.cw.mg63 .chart-frame {
  min-height: 250px;
}

.cw.mg63 .chart-panel-tall .chart-frame {
  min-height: 340px;
}

/* Tables */

.cw.mg63 .table-scroll {
  overflow-x: auto;
  border: 1px solid var(--sd-line);
  border-radius: 0;
}

.cw.mg63 .data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: var(--sd-surface);
  color: var(--sd-ink-soft);
  font-family: var(--number);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.cw.mg63 .data-table th,
.cw.mg63 .data-table td {
  padding: 9px;
  text-align: right;
  border-bottom: 1px solid var(--sd-line);
  white-space: nowrap;
}

.cw.mg63 .data-table th:first-child,
.cw.mg63 .data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--sd-surface);
}

.cw.mg63 .data-table thead th {
  color: #f8f4eb;
  background: var(--sd-ink);
  font-family: var(--body);
  font-weight: 500;
}

.cw.mg63 .data-table thead th:first-child {
  color: #f8f4eb;
  background: var(--sd-ink);
}

.cw.mg63 .data-table tbody tr:hover td,
.cw.mg63 .data-table tbody tr:hover th {
  background: var(--sd-accent-soft);
}

.cw.mg63 .data-table .total-row th,
.cw.mg63 .data-table .total-row td {
  color: var(--sd-ink);
  background: var(--sd-surface-soft);
  font-weight: 600;
}

.cw.mg63 .economics-stack {
  display: grid;
  gap: 0;
}

.cw.mg63 .economics-hero {
  display: grid;
  gap: 5px;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--sd-line);
}

.cw.mg63 .economics-hero span {
  color: var(--sd-muted);
  font-size: 8px;
}

.cw.mg63 .economics-hero strong {
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: clamp(32px, 2.8vw, 46px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.cw.mg63 .economics-hero strong small {
  margin-left: 4px;
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 500;
}

.cw.mg63 .economics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  color: var(--sd-muted);
  border-bottom: 1px solid var(--sd-line);
  font-size: 8px;
}

.cw.mg63 .economics-row strong {
  color: var(--sd-ink-soft);
  font-family: var(--number);
  font-size: 9px;
  font-weight: 500;
}

.cw.mg63 .economics-note {
  padding: 9px 0;
  color: #6d450b;
  font-size: 8px;
}

/* Analysis controls and supporting views */

.cw.mg63 .balance-checks,
.cw.mg63 .hourly-status,
.cw.mg63 .quality-verdict {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.cw.mg63 .check-chip {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 3px 7px;
  color: var(--sd-muted);
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
  font-family: var(--number);
  font-size: 7px;
}

.cw.mg63 .hourly-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 11px;
  padding: 12px;
  background: var(--sd-surface);
  border: 1px solid var(--sd-line);
  border-top: 2px solid var(--sd-ink);
  border-radius: 0;
}

.cw.mg63 .hourly-toolbar label {
  display: grid;
  gap: 4px;
  color: var(--sd-muted);
  font-size: 8px;
}

.cw.mg63 .hourly-toolbar select,
.cw.mg63 .hourly-toolbar input {
  min-height: 31px;
  padding: 5px 8px;
  color: var(--sd-ink);
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
  font-size: 8px;
}

.cw.mg63 .toolbar-spacer {
  flex: 1;
}

.cw.mg63 .row-count {
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .chart-key {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 11px;
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .chart-key span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cw.mg63 .swatch {
  width: 7px;
  height: 7px;
  border-radius: 0;
}

.cw.mg63 .swatch-load {
  background: var(--sd-ink-soft);
}

.cw.mg63 .swatch-pv {
  background: var(--sd-solar);
}

.cw.mg63 .swatch-storage {
  background: var(--sd-blue);
}

.cw.mg63 .swatch-diesel {
  background: var(--sd-diesel);
}

.cw.mg63 .swatch-soc {
  background: var(--sd-green);
}

.cw.mg63 .hourly-table-shell {
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: 0;
}

.cw.mg63 .hourly-head,
.cw.mg63 .hourly-row {
  display: grid;
  grid-template-columns: 1.25fr repeat(8, minmax(78px, 1fr));
  min-width: 880px;
}

.cw.mg63 .hourly-head {
  color: #f8f4eb;
  background: var(--sd-ink);
  font-size: 8px;
  font-weight: 500;
}

.cw.mg63 .hourly-head > *,
.cw.mg63 .hourly-row > * {
  min-width: 0;
  padding: 8px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--sd-line);
}

.cw.mg63 .hourly-head > *:first-child,
.cw.mg63 .hourly-row > *:first-child {
  text-align: left;
}

.cw.mg63 .hourly-body {
  position: relative;
  overflow: auto;
  max-height: 530px;
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .hourly-row:hover {
  background: var(--sd-accent-soft);
}

.cw.mg63 .sensitivity-status {
  margin: -4px 0 12px;
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 9px;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.cw.mg63 .sensitivity-wrap {
  position: relative;
  min-height: 326px;
  overflow: auto;
  border: 1px solid var(--sd-line);
  border-radius: 0;
}

.cw.mg63 .sensitivity-grid {
  display: grid;
  gap: 2px;
  min-width: 740px;
  padding: 8px;
  background: var(--sd-surface-soft);
}

.cw.mg63 .sensitivity-cell {
  min-height: 55px;
  padding: 5px;
  color: var(--sd-ink);
  border: 1px solid rgba(32, 35, 31, 0.06);
  border-radius: 0;
}

.cw.mg63 .sensitivity-cell:hover,
.cw.mg63 .sensitivity-cell.is-active {
  outline: 2px solid var(--sd-accent);
  outline-offset: -2px;
}

.cw.mg63 .sensitivity-placeholder {
  display: grid;
  min-height: 326px;
  grid-template-columns: minmax(240px, 0.8fr) minmax(260px, 1.2fr);
  align-items: center;
  gap: 24px;
  padding: 25px;
  background:
    linear-gradient(
      135deg,
      rgba(193, 77, 45, 0.06),
      transparent 55%
    ),
    var(--sd-surface);
}

.cw.mg63 .quality-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 11px;
}

.cw.mg63 .quality-summary-card {
  min-height: 100px;
  padding: 15px;
}

.cw.mg63 .quality-verdict {
  display: grid;
  min-width: 260px;
  max-width: 360px;
  justify-items: end;
  gap: 3px;
  padding: 10px 12px;
  text-align: right;
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
}

.cw.mg63 .quality-status {
  display: inline-flex;
  padding: 3px 7px;
  color: var(--sd-green);
  background: var(--sd-green-soft);
  border-radius: 1px;
  font-family: var(--number);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.cw.mg63 .quality-verdict.is-warning .quality-status {
  color: #6d450b;
  background: var(--sd-solar-soft);
}

.cw.mg63 .quality-verdict.is-fail .quality-status {
  color: var(--sd-red);
  background: #f6e4e4;
}

.cw.mg63 .quality-verdict strong {
  color: var(--sd-ink-soft);
  font-size: 9px;
}

.cw.mg63 .quality-verdict small {
  color: var(--sd-muted);
  font-family: var(--number);
  font-size: 7px;
}

.cw.mg63 .quality-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 12px;
  margin-top: 12px;
}

.cw.mg63 .quality-side-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.cw.mg63 .quality-check-list {
  display: grid;
  max-height: 640px;
  overflow-y: auto;
  border-top: 1px solid var(--sd-line);
}

.cw.mg63 .quality-check-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 9px 2px;
  border-bottom: 1px solid var(--sd-line);
}

.cw.mg63 .quality-repro,
.cw.mg63 .quality-normalization,
.cw.mg63 .provenance-audit {
  display: grid;
  gap: 8px;
  color: var(--sd-ink-soft);
  font-size: 8px;
}

.cw.mg63 .quality-warning-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cw.mg63 .quality-warning-list li {
  padding: 9px 0;
  color: var(--sd-ink-soft);
  border-bottom: 1px solid var(--sd-line);
  font-size: 9px;
  line-height: 1.55;
}

.cw.mg63 .quality-normalization-panel,
.cw.mg63 .quality-warning-panel,
.cw.mg63 .limitation-panel,
.cw.mg63 .calendar-panel {
  margin-top: 12px;
}

.cw.mg63 .calendar-grid {
  display: grid;
  grid-template-columns: repeat(31, minmax(10px, 1fr));
  gap: 3px;
  min-width: 720px;
}

.cw.mg63 .calendar-grid > * {
  aspect-ratio: 1;
  border-radius: 0;
}

.cw.mg63 .method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cw.mg63 .method-card {
  position: relative;
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: flex-start;
}

.cw.mg63 .method-index {
  color: var(--sd-accent);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
}

.cw.mg63 .method-card h2 {
  margin: 19px 0 8px;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.cw.mg63 .method-card p {
  margin: 0;
  color: var(--sd-muted);
  font-size: 9px;
  line-height: 1.65;
}

.cw.mg63 .method-card code {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 9px;
  color: var(--sd-accent-deep);
  background: var(--sd-accent-soft);
  border-radius: 0;
  font-family: var(--number);
  font-size: 8px;
  white-space: normal;
}

.cw.mg63 .provenance-list,
.cw.mg63 .api-list {
  display: grid;
  gap: 0;
}

.cw.mg63 .provenance-list > div,
.cw.mg63 .api-list > div {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sd-line);
}

.cw.mg63 .provenance-list span,
.cw.mg63 .api-list code {
  color: var(--sd-accent-deep);
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .provenance-list strong,
.cw.mg63 .api-list span {
  color: var(--sd-ink-soft);
  font-size: 9px;
}

.cw.mg63 .provenance-list em {
  color: var(--sd-muted);
  font-size: 8px;
  font-style: normal;
}

.cw.mg63 .limitation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
}

.cw.mg63 .limitation-grid p {
  margin: 0;
  padding: 10px 0;
  color: var(--sd-ink-soft);
  border-bottom: 1px solid var(--sd-line);
  font-size: 9px;
}

.cw.mg63 .version-badge {
  padding: 8px 10px;
  color: var(--sd-accent-deep);
  background: transparent;
  border: 1px solid #cf9d89;
  border-radius: 1px;
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .software-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  margin-top: 12px;
  padding: 13px 0;
  color: var(--sd-faint);
  border-top: 1px solid var(--sd-line);
  font-size: 8px;
}

.cw.mg63 .software-identity strong {
  color: var(--sd-ink-soft);
}

.cw.mg63 .software-identity em {
  font-style: normal;
}

/* Startup, progress, dialogs */

.cw.mg63 .startup-console {
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(193, 77, 45, 0.12),
      transparent 32%
    ),
    radial-gradient(
      circle at 80% 75%,
      rgba(21, 90, 69, 0.09),
      transparent 30%
    ),
    var(--sd-paper);
}

.cw.mg63 .startup-card {
  display: grid;
  width: min(840px, 100%);
  grid-template-columns: 238px minmax(0, 1fr);
  overflow: hidden;
  background: var(--sd-surface);
  border: 1px solid var(--sd-line-strong);
  border-top: 3px solid var(--sd-ink);
  border-radius: 2px;
  box-shadow: 0 26px 70px rgba(52, 44, 30, 0.16);
}

.cw.mg63 .startup-identity {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  color: #f8f4eb;
  background:
    linear-gradient(
      145deg,
      rgba(193, 77, 45, 0.25),
      transparent 48%
    ),
    var(--sd-ink);
}

.cw.mg63 .startup-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #f8f4eb;
  background: transparent;
  border: 1px solid rgba(248, 244, 235, 0.52);
  border-radius: 1px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
}

.cw.mg63 .startup-identity .eyebrow {
  color: #d8b7a8;
}

.cw.mg63 .startup-identity > div:last-child span {
  color: #e9dfd0;
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .startup-body {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 28px;
}

.cw.mg63 .startup-loader {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  color: var(--sd-accent);
  border: 1px solid var(--sd-line);
  border-radius: 50%;
}

.cw.mg63 .startup-loader::before {
  position: absolute;
  inset: 8px;
  content: "";
  border: 2px solid transparent;
  border-top-color: var(--sd-accent);
  border-right-color: rgba(193, 77, 45, 0.2);
  border-radius: 50%;
  animation: fx-startup-spin 1.2s linear infinite;
}

.cw.mg63 .startup-loader span {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
}

.cw.mg63 .startup-copy h1 {
  margin: 6px 0;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.cw.mg63 .startup-copy > p:not(.eyebrow) {
  margin: 0;
  color: var(--sd-muted);
  font-size: 9px;
}

.cw.mg63 .startup-steps {
  display: grid;
  gap: 6px;
  margin: 17px 0 14px;
  padding: 0;
  list-style: none;
}

.cw.mg63 .startup-steps li {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  color: var(--sd-muted);
  font-size: 8px;
}

.cw.mg63 .startup-steps i {
  width: 6px;
  height: 6px;
  border: 1px solid var(--sd-line-strong);
  border-radius: 0;
  transform: rotate(45deg);
}

.cw.mg63 .startup-steps li.is-active i {
  background: var(--sd-accent);
  border-color: var(--sd-accent);
  box-shadow: 0 0 0 4px rgba(193, 77, 45, 0.1);
}

.cw.mg63 .startup-steps li.is-done i {
  background: var(--sd-green);
  border-color: var(--sd-green);
}

.cw.mg63 .startup-steps li.is-error i {
  background: var(--sd-red);
  border-color: var(--sd-red);
}

.cw.mg63 .startup-steps em {
  color: var(--sd-faint);
  font-family: var(--number);
  font-size: 7px;
  font-style: normal;
}

.cw.mg63 .startup-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 11px;
  color: var(--sd-faint);
  border-top: 1px solid var(--sd-line);
  font-size: 8px;
}

.cw.mg63 .startup-foot strong {
  color: var(--sd-ink-soft);
  font-family: var(--number);
}

.cw.mg63 .calculation-dock {
  right: max(18px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  width: min(480px, calc(100vw - 24px));
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  color: #f8f4eb;
  background: var(--sd-ink);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  box-shadow: var(--fx-shadow);
}

.cw.mg63 .toast-stack {
  right: 14px;
  bottom: calc(14px + var(--calculation-dock-offset, 0px));
  gap: 7px;
  width: min(390px, calc(100vw - 28px));
}

.cw.mg63 .toast {
  padding: 10px 11px;
  color: #f8f4eb;
  background: var(--sd-ink);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 2px;
  box-shadow: var(--fx-shadow);
  font-size: 9px;
}

.cw.mg63 .action-dialog {
  width: min(680px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
  color: var(--sd-ink);
  background: var(--sd-surface);
  border: 1px solid var(--sd-line-strong);
  border-top: 3px solid var(--sd-ink);
  border-radius: 2px;
  box-shadow: 0 24px 70px rgba(32, 35, 31, 0.24);
}

.cw.mg63 .action-dialog::backdrop {
  background: rgba(32, 35, 31, 0.46);
  backdrop-filter: blur(4px);
}

.cw.mg63 .dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px;
  background: transparent;
  border-bottom: 1px solid var(--sd-line);
}

.cw.mg63 .dialog-head h2 {
  margin: 4px 0 0;
  color: var(--sd-ink);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.cw.mg63 .dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 15px 19px;
  background: transparent;
}

.cw.mg63 .action-card {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--sd-ink-soft);
  text-align: left;
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
}

.cw.mg63 .action-card:hover {
  background: var(--sd-accent-soft);
  border-color: #cf9d89;
}

.cw.mg63 .action-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--sd-accent-deep);
  background: transparent;
  border: 1px solid var(--sd-line);
  border-radius: 1px;
  font-family: var(--number);
  font-size: 8px;
  font-weight: 600;
}

.cw.mg63 .action-card strong {
  font-size: 9px;
}

.cw.mg63 .action-card small {
  color: var(--sd-muted);
  font-size: 8px;
}

.cw.mg63 .dialog-note {
  margin: 0;
  padding: 0 19px 17px;
  color: var(--sd-faint);
  font-size: 8px;
}

.cw.mg63 .import-filebar,
.cw.mg63 .import-preview-body,
.cw.mg63 .import-actions,
.cw.mg63 .confirm-message,
.cw.mg63 .confirm-actions {
  margin: 0;
  padding: 13px 19px;
  background: transparent;
}

.cw.mg63 .import-filebar {
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--sd-line);
  font-size: 9px;
}

.cw.mg63 .import-filebar span,
.cw.mg63 .import-filebar em {
  color: var(--sd-muted);
  font-size: 8px;
  font-style: normal;
}

.cw.mg63 .import-filebar strong {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw.mg63 .import-actions,
.cw.mg63 .confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  border-top: 1px solid var(--sd-line);
}

/* Tablet: the parameter register becomes a right-side drawing sheet. */

@media (max-width: 1279px) {
  .cw.mg63 {
    --fx-inspector-width: min(380px, calc(100vw - 20px));
  }

  .cw.mg63 .app-sidebar {
    gap: 18px;
  }

  .cw.mg63 .view-tab {
    padding-right: 10px;
    padding-left: 10px;
  }

  .cw.mg63 .workspace {
    display: block;
  }

  .cw.mg63 .main-stage {
    padding-right: clamp(16px, 2.4vw, 30px);
    padding-left: clamp(16px, 2.4vw, 30px);
  }

  .cw.mg63 .control-trigger {
    display: inline-flex;
  }

  .cw.mg63 .control-rail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 140;
    width: min(var(--fx-inspector-width), calc(100vw - 16px));
    height: 100dvh;
    padding:
      max(16px, env(safe-area-inset-top))
      15px
      max(18px, env(safe-area-inset-bottom));
    background:
      linear-gradient(
        to bottom,
        rgba(32, 35, 31, 0.025) 1px,
        transparent 1px
      )
      0 0 / 100% 24px,
      var(--sd-paper);
    border-left: 1px solid var(--sd-line);
    box-shadow: -20px 0 54px rgba(32, 35, 31, 0.18);
    transform: translate3d(calc(100% + 20px), 0, 0);
    transition:
      transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 280ms;
    visibility: hidden;
  }

  .cw.mg63 .rail-close {
    display: inline-grid;
  }

  .cw.mg63.controls-open .control-rail {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    transition:
      transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s;
  }

  .cw.mg63.controls-open .panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: block;
  }
}

@media (min-width: 1280px) {
  .cw.mg63 .control-trigger {
    display: none;
  }

  .cw.mg63 .panel-backdrop {
    display: none !important;
  }

  .cw.mg63 .rail-close {
    display: none;
  }
}

@media (max-width: 1120px) {
  .cw.mg63 .sidebar-foot {
    display: none;
  }

  .cw.mg63 .save-state {
    display: none;
  }

  .cw.mg63 .scenario-title {
    width: min(480px, 50vw);
  }

  .cw.mg63 #view-overview .overview-hero {
    grid-template-columns: minmax(0, 1.45fr) minmax(255px, 0.55fr);
  }

  .cw.mg63 .hero-copy {
    padding-right: 20px;
  }

  .cw.mg63 .hero-score {
    padding-left: 22px;
  }

  .cw.mg63 .energy-atlas,
  .cw.mg63 .hero-signal {
    padding-right: 20px;
    padding-left: 20px;
  }

  .cw.mg63 .quality-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cw.mg63 .method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cw.mg63 {
    --fx-inspector-width: min(370px, calc(100vw - 16px));
  }

  .cw.mg63 .app-sidebar {
    gap: 12px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .cw.mg63 .brand-copy small {
    display: none;
  }

  .cw.mg63 .brand-copy strong {
    font-size: 17px;
  }

  .cw.mg63 .view-tab-icon {
    display: none;
  }

  .cw.mg63 .view-tab {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 9px;
  }

  .cw.mg63 .topbar {
    gap: 8px;
    padding-right: 12px;
    padding-left: 14px;
  }

  .cw.mg63 .scenario-meta {
    display: none;
  }

  .cw.mg63 .scenario-title {
    width: min(390px, 47vw);
    min-height: 32px;
    font-size: 16px;
  }

  .cw.mg63 .top-mode-switch {
    display: none;
  }

  .cw.mg63 .top-baseline {
    display: none;
  }

  .cw.mg63 #view-overview .overview-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "score"
      "mix"
      "signal";
  }

  .cw.mg63 .hero-copy {
    min-height: 0;
    padding: 23px 0 21px;
    border-right: 0;
    border-bottom: 1px solid var(--sd-line);
  }

  .cw.mg63 .hero-copy h1 {
    font-size: clamp(43px, 8vw, 64px);
  }

  .cw.mg63 .hero-score {
    min-height: 210px;
    padding: 20px 0 21px;
    border-top: 0;
    border-left: 0;
    border-bottom: 1px solid var(--sd-line);
    background:
      linear-gradient(
        90deg,
        rgba(193, 77, 45, 0.11),
        transparent 65%
      ),
      transparent;
  }

  .cw.mg63 .brief-score {
    margin: 25px 0 15px;
  }

  .cw.mg63 .score-value {
    font-size: 62px;
  }

  .cw.mg63 .hero-mix {
    padding-right: 0;
    padding-left: 0;
  }

  .cw.mg63 .hero-signal {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 16px;
    padding-left: 16px;
  }

  .cw.mg63 .hero-signal-copy {
    gap: 12px;
  }

  .cw.mg63 .hero-signal-note {
    max-width: 64ch;
  }

  .cw.mg63 .energy-atlas {
    padding: 18px 16px;
  }

  .cw.mg63 .energy-atlas-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .cw.mg63 .atlas-balance {
    min-width: 0;
    text-align: left;
  }

  .cw.mg63 .atlas-desktop {
    display: none;
  }

  .cw.mg63 .atlas-mobile {
    display: block;
  }

  .cw.mg63 .energy-atlas-visual {
    min-height: 0;
  }

  .cw.mg63 .insight-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw.mg63 .insight-card {
    border-right: 0;
    border-bottom: 1px solid var(--sd-line);
  }

  .cw.mg63 .insight-card:last-child {
    border-bottom: 0;
  }

  .cw.mg63 .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cw.mg63 .metric-card:nth-child(4n) {
    border-right: 1px solid var(--sd-line);
  }

  .cw.mg63 .metric-card:nth-child(2n) {
    border-right: 0;
  }

  .cw.mg63 .metric-card:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--sd-line);
  }

  .cw.mg63 .metric-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .cw.mg63 .dashboard-grid,
  .cw.mg63 .dashboard-grid-wide,
  .cw.mg63 .quality-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw.mg63 .view-intro {
    padding-left: 78px;
  }

  .cw.mg63 .view-intro::after {
    left: 60px;
  }

  .cw.mg63 .quality-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .cw.mg63 .quality-verdict {
    max-width: none;
    justify-items: start;
    text-align: left;
  }

  .cw.mg63 .sensitivity-placeholder {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Phone: the chapter index becomes a bottom control strip. */

@media (max-width: 760px) {
  .cw.mg63 {
    --fx-topbar: 54px;
    --sd-nav-height: 62px;
    --sd-chrome-height: var(--fx-topbar);
  }

  .cw.mg63 .app-shell {
    display: block;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .cw.mg63 .app-sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    display: block;
    width: 100%;
    height: calc(62px + env(safe-area-inset-bottom));
    padding: 4px 5px env(safe-area-inset-bottom);
    overflow: visible;
    color: var(--sd-ink-soft);
    background: rgba(248, 245, 237, 0.97);
    border-top: 1px solid var(--sd-line);
    box-shadow: 0 -10px 28px rgba(55, 46, 31, 0.08);
    backdrop-filter: blur(18px) saturate(1.08);
  }

  .cw.mg63 .sidebar-head,
  .cw.mg63 .sidebar-nav-block {
    display: contents;
  }

  .cw.mg63 .brand {
    display: none;
  }

  .cw.mg63 .view-nav {
    display: flex;
    width: 100%;
    max-height: none;
    height: 100%;
    flex-direction: row;
    gap: 2px;
    overflow-x: hidden;
    overflow-y: hidden;
    scroll-snap-type: none;
  }

  .cw.mg63 .view-tab-indicator {
    display: none;
  }

  .cw.mg63 .view-tab,
  .cw.mg63 .view-tab:nth-child(n) {
    min-width: 0;
    min-height: 54px;
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    padding: 5px 2px 4px;
    color: var(--sd-muted);
    border-radius: 0;
    scroll-snap-align: center;
    font-size: 8px;
    white-space: normal;
  }

  .cw.mg63 .view-tab.is-active,
  .cw.mg63 .view-tab.is-active:nth-child(n) {
    color: var(--sd-accent-deep);
    background: var(--sd-accent-soft);
  }

  .cw.mg63 .view-tab.is-active::after {
    display: block;
    top: 0;
    left: 50%;
    width: 24px;
    height: 2px;
    background: var(--sd-accent);
    border-radius: 0;
    transform: translateX(-50%);
    animation: none;
  }

  .cw.mg63 .view-tab-icon {
    display: grid;
    width: 19px;
    height: 19px;
  }

  .cw.mg63 .view-tab-icon svg {
    width: 18px;
    height: 18px;
  }

  .cw.mg63 .view-tab-label {
    overflow: hidden;
    width: 100%;
    text-overflow: ellipsis;
  }

  .cw.mg63 .sidebar-foot {
    display: none;
  }

  .cw.mg63 .app-frame {
    min-height: 100dvh;
    background:
      linear-gradient(rgba(32, 35, 31, 0.022) 1px, transparent 1px),
      linear-gradient(
        90deg,
        rgba(32, 35, 31, 0.022) 1px,
        transparent 1px
      ),
      transparent;
    background-size: 38px 38px;
  }

  .cw.mg63 .topbar {
    position: sticky;
    top: 0;
    min-height: var(--fx-topbar);
    gap: 5px;
    padding: 6px 8px;
  }

  .cw.mg63 .nav-button {
    display: none;
  }

  .cw.mg63 .title-stack {
    padding-left: 3px;
    border-left: 0;
  }

  .cw.mg63 .scenario-title {
    width: min(54vw, 250px);
    min-height: 32px;
    padding: 4px 2px;
    font-size: 14px;
  }

  .cw.mg63 .top-actions {
    gap: 3px;
    margin-left: auto;
  }

  .cw.mg63 .control-trigger {
    width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .cw.mg63 .control-trigger span {
    display: none;
  }

  .cw.mg63 .exportButton,
  .cw.mg63 #exportButton {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 9px;
  }

  .cw.mg63 .main-stage {
    padding: 12px 10px 24px;
  }

  .cw.mg63 .view-intro {
    min-height: 110px;
    align-items: flex-end;
    margin-bottom: 10px;
    padding: 18px 12px 15px 61px;
  }

  .cw.mg63 .view-intro::before {
    top: 17px;
    left: 9px;
    font-size: 34px;
  }

  .cw.mg63 .view-intro::after {
    top: 17px;
    bottom: 17px;
    left: 49px;
  }

  .cw.mg63 .view-intro h1 {
    font-size: 26px;
  }

  .cw.mg63 .view-intro p:not(.eyebrow) {
    font-size: 8px;
  }

  .cw.mg63 .view-intro > .button,
  .cw.mg63 .view-intro .quality-verdict {
    width: 100%;
  }

  .cw.mg63 .overview-hero,
  .cw.mg63 .energy-atlas,
  .cw.mg63 .metric-grid,
  .cw.mg63 .panel,
  .cw.mg63 .method-card,
  .cw.mg63 .quality-summary-card {
    border-radius: 0;
  }

  .cw.mg63 .overview-hero {
    border-top-width: 2px;
  }

  .cw.mg63 .hero-copy {
    padding: 19px 2px 17px;
  }

  .cw.mg63 .hero-copy h1 {
    margin-top: 13px;
    font-size: clamp(40px, 12vw, 54px);
    letter-spacing: -0.06em;
  }

  .cw.mg63 .hero-lede {
    font-size: 9px;
  }

  .cw.mg63 .health-tag {
    min-height: 23px;
    font-size: 7px;
  }

  .cw.mg63 .hero-score {
    min-height: 190px;
    padding: 17px 2px;
  }

  .cw.mg63 .brief-score {
    margin: 22px 0 13px;
  }

  .cw.mg63 .score-value {
    font-size: 58px;
  }

  .cw.mg63 .hero-mix {
    padding: 14px 2px 16px;
  }

  .cw.mg63 .hero-signal {
    margin-top: 10px;
    padding: 17px 13px 13px;
  }

  .cw.mg63 .hero-energy-map {
    height: 164px;
  }

  .cw.mg63 .energy-atlas {
    margin-top: 10px;
    padding: 16px 13px;
  }

  .cw.mg63 .insight-strip {
    gap: 0;
    margin-top: 10px;
  }

  .cw.mg63 .insight-card {
    padding: 12px 4px;
  }

  .cw.mg63 .metric-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
  }

  .cw.mg63 .metric-scope-actions {
    width: 100%;
    justify-content: space-between;
  }

  .cw.mg63 .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw.mg63 .metric-card,
  .cw.mg63 .metric-card:nth-child(n) {
    min-height: 108px;
    padding-right: 4px;
    padding-left: 4px;
    border-right: 0;
    border-bottom: 1px solid var(--sd-line);
  }

  .cw.mg63 .metric-card:last-child {
    border-bottom: 0;
  }

  .cw.mg63 .metric-value {
    margin-top: 13px;
    font-size: 34px;
  }

  .cw.mg63 .panel,
  .cw.mg63 .method-card,
  .cw.mg63 .quality-summary-card {
    padding: 15px 13px;
  }

  .cw.mg63 .panel-heading {
    flex-wrap: wrap;
  }

  .cw.mg63 .chart-frame {
    min-height: 226px;
  }

  .cw.mg63 .chart-panel-tall .chart-frame {
    min-height: 286px;
  }

  .cw.mg63 .quality-summary-grid,
  .cw.mg63 .method-grid,
  .cw.mg63 .limitation-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw.mg63 .quality-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw.mg63 .sensitivity-placeholder {
    min-height: 274px;
    padding: 16px;
  }

  .cw.mg63 .hourly-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cw.mg63 .hourly-toolbar label,
  .cw.mg63 .hourly-toolbar select,
  .cw.mg63 .hourly-toolbar input {
    width: 100%;
  }

  .cw.mg63 .toolbar-spacer {
    display: none;
  }

  .cw.mg63 .control-rail {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 160;
    width: 100%;
    height: min(88dvh, 760px);
    padding: 17px 14px max(20px, env(safe-area-inset-bottom));
    background:
      linear-gradient(
        to bottom,
        rgba(32, 35, 31, 0.025) 1px,
        transparent 1px
      )
      0 0 / 100% 24px,
      var(--sd-paper);
    border-top: 1px solid var(--sd-line);
    border-left: 0;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -22px 58px rgba(32, 35, 31, 0.2);
    transform: translate3d(0, calc(100% + 20px), 0);
  }

  .cw.mg63.controls-open .control-rail {
    transform: translate3d(0, 0, 0);
  }

  .cw.mg63 .rail-head::before {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 38px;
    height: 2px;
    content: "";
    background: var(--sd-line-strong);
    border-radius: 0;
    transform: translateX(-50%);
  }

  .cw.mg63 .rail-head {
    position: relative;
    padding-top: 16px;
  }

  .cw.mg63 .mode-mobile {
    display: flex;
  }

  .cw.mg63 .calculation-dock {
    right: 8px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
  }

  .cw.mg63 .toast-stack {
    right: 8px;
    bottom: calc(
      70px + env(safe-area-inset-bottom) +
        var(--calculation-dock-offset, 0px)
    );
    width: calc(100vw - 16px);
  }

  .cw.mg63 .startup-console {
    padding: 12px;
  }

  .cw.mg63 .startup-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw.mg63 .startup-identity {
    display: grid;
    min-height: 92px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 16px;
  }

  .cw.mg63 .startup-identity > div:last-child {
    align-self: end;
  }

  .cw.mg63 .startup-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    padding: 19px;
  }

  .cw.mg63 .startup-loader {
    width: 74px;
    height: 74px;
  }

  .cw.mg63 .startup-copy h1 {
    font-size: 24px;
  }

  .cw.mg63 .dialog-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw.mg63 .action-card-wide {
    grid-column: auto;
  }
}

@media (max-width: 380px) {
  .cw.mg63 .scenario-title {
    width: 54vw;
    font-size: 13px;
  }

  .cw.mg63 #exportButton {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 8px;
  }

  .cw.mg63 .view-tab-icon {
    display: none;
  }

  .cw.mg63 .view-tab {
    font-size: 7px;
  }

  .cw.mg63 .hero-copy h1 {
    font-size: 39px;
  }

  .cw.mg63 .view-intro {
    padding-left: 54px;
  }

  .cw.mg63 .view-intro::before {
    left: 7px;
    font-size: 29px;
  }

  .cw.mg63 .view-intro::after {
    left: 43px;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .cw.mg63 .app-sidebar {
    height: calc(56px + env(safe-area-inset-bottom));
  }

  .cw.mg63 .view-tab,
  .cw.mg63 .view-tab:nth-child(n) {
    min-height: 47px;
    flex-direction: row;
    gap: 5px;
  }

  .cw.mg63 .view-tab-icon {
    display: grid;
    width: 16px;
    height: 16px;
  }

  .cw.mg63 .app-shell {
    padding-bottom: calc(59px + env(safe-area-inset-bottom));
  }

  .cw.mg63 .control-rail {
    height: 94dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cw.mg63 .hero-route-pulse,
  .cw.mg63 .hero-node-ripple {
    display: none;
  }
}

@media print {
  .cw.mg63 {
    background: #fff;
  }

  .cw.mg63 .app-sidebar,
  .cw.mg63 .topbar,
  .cw.mg63 .control-rail,
  .cw.mg63 .panel-backdrop,
  .cw.mg63 .nav-backdrop,
  .cw.mg63 .calculation-dock,
  .cw.mg63 .toast-stack {
    display: none !important;
  }

  .cw.mg63 .app-shell,
  .cw.mg63 .workspace {
    display: block;
  }

  .cw.mg63 .main-stage {
    max-width: none;
    padding: 0;
  }

  .cw.mg63 .view {
    display: block !important;
  }

  .cw.mg63 .panel,
  .cw.mg63 .metric-grid,
  .cw.mg63 .overview-hero,
  .cw.mg63 .energy-atlas {
    break-inside: avoid;
  }
}
