/* =========================================================
   OREGON ENERGY PLANNER — COMPLETE MODEL STYLES
   ========================================================= */

:root {
  --bg: #071416;
  --panel: #111f20;
  --panel-2: #172829;
  --panel-3: #0c1718;
  --inset: #081314;
  --line: #365052;
  --line-soft: rgba(132, 177, 181, 0.2);
  --text: #e9f1ef;
  --muted: #9fb0ad;
  --green: #70d889;
  --green-dark: #27633b;
  --yellow: #f4d45d;
  --orange: #ed9d3f;
  --red: #e76055;
  --blue: #61b9ed;
  --cyan: #69dce5;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(26, 116, 104, 0.16), transparent 30rem),
    linear-gradient(180deg, #0a1718 0%, #061011 100%);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.4;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1760px, calc(100% - 22px));
  margin: 18px auto 0;
  padding-bottom: 34px;
}

.panel {
  border: 1px solid #3a5556;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 30%),
    #101d1e;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.025),
    0 12px 30px rgba(0,0,0,.27);
}

.inset-panel {
  border: 1px solid #294244;
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent),
    #081415;
  box-shadow:
    inset 0 0 16px rgba(0,0,0,.48),
    0 1px rgba(255,255,255,.025);
}

/* =========================================================
   MODEL TOOLBAR
   ========================================================= */

.topbar {
  position: sticky;
  top: 8px;
  z-index: 35;
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(520px, 1.45fr) minmax(300px, .8fr);
  align-items: center;
  gap: 18px;
  min-height: 92px;
  padding: 12px 15px;
  background:
    linear-gradient(180deg, #1d3031, #101d1e);
}

.toolbar-mark .mountain {
  position: absolute;
  bottom: 12px;
  width: 0;
  height: 0;
  border-right: 18px solid transparent;
  border-bottom: 30px solid #78c58b;
  border-left: 18px solid transparent;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.3));
}

.toolbar-mark .mountain-one {
  left: 5px;
}

.toolbar-mark .mountain-two {
  left: 25px;
  bottom: 8px;
  border-right-width: 23px;
  border-bottom-width: 38px;
  border-left-width: 23px;
  border-bottom-color: #4e9870;
}

.toolbar-mark .river {
  position: absolute;
  right: 2px;
  bottom: 2px;
  left: 3px;
  height: 13px;
  border-radius: 50%;
  border-bottom: 5px solid #61b9ed;
  transform: rotate(-7deg);
}

.decade-panel {
  min-width: 0;
  text-align: center;
}

.decade-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(62px, 1fr));
  gap: 6px;
}

.decade-tab {
  min-height: 38px;
  padding: 7px 6px;
  border: 1px solid #4c6768;
  border-radius: 7px;
  color: #b9c8c6;
  background:
    linear-gradient(180deg, #263b3c, #152526);
  box-shadow:
    inset 0 1px rgba(255,255,255,.06),
    0 3px 0 #071011;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .03em;
  transition: .16s ease;
}

.decade-tab:hover {
  border-color: #76a9aa;
  color: #fff;
  transform: translateY(-1px);
}

.decade-tab.active {
  border-color: #87e89b;
  color: #d9ffe1;
  background:
    linear-gradient(180deg, #287343, #174a2c);
  box-shadow:
    inset 0 1px rgba(255,255,255,.12),
    0 0 15px rgba(112,216,137,.24);
}

.decade-tab.locked:not(.active)::after {
  margin-left: 5px;
  color: #8ce19d;
  content: "✓";
}

#decadeInstruction {
  margin: 7px 0 0;
  color: #98aaa7;
  font-size: 10px;
}

.top-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
  gap: 7px;
}

