:root {
  --bg: #f4efe5;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-border: rgba(10, 30, 20, 0.12);
  --text: #12231d;
  --muted: #4f635a;
  --sun: #ff8f3f;
  --teal: #1d9b8b;
  --sky: #2a6f97;
  --track: #d5e0dc;
  --danger: #d45b3f;
  --radius: 20px;
  --shadow: 0 24px 45px rgba(34, 53, 44, 0.12);
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 30;
  border: 1px solid rgba(18, 35, 29, 0.24);
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 7px 18px rgba(18, 35, 29, 0.16);
  cursor: pointer;
}

.theme-toggle:hover {
  background: white;
}

body[data-theme="dark"] {
  --bg: #091218;
  --panel: rgba(12, 20, 27, 0.86);
  --panel-border: rgba(141, 176, 199, 0.22);
  --text: #e8f2fa;
  --muted: #adc0cf;
  --sky: #82b7df;
  --track: #304755;
  --shadow: 0 24px 45px rgba(3, 8, 11, 0.45);
  background: radial-gradient(circle at 14% 10%, #182733 0%, #0f1b25 40%, #08131b 100%);
}

body[data-theme="dark"] .theme-toggle {
  border-color: rgba(176, 205, 223, 0.4);
  background: rgba(10, 18, 25, 0.9);
  color: #eaf3fb;
}

body[data-theme="dark"] .theme-toggle:hover {
  background: rgba(18, 29, 39, 0.95);
}

body[data-theme="dark"] .orb-a {
  background: #a8642f;
}

body[data-theme="dark"] .orb-b {
  background: #186f63;
}

body[data-theme="dark"] .orb-c {
  background: #345c82;
}

body[data-theme="dark"] .panel-section,
body[data-theme="dark"] .load-card,
body[data-theme="dark"] .recharge-block,
body[data-theme="dark"] .fridge-temp-control,
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .recommend-card,
body[data-theme="dark"] .components-card,
body[data-theme="dark"] .component-item,
body[data-theme="dark"] .runway-card,
body[data-theme="dark"] .draws-card,
body[data-theme="dark"] .manual-controls,
body[data-theme="dark"] .map-dialog {
  border-color: rgba(141, 176, 199, 0.2);
  background: rgba(12, 21, 29, 0.85);
}

body[data-theme="dark"] .consumption-hero {
  border-color: rgba(141, 176, 199, 0.2);
  background: linear-gradient(125deg, rgba(16, 29, 39, 0.95), rgba(12, 24, 33, 0.9));
}

body[data-theme="dark"] .segmented {
  background: rgba(144, 175, 192, 0.14);
}

body[data-theme="dark"] .seg-btn {
  color: #b5c7d5;
}

body[data-theme="dark"] .seg-btn.active {
  background: rgba(27, 42, 53, 0.96);
  color: #edf6ff;
  box-shadow: 0 3px 10px rgba(3, 8, 11, 0.45);
}

body[data-theme="dark"] .presets {
  background: rgba(147, 179, 198, 0.16);
}

body[data-theme="dark"] .preset-btn {
  color: #bfd1dd;
}

body[data-theme="dark"] .preset-btn.active {
  background: rgba(24, 39, 50, 0.95);
  color: #edf6ff;
  box-shadow: 0 3px 10px rgba(3, 8, 11, 0.45);
}

body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .file-input,
body[data-theme="dark"] select {
  border-color: rgba(147, 179, 198, 0.44);
  background: rgba(16, 28, 38, 0.95);
  color: #edf6ff;
}

body[data-theme="dark"] .ghost-btn:hover,
body[data-theme="dark"] .file-input:hover {
  background: rgba(28, 43, 55, 0.98);
}

body[data-theme="dark"] .section-copy code {
  background: rgba(130, 183, 223, 0.25);
  color: #dbeeff;
}

body[data-theme="dark"] .mode-pill {
  background: rgba(130, 183, 223, 0.22);
  color: #cfe8ff;
}

body[data-theme="dark"] .mode-pill.manual {
  background: rgba(212, 91, 63, 0.2);
  color: #ffb8a7;
}

body[data-theme="dark"] .watt-pill {
  background: rgba(130, 183, 223, 0.2);
  color: #a8cff0;
}

body[data-theme="dark"] .watt-pill.custom {
  background: rgba(255, 143, 63, 0.22);
  color: #ffb366;
}

body[data-theme="dark"] input[type="range"]::-webkit-slider-thumb {
  background: #0f1b25;
  border-color: #7cc9bf;
}

body[data-theme="dark"] input[type="range"]::-moz-range-thumb {
  background: #0f1b25;
  border-color: #7cc9bf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 14% 10%, #fff9f0 0%, #f4efe5 43%, #efe4d4 100%);
  overflow-x: hidden;
}

.background-orb {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.62;
}

.orb-a {
  width: 380px;
  height: 380px;
  background: #ffc289;
  top: -110px;
  left: -100px;
}

.orb-b {
  width: 320px;
  height: 320px;
  background: #7cd6c5;
  top: 24%;
  right: -120px;
}

.orb-c {
  width: 280px;
  height: 280px;
  background: #9bc4f3;
  bottom: -110px;
  left: 26%;
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.8rem 1.2rem 2.6rem;
}

.hero {
  margin-bottom: 1.2rem;
  animation: enter 0.6s ease;
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--sky);
  font-weight: 700;
}

