/* EnergyPlan workspace: the existing CarbonLedger layout and shared ZCO tokens.
   Form IDs, calculation inputs and chart semantics remain owned by EnergyPlan. */
/* Public project navigation follows the current Home / Create shell. */
body.zco-island.zco-project-page { padding: 0; }
body.zco-island > .zco-project-utilities {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  width: min(1200px, calc(100% - 64px));
  min-height: 44px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  font: 600 13px/1.5 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
}
body.zco-island > .zco-project-utilities a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
}
body.zco-island > .zco-project-utilities a:hover { text-decoration: underline; }
body.zco-island > .zco-project-utilities a:focus-visible { outline: 2px solid #b83b32; outline-offset: 4px; }
.energyplan-skip-link { position: fixed; top: -100px; left: 16px; z-index: 10000; padding: 12px 18px; background: #e3edcf; color: #173d2c; border-radius: 8px; }
.energyplan-skip-link:focus { top: 12px; }
@media (max-width: 820px) { body.zco-island > .zco-project-utilities { width: calc(100% - 32px); } }
@media (max-width: 640px) { body.zco-island > .zco-project-utilities { gap: 16px; } }
@media screen {
  body.zco-island.zco-editorial main.energyplan-workspace {
    width: min(100%, 1280px);
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 48px;
  }

  body.zco-island.zco-editorial #projectModes {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.zco-island.zco-editorial #projectModes .planning-mode-nav {
    display: flex;
    align-items: stretch;
    gap: 28px;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--line);
  }
  body.zco-island.zco-editorial #projectModes .planning-mode-nav button[data-mode] {
    flex: 0 1 auto;
    min-height: 48px;
    margin: 0 0 -1px;
    padding: 12px 0;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    box-shadow: none;
  }
  body.zco-island.zco-editorial #projectModes .planning-mode-nav button[data-mode][aria-pressed="true"] {
    color: var(--ink);
    border-bottom-color: var(--ink);
    background: transparent;
    box-shadow: none;
  }
  body.zco-island.zco-editorial #projectModes .planning-mode-nav button[data-mode]:hover {
    color: var(--ink);
    filter: none;
  }

  body.zco-island.zco-editorial #projectModes .project-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 0 22px;
  }
  body.zco-island.zco-editorial #projectModes .project-actions > button,
  body.zco-island.zco-editorial #projectModes .project-import > summary {
    width: auto;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
  }
  body.zco-island.zco-editorial #projectModes .project-import {
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  body.zco-island.zco-editorial #projectModes .project-import[open] {
    max-width: 310px;
  }
  body.zco-island.zco-editorial #projectModes .project-import input {
    width: 100%;
  }
  body.zco-island.zco-editorial #projectModes .project-actions > #status {
    order: -1;
    flex: 1 1 220px;
    align-self: center;
    text-align: left;
    margin: 0;
  }

  body.zco-island.zco-editorial #energyPlanWorkspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
  }
  body.zco-island.zco-editorial #energyPlanWorkspace > * {
    min-width: 0;
    max-width: 100%;
  }
  body.zco-island.zco-editorial #projectModes .plan-main {
    display: grid;
    gap: 20px;
  }
  body.zco-island.zco-editorial #projectModes .plan-main > :is(section, details),
  body.zco-island.zco-editorial #projectModes #planningOverview {
    margin: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
    color: var(--ink);
    box-shadow: none;
    scroll-margin-top: 20px;
  }
  body.zco-island.zco-editorial #projectModes #planningOverview h2 {
    margin: 0 0 10px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.025em;
  }
  body.zco-island.zco-editorial #projectModes :is(#planningFiles, #planningReview, #planningCompute) > h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.025em;
  }
  body.zco-island.zco-editorial #projectModes .plan-main p.note {
    margin: 6px 0 16px;
    color: var(--muted);
    line-height: 1.8;
  }
  body.zco-island.zco-editorial #projectModes .plan-main a {
    color: var(--ink);
    text-underline-offset: 3px;
  }
  body.zco-island.zco-editorial #projectModes .top {
    gap: 8px;
    margin: 16px 0;
  }
  body.zco-island.zco-editorial #projectModes .top:last-child {
    margin-bottom: 0;
  }
  body.zco-island.zco-editorial #projectModes .top :is(button, .btn) {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.5;
  }

  body.zco-island.zco-editorial #projectModes #planningWorkspaceNav {
    display: flex;
    flex-wrap: nowrap;
    gap: 26px;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--line);
    margin: 0;
    padding: 1px 0 2px;
  }
  body.zco-island.zco-editorial #projectModes #planningWorkspaceNav a {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 48px;
    padding: 10px 0;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
  }
  body.zco-island.zco-editorial #projectModes #planningWorkspaceNav a:hover {
    color: var(--ink);
    border-bottom-color: var(--ink);
  }
  body.zco-island.zco-editorial #projectModes #planningWorkspaceNav a[aria-current="location"] {
    color: var(--ink);
    border-bottom-color: var(--green);
  }
  body.zco-island.zco-editorial #projectModes :is(.planning-mode-nav button, #planningWorkspaceNav a):focus-visible {
    outline: 2px solid var(--green);
    outline-offset: -2px;
  }
  body.zco-island.zco-editorial #projectModes :is(.intakeSection, #planningCompute, #planningResult, #planningCaseSelect) { scroll-margin-top: 20px; }

  body.zco-island.zco-editorial #projectModes .intakeSection > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 0;
    padding: 0;
    min-height: 32px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 600;
    list-style: none;
  }
  body.zco-island.zco-editorial #projectModes .intakeSection > summary::-webkit-details-marker {
    display: none;
  }
  body.zco-island.zco-editorial #projectModes .intakeSection > summary::after {
    content: "+";
    flex-shrink: 0;
    font-size: 21px;
    font-weight: 400;
    color: var(--muted);
  }
  body.zco-island.zco-editorial #projectModes .intakeSection[open] > summary::after {
    content: "−";
  }
  body.zco-island.zco-editorial #projectModes .intakeSection > summary > span {
    flex: 1;
  }
  body.zco-island.zco-editorial #projectModes .intakeSection[open] > summary {
    margin-bottom: 16px;
  }
  body.zco-island.zco-editorial #projectModes .groupProgress {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
  }
  body.zco-island.zco-editorial #projectModes .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
    margin-top: 18px;
  }
  body.zco-island.zco-editorial #projectModes .field {
    min-width: 0;
  }
  body.zco-island.zco-editorial #projectModes .field > label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 7px;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
  }
  body.zco-island.zco-editorial #projectModes .field :is(input, select, textarea) {
    min-width: 0;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.6;
  }
  body.zco-island.zco-editorial #projectModes .field textarea {
    min-height: 88px;
    resize: vertical;
  }
  body.zco-island.zco-editorial #projectModes .field :is(input, select, textarea):focus {
    border-color: var(--green);
  }
  body.zco-island.zco-editorial #projectModes .field :is(.fieldHelp, .fileStatus) {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }
  body.zco-island.zco-editorial #projectModes .fieldRequirement {
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
  }
  body.zco-island.zco-editorial #projectModes .fieldRequirement.isRequired {
    color: var(--ink);
  }
  body.zco-island.zco-editorial #projectModes .fileRemove {
    margin-top: 7px;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 11px;
  }
  body.zco-island.zco-editorial #projectModes .intakeOptional > details {
    padding: 14px 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }
  body.zco-island.zco-editorial #projectModes #generationOptional > #energyGeneration {
    margin: 16px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body.zco-island.zco-editorial #projectModes .plan-summary-column {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 16px;
    align-self: start;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-card {
    margin: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
    color: var(--ink);
    box-shadow: none;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-status {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--ink);
    color: var(--paper);
    font-size: 10px;
    line-height: 1.6;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-name {
    margin: 20px 0 5px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin: 13px 0 8px;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-value {
    color: var(--ink);
    font-size: 40px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-unit {
    color: var(--muted);
    font-size: 11px;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px 12px;
    margin: 18px 0;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 12px;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-metrics > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 12px;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-metrics dt {
    color: var(--muted);
    overflow-wrap: anywhere;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-metrics dd {
    margin: 0;
    color: var(--ink);
    font-weight: 500;
    text-align: right;
    overflow-wrap: anywhere;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-card p.note {
    margin: 10px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.8;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-actions {
    display: grid;
    gap: 8px;
    margin-top: 18px;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-actions :is(button, a) {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
  }
  body.zco-island.zco-editorial #projectModes .plan-summary-actions .secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
  }

  body.zco-island.zco-editorial #projectModes :is(.cataverseCaseLoader, .projectScale, .storageSizing) {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
  }
  body.zco-island.zco-editorial #projectModes .cataverseCaseLoader .top {
    margin-bottom: 10px;
  }
  body.zco-island.zco-editorial #projectModes .cataverseCaseLoader select {
    width: 100%;
    min-height: 42px;
  }
  body.zco-island.zco-editorial #projectModes .projectScale dt {
    color: var(--muted);
  }
  body.zco-island.zco-editorial #projectModes .projectScale dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.zco-island.zco-editorial #projectModes :is(.caseModelNotice, .capacityBoundWarning) {
    background: color-mix(in srgb, var(--paper) 90%, #bb8429);
    color: var(--ink);
    border-color: #a1742c;
    font-size: 12px;
    line-height: 1.8;
  }
  body.zco-island.zco-editorial #projectModes .intakeIssue {
    min-height: 36px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  body.zco-island.zco-editorial #projectModes #planningResult {
    padding-top: 8px;
  }
  body.zco-island.zco-editorial #projectModes :is(.tablewrap, pre) {
    max-width: 100%;
    overflow: auto;
  }
  body.zco-island.zco-editorial #projectModes :is(p, label, summary, li, td, th, dd, a) {
    overflow-wrap: anywhere;
  }
  body.zco-island.zco-editorial #projectModes [hidden] {
    display: none !important;
  }

  @media (min-width: 1450px) {
    body.zco-island.zco-editorial main.energyplan-workspace { width: min(100%, 1390px); max-width: 1390px; }
    body.zco-island.zco-editorial #energyPlanWorkspace { grid-template-columns: minmax(0, 1fr) 320px; }
    body.zco-island.zco-editorial #projectModes .plan-main > :is(section, details),
    body.zco-island.zco-editorial #projectModes #planningOverview { padding: 28px; }
  }
  @media (max-width: 1000px) {
    body.zco-island.zco-editorial #energyPlanWorkspace { grid-template-columns: minmax(0, 1fr) 265px; gap: 18px; }
    body.zco-island.zco-editorial #projectModes .plan-main > :is(section, details),
    body.zco-island.zco-editorial #projectModes #planningOverview,
    body.zco-island.zco-editorial #projectModes .plan-summary-card { padding: 20px; }
    body.zco-island.zco-editorial #projectModes .grid { gap: 16px 12px; }
  }
  @media (max-width: 760px) {
    body.zco-island.zco-editorial main.energyplan-workspace { padding: 22px 18px 32px; }
    body.zco-island.zco-editorial #energyPlanWorkspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    body.zco-island.zco-editorial #projectModes .planning-mode-nav { gap: 10px; justify-content: space-between; margin-bottom: 20px; }
    body.zco-island.zco-editorial #projectModes .planning-mode-nav button[data-mode] { font-size: 12px; }
    body.zco-island.zco-editorial #projectModes .plan-summary-column { position: static; grid-row: 1; }
    body.zco-island.zco-editorial #projectModes .plan-summary-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 20px; }
    body.zco-island.zco-editorial #projectModes .plan-summary-card > :is(.plan-summary-label, .plan-summary-name, .plan-summary-metrics, .plan-summary-context, .plan-summary-actions) { grid-column: 1 / -1; }
    body.zco-island.zco-editorial #projectModes .plan-summary-card > .note[data-summary-field="mode"] { grid-column: 1; grid-row: 3; }
    body.zco-island.zco-editorial #projectModes .plan-summary-card > .plan-summary-total + .note { grid-column: 1; grid-row: 4; }
    body.zco-island.zco-editorial #projectModes .plan-summary-name { margin-top: 12px; }
    body.zco-island.zco-editorial #projectModes .plan-summary-total { grid-column: 2; grid-row: 3 / 5; display: block; align-self: center; margin: 8px 0; }
    body.zco-island.zco-editorial #projectModes .plan-summary-value { display: block; font-size: 30px; }
    body.zco-island.zco-editorial #projectModes .plan-summary-metrics { margin: 12px 0; padding: 12px 0; gap: 6px 12px; }
    body.zco-island.zco-editorial #projectModes .plan-summary-card p.note { margin: 7px 0; }
    body.zco-island.zco-editorial #projectModes .plan-summary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
    body.zco-island.zco-editorial #projectModes .grid { grid-template-columns: minmax(0, 1fr); }
    body.zco-island.zco-editorial #projectModes .intakeSection > summary { gap: 7px; font-size: 16px; }
    body.zco-island.zco-editorial #projectModes .groupProgress { font-size: 10px; }
    body.zco-island.zco-editorial #projectModes .field :is(input, select, textarea) { font-size: 16px; min-height: 44px; }
    body.zco-island.zco-editorial #projectModes .field input[type="file"] { font-size: 12px; }
    body.zco-island.zco-editorial #projectModes .top :is(button, .btn),
    body.zco-island.zco-editorial #projectModes #planningWorkspaceNav a,
    body.zco-island.zco-editorial #projectModes .fileRemove { min-height: 44px; }
    body.zco-island.zco-editorial #projectModes .projectScale dl { grid-template-columns: minmax(0, 1fr); }
    body.zco-island.zco-editorial #projectModes .project-actions { justify-content: flex-start; }
    body.zco-island.zco-editorial #projectModes .project-actions > #status { flex-basis: 100%; text-align: left; }
    body.zco-island.zco-editorial #projectModes .project-actions > button,
    body.zco-island.zco-editorial #projectModes .project-import > summary { min-height: 44px; font-size: 11px; }
    body.zco-island.zco-editorial #projectModes #planningWorkspaceNav { gap: 3px 14px; }
  }
  @media (prefers-reduced-motion: reduce) {
    body.zco-island.zco-editorial #projectModes * { scroll-behavior: auto; transition: none; }
  }
}