.top-action {
  min-height: 58px;
  padding: 6px 5px;
  border: 1px solid #526d6e;
  border-radius: 8px;
  color: #dce8e6;
  background:
    linear-gradient(180deg, #314748, #172829);
  box-shadow:
    inset 0 1px rgba(255,255,255,.08),
    0 3px 0 #071011;
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.15;
}

.top-action span {
  display: block;
  margin-bottom: 3px;
  color: #7ce3a0;
  font-size: 18px;
  line-height: 1;
}

.top-action:hover {
  border-color: #7ab2b4;
  background: linear-gradient(180deg, #3c5657, #1d3132);
}

/* =========================================================
   MAIN DASHBOARD
   ========================================================= */

.dashboard {
  display: grid;
  grid-template-columns: minmax(390px, .95fr) minmax(520px, 1.2fr) minmax(300px, .75fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.source-panel,
.system-panel,
.rules-card,
.decade-info-card,
.limits-card,
.summary-panel,
.limitation-card {
  padding: 15px;
}

.source-panel {
  grid-column: 1;
}

.system-panel {
  grid-column: 2;
}

.rules-panel {
  grid-column: 3;
  display: grid;
  gap: 12px;
}

.summary-panel,
.limitation-card {
  grid-column: 1 / -1;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.section-title-row h2,
.system-panel > h2,
.rules-panel h2,
.summary-panel > h2 {
  margin: 0;
  color: #dce8e5;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.text-button {
  padding: 5px 9px;
  border: 1px solid #587273;
  border-radius: 6px;
  color: #9edab0;
  background: #162728;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.text-button:hover {
  border-color: #82c895;
  color: #fff;
}

.source-columns {
  display: grid;
  grid-template-columns: minmax(148px, 1.5fr) 62px minmax(120px, 1.05fr) 62px;
  align-items: center;
  gap: 7px;
  padding: 0 8px 7px;
  color: #718985;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}

.source-columns span:first-child {
  text-align: left;
}

.source-rows {
  display: grid;
  gap: 7px;
}

.source-row {
  --accent: #6fd88a;
  display: grid;
  grid-template-columns: minmax(148px, 1.5fr) 62px minmax(120px, 1.05fr) 62px;
  align-items: center;
  gap: 7px;
  min-height: 68px;
  padding: 8px;
  border: 1px solid #344c4d;
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 32%),
    #0c1819;
  transition: .15s ease;
}

.source-row.changed {
  border-color: color-mix(in srgb, var(--accent) 60%, #344c4d);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 17%, transparent);
}

.source-row.warning {
  border-color: #b65a48;
  background:
    linear-gradient(90deg, rgba(219,77,57,.12), transparent 36%),
    #171313;
}

.source-row.disabled {
  opacity: .68;
}

.source-name-cell {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) 25px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.source-icon {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, #314748);
  border-radius: 8px;
  color: var(--accent);
  background: #122122;
  font-size: 18px;
  text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent);
}

.source-label {
  min-width: 0;
}

.source-label strong,
.source-label small {
  display: block;
}

.source-label strong {
  overflow: hidden;
  color: #e7efed;
  font-size: 10px;
  letter-spacing: .035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-label small {
  margin-top: 3px;
  overflow: hidden;
  color: #7e9490;
  font-size: 7px;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1px solid #496565;
  border-radius: 50%;
  color: #91b7b4;
  background: #102021;
  cursor: pointer;
  font-size: 11px;
}

.info-button:hover {
  border-color: var(--accent);
  color: #fff;
}

.mix-value {
  color: #d6e2df;
  font-family: "Courier New", monospace;
  font-size: 13px;
  text-align: center;
}

.mix-value.new {
  color: var(--accent);
  text-shadow: 0 0 7px color-mix(in srgb, var(--accent) 35%, transparent);
}

.knob-cell {
  display: grid;
  grid-template-columns: 25px 58px 25px;
  grid-template-rows: 42px 14px;
  align-items: center;
  justify-content: center;
  gap: 2px 4px;
}

.adjust {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 1px solid #536f70;
  border-radius: 5px;
  color: #e4efed;
  background: linear-gradient(180deg, #344c4d, #172728);
  box-shadow: 0 2px 0 #050a0b;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

.adjust:hover:not(:disabled) {
  border-color: var(--accent);
}

.adjust:disabled {
  opacity: .25;
  cursor: not-allowed;
}

.knob {
  --angle: 0deg;
  position: relative;
  width: 56px;
  height: 56px;
  border: 5px solid #3f5354;
  border-radius: 50%;
  background:
    radial-gradient(circle at 37% 29%, #718081 0 7%, transparent 8%),
    radial-gradient(circle, #384a4b 0 38%, #1b2829 39% 58%, #091112 59%);
  box-shadow:
    inset 0 0 0 2px #0a1213,
    inset 0 -7px 10px rgba(0,0,0,.5),
    0 4px 6px rgba(0,0,0,.55);
  cursor: ns-resize;
  outline: none;
  transform: rotate(var(--angle));
  transition: transform .12s ease;
}

.knob::before {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 3px;
  height: 17px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
  content: "";
  transform: translateX(-50%);
}

.knob:focus-visible {
  box-shadow:
    0 0 0 3px rgba(103,219,232,.32),
    inset 0 0 0 2px #0a1213,
    0 4px 6px rgba(0,0,0,.55);
}

.knob.disabled {
  cursor: not-allowed;
  filter: grayscale(.7);
}

.change-readout {
  grid-column: 1 / -1;
  color: #70d889;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.change-readout.negative,
#sourceTotalChange.negative {
  color: #ff8075;
}

.source-total {
  display: grid;
  grid-template-columns: minmax(148px, 1.5fr) 62px minmax(120px, 1.05fr) 62px;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 10px 8px;
  border: 1px solid #4b6667;
  border-radius: 8px;
  background: #172627;
  color: #cbd8d5;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.source-total span {
  text-align: left;
}

.source-total strong {
  font-family: "Courier New", monospace;
  font-size: 14px;
}

.control-tip {
  margin: 9px 4px 0;
  color: #768c88;
  font-size: 8px;
  line-height: 1.45;
}

/* =========================================================
   SYSTEM OVERVIEW
   ========================================================= */

.system-panel > h2 {
  margin-bottom: 12px;
}

.power-overview {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 12px 38px;
}

.power-stat,
.power-status {
  min-height: 94px;
  padding: 12px;
  border: 1px solid #30494a;
  border-radius: 8px;
  background: #101f20;
  text-align: center;
}

.power-stat span,
.power-status > span,
.power-stat small,
.power-status small {
  display: block;
}

.power-stat span,
.power-status > span {
  color: #829894;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.power-stat strong {
  display: block;
  margin-top: 7px;
  font-family: "Courier New", monospace;
  font-size: 29px;
  line-height: 1;
}

.power-stat.supplied strong {
  color: #68dce5;
  text-shadow: 0 0 10px rgba(104,220,229,.35);
}

.power-stat.required strong {
  color: #f4d45d;
  text-shadow: 0 0 10px rgba(244,212,93,.3);
}

.power-stat small {
  margin-top: 4px;
  color: #6f8581;
  font-size: 8px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 7px;
}

.status-line strong {
  font-size: 18px;
}

.status-line i {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-weight: 900;
}

.power-status {
  border-color: #3c704a;
  color: #7ce095;
}

.power-status .status-line i {
  color: #102516;
  background: #70d889;
}

.power-status.shortage {
  border-color: #914a42;
  color: #ff776e;
  background: #241515;
}

.power-status.shortage .status-line i {
  color: #2b0d0b;
  background: #ef6a5f;
}

.power-status.excess {
  border-color: #907538;
  color: #f5d363;
  background: #211e13;
}

.power-status.excess .status-line i {
  color: #2b240a;
  background: #f5d363;
}

.power-status small {
  margin-top: 8px;
  color: #9fb0ad;
  font-size: 8px;
}

.supply-meter {
  position: absolute;
  right: 12px;
  bottom: 19px;
  left: 12px;
  height: 10px;
  overflow: hidden;
  border: 1px solid #355052;
  border-radius: 20px;
  background: #050c0d;
  box-shadow: inset 0 0 6px #000;
}

.supply-meter span {
  display: block;
  width: 0;
  height: 100%;
  background:
    linear-gradient(90deg, #db5048 0%, #e7b84d 48%, #6ad486 76%);
  box-shadow: 0 0 9px rgba(108,222,139,.45);
  transition: width .3s ease;
}

#supplyMeterText {
  position: absolute;
  right: 14px;
  bottom: 2px;
  left: 14px;
  margin: 0;
  color: #9fb0ad;
  font-size: 7px;
  font-weight: 850;
  text-align: center;
}

.mix-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 9px;
}

.mix-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #2d4647;
  border-radius: 7px;
  background: #0e1c1d;
}

.mix-stat span {
  grid-column: 1;
  color: #819591;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.mix-stat strong {
  grid-column: 1;
  color: #e5efec;
  font-size: 18px;
}

.mix-stat i {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #6fcf87;
  font-size: 18px;
  font-style: normal;
}

.mix-stat.fossil i {
  color: #e76a5d;
}

.mix-stat.non-emitting i {
  color: #63c5ed;
}

/* =========================================================
   GAUGES
   ========================================================= */

.gauges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px;
  margin-top: 11px;
}

.gauge {
  min-width: 0;
  padding: 10px 5px 8px;
  border: 1px solid #30494a;
  border-radius: 9px;
  background:
    linear-gradient(180deg, #172829, #0a1516);
  text-align: center;
}

.gauge h3 {
  min-height: 28px;
  margin: 0;
  display: grid;
  place-items: end center;
  color: #a6b9b5;
  font-size: 7px;
  letter-spacing: .05em;
  line-height: 1.15;
}

.gauge-dial {
  --needle: -135deg;
  position: relative;
  width: min(110px, 92%);
  aspect-ratio: 1;
  margin: 5px auto 0;
  border: 4px solid #506466;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0c1718 0 46%, transparent 47%),
    conic-gradient(
      from 225deg,
      #d45349 0 18%,
      #e89b3f 18% 35%,
      #e6cf53 35% 48%,
      #72c96f 48% 68%,
      #278d46 68% 75%,
      #0c1718 75% 100%
    );
  box-shadow:
    inset 0 0 0 4px #071011,
    inset 0 0 13px #000,
    0 4px 8px rgba(0,0,0,.55);
}

.gauge-dial::before {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 3px;
  height: 34%;
  border-radius: 3px;
  background: linear-gradient(#f2f5ef, #f17c55);
  box-shadow: 0 0 6px rgba(241,124,85,.75);
  content: "";
  transform:
    translate(-50%, -100%)
    rotate(var(--needle));
  transform-origin: 50% 100%;
  transition: transform .35s ease;
}

.gauge-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 15px;
  height: 15px;
  border: 1px solid #819091;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #96a5a5, #1a2526 70%);
  box-shadow: 0 0 5px #000;
  transform: translate(-50%, -50%);
}

.gauge-value {
  margin-top: -7px;
  color: #eef5f2;
  font-family: "Courier New", monospace;
  font-size: 15px;
  font-weight: 900;
}

.gauge-value small {
  color: #758985;
  font-size: 7px;
}

.gauge-rating {
  display: inline-block;
  margin-top: 3px;
  padding: 3px 7px;
  border: 1px solid #3d7250;
  border-radius: 5px;
  color: #75dd8c;
  background: #0a1810;
  font-size: 7px;
  font-weight: 900;
}

.gauge-rating.moderate {
  border-color: #8c773b;
  color: #efd05a;
  background: #1d1a0d;
}

.gauge-rating.poor {
  border-color: #80423b;
  color: #f07168;
  background: #21100f;
}

.gauge-key {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 7px;
  color: #829692;
  font-size: 7px;
  font-weight: 900;
}

.gauge-key span {
  padding: 3px 7px;
  border-radius: 4px;
}

.gauge-key .poor {
  color: #f47a71;
  background: rgba(217,76,67,.11);
}

.gauge-key .moderate {
  color: #efd05a;
  background: rgba(229,188,61,.1);
}

.gauge-key .good {
  color: #75db8d;
  background: rgba(82,187,105,.1);
}

/* =========================================================
   RULES / INFORMATION / LIMITS
   ========================================================= */

.rules-panel h2 {
  margin-bottom: 10px;
}

.rules-list {
  display: grid;
  gap: 7px;
}

.rule-row {
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: start;
  gap: 8px;
  padding: 8px;
  border: 1px solid #365b42;
  border-radius: 7px;
  background: #0d1d13;
}

.rule-row.warning {
  border-color: #816e35;
  background: #1c190e;
}

.rule-row.danger {
  border-color: #7f403a;
  background: #211110;
}

.rule-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #102215;
  background: #70d889;
  font-weight: 900;
}

.rule-row.warning .rule-icon {
  color: #2c2406;
  background: #f1ce55;
}

.rule-row.danger .rule-icon {
  color: #2b0b09;
  background: #ec6e64;
}

.rule-row strong,
.rule-row small {
  display: block;
}

.rule-row strong {
  color: #dce7e4;
  font-size: 9px;
}

.rule-row small {
  margin-top: 3px;
  color: #8da09c;
  font-size: 7px;
  line-height: 1.4;
}

.decade-info-card dl {
  margin: 0;
}

.decade-info-card dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #2b4142;
}

.decade-info-card dl > div:last-child {
  border-bottom: 0;
}

.decade-info-card dt {
  color: #80938f;
  font-size: 8px;
}

.decade-info-card dd {
  margin: 0;
  color: #dce7e4;
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
  text-align: right;
}

.limits-card h2 small {
  display: block;
  margin-top: 4px;
  color: #758985;
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.limits-list {
  display: grid;
  gap: 7px;
}

.limits-list p {
  display: grid;
  grid-template-columns: 25px 1fr;
  margin: 0;
  padding: 8px;
  border: 1px solid #2b4344;
  border-radius: 7px;
  background: #0c1819;
}

.limits-list p > span {
  grid-row: 1 / span 2;
  color: #68c3d3;
  font-size: 17px;
}

.limits-list strong,
.limits-list small {
  display: block;
}

.limits-list strong {
  color: #cfdad7;
  font-size: 8px;
}

.limits-list small {
  margin-top: 2px;
  color: #7d918d;
  font-size: 7px;
  line-height: 1.35;
}

/* =========================================================
   SUMMARY
   ========================================================= */

.summary-panel {
  margin-top: 0;
}

.summary-content {
  display: grid;
  grid-template-columns: minmax(650px, 1.35fr) minmax(360px, .65fr);
  gap: 13px;
  margin-top: 12px;
}

.summary-table-wrap,
.chart-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid #2e494a;
  border-radius: 9px;
  background: #0a1516;
  overflow: auto;
}

#summaryTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 8px;
  white-space: nowrap;
}

#summaryTable th,
#summaryTable td {
  padding: 7px 6px;
  border: 1px solid #294142;
  text-align: center;
}

#summaryTable th {
  color: #b9cac6;
  background: #172728;
  font-size: 7px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#summaryTable td {
  color: #cfd9d6;
  background: #0d191a;
}

#summaryTable tbody tr:nth-child(even) td {
  background: #101e1f;
}

#summaryTable td.good,
#summaryTable td.pass {
  color: #75dc8c;
}

#summaryTable td.warning,
#summaryTable td.moderate {
  color: #f0d05c;
}

