/*
 * MineGrid Studio v63 - Frontier Workbench
 *
 * A structural UI rebuild: persistent tool rail, analysis canvas, engineering
 * inspector and a responsive mobile navigation. Calculation contracts remain
 * server-only and are intentionally untouched by this stylesheet.
 */

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

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

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

.cw.mg63 {
  --fx-bg: #e8eef1;
  --fx-canvas: #f4f7f8;
  --fx-surface: #ffffff;
  --fx-surface-soft: #f8fafb;
  --fx-surface-raised: #eef4f7;
  --fx-ink: #14242d;
  --fx-ink-soft: #304751;
  --fx-muted: #536a75;
  --fx-faint: #657883;
  --fx-line: #d5e0e5;
  --fx-line-strong: #b7c7cf;
  --fx-accent: #125ed1;
  --fx-accent-deep: #0a469f;
  --fx-accent-soft: #e7f0ff;
  --fx-green: #087b61;
  --fx-green-soft: #e2f4ed;
  --fx-solar: #d66518;
  --fx-solar-soft: #fff0e3;
  --fx-amber: #9d5d02;
  --fx-red: #b12e34;
  --fx-red-soft: #fbe9e9;
  --fx-storage: #3e6f95;
  --fx-diesel: #5f707b;
  --fx-rail: #102631;
  --fx-rail-soft: #183541;
  --fx-rail-line: rgba(231, 244, 250, 0.12);
  --fx-radius: 14px;
  --fx-radius-small: 9px;
  --fx-shadow: 0 12px 30px rgba(18, 42, 54, 0.08);
  --fx-topbar: 62px;
  --fx-rail-width: 84px;
  --fx-inspector-width: 332px;
  --body: "Frontier Sans", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --number: "DIN Alternate", "SFMono-Regular", "Cascadia Mono",
    "Roboto Mono", monospace;
  --display: var(--body);
  min-width: 320px;
  min-height: 100dvh;
  color: var(--fx-ink);
  background: var(--fx-bg);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
}

.cw.mg63 *,
.cw.mg63 *::before,
.cw.mg63 *::after {
  box-sizing: border-box;
}

.cw.mg63::before,
.cw.mg63::after,
.cw.mg63 .page-noise {
  display: none !important;
}

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

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

.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;
}

.cw.mg63 :where(
    .data-table,
    .quality-check-list,
    .quality-normalization,
    .quality-provenance,
    .method-card p,
    .limitation-grid,
    .hero-lede,
    .insight-card p,
    #qualityRepro,
    #qualityWarnings
  ) {
  -webkit-user-select: text;
  user-select: text;
}

.cw.mg63 .app-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: var(--fx-rail-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

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

.cw.mg63 .app-frame {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
  min-height: 100dvh;
  overflow: visible;
  background: var(--fx-canvas);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

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

/* Persistent tool rail */

.cw.mg63 .app-sidebar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  grid-row: 1;
  grid-column: 1;
  width: var(--fx-rail-width);
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  padding:
    max(14px, env(safe-area-inset-top))
    9px
    max(14px, env(safe-area-inset-bottom));
  overflow: hidden;
  color: #eef7fb;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    var(--fx-rail);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.cw.mg63 .sidebar-head {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 0;
}

.cw.mg63 .brand {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #f5fbfe;
}

.cw.mg63 .brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #ffffff;
  background: var(--fx-accent);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.22);
  font-family: var(--number);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.cw.mg63 .brand-mark::after {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 9px;
  height: 9px;
  content: "";
  background: #4cd8ac;
  border: 2px solid var(--fx-rail);
  border-radius: 50%;
}

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