@media print {
  body.zco-island > .zco-project-utilities, .energyplan-skip-link { display: none !important; }
  body.zco-island #projectModes,
  body.zco-island #energyPlanWorkspace,
  body.zco-island #projectModes .plan-main { display: block; }
  body.zco-island #projectModes .planning-mode-nav,
  body.zco-island #planningWorkspaceNav,
  body.zco-island .plan-summary-actions,
  body.zco-island #projectModes .fileRemove { display: none !important; }
  body.zco-island #planningWorkspaceSummary { position: static; margin-bottom: 16pt; }
  body.zco-island #projectModes .plan-summary-card,
  body.zco-island #projectModes .intakeSection,
  body.zco-island #projectModes .plan-main > section {
    background: white;
    color: #111;
    border: 1px solid #bbb;
    padding: 12pt;
    margin-bottom: 12pt;
    box-shadow: none;
  }
  body.zco-island #projectModes .plan-summary-card { break-inside: avoid; }
  body.zco-island #projectModes #planningCompute { break-inside: auto; }
  body.zco-island #projectModes .tablewrap { overflow: visible; }
}

/* Public planner service availability. */
body.zco-energyplanner .planner-service-notice{padding:14px 16px;border-left:3px solid #6c8b65;background:#e8eddf;color:#173c2c;font-size:.9rem;line-height:1.65}body.zco-energyplanner button:disabled{cursor:not-allowed;opacity:.58}