#summaryTable td.danger,
#summaryTable td.fail,
#summaryTable td.poor {
  color: #f2786e;
}

.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  margin: 0 0 8px;
  color: #cdd9d6;
  font-size: 10px;
  text-transform: uppercase;
}

#planChart {
  display: block;
  width: 100%;
  height: 270px;
  border: 1px solid #2b4546;
  border-radius: 6px;
  background:
    linear-gradient(rgba(114,174,178,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114,174,178,.055) 1px, transparent 1px),
    #071112;
  background-size: 28px 28px;
}

/* =========================================================
   BOTTOM CONTROLS
   ========================================================= */

.footer-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  margin-top: 0;
  padding: 13px;
}

.footer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid #536e6f;
  border-radius: 8px;
  color: #dce8e5;
  background: linear-gradient(180deg, #314748, #172829);
  box-shadow: 0 3px 0 #070d0e;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

.footer-button:hover:not(:disabled) {
  border-color: #82b5b6;
  transform: translateY(-1px);
}

.footer-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.footer-button.primary {
  flex: 1;
  border-color: #4b9a62;
  color: #e2ffe9;
  background: linear-gradient(180deg, #2d7e48, #17492b);
}

.footer-button small {
  display: block;
  margin-left: 4px;
  color: rgba(255,255,255,.65);
  font-size: 7px;
  font-weight: 500;
}

.limitation-card {
  margin-top: 0;
}

/* =========================================================
   MODAL
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  padding: 20px;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  background: rgba(0, 8, 9, .78);
  backdrop-filter: blur(5px);
  transition: opacity .16s ease, visibility .16s ease;
}

.modal-backdrop.open {
  visibility: visible;
  opacity: 1;
}

.modal {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid #4f6b6c;
  border-radius: 15px;
  background:
    linear-gradient(180deg, #1c3031, #0d191a);
  box-shadow: 0 30px 90px rgba(0,0,0,.65);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 17px;
  border-bottom: 1px solid #3b5556;
  background: #17292a;
}

.modal-header h2 {
  margin: 0;
  color: #e8f0ee;
  font-size: 18px;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid #526e6f;
  border-radius: 50%;
  color: #dbe6e4;
  background: #0d1a1b;
  cursor: pointer;
  font-size: 20px;
}

.modal-body {
  padding: 18px;
  color: #c2cfcc;
  font-size: 13px;
  line-height: 1.6;
}

.modal-body h3 {
  color: #e8f0ee;
}

.modal-body li {
  margin-bottom: 8px;
}

.modal-body .source-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.modal-body .source-large-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 15px;
  font-size: 39px;
}

.modal-body .stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 9px;
  margin-top: 15px;
}

.modal-body .stat-card {
  padding: 11px;
  border: 1px solid #385354;
  border-radius: 8px;
  background: #0b1718;
}

.modal-body .stat-card span,
.modal-body .stat-card strong {
  display: block;
}

.modal-body .stat-card span {
  color: #809490;
  font-size: 8px;
  text-transform: uppercase;
}

.modal-body .stat-card strong {
  margin-top: 3px;
  color: #e0eae7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 17px 17px;
}

.modal-actions button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #526e6f;
  border-radius: 7px;
  color: #dce7e4;
  background: #1a2c2d;
  cursor: pointer;
  font-weight: 800;
}

.modal-actions button.primary {
  border-color: #4d9b62;
  background: #236b3b;
}

/* =========================================================
   RESPONSIVE MODEL LAYOUT
   ========================================================= */

@media (max-width: 1420px) {
  .topbar {
    grid-template-columns: minmax(220px, .65fr) minmax(470px, 1.35fr) 280px;
  }

  .dashboard {
    grid-template-columns: minmax(370px, .9fr) minmax(500px, 1.1fr);
  }

  .rules-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .topbar {
    position: relative;
    top: 0;
    grid-template-columns: 1fr;
  }

  .model-toolbar-label,
  .top-actions {
    justify-content: center;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .source-panel,
  .system-panel,
  .rules-panel {
    grid-column: 1;
  }

  .rules-panel {
    grid-template-columns: 1fr 1fr;
  }

  .limits-card {
    grid-column: 1 / -1;
  }

  .summary-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 10px, 1760px);
    margin-top: 6px;
  }

  .topbar,
  .source-panel,
  .system-panel,
  .rules-card,
  .decade-info-card,
  .limits-card,
  .summary-panel,
  .footer-actions,
  .limitation-card {
    border-radius: 9px;
  }

  .decade-tabs {
    grid-template-columns: repeat(3, minmax(72px,1fr));
  }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .source-columns {
    display: none;
  }

  .source-row {
    grid-template-columns: minmax(145px, 1fr) 52px 116px 52px;
  }

  .source-total {
    grid-template-columns: minmax(145px, 1fr) 52px 116px 52px;
  }

  .gauges {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .rules-panel {
    grid-template-columns: 1fr;
  }

  .footer-actions {
    flex-direction: column;
  }

  .footer-button {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .source-row {
    grid-template-columns: minmax(128px, 1fr) 105px 48px;
  }

  .source-row .mix-value.previous {
    display: none;
  }

  .source-total {
    grid-template-columns: minmax(128px, 1fr) 105px 48px;
  }

  #sourceTotalPrevious {
    display: none;
  }

  .source-name-cell {
    grid-template-columns: 29px minmax(0,1fr);
  }

  .source-name-cell .info-button {
    display: none;
  }

  .source-icon {
    width: 29px;
    height: 29px;
  }

  .power-overview {
    grid-template-columns: 1fr;
    padding-bottom: 38px;
  }

  .power-stat,
  .power-status {
    min-height: 78px;
  }

  .mix-overview {
    grid-template-columns: 1fr;
  }

  .gauges {
    grid-template-columns: 1fr 1fr;
  }

  .modal-body .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .platform-header,
  .site-header,
  .topbar,
  .source-panel,
  .rules-panel,
  .footer-actions,
  .platform-footer,
  .modal-backdrop {
    display: none !important;
  }

  body {
    color: #111;
    background: #fff;
  }

  .app-shell {
    width: 100%;
    margin: 0;
  }

  .dashboard {
    display: block;
  }

  .system-panel,
  .summary-panel,
  .limitation-card {
    margin-bottom: 14px;
    color: #111;
    background: #fff;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}



/* =====================================================
   UPDATED OREGON ENERGY MODEL TOOLBAR
===================================================== */

.model-toolbar-label {
  color: inherit;
  text-decoration: none;

  display: flex;
  align-items: center;

  gap: 13px;

  padding:
    8px
    8px
    8px
    6px;
}

.toolbar-mark {
  position: relative;

  width: 64px;
  height: 55px;

  flex: 0 0 auto;
}

.toolbar-copy {
  display: grid;
  gap: 5px;
}

.toolbar-copy strong {
  color: var(--green);

  font-size: 21px;
  line-height: 1;

  letter-spacing: 0.01em;
}

.toolbar-copy small {
  color: #c7d4da;

  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* The revised HTML uses an h2 instead of an h1 here. */

.decade-panel h2 {
  margin:
    0
    0
    4px;

  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* =====================================================
   VARIABLEVISTA PLATFORM HEADER
===================================================== */

.platform-header {
  min-height: 76px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 2rem;

  padding:
    0.9rem
    clamp(1rem, 4vw, 4rem);

  color: #17343a;

  background:
    rgba(255, 255, 255, 0.97);

  border-bottom:
    1px solid #cfdde0;

  box-shadow:
    0 4px 18px rgba(17, 64, 72, 0.08);

  position: relative;
  z-index: 60;

  font-family:
    Inter,
    Arial,
    Helvetica,
    sans-serif;

  font-stretch: normal;
  letter-spacing: normal;
}

.platform-brand {
  display: flex;
  align-items: center;

  gap: 0.8rem;

  min-width: max-content;

  color: #17343a;
  text-decoration: none;
}

.platform-logo {
  width: 46px;
  height: 46px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 0.85rem;

  color: white;

  background:
    linear-gradient(
      145deg,
      #147f8c,
      #0b626d
    );

  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.05em;

  box-shadow:
    0 7px 16px rgba(11, 98, 109, 0.2);
}

.platform-brand-text {
  display: grid;

  gap: 0.12rem;
}

.platform-brand-text strong {
  font-size: 1.08rem;
  line-height: 1;
}

.platform-brand-text span {
  color: #5f7479;

  font-size: 0.73rem;
  line-height: 1.2;
}

.platform-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;

  gap: 0.35rem;
}

.platform-navigation a {
  padding:
    0.62rem
    0.78rem;

  border-radius: 0.65rem;

  color: #5f7479;
  text-decoration: none;

  font-size: 0.88rem;
  font-weight: 700;

  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    transform 0.15s ease;
}

.platform-navigation a:hover {
  color: #0b626d;

  background: #e8f5f6;
}

.platform-navigation .model-library-link {
  margin-left: 0.35rem;

  padding-inline: 0.95rem;

  color: white;

  background: #147f8c;
}

.platform-navigation .model-library-link:hover {
  color: white;

  background: #0b626d;

  transform:
    translateY(-1px);
}

/* =====================================================
   MODEL INTRODUCTION HEADER
===================================================== */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 2rem;

  padding:
    2rem
    clamp(1rem, 4vw, 4rem);

  color: white;

  background:
    linear-gradient(
      120deg,
      rgba(6, 71, 81, 0.97),
      rgba(22, 135, 149, 0.93)
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.18),
      transparent 20rem
    );

  border-bottom:
    1px solid #294150;

  font-family:
    Inter,
    Arial,
    Helvetica,
    sans-serif;

  font-stretch: normal;
  letter-spacing: normal;
}

.model-introduction {
  max-width: 900px;
}

.model-eyebrow {
  margin: 0;

  color: #b7eef2;

  font-size: 0.75rem;
  font-weight: 800;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header h1 {
  margin:
    0.15rem
    0
    0.45rem;

  color: white;

  font-size:
    clamp(
      1.85rem,
      4vw,
      3.1rem
    );

  line-height: 1.08;
  letter-spacing: normal;
}

.model-subtitle {
  max-width: 830px;

  margin: 0;

  color:
    rgba(255, 255, 255, 0.9);

  font-size: 1rem;
  line-height: 1.55;
}

.model-details {
  display: flex;
  flex-wrap: wrap;

  gap: 0.55rem;

  margin-top: 1rem;
}

.model-details span {
  padding:
    0.38rem
    0.7rem;

  border:
    1px solid rgba(255, 255, 255, 0.28);

  border-radius: 999px;

  color: white;

  background:
    rgba(255, 255, 255, 0.12);

  font-size: 0.75rem;
  font-weight: 750;

  backdrop-filter:
    blur(5px);
}

/* =====================================================
   MODEL LIMITATION
===================================================== */

.limitation-card {
  grid-column:
    1 / -1;

  padding:
    14px
    18px;

  border-color:
    #77651f;

  color:
    #f1df91;

  background:
    linear-gradient(
      180deg,
      rgba(255, 209, 31, 0.09),
      rgba(255, 138, 31, 0.04)
    ),
    #111a19;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 13px;
  line-height: 1.55;
}

.limitation-card strong {
  color:
    #ffe65d;
}

/* =====================================================
   VARIABLEVISTA PLATFORM FOOTER
===================================================== */

.platform-footer {
  margin-top: 3rem;

  padding:
    2.2rem
    clamp(1rem, 4vw, 4rem)
    1.25rem;

  color:
    rgba(255, 255, 255, 0.82);

  background:
    #102f35;

  font-family:
    Inter,
    Arial,
    Helvetica,
    sans-serif;

  font-stretch: normal;
  letter-spacing: normal;
}

.footer-content {
  width:
    min(
      1400px,
      100%
    );

  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 2rem;

  margin:
    0
    auto;

  padding-bottom:
    1.75rem;
}

.footer-brand {
  max-width:
    340px;
}

.footer-brand > a {
  color: white;
  text-decoration: none;

  font-size: 1.2rem;
  font-weight: 900;
}

.footer-brand p {
  margin:
    0.45rem
    0
    0;

  color:
    rgba(255, 255, 255, 0.64);

  line-height: 1.5;
}

.footer-navigation {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;

  gap: 0.35rem;
}

.footer-navigation a {
  padding:
    0.55rem
    0.68rem;

  border-radius:
    0.55rem;

  color:
    rgba(255, 255, 255, 0.76);

  text-decoration: none;

  font-size: 0.84rem;
  font-weight: 700;

  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.footer-navigation a:hover {
  color: white;

  background:
    rgba(255, 255, 255, 0.09);
}

.footer-bottom {
  width:
    min(
      1400px,
      100%
    );

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 1rem;

  margin:
    0
    auto;

  padding-top:
    1.1rem;

  border-top:
    1px solid rgba(255, 255, 255, 0.13);

  color:
    rgba(255, 255, 255, 0.5);

  font-size: 0.76rem;
}

/* =====================================================
   ACCESSIBILITY
===================================================== */

.platform-header a:focus-visible,
.platform-footer a:focus-visible {
  outline:
    3px solid #5ae7f0;

  outline-offset:
    3px;
}

/* =====================================================
   PLATFORM RESPONSIVE ADJUSTMENTS
===================================================== */

@media (max-width: 1450px) {
  .platform-header {
    gap: 1rem;
  }

  .platform-navigation a {
    padding:
      0.55rem
      0.62rem;
  }

  .toolbar-copy strong {
    font-size: 18px;
  }
}

@media (min-width: 1800px) {
  .platform-header,
  .site-header {
    padding-left:
      4rem;

    padding-right:
      4rem;
  }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior:
      auto !important;

    animation-duration:
      0.01ms !important;

    animation-iteration-count:
      1 !important;

    transition-duration:
      0.01ms !important;
  }
}