.cw.mg63 .brand-copy strong {
  color: #eff8fc;
  font-family: var(--body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

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

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

.cw.mg63 .sidebar-nav-block {
  min-height: 0;
  margin: 18px 0 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: auto;
  max-height: calc(100dvh - 196px);
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  overflow: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: 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: var(--fx-rail-soft);
  border: 1px solid rgba(204, 236, 250, 0.1);
  border-radius: 10px;
  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-height: 62px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 3px;
  color: #8eacb8;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-align: center;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.cw.mg63 .view-tab:hover {
  color: #f3fbff;
  background: rgba(255, 255, 255, 0.055);
}

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

.cw.mg63 .view-tab.is-active::after {
  position: absolute;
  top: 17px;
  left: 0;
  width: 2px;
  height: 28px;
  content: "";
  background: #4d8dff;
  border-radius: 0 2px 2px 0;
  animation: fx-rail-active 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fx-rail-active {
  from {
    opacity: 0;
    transform: scaleY(0.4);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

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

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

.cw.mg63 #tab-overview .view-tab-icon svg path {
  fill: none;
}

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

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

.cw.mg63 .sidebar-foot {
  display: flex;
  margin-top: auto;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid var(--fx-rail-line);
}

.cw.mg63 .sidebar-local-state {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #8eaeb9;
  text-align: center;
}

.cw.mg63 .sidebar-local-state > span {
  width: 7px;
  height: 7px;
  background: #42d9a6;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(66, 217, 166, 0.1);
}

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

.cw.mg63 .sidebar-local-state strong {
  color: #d8e9ef;
  font-size: 8px;
  font-weight: 500;
}

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

/* Project command bar */

.cw.mg63 .topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  min-height: var(--fx-topbar);
  gap: 14px;
  margin: 0;
  padding: 8px 18px 8px 22px;
  background: rgba(251, 253, 254, 0.94);
  border: 0;
  border-bottom: 1px solid var(--fx-line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(1.1);
}

.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: 1px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--fx-line);
}

.cw.mg63 .scenario-title {
  width: min(520px, 46vw);
  min-height: 27px;
  padding: 2px 4px;
  margin: 0 0 0 -4px;
  overflow: hidden;
  color: var(--fx-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.cw.mg63 .scenario-title:focus {
  color: var(--fx-ink);
  background: #ffffff;
  border-color: var(--fx-accent);
  box-shadow: 0 0 0 3px rgba(18, 94, 209, 0.1);
}

.cw.mg63 .scenario-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--fx-muted);
  font-family: var(--number);
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.cw.mg63 .scenario-meta-separator {
  width: 1px;
  height: 9px;
  background: var(--fx-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: 30px;
  align-items: center;
  gap: 7px;
  margin: 0 2px;
  color: var(--fx-muted);
  font-size: 10px;
  white-space: nowrap;
}

.cw.mg63 .save-state::before {
  width: 6px;
  height: 6px;
  content: "";
  background: var(--fx-green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(8, 123, 97, 0.09);
  animation: none;
}

.cw.mg63 .save-state.is-dirty::before {
  background: var(--fx-amber);
  box-shadow: 0 0 0 3px rgba(157, 93, 2, 0.1);
}

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

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

.cw.mg63 .mode-switch {
  display: inline-flex;
  min-height: 32px;
  gap: 2px;
  padding: 2px;
  background: var(--fx-surface-raised);
  border: 1px solid var(--fx-line);
  border-radius: 7px;
  box-shadow: none;
}

.cw.mg63 .mode-button,
.cw.mg63 .mode-pro .mode-button,
.cw.mg63 .mode-simple .mode-button {
  min-height: 26px;
  padding: 3px 10px;
  color: var(--fx-muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  font-size: 10px;
  font-weight: 500;
}

.cw.mg63 .mode-button:hover {
  color: var(--fx-ink);
}

.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: #ffffff;
  background: var(--fx-accent);
  box-shadow: none;
}

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

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

.cw.mg63 .button:hover {
  color: var(--fx-ink);
  background: var(--fx-surface-raised);
  border-color: #9eb1bb;
  transform: translateY(-1px);
}

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

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

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

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

.cw.mg63 .button-small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 9px;
}

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

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

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

/* Two-pane workspace with a persistent engineering inspector */

.cw.mg63 .workspace {
  position: relative;
  display: grid;
  min-height: calc(100dvh - var(--fx-topbar));
  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:
    18px 20px
    calc(92px + var(--calculation-dock-offset, 0px));
}

.cw.mg63 .panel-backdrop,
.cw.mg63 .nav-backdrop {
  background: rgba(12, 28, 36, 0.38);
  border: 0;
  backdrop-filter: blur(3px);
}

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

.cw.mg63 .control-rail {
  position: sticky;
  top: var(--fx-topbar);
  order: 2;
  width: var(--fx-inspector-width);
  height: calc(100dvh - var(--fx-topbar));
  max-height: none;
  margin: 0;
  padding: 17px 15px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--fx-ink);
  background: var(--fx-surface-soft);
  border: 0;
  border-left: 1px solid var(--fx-line);
  border-radius: 0;
  box-shadow: none;
  transform: none;
  transition: none;
  scrollbar-width: thin;
  scrollbar-color: var(--fx-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 12px;
  padding: 1px 1px 13px;
  border-bottom: 1px solid var(--fx-line);
}

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

.cw.mg63 .rail-head h2 {
  margin: 4px 0 0;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

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

.cw.mg63 .mode-mobile {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 11px;
  color: var(--fx-muted);
  font-size: 10px;
}

.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 0 9px;
  overflow: hidden;
  color: var(--fx-ink);
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: var(--fx-radius-small);
  box-shadow: none;
}

.cw.mg63 .scenario-editor > summary,
.cw.mg63 .control-group > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  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(--fx-faint);
  content: "+";
  font-family: var(--number);
  font-size: 14px;
}

.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(--fx-ink-soft);
  font-size: 11px;
  font-weight: 600;
}

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

.cw.mg63 .section-count {
  min-height: 20px;
  padding: 2px 6px;
  color: var(--fx-faint);
  background: var(--fx-surface-raised);
  border: 0;
  border-radius: 5px;
  font-family: var(--number);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.cw.mg63 .scenario-editor-body,
.cw.mg63 .control-body {
  padding: 10px 11px 12px;
  border-top: 1px solid var(--fx-line);
}

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

.cw.mg63 .field input,
.cw.mg63 .field select,
.cw.mg63 .field textarea,
.cw.mg63 .control-value input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  color: var(--fx-ink);
  background: var(--fx-surface-soft);
  border: 1px solid var(--fx-line);
  border-radius: 6px;
  font-family: var(--body);
  font-size: 10px;
}

.cw.mg63 .field input:focus,
.cw.mg63 .field select:focus,
.cw.mg63 .control-value input:focus {
  background: #ffffff;
  border-color: var(--fx-accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(18, 94, 209, 0.09);
}

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

.cw.mg63 .mode-rail-note.is-warning {
  padding: 8px 9px;
  color: #6f4708;
  background: #fff2de;
  border: 1px solid #f2d7ae;
  border-radius: 6px;
}

.cw.mg63 .preset-section {
  padding: 11px;
}

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

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

.cw.mg63 .preset-button {
  display: grid;
  min-width: 0;
  min-height: 54px;
  gap: 2px;
  padding: 8px;
  color: var(--fx-ink-soft);
  text-align: left;
  background: var(--fx-surface-soft);
  border: 1px solid var(--fx-line);
  border-radius: 7px;
  box-shadow: none;
}

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

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

.cw.mg63 .preset-button small {
  overflow: hidden;
  color: var(--fx-faint);
  font-family: var(--number);
  font-size: 8px;
  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: 10px 0;
  border-top: 1px solid var(--fx-line);
}

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

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

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

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

.cw.mg63 .control-value input {
  min-height: 28px;
  padding: 4px 6px;
  text-align: right;
  font-family: var(--number);
  font-size: 10px;
}

.cw.mg63 .control-value span {
  color: var(--fx-faint);
  font-size: 9px;
}

.cw.mg63 .range-shell {
  padding-top: 5px;
}

.cw.mg63 .range-visual {
  height: 5px;
  overflow: hidden;
  background: #dfe8ec;
  border-radius: 999px;
}

.cw.mg63 .range-fill {
  height: 100%;
  background: var(--fx-accent);
  border-radius: inherit;
  box-shadow: none;
}

.cw.mg63 input[type="range"] {
  accent-color: var(--fx-accent);
}

.cw.mg63 input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -6px;
  background: #ffffff;
  border: 2px solid var(--fx-accent);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(13, 45, 70, 0.22);
}

.cw.mg63 input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background: #ffffff;
  border: 2px solid var(--fx-accent);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(13, 45, 70, 0.22);
}

.cw.mg63 .range-bubble {
  color: #ffffff;
  background: var(--fx-rail);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  box-shadow: none;
  font-family: var(--number);
  font-size: 8px;
}

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

.cw.mg63 .simple-mode-guide {
  padding: 12px;
  background: var(--fx-accent-soft);
  border-color: #bed2ef;
}

.cw.mg63 .simple-mode-guide-kicker {
  color: var(--fx-accent);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.cw.mg63 .simple-mode-guide strong {
  display: block;
  margin-top: 5px;
  color: var(--fx-ink);
  font-size: 10px;
}

.cw.mg63 .simple-mode-guide p {
  margin: 5px 0 9px;
  color: var(--fx-muted);
  font-size: 9px;
  line-height: 1.55;
}

.cw.mg63 .simple-mode-guide-button {
  min-height: 30px;
  padding: 5px 8px;
  color: var(--fx-accent-deep);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid #a9c4ed;
  border-radius: 6px;
  font-size: 9px;
}

.cw.mg63 .rail-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--fx-line);
}

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

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

