html { font-size: 18px; }

body {
    margin: 0;
    color: #1c2421;
    background:
        radial-gradient(1200px 500px at 10% -10%, #e7f0e4 0%, transparent 55%),
        linear-gradient(#f4efe6, #efe6d8);
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    line-height: 1.45;
}

.shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    background: #16332f;
    color: #f4efe6;
    padding: 1.4rem 0 1.6rem;
}

.site-header .brand {
    color: #f4efe6;
    text-decoration: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6rem;
    letter-spacing: 0.01em;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.2rem;
}

.site-nav {
    display: flex;
    gap: 0.4rem 0.85rem;
    flex-shrink: 0;
}

.site-nav a {
    color: #f4efe6;
    text-decoration: none;
    font-weight: 650;
    font-size: 0.95rem;
    padding: 0.35rem 0.15rem;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a.is-current {
    border-bottom-color: #e7c27a;
    color: #fff8ea;
}

.home-stack {
    display: flex;
    flex-direction: column;
}

.prio-fronius { order: 1; }
.prio-graphs { order: 2; }
.prio-prices { order: 3; }
.prio-notes { order: 4; }

.identity-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin: 1rem 0 0.4rem;
    padding: 0.9rem 1rem;
    background: #f6f1e6;
    border-radius: 12px;
}

.identity-number {
    margin: 0.15rem 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    letter-spacing: 0.06em;
}

.identity-guid {
    margin: 0.15rem 0 0;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.82rem;
    word-break: break-all;
    color: #3b463f;
}

.identity-box .hint {
    color: #5d675f;
    max-width: none;
}

.view-bar {
    margin-top: 1rem;
}

.view-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.controls h2 {
    font-family: Georgia, serif;
    font-weight: normal;
    font-size: 1.25rem;
    margin: 0 0 0.85rem;
}

.lede, .site-footer p, .hint {
    color: #cfd8d4;
    margin: 0.35rem 0 0;
    max-width: 42rem;
}

.eyebrow {
    margin: 0 0 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.68rem;
    color: #c9b48a;
}

.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0 2rem;
    background: #16332f;
    color: #f4efe6;
}

.site-footer a { color: #e7c27a; }

.intro {
    padding: 1.8rem 0 0.6rem;
}

.intro h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: normal;
    font-size: 2.1rem;
    margin: 0 0 0.6rem;
}

.flow-connect {
    display: flex;
    justify-content: flex-end;
    margin: 1.1rem 0 0;
}

.btn-connect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #16332f;
    color: #f4efe6;
    text-decoration: none;
    border: 0;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.btn-connect:hover {
    background: #1f4a44;
}

.plant-push-actions .btn-connect {
    padding: 0.35rem 0.85rem;
    font-weight: 600;
}

.controls > .plant-grid:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.flow-panel {
    padding: 1.2rem 1.2rem 0.6rem;
}

.flow-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.flow-caption {
    margin: 0.35rem 0 0;
    max-width: 40rem;
    color: #3b463f;
    font-size: 1.02rem;
}

.flow-badge {
    margin: 0;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #f7ecd0;
    color: #7a5a12;
    white-space: nowrap;
}

.flow-badge.live {
    background: #e7f0e4;
    color: #2f5a32;
}

.flow-stage {
    margin: 0.4rem -0.4rem 0;
}

.flow-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.flow-edge {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
}