.hero h1 {
  margin: 0.25rem 0 0;
  line-height: 1.03;
  font-size: clamp(2rem, 5vw, 3.3rem);
}

.subtitle {
  margin: 0.65rem 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.02rem;
}

.app-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.35fr 1fr;
}

.panel {
  backdrop-filter: blur(8px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.controls-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  animation: enter 0.66s ease;
}

.panel-section {
  border: 1px solid rgba(18, 35, 29, 0.12);
  border-radius: 16px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.7);
}

.section-title-row {
  display: flex;
  gap: 0.7rem;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.section-copy {
  margin: 0.45rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-copy code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  background: rgba(42, 111, 151, 0.12);
  padding: 0.06rem 0.24rem;
  border-radius: 6px;
}

.presets {
  display: inline-flex;
  gap: 0.35rem;
  background: rgba(18, 35, 29, 0.06);
  border-radius: 999px;
  padding: 0.23rem;
}

.preset-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  cursor: pointer;
}

.preset-btn.active {
  background: white;
  color: var(--text);
  box-shadow: 0 3px 10px rgba(18, 35, 29, 0.12);
}

.loads-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 8px;
  align-items: start;
}

.load-card {
  border: 1px solid rgba(18, 35, 29, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.7rem;
  display: grid;
  gap: 0.56rem;
  align-self: start;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.load-card[data-device="lights"],
.load-card[data-device="induction"] {
  padding: 0.9rem;
  gap: 0.78rem;
}

.load-card:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 155, 139, 0.5);
}

.load-card.disabled {
  opacity: 0.56;
}

.load-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.watt-pill {
  font-family: "IBM Plex Mono", monospace;
  background: rgba(42, 111, 151, 0.14);
  color: #164866;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  cursor: pointer;
  transition: background 0.15s;
}

.watt-pill:hover {
  background: rgba(42, 111, 151, 0.25);
}

.watt-pill.custom {
  background: rgba(255, 143, 63, 0.18);
  color: #a65500;
}

.watt-pill.hidden {
  display: none;
}

.watt-edit {
  display: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  width: 4.5rem;
  padding: 0.15rem 0.4rem;
  border: 1.5px solid var(--sky);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  text-align: center;
  outline: none;
}

.watt-edit.visible {
  display: inline-block;
}

.watt-edit:focus {
  border-color: var(--sun);
  box-shadow: 0 0 0 2px rgba(255, 143, 63, 0.2);
}

.load-note {
  margin: 0;
  font-size: 0.79rem;
  color: var(--muted);
}

.lighting-variant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.lighting-variant span {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 600;
}

.segmented {
  display: inline-flex;
  gap: 0.33rem;
  background: rgba(18, 35, 29, 0.08);
  border-radius: 999px;
  padding: 0.22rem;
  width: fit-content;
}

.seg-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  color: var(--muted);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
}

.seg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.seg-btn.active {
  background: white;
  color: var(--text);
  box-shadow: 0 3px 10px rgba(18, 35, 29, 0.16);
}