/* Shared view structure */

.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;
}

@keyframes fx-view-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fx-section-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cw.mg63 .view-intro {
  position: relative;
  display: flex;
  min-height: 118px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 12px;
  padding: 22px 24px 20px 92px;
  overflow: hidden;
  color: var(--fx-ink);
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: var(--fx-radius);
  box-shadow: none;
}

.cw.mg63 .view-intro::before {
  position: absolute;
  top: 20px;
  left: 22px;
  color: #cbdbe2;
  font-family: var(--number);
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
}

.cw.mg63 #view-balance .view-intro::before {
  content: "02";
}

.cw.mg63 #view-hourly .view-intro::before {
  content: "03";
}

.cw.mg63 #view-explore .view-intro::before {
  content: "04";
}

.cw.mg63 #view-quality .view-intro::before {
  content: "05";
}

.cw.mg63 #view-method .view-intro::before {
  content: "06";
}

.cw.mg63 .view-intro::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 71px;
  width: 1px;
  content: "";
  background: var(--fx-line);
}

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

.cw.mg63 .view-intro .eyebrow {
  display: none;
}

.cw.mg63 .view-intro h1 {
  margin: 0 0 5px;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.cw.mg63 .view-intro p:not(.eyebrow) {
  max-width: 74ch;
  margin: 0;
  color: var(--fx-muted);
  font-size: 11px;
  line-height: 1.6;
  text-wrap: pretty;
}

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

.cw.mg63 .panel-heading .eyebrow {
  display: none;
}

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

/* Overview instrument deck */

.cw.mg63 #view-overview .overview-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(275px, 0.38fr);
  grid-template-areas:
    "copy score"
    "mix score"
    "signal signal";
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--fx-ink);
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: var(--fx-radius);
  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: 212px;
  flex-direction: column;
  justify-content: flex-start;
  padding: 25px 28px 20px;
  overflow: hidden;
  background: var(--fx-surface);
  border: 0;
  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: 7px;
  color: var(--fx-muted);
  font-family: var(--number);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cw.mg63 .brief-live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--fx-green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(8, 123, 97, 0.09);
}

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