.flow-edge.sun { stroke: #e8b423; }
.flow-edge.batt { stroke: #6aa36a; }
.flow-edge.grid { stroke: #c43c32; }

.flow-edge.on {
    opacity: 0.95;
    filter: url(#flow-glow);
}

.flow-bolt {
    pointer-events: none;
    stroke: #fffdf8;
    stroke-width: 0.7;
    stroke-linejoin: round;
}

.flow-bolt.sun { fill: #f2c230; }
.flow-bolt.batt { fill: #7dbe78; }
.flow-bolt.grid { fill: #d6453b; }

.flow-kw {
    font-size: 13px;
    font-weight: 700;
    fill: #3b463f;
    text-anchor: middle;
    opacity: 0;
    paint-order: stroke;
    stroke: #fffdf8;
    stroke-width: 4px;
    stroke-linejoin: round;
}

.flow-kw.on { opacity: 1; }

.flow-node rect {
    stroke-width: 1.5;
}

.flow-node.sun rect { fill: #fbf3de; stroke: #e0b04a; }
.flow-node.grid rect { fill: #e8f1f5; stroke: #1f6f8b; }
.flow-node.house rect { fill: #16332f; stroke: #16332f; }
.flow-node.batt rect { fill: #eaf3e8; stroke: #5b8c5a; }

.flow-node.dim { opacity: 0.42; }

.flow-node-label, .flow-node-value, .flow-node-sub {
    text-anchor: middle;
}

.flow-node-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    fill: #5d675f;
}

.flow-node.house .flow-node-label,
.flow-node.house .flow-node-value,
.flow-node.house .flow-node-sub { fill: #f4efe6; }

.flow-node-value {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    fill: #16332f;
}

.flow-node-sub {
    font-size: 13px;
    fill: #5d675f;
}

#flow-soc-bg { fill: #cddbcb; stroke: none; }
#flow-soc-fg { fill: #5b8c5a; stroke: none; }

.panel {
    background: #fffdf8;
    border: 1px solid #d9d0c3;
    border-radius: 14px;
    padding: 1.1rem 1.2rem 1.2rem;
    box-shadow: 0 10px 30px rgba(22, 51, 47, 0.06);
    margin: 1rem 0;
}

.controls { margin-top: 1rem; }

.control-grid, .more-grid, .plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem 1rem;
}

.plant-grid {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed #d9d0c3;
}

.plant-push {
    margin-top: 1rem;
    display: grid;
    gap: 0.65rem;
}

.plant-push-lead {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3b463f;
    max-width: 52rem;
}

.push-url-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.push-url-row input {
    flex: 1;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.78rem;
}

.plant-push-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.plant-push code {
    font-size: 0.85em;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
}

label[hidden],
[hidden] {
    display: none !important;
}

label.check {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding-top: 1.4rem;
}

select, input[type="date"], input[type="month"], input[type="number"], input[type="text"] {
    font: inherit;
    padding: 0.45rem 0.55rem;
    border: 1px solid #cbbfae;
    border-radius: 8px;
    background: #fff;
}

.more {
    margin-top: 1rem;
    border-top: 1px dashed #d9d0c3;
    padding-top: 0.8rem;
}

.more summary {
    cursor: pointer;
    font-weight: 650;
    color: #16332f;
}

label .hint {
    font-weight: 400;
    margin-top: 0.15rem;
}

.status {
    background: #fff4d6;
    border: 1px solid #e0c36a;
    padding: 0.7rem 1rem;
    border-radius: 10px;
}

.status.review {
    background: #f8e7d4;
    border-color: #d7a36a;
}

.hero-row, .split {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
}

.hero-row.has-plant {
    grid-template-columns: 1.15fr 0.8fr 1.05fr;
}

.plant-error { color: #8a3b2a; }
.plant-wait { color: #5d675f; }

.plant .hint, .now .hint {
    color: #5d675f;
    max-width: none;
}

.now-price {
    font-family: Georgia, serif;
    font-size: 3rem;
    margin: 0.4rem 0 0.2rem;
    letter-spacing: -0.03em;
}

.now-price small {
    font-size: 1rem;
    color: #5d675f;
}

.now-price.plant-power {
    font-size: 2.4rem;
}

.period { margin: 0; color: #5d675f; text-transform: capitalize; }

.now-split {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
    margin: 1rem 0 0;
}

.now-split dt { color: #5d675f; font-size: 0.92rem; }
.now-split dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-content: start;
}

.stat {
    font-family: Georgia, serif;
    font-size: 1.8rem;
    margin: 0.15rem 0 0;
}

.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.6rem;
}

.chart-head-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.1rem;
    min-width: 0;
}

.chart-heading .hint {
    color: #5d675f;
    margin: 0.15rem 0 0;
    max-width: 36rem;
    font-weight: 400;
}

.chart-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.9rem;
}

.chart-spot-only {
    padding-top: 0;
    font-size: 0.88rem;
    color: #3d4742;
}

.chart-type {
    display: flex;
    gap: 0.25rem;
}

.chart-type-btn {
    width: 2.15rem;
    height: 2.15rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #cbbfae;
    background: #fff;
    border-radius: 8px;
    color: #16332f;
    cursor: pointer;
}

.chart-type-btn svg {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}

.chart-type-btn[aria-pressed="true"] {
    background: #16332f;
    border-color: #16332f;
    color: #f4efe6;
}

.chart-head h2, .panel h2 {
    font-family: Georgia, serif;
    font-weight: normal;
    font-size: 1.25rem;
    margin: 0 0 0.6rem;
}

.chart-head h2 { margin: 0; }

.chart-wrap {
    height: 360px;
    position: relative;
    overflow: hidden;
}

.chart-wrap canvas,
.weather-chart-wrap canvas {
    display: block;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.1rem;
    list-style: none;
    padding: 0.9rem 0 0;
    margin: 0;
    font-size: 0.88rem;
    position: relative;
    z-index: 1;
}

.legend i {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 2px;
    margin-right: 0.35rem;
}

.nav-dates {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.chart-date-label {
    margin: 0 0.35rem;
    min-width: 11rem;
    text-align: center;
    font-weight: 650;
    color: #16332f;
    text-transform: capitalize;
}

.ghost:disabled {
    opacity: 0.35;
    cursor: default;
}

.ghost {
    background: #16332f;
    color: #f4efe6;
    border: 0;
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font: inherit;
}

.components {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.component {
    border-bottom: 1px solid #eee6d8;
    padding-bottom: 0.7rem;
}

.component .group {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a6a32;
    margin: 0;
}

.component h3 { margin: 0.1rem 0; font-size: 1rem; }
.component .amount { font-weight: 700; }
.component p { margin: 0.2rem 0 0; color: #5d675f; font-size: 0.9rem; }

.notes-heading {
    margin-top: 1.4rem;
}

.fixed-box {
    background: #f6f1e6;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
}

.fixed-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a6a32;
    margin: 0 0 0.5rem;
}

.notes p { margin: 0 0 0.7rem; color: #3d4742; }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
}

th, td {
    text-align: right;
    padding: 0.4rem 0.45rem;
    border-bottom: 1px solid #eee6d8;
}

th:first-child, td:first-child { text-align: left; }

tr.high td:first-child { box-shadow: inset 3px 0 0 #d9772c; }

.weather-chart-wrap {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.weather-now {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    margin: 0;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.weather-now div {
    display: flex;
    flex-direction: column;
    min-width: 4.5rem;
}

.weather-now dt {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a6a32;
}

.weather-now dd {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.15rem;
}

#weather-panel .chart-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem 1.5rem;
}

#weather-panel .hint {
    color: #5d675f;
    margin: 0.15rem 0 0;
    max-width: none;
}

.solar-outlook {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.2rem, 1fr));
    gap: 0.55rem;
    margin: 0.2rem 0 0.95rem;
}

.solar-day {
    background: #f6f1e6;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
}

.solar-day.today {
    background: #e7f0e4;
}

.solar-day .kicker {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a6a32;
}

.solar-day .kind {
    margin: 0.1rem 0 0.25rem;
    font-size: 0.78rem;
    color: #5d675f;
}

.solar-day .value {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.15rem;
}

.solar-day .sub {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: #5d675f;
}

.prio-fronius {
    display: grid;
    gap: 1rem;
}

@media (min-width: 901px) {
    .prio-fronius {
        grid-template-columns: 1.55fr 0.9fr;
        align-items: start;
    }
}

@media (max-width: 800px) {
    .header-row { flex-direction: column; align-items: flex-start; }
    .hero-row, .split, .hero-row.has-plant { grid-template-columns: 1fr; }
    .now-price { font-size: 2.3rem; }
    .identity-number { font-size: 1.6rem; }
    label.check { padding-top: 0.4rem; }
    #weather-panel .chart-head { grid-template-columns: 1fr; }
    .flow-head { flex-direction: column; }
}