.slider-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.slider-meta output {
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--sun));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid #155f57;
  box-shadow: 0 3px 8px rgba(18, 35, 29, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid #155f57;
  box-shadow: 0 3px 8px rgba(18, 35, 29, 0.3);
}

.recharge-block {
  border: 1px solid rgba(18, 35, 29, 0.12);
  border-radius: 14px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.87);
}

.recharge-block + .recharge-block {
  margin-top: 0.72rem;
}

.block-header {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.top-gap {
  margin-top: 0.6rem;
}

.assumption-note {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.fridge-temp-control {
  border: 1px solid rgba(18, 35, 29, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.fridge-temp-control.disabled {
  opacity: 0.46;
}

.fridge-temp-control .field-row {
  font-size: 0.98rem;
  align-items: flex-end;
}

.fridge-temp-control .field-row span {
  max-width: 72%;
  font-size: 1.06rem;
  color: #3d5a52;
  font-weight: 500;
}

.fridge-temp-control .field-row output {
  font-size: 2rem;
  line-height: 1;
  color: #12231d;
}

.fridge-temp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.temp-unit-toggle {
  background: rgba(42, 111, 151, 0.14);
}

.temp-unit-toggle .seg-btn {
  padding: 0.26rem 0.52rem;
  font-size: 0.76rem;
}

.fridge-temp-control input[type="range"] {
  background: linear-gradient(90deg, #b9f2ff, #ff2f2f);
}

.fridge-insight {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.fridge-insight strong {
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
}

.fridge-precision {
  border-top: 1px solid rgba(18, 35, 29, 0.1);
  margin-top: 0.2rem;
  padding-top: 0.55rem;
}

.fridge-precision-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fridge-precision-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.fridge-precision-body {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.45rem;
}

.fridge-precision-body.hidden {
  display: none;
}

.fridge-precision-body.disabled {
  opacity: 0.48;
}

.sun-hours-readout {
  margin: 0.6rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.sun-hours-readout strong {
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
}

.sun-hours-source {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.79rem;
}

.exposure-hint {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

.solar-precision {
  border-top: 1px solid rgba(18, 35, 29, 0.1);
  margin-top: 0.55rem;
  padding-top: 0.58rem;
}

.solar-precision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.solar-precision-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.solar-precision-body {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.45rem;
}

.solar-precision-body.hidden {
  display: none;
}

.solar-precision-body.disabled {
  opacity: 0.48;
}

.solar-insight {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.control-stack {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.6rem;
}

.control-stack.hidden {
  display: none;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.93rem;
  color: var(--muted);
}

.field-row output {
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  font-weight: 500;
}

.inline-fields {
  display: grid;
  gap: 0.62rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.75rem 0;
}

.select-field {
  display: grid;
  gap: 0.35rem;
}

.select-field span {
  font-size: 0.9rem;
  color: var(--muted);
}

select {
  border: 1px solid rgba(18, 35, 29, 0.2);
  border-radius: 10px;
  padding: 0.45rem 0.62rem;
  font-family: inherit;
  background: white;
  color: var(--text);
}

.ghost-btn {
  border: 1px solid rgba(18, 35, 29, 0.2);
  border-radius: 10px;
  padding: 0.58rem 0.8rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ghost-btn:hover {
  background: white;
  transform: translateY(-1px);
}

.ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

.file-input {
  border: 1px solid rgba(18, 35, 29, 0.2);
  border-radius: 10px;
  padding: 0.58rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

#uploadSettings {
  display: none;
}

.settings-status {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.results-panel {
  padding: 1rem;
  position: sticky;
  top: 1rem;
  align-self: start;
  height: fit-content;
  animation: enter 0.73s ease;
}

.consumption-hero {
  margin-top: 0.68rem;
  border-radius: 16px;
  border: 1px solid rgba(18, 35, 29, 0.12);
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.95), rgba(237, 248, 245, 0.9));
  padding: 0.82rem;
}

.consumption-hero p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.consumption-hero h3 {
  margin: 0.36rem 0 0;
  font-size: 2rem;
  line-height: 1.03;
  font-family: "IBM Plex Mono", monospace;
}

.consumption-hero span {
  display: block;
  margin-top: 0.24rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.consumption-hero small {
  display: block;
  margin-top: 0.45rem;
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.72rem;
}

.stat-card {
  border: 1px solid rgba(18, 35, 29, 0.1);
  border-radius: 12px;
  padding: 0.56rem;
  background: rgba(255, 255, 255, 0.82);
}

.stat-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-card h3 {
  margin: 0.35rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.05rem;
}

.recommend-grid {
  display: grid;
  gap: 0.58rem;
  margin-top: 0.62rem;
}

.recommend-card {
  border-radius: 14px;
  padding: 0.72rem;
  border: 1px solid rgba(18, 35, 29, 0.1);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.95), rgba(250, 255, 255, 0.85));
}

.recommend-card p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
}

.recommend-card h3 {
  margin: 0.38rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.35rem;
}

.recommend-card span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.components-card {
  margin-top: 0.72rem;
  border: 1px solid rgba(18, 35, 29, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.75rem;
}

.components-toolbar {
  margin-top: 0.52rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.compact-btn {
  padding: 0.38rem 0.66rem;
  font-size: 0.8rem;
}

.manual-controls {
  margin-top: 0.58rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.52rem;
  padding: 0.62rem;
  border: 1px solid rgba(18, 35, 29, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.manual-controls.hidden {
  display: none;
}

.component-grid {
  margin-top: 0.54rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.52rem;
}

.component-item {
  border: 1px solid rgba(18, 35, 29, 0.12);
  border-radius: 12px;
  padding: 0.58rem;
  background: rgba(255, 255, 255, 0.92);
}

.component-item p {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.component-item strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.2rem;
  font-family: "IBM Plex Mono", monospace;
}

.mode-pill {
  border-radius: 999px;
  padding: 0.12rem 0.44rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  background: rgba(42, 111, 151, 0.14);
  color: #164866;
}

.mode-pill.manual {
  background: rgba(212, 91, 63, 0.14);
  color: #8a2f1b;
}

.component-item span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.runway-card {
  margin-top: 0.72rem;
  border: 1px solid rgba(18, 35, 29, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.7rem;
}

.draws-card {
  margin-top: 0.72rem;
  border: 1px solid rgba(18, 35, 29, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.7rem;
}

.runway-metrics {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.runway-metrics p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.runway-metrics strong {
  margin-top: 0.2rem;
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.1rem;
}

.runway-text {
  margin: 0.48rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.breakdown {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.52rem;
}

.break-row {
  display: grid;
  gap: 0.3rem;
}

.break-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.86rem;
}

.break-top span:first-child {
  color: var(--text);
}

.break-top span:last-child {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.break-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(18, 35, 29, 0.1);
  overflow: hidden;
}

.break-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #42b7a5, #3f87be);
}

.empty-breakdown {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.fine-print {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.42;
}

.sizing-footnote {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.76rem;
  line-height: 1.42;
  background: rgba(42, 111, 151, 0.1);
  color: #1a5276;
  border-left: 3px solid var(--sky);
}

body[data-theme="dark"] .sizing-footnote {
  background: rgba(130, 183, 223, 0.12);
  color: #a8cff0;
}

.system-warnings {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.system-warnings.hidden {
  display: none;
}

.system-warning {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.42;
  background: rgba(212, 91, 63, 0.12);
  color: #a03020;
  border-left: 3px solid var(--danger);
}

body[data-theme="dark"] .system-warning {
  background: rgba(212, 91, 63, 0.15);
  color: #f5a090;
}

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(11, 19, 16, 0.46);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.map-modal.hidden {
  display: none;
}

.map-dialog {
  width: min(740px, 100%);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(18, 35, 29, 0.15);
  border-radius: 16px;
  box-shadow: 0 24px 45px rgba(20, 33, 28, 0.22);
  padding: 0.85rem;
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.map-copy {
  margin: 0.45rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.precision-map {
  width: 100%;
  height: 320px;
  border: 1px solid rgba(18, 35, 29, 0.14);
  border-radius: 12px;
  overflow: hidden;
}

.map-selection {
  margin: 0.55rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .component-grid {
    grid-template-columns: 1fr;
  }

  .manual-controls {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .consumption-hero h3 {
    font-size: 1.7rem;
  }

  .precision-map {
    height: 260px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 10vw, 2.6rem);
  }

  .layout {
    padding: 1.2rem 0.8rem 2rem;
  }
}