.cw.mg63 .hero-copy h1 {
  max-width: 18ch;
  margin: 14px 0 8px;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: clamp(28px, 2.5vw, 38px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.cw.mg63 .hero-lede {
  max-width: 64ch;
  margin: 0;
  color: var(--fx-ink-soft);
  font-size: 12px;
  line-height: 1.65;
  text-wrap: pretty;
}

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

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

.cw.mg63 .health-tag:nth-child(2) {
  animation-delay: 24ms;
}

.cw.mg63 .health-tag:nth-child(3) {
  animation-delay: 48ms;
}

.cw.mg63 .health-tag:nth-child(4) {
  animation-delay: 72ms;
}

.cw.mg63 .health-tag:nth-child(5) {
  animation-delay: 96ms;
}

@keyframes fx-chip-enter {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.cw.mg63 .health-tag.is-warning {
  color: #714807;
  background: #fff3df;
  border-color: #efd6ae;
}

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

.cw.mg63 .health-tag.is-critical {
  color: var(--fx-red);
  background: var(--fx-red-soft);
  border-color: #efc5c8;
}

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

.cw.mg63 .hero-score {
  grid-area: score;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  padding: 22px;
  overflow: hidden;
  color: var(--fx-ink);
  text-align: left;
  background:
    linear-gradient(160deg, rgba(18, 94, 209, 0.1), transparent 54%),
    var(--fx-accent-soft);
  border: 0;
  border-left: 1px solid #cbdaf1;
  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(--fx-ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.cw.mg63 .hero-score-period {
  color: var(--fx-muted);
  font-family: var(--number);
  font-size: 9px;
}

.cw.mg63 .brief-score {
  --score-percent: 0%;
  position: relative;
  display: flex;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  margin: 42px 0 17px;
  padding: 0 0 16px;
  background: transparent;
  border: 0;
}

.cw.mg63 .brief-score::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: 8px;
  content: "";
  background: rgba(18, 94, 209, 0.14);
  border-radius: 999px;
  mask: none;
  transform: none;
  filter: none;
}

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

.cw.mg63 .score-value {
  position: relative;
  z-index: 2;
  color: var(--fx-accent-deep);
  font-family: var(--body);
  font-size: clamp(46px, 4.6vw, 64px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

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

@keyframes fx-score-refresh {
  from {
    opacity: 0.45;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.cw.mg63 .score-delta {
  min-height: 22px;
  align-self: flex-start;
  padding: 3px 7px;
  color: var(--fx-accent-deep);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(18, 94, 209, 0.16);
  border-radius: 5px;
  font-size: 9px;
}

.cw.mg63 .score-delta.is-positive {
  color: #08634f;
  background: var(--fx-green-soft);
  border-color: #b9dfd2;
}

.cw.mg63 .score-delta.is-negative {
  color: var(--fx-red);
  background: var(--fx-red-soft);
  border-color: #efc5c8;
}

.cw.mg63 .hero-score > p {
  max-width: 30ch;
  margin: 10px 0 0;
  color: var(--fx-muted);
  font-size: 9px;
  line-height: 1.55;
}

.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: 14px 28px 16px;
  overflow: hidden;
  background: var(--fx-surface);
  border: 0;
  border-top: 1px solid var(--fx-line);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .hero-mix::after {
  display: none;
}

.cw.mg63 .mix-head {
  grid-area: head;
  display: flex;
  align-items: center;
  color: var(--fx-ink-soft);
  font-size: 10px;
  font-weight: 600;
}

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

.cw.mg63 .mix-bar {
  grid-area: bar;
  display: flex;
  height: 11px;
  overflow: hidden;
  background: #e6ecef;
  border-radius: 999px;
  box-shadow: none;
}

.cw.mg63 .mix-bar::after {
  display: none !important;
}

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

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

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

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

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

.cw.mg63 .mix-legend {
  grid-area: legend;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  margin: 0;
  color: var(--fx-muted);
  font-size: 9px;
  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: 2px;
}

.cw.mg63 .hero-signal {
  grid-area: signal;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(190px, 0.24fr) minmax(0, 0.76fr);
  gap: 18px;
  align-items: stretch;
  padding: 19px 28px 15px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 94, 209, 0.025), transparent 50%),
    var(--fx-surface);
  border: 0;
  border-top: 1px solid var(--fx-line);
  border-radius: 0;
  box-shadow: none;
}

.cw.mg63 .hero-signal::before {
  display: 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: 8px;
}

.cw.mg63 .hero-signal-copy h2 {
  margin: 0;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

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

.cw.mg63 .hero-signal-note {
  max-width: 33ch;
  margin: 0;
  color: var(--fx-muted);
  font-size: 9px;
  line-height: 1.55;
}

.cw.mg63 .hero-signal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  color: var(--fx-muted);
  font-size: 9px;
}

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

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

.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(154px, 13vw, 205px);
  overflow: visible;
}

.cw.mg63 .hero-chart-grid line {
  stroke: #dfe7eb;
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

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

.cw.mg63 #heroLoadPath {
  stroke-width: 1.4;
  opacity: 0.9;
}

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

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

.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;
}

@keyframes fx-hero-draw {
  from {
    stroke-dashoffset: var(--hero-length, 1);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.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: #ff9b4d;
  stroke-width: 3.2;
  filter: drop-shadow(0 0 5px rgba(214, 101, 24, 0.55));
}

.cw.mg63 .hero-route-pulse-cool {
  stroke: #55d5af;
  stroke-width: 3;
  filter: drop-shadow(0 0 5px rgba(8, 123, 97, 0.48));
}

.cw.mg63 .hero-route-pulse-load {
  stroke: #8ca4b0;
  stroke-width: 2.2;
}

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

.cw.mg63 #heroPvPulse.is-flowing {
  animation-delay: 720ms;
}

.cw.mg63 #heroRenewablePulse.is-flowing {
  animation-delay: 1320ms;
}

@keyframes fx-hero-pulse {
  0% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  10%,
  80% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -0.05;
    opacity: 0;
  }
}

.cw.mg63 .hero-node {
  fill: #ffffff;
  stroke: var(--fx-green);
  stroke-width: 1.4;
  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(--fx-green);
  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;
}

@keyframes fx-node-in {
  from {
    opacity: 0;
    transform: scale(0.45);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fx-node-ripple {
  0% {
    opacity: 0.44;
    transform: scale(0.55);
  }
  100% {
    opacity: 0;
    transform: scale(2.4);
  }
}

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

/* Energy topology as the lead analysis surface */

.cw.mg63 .energy-atlas {
  margin: 12px 0 0;
  padding: 19px 22px 15px;
  overflow: hidden;
  background:
    radial-gradient(circle at 55% 15%, rgba(18, 94, 209, 0.06), transparent 30%),
    var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: var(--fx-radius);
  box-shadow: none;
}

.cw.mg63 .energy-atlas::before {
  display: none;
}

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

.cw.mg63 .energy-atlas-head h2 {
  margin: 0 0 4px;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.cw.mg63 .energy-atlas-head p:not(.eyebrow) {
  max-width: 72ch;
  margin: 0;
  color: var(--fx-muted);
  font-size: 10px;
  line-height: 1.55;
}

.cw.mg63 .atlas-balance {
  display: grid;
  min-width: 190px;
  gap: 1px;
  padding: 8px 10px;
  color: var(--fx-ink-soft);
  text-align: right;
  background: var(--fx-surface-soft);
  border: 1px solid var(--fx-line);
  border-radius: 7px;
}

.cw.mg63 .atlas-balance span {
  color: var(--fx-faint);
  font-size: 8px;
}

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

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

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

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

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

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

.cw.mg63 .atlas-desktop svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.cw.mg63 .atlas-rules line {
  stroke: #e6edf0;
  stroke-width: 1;
  stroke-dasharray: 2 6;
}

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

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

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

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

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

.cw.mg63 .atlas-flow-start {
  stroke: none;
}

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

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

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

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

.cw.mg63 .atlas-link-label {
  fill: var(--fx-muted);
  font-family: var(--body);
  font-size: 9px;
  font-weight: 500;
}

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

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

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

.cw.mg63 .atlas-node-value {
  fill: var(--fx-ink);
  font-family: var(--body);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

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

.cw.mg63 .atlas-node-detail {
  fill: var(--fx-faint);
  font-family: var(--body);
  font-size: 7px;
}

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

.cw.mg63 .atlas-node.is-solar {
  --mg-node-accent: var(--fx-solar);
}

.cw.mg63 .atlas-node.is-diesel {
  --mg-node-accent: var(--fx-diesel);
}

.cw.mg63 .atlas-node.is-storage {
  --mg-node-accent: var(--fx-storage);
}

.cw.mg63 .atlas-node.is-curtailment {
  --mg-node-accent: var(--fx-solar);
}

.cw.mg63 .atlas-node.is-load {
  --mg-node-accent: var(--fx-green);
}

.cw.mg63 .atlas-unserved-badge rect {
  fill: var(--fx-red-soft);
  stroke: #eac0c3;
}

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

.cw.mg63 .atlas-unserved-badge text {
  fill: var(--fx-red);
  font-family: var(--body);
  font-size: 9px;
  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(--fx-line);
}

.cw.mg63 .atlas-mobile-row > div {
  display: grid;
  gap: 2px;
}

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

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

.cw.mg63 .atlas-mobile-row strong {
  color: var(--fx-ink);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cw.mg63 .atlas-mobile-row strong em,
.cw.mg63 .atlas-mobile-load strong em {
  margin-left: 3px;
  color: var(--fx-faint);
  font-size: 7px;
  font-style: normal;
  font-weight: 500;
}

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

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

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

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

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

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

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

.cw.mg63 .atlas-mobile-load strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--fx-ink);
  font-size: 19px;
  font-weight: 600;
}

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

/* Decision signals, metrics and evidence */

.cw.mg63 .insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  overflow: visible;
}

.cw.mg63 .insight-card {
  min-width: 0;
  padding: 12px 14px 13px;
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-top: 2px solid var(--fx-accent);
  border-radius: 0 0 8px 8px;
  box-shadow: none;
}

.cw.mg63 .insight-card.is-warning {
  border-top-color: var(--fx-solar);
}

.cw.mg63 .insight-card.is-critical {
  border-top-color: var(--fx-red);
}

.cw.mg63 .insight-card + .insight-card {
  border-left: 1px solid var(--fx-line);
}

.cw.mg63 .insight-card > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fx-muted);
  font-family: var(--number);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.cw.mg63 .insight-card > span::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--fx-accent);
  border-radius: 50%;
}

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

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

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

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

.cw.mg63 .metric-section-head h2 {
  margin: 0 0 2px;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

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

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

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

.cw.mg63 .metric-scope-toggle {
  min-height: 30px;
  padding: 5px 9px;
  color: var(--fx-accent-deep);
  background: var(--fx-accent-soft);
  border: 1px solid #b8cff0;
  border-radius: 6px;
  font-size: 8px;
}

.cw.mg63 .metric-scope-toggle:hover {
  background: #dce9ff;
  transform: none;
}

.cw.mg63 .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: var(--fx-radius);
}

.cw.mg63 .metric-card,
.cw.mg63 .metric-card:nth-child(n) {
  position: relative;
  min-height: 126px;
  padding: 15px 16px;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--fx-line);
  border-bottom: 1px solid var(--fx-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: var(--fx-surface-soft);
  transform: none;
}

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

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

.cw.mg63 .metric-label i {
  width: 5px;
  height: 5px;
  background: var(--metric-color, var(--fx-accent));
  border-radius: 50%;
}

.cw.mg63 .metric-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 16px 0 6px;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

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

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

.cw.mg63 .metric-delta {
  position: absolute;
  top: 13px;
  right: 13px;
  padding: 2px 5px;
  color: var(--fx-muted);
  background: var(--fx-surface-soft);
  border-radius: 4px;
  font-family: var(--number);
  font-size: 7px;
}

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

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

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

.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: 17px;
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: var(--fx-radius);
  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(--fx-line);
}

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

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

.cw.mg63 .panel-heading h2 {
  margin: 0;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.022em;
}

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

.cw.mg63 .status-pill {
  color: var(--fx-green);
  background: var(--fx-green-soft);
  border-color: #b9dfd2;
}

.cw.mg63 .status-warning,
.cw.mg63 .status-pill.status-warning {
  color: #714807;
  background: #fff3df;
  border-color: #efd6ae;
}

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

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

/* Tables and data registers */

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

.cw.mg63 .data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--fx-surface);
  color: var(--fx-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: 8px 9px;
  text-align: right;
  border-bottom: 1px solid var(--fx-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(--fx-surface);
}

.cw.mg63 .data-table thead th {
  color: var(--fx-muted);
  background: var(--fx-surface-soft);
  font-family: var(--body);
  font-weight: 600;
}

.cw.mg63 .data-table tbody tr:hover td,
.cw.mg63 .data-table tbody tr:hover th {
  background: #eef5ff;
}

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

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

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

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

.cw.mg63 .economics-hero strong {
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

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

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

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

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

/* Analysis 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: 24px;
  align-items: center;
  padding: 3px 7px;
  color: var(--fx-muted);
  background: var(--fx-surface-soft);
  border: 1px solid var(--fx-line);
  border-radius: 5px;
  font-family: var(--number);
  font-size: 7px;
}

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

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

.cw.mg63 .hourly-toolbar select,
.cw.mg63 .hourly-toolbar input {
  min-height: 32px;
  padding: 5px 8px;
  color: var(--fx-ink);
  background: var(--fx-surface-soft);
  border: 1px solid var(--fx-line);
  border-radius: 6px;
  font-size: 9px;
}

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

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

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

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

.cw.mg63 .swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

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

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

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

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

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

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

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

.cw.mg63 .hourly-head {
  color: var(--fx-muted);
  background: var(--fx-surface-soft);
  font-size: 8px;
  font-weight: 600;
}

.cw.mg63 .hourly-head > *,
.cw.mg63 .hourly-row > * {
  min-width: 0;
  padding: 7px 8px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--fx-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: 520px;
  font-family: var(--number);
  font-size: 8px;
}

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

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

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

.cw.mg63 .sensitivity-cell {
  min-height: 54px;
  padding: 5px;
  color: var(--fx-ink);
  border: 1px solid rgba(20, 36, 45, 0.06);
  border-radius: 4px;
}

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

.cw.mg63 .sensitivity-placeholder {
  display: grid;
  min-height: 318px;
  grid-template-columns: minmax(240px, 0.8fr) minmax(260px, 1.2fr);
  align-items: center;
  gap: 24px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(18, 94, 209, 0.05), transparent 55%),
    var(--fx-surface);
}

.cw.mg63 .comparison-visual {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.cw.mg63 .reading-note {
  display: grid;
  gap: 10px;
}

.cw.mg63 .reading-note p {
  margin: 0;
  padding-bottom: 10px;
  color: var(--fx-ink-soft);
  border-bottom: 1px solid var(--fx-line);
  font-size: 9px;
  line-height: 1.6;
}

.cw.mg63 .reading-note p:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

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

.cw.mg63 .quality-summary-card {
  min-height: 96px;
  padding: 14px;
}

.cw.mg63 .quality-verdict {
  display: grid;
  min-width: 250px;
  max-width: 340px;
  justify-items: end;
  gap: 3px;
  padding: 10px 12px;
  text-align: right;
  background: var(--fx-surface-soft);
  border: 1px solid var(--fx-line);
  border-radius: 7px;
}

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

.cw.mg63 .quality-verdict.is-warning .quality-status {
  color: var(--fx-amber);
  background: #fff3df;
}

.cw.mg63 .quality-verdict.is-fail .quality-status {
  color: var(--fx-red);
  background: var(--fx-red-soft);
}

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

.cw.mg63 .quality-verdict small {
  color: var(--fx-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: 10px;
  margin-top: 10px;
}

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

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

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

.cw.mg63 .quality-repro,
.cw.mg63 .quality-normalization,
.cw.mg63 .provenance-audit {
  display: grid;
  gap: 8px;
  color: var(--fx-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: 8px 0;
  color: var(--fx-ink-soft);
  border-bottom: 1px solid var(--fx-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: 10px;
}

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

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

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

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

.cw.mg63 .method-index {
  color: var(--fx-accent);
  font-family: var(--number);
  font-size: 22px;
  font-weight: 600;
}

.cw.mg63 .method-card h2 {
  margin: 18px 0 7px;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

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

.cw.mg63 .method-card code {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 8px;
  color: var(--fx-accent-deep);
  background: var(--fx-accent-soft);
  border-radius: 5px;
  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: 9px 0;
  border-bottom: 1px solid var(--fx-line);
}

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

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

.cw.mg63 .provenance-list em {
  color: var(--fx-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: 9px 0;
  color: var(--fx-ink-soft);
  border-bottom: 1px solid var(--fx-line);
  font-size: 9px;
}

.cw.mg63 .version-badge {
  padding: 8px 10px;
  color: var(--fx-accent-deep);
  background: var(--fx-accent-soft);
  border: 1px solid #b8cff0;
  border-radius: 6px;
  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: 12px 0;
  color: var(--fx-faint);
  border-top: 1px solid var(--fx-line);
  font-size: 8px;
}

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

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

/* Loading, dialogs and transient state */

.cw.mg63 .startup-console {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  padding: 22px;
  place-items: center;
  background:
    linear-gradient(140deg, rgba(18, 94, 209, 0.11), transparent 45%),
    #edf3f6;
}

.cw.mg63 .startup-console.is-leaving {
  animation: fx-startup-out 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fx-startup-out {
  to {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
  }
}

.cw.mg63 .startup-card {
  display: grid;
  width: min(820px, 100%);
  grid-template-columns: 230px minmax(0, 1fr);
  overflow: hidden;
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: 16px;
  box-shadow: var(--fx-shadow);
}

.cw.mg63 .startup-identity {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  color: #eaf7fb;
  background: var(--fx-rail);
}

.cw.mg63 .startup-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: var(--fx-accent);
  border-radius: 9px;
  font-family: var(--number);
  font-size: 11px;
  font-weight: 600;
}

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

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

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

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

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

.cw.mg63 .startup-loader i {
  display: none;
}

.cw.mg63 .startup-loader span {
  font-family: var(--number);
  font-size: 15px;
  font-weight: 600;
}

@keyframes fx-startup-spin {
  to {
    transform: rotate(360deg);
  }
}

.cw.mg63 .startup-copy h1 {
  margin: 5px 0;
  color: var(--fx-ink);
  font-family: var(--body);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

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

.cw.mg63 .startup-steps {
  display: grid;
  gap: 5px;
  margin: 16px 0 13px;
  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(--fx-muted);
  font-size: 9px;
}

.cw.mg63 .startup-steps i {
  width: 7px;
  height: 7px;
  border: 1px solid var(--fx-line-strong);
  border-radius: 50%;
}

.cw.mg63 .startup-steps li.is-active i {
  background: var(--fx-accent);
  border-color: var(--fx-accent);
  box-shadow: 0 0 0 4px rgba(18, 94, 209, 0.09);
}

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

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

.cw.mg63 .startup-steps em {
  color: var(--fx-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: 10px;
  color: var(--fx-faint);
  border-top: 1px solid var(--fx-line);
  font-size: 8px;
}

.cw.mg63 .startup-foot strong {
  color: var(--fx-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(470px, calc(100vw - 24px));
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  color: #eef7fb;
  background: var(--fx-rail);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  box-shadow: var(--fx-shadow);
}

.cw.mg63 .calculation-dock[hidden] {
  display: none !important;
}

.cw.mg63 .calculation-signal {
  position: relative;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.cw.mg63 .calculation-signal::before {
  position: absolute;
  inset: 3px;
  content: "";
  border: 1px solid rgba(93, 157, 255, 0.55);
  border-radius: 50%;
  animation: fx-startup-spin 1.6s linear infinite;
}

.cw.mg63 .calculation-signal::after {
  width: 5px;
  height: 5px;
  content: "";
  background: #5d9dff;
  border-radius: 50%;
}

.cw.mg63 .calculation-copy {
  min-width: 0;
}

.cw.mg63 .calculation-kicker {
  display: block;
  margin-bottom: 2px;
  color: #82a5b4;
  font-family: var(--number);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.cw.mg63 .calculation-copy strong {
  display: block;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw.mg63 .calculation-copy p {
  margin: 2px 0 0;
  overflow: hidden;
  color: #9bb7c3;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw.mg63 .calculation-track {
  height: 2px;
  margin-top: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.cw.mg63 .calculation-track i {
  display: block;
  width: 32%;
  height: 100%;
  background: #5d9dff;
  animation: fx-calc-scan 1.2s ease-in-out infinite;
}

@keyframes fx-calc-scan {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(340%);
  }
}

.cw.mg63 .calculation-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: #d9e9ef;
  font-family: var(--number);
  font-size: 8px;
}

.cw.mg63 .calculation-meta small {
  color: #87a8b5;
  font-size: 7px;
}

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

.cw.mg63 .toast {
  padding: 9px 11px;
  color: #edf7fa;
  background: var(--fx-rail);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  box-shadow: var(--fx-shadow);
  font-size: 9px;
}

.cw.mg63 .action-dialog {
  width: min(660px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
  color: var(--fx-ink);
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(12, 30, 39, 0.24);
}

.cw.mg63 .action-dialog::backdrop {
  background: rgba(12, 28, 36, 0.44);
  backdrop-filter: blur(3px);
}

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

.cw.mg63 .dialog-head h2 {
  margin: 4px 0 0;
  color: var(--fx-ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.cw.mg63 .dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 18px;
  background: var(--fx-surface);
}

.cw.mg63 .action-card {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 10px;
  padding: 11px;
  color: var(--fx-ink-soft);
  text-align: left;
  background: var(--fx-surface-soft);
  border: 1px solid var(--fx-line);
  border-radius: 8px;
}

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

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

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

.cw.mg63 .action-card > span:last-child {
  display: grid;
  gap: 3px;
}

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

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

.cw.mg63 .dialog-note {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--fx-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: 12px 18px;
  background: var(--fx-surface);
}

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

.cw.mg63 .import-filebar span,
.cw.mg63 .import-filebar em {
  color: var(--fx-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(--fx-line);
}

/* Tablet: the inspector becomes a spatial drawer. */

@media (max-width: 1279px) {
  .cw.mg63 {
    --fx-inspector-width: 360px;
  }

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

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

  .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(15px, env(safe-area-inset-top))
      14px
      max(16px, env(safe-area-inset-bottom));
    background: var(--fx-surface-soft);
    border-left: 1px solid var(--fx-line);
    box-shadow: -16px 0 40px rgba(12, 30, 39, 0.18);
    transform: translate3d(calc(100% + 18px), 0, 0);
    transition:
      transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 260ms;
    visibility: hidden;
  }

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

  .cw.mg63.controls-open .control-rail {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    transition:
      transform 260ms 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 .topbar {
    gap: 9px;
  }

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

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

  .cw.mg63 #view-overview .overview-hero {
    grid-template-columns: minmax(0, 1fr) minmax(245px, 0.4fr);
  }

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

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

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

  .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 .topbar {
    padding-right: 12px;
    padding-left: 14px;
  }

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

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

  .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 .control-trigger {
    width: 36px;
    min-height: 34px;
    padding: 0;
    gap: 0;
  }

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

  .cw.mg63 .hero-copy {
    min-height: 0;
    padding: 20px;
  }

  .cw.mg63 .hero-copy h1 {
    max-width: none;
    font-size: 30px;
  }

  .cw.mg63 .hero-score {
    min-height: 205px;
    padding: 18px 20px;
    border-top: 1px solid #cbdaf1;
    border-left: 0;
  }

  .cw.mg63 .brief-score {
    margin: 24px 0 14px;
  }

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

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

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

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

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

  .cw.mg63 .hero-signal-legend {
    margin-top: 2px;
  }

  .cw.mg63 .energy-atlas {
    padding: 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 + .insight-card {
    border-left: 1px solid var(--fx-line);
  }

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

  .cw.mg63 .metric-card:nth-child(4n) {
    border-right: 1px solid var(--fx-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(--fx-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: 82px;
  }

  .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: bottom navigation and bottom-sheet inspector. */

@media (max-width: 760px) {
  .cw.mg63 {
    --fx-rail-width: 0px;
    --fx-topbar: 56px;
  }

  .cw.mg63 .app-shell {
    display: block;
    padding-bottom: calc(66px + 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(64px + env(safe-area-inset-bottom));
    padding: 5px 6px env(safe-area-inset-bottom);
    overflow: visible;
    color: var(--fx-ink-soft);
    background: rgba(251, 253, 254, 0.97);
    border-top: 1px solid var(--fx-line);
    box-shadow: 0 -8px 26px rgba(12, 30, 39, 0.08);
    backdrop-filter: blur(18px) saturate(1.1);
  }

  .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: 55px;
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    padding: 5px 2px 4px;
    border-radius: 7px;
    scroll-snap-align: center;
  }

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

  .cw.mg63 .view-tab.is-active::after {
    top: 0;
    left: 50%;
    width: 22px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    transform: translateX(-50%);
    animation: none;
  }

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

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

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

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

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

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

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

  .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: 10px 9px 24px;
  }

  .cw.mg63 .view-intro {
    min-height: 94px;
    align-items: flex-end;
    padding: 16px 14px 14px 59px;
  }

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

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

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

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

  .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: 10px;
  }

  .cw.mg63 #view-overview .overview-hero {
    border-radius: 10px;
  }

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

  .cw.mg63 .hero-copy h1 {
    margin-top: 11px;
    font-size: 27px;
    letter-spacing: -0.045em;
  }

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

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

  .cw.mg63 .hero-score {
    min-height: 186px;
    padding: 16px 15px;
  }

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

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

  .cw.mg63 .hero-mix {
    padding: 12px 15px 14px;
  }

  .cw.mg63 .hero-signal {
    padding: 16px 15px 12px;
  }

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

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

  .cw.mg63 .insight-strip {
    gap: 6px;
  }

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

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

  .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: 104px;
    border-right: 0;
    border-bottom: 1px solid var(--fx-line);
  }

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

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

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

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

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

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

  .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: 270px;
    padding: 15px;
  }

  .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: 16px 13px max(18px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--fx-line);
    border-left: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -20px 52px rgba(12, 30, 39, 0.22);
    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: 6px;
    left: 50%;
    width: 38px;
    height: 4px;
    content: "";
    background: var(--fx-line-strong);
    border-radius: 999px;
    transform: translateX(-50%);
  }

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

  .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: 18px;
  }

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

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

  .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: 38vw;
    font-size: 12px;
  }

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

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

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

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

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

@media (max-height: 620px) and (orientation: landscape) {
  .cw.mg63 .topbar {
    min-height: 52px;
  }

  .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: 46px;
    flex-direction: row;
    gap: 5px;
  }

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

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

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

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

@media (prefers-reduced-motion: reduce) {
  .cw.mg63 *,
  .cw.mg63 *::before,
  .cw.mg63 *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .cw.mg63 .hero-route-pulse,
  .cw.mg63 .hero-node-ripple {
    display: none;
  }
}

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

  .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 .app-frame {
    border: 0;
  }

  .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;
  }
}
