:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --page: #07111f;
  --page-soft: #0a1626;
  --surface: #101c2b;
  --surface-high: #162436;
  --surface-soft: #0d1826;
  --line: #2a3b50;
  --line-soft: #1d2d40;
  --text: #f6f8fb;
  --muted: #9aabba;
  --blue: #3e9eff;
  --blue-soft: #173c60;
  --gold: #e7a83b;
  --green: #38d27a;
  --yellow: #f2bd3c;
  --red: #ff6b6b;
  --radius: 22px;
  --shadow: 0 18px 50px #0007;
  background: var(--page);
  color: var(--text);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, #16426d 0, transparent 34rem),
    radial-gradient(circle at 100% 15%, #1d2e47 0, transparent 30rem),
    linear-gradient(145deg, var(--page), #091522 70%, #101722);
  color: var(--text);
}
a { color: #83c2ff; text-underline-offset: .18em; }
button, input, select { font: inherit; }
button, .button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 64px);
  background: #091421ed;
  border-bottom: 1px solid #ffffff12;
  box-shadow: 0 10px 30px #0005;
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-size: 1.04rem; font-weight: 650; letter-spacing: .01em; }
.brand strong { font-weight: 850; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #08131f; background: linear-gradient(145deg, #ffc85d, var(--gold)); box-shadow: 0 8px 24px #e7a83b33; }
.top nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.top nav a, .nav-button { display: inline-flex; align-items: center; min-height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: #dce7f2; text-decoration: none; cursor: pointer; }
.top nav a:hover, .nav-button:hover { background: #ffffff10; color: #fff; }
.pwa-install-button { border: 1px solid #31597d; background: #123454; color: #a9d7ff; }
.pwa-install-button:hover { background: #19466f; }
.top form { margin: 0; }

.page { width: min(1420px, calc(100% - 40px)); margin: 34px auto 64px; }
.hero, .card, .charge-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #142234f2, #0e1928f2);
  box-shadow: var(--shadow);
}
.hero { position: relative; overflow: hidden; margin-bottom: 28px; padding: clamp(24px, 4vw, 44px); }
.hero::after { content: ""; position: absolute; right: -70px; top: -95px; width: 250px; height: 250px; border-radius: 50%; background: #3e9eff12; box-shadow: 0 0 0 42px #e7a83b08; }
.hero h1 { position: relative; z-index: 1; margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -.04em; }
.hero p:not(.eyebrow) { position: relative; z-index: 1; max-width: 780px; margin: 14px 0 0; color: #b7c6d5; font-size: clamp(1rem, 2vw, 1.22rem); }
.compact-hero { padding-block: 28px; }
.card { min-width: 0; padding: clamp(20px, 3vw, 32px); }
.card h1, .card h2, .card h3 { margin-top: 0; }
.page > section.card + section.card { margin-top: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.stack { display: grid; gap: 20px; margin-top: 24px; }
.dashboard-grid { margin-top: 24px; }
.dashboard-grid + .card { margin-top: 24px; }
.summary-card { min-height: 190px; }
.summary-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 24px; border-radius: 14px; background: var(--blue-soft); color: #8bc9ff; font-size: 1.35rem; }
.summary-card h2 { font-size: 1.22rem; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: #7fbdf7; font-size: .75rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }

.auth { max-width: 520px; margin: 7vh auto; }
.auth h1 { font-size: 2.2rem; }
.auth form button { margin-top: 18px; }
.profile-form > button:last-child { margin-top: 18px; }
.remember-login { display:flex; align-items:flex-start; gap:12px; margin:16px 0 2px; cursor:pointer; }
.remember-login input { flex:0 0 auto; margin-top:2px; }
.remember-login span { display:grid; gap:3px; }
.remember-login small { color:var(--muted); font-weight:400; line-height:1.35; }
.notice, .error { padding: 14px 16px; border: 1px solid; border-radius: 14px; margin: 16px 0; }
.notice { background: #153b2a; border-color: #2c8457; color: #c9f8db; }
.error { background: #451f28; border-color: #963d4c; color: #ffd7dc; }
label { display: block; margin: 15px 0 7px; color: #dbe5ee; font-weight: 720; }
input, select {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid #3a4d63;
  border-radius: 12px;
  background: #091522;
  color: var(--text);
}
input:hover, select:hover { border-color: #55718e; }
input[type="checkbox"] { width: 20px; min-height: 20px; accent-color: var(--blue); vertical-align: middle; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  background: var(--blue);
  color: #06111d;
  font-weight: 820;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
button:hover, .button:hover { filter: brightness(1.09); }
button:active, .button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .48; filter: none; }
.secondary { background: #25364a; color: #eaf2f8; }
.danger { background: #a94750; color: #fff; }
.row { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 16px; }
.billing-review-table table { min-width: 1320px; }
.billing-review-table th:nth-child(1), .billing-review-table td:nth-child(1) { width: 140px; }
.billing-review-table th:nth-child(2), .billing-review-table td:nth-child(2) { width: 150px; }
.billing-review-table th:nth-child(3), .billing-review-table td:nth-child(3) { width: 310px; }
.billing-review-table th:nth-child(4), .billing-review-table td:nth-child(4) { width: 150px; }
.billing-review-table th:nth-child(5), .billing-review-table td:nth-child(5) { width: 160px; }
.billing-review-table th:nth-child(6), .billing-review-table td:nth-child(6) { width: 220px; }
.billing-review-table th:nth-child(7), .billing-review-table td:nth-child(7) { width: 190px; }
table { width: 100%; border-collapse: collapse; background: #0d1927; }
th, td { padding: 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
th { color: #8fa4b8; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff05; }
.badge, .source-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 9px; border: 1px solid #3b5873; border-radius: 999px; background: #15304b; color: #9dd1ff; font-size: .78rem; font-weight: 780; }

.live-shell, .admin-live { margin: 26px 0; }
.evaluation-shell { margin: 26px 0; }
.evaluation-list { display: grid; gap: 14px; }
.evaluation-card { display: flex; align-items: center; gap: 18px; padding-block: 20px; box-shadow: 0 12px 34px #0005; }
.evaluation-card h3, .evaluation-card p { margin: 0; }
.evaluation-card p { margin-top: 5px; color: #c0cfdd; }
.evaluation-card small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.4; }
.evaluation-icon { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 16px; background: #3d3218; color: #ffd785; font-size: 1.45rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 0 16px; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: clamp(1.7rem, 3.5vw, 2.5rem); letter-spacing: -.035em; }
.live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.charge-card { position: relative; overflow: hidden; min-width: 0; padding: clamp(20px, 2.8vw, 32px); }
.charge-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--state, #607184); }
.charge-card.state-charging { --state: var(--green); }
.charge-card.state-waiting { --state: var(--yellow); }
.charge-card.state-paused { --state: var(--red); }
.charge-card.state-disconnected { --state: #647386; }
.charge-card-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.charge-card-top h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.025em; }
.charge-card-controls { display: flex; align-items: center; gap: 10px; }
.mode-switch { display: flex; align-items: center; min-height: 48px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #081320; }
.mode-switch form { margin: 0; }
.mode-option { min-height: 38px; padding: 0 14px; border-radius: 10px; background: transparent; color: #9eb0c1; font-size: .9rem; }
.mode-option.active { background: #2e80c9; color: #fff; box-shadow: 0 5px 18px #1f6eaf55; opacity: 1; }
.mode-option:disabled:not(.active) { background: transparent; }
.icon-button { flex: 0 0 auto; width: 48px; min-height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: #172537; color: #dbe6ef; font-size: 1.2rem; }
.primary-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0 23px; }
.primary-metrics span, .setting-stats span { display: block; margin-bottom: 6px; color: #8ea2b5; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.primary-metrics strong { display: block; font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1; letter-spacing: -.04em; }
.primary-metrics > div:last-child { text-align: right; }
.card-divider { height: 1px; margin-bottom: 22px; background: var(--line); }
.vehicle-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.vehicle-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #1d2e42; color: var(--state, #73869a); font-size: 1.25rem; transform: rotate(45deg); }
.vehicle-copy h3 { margin: 0; font-size: 1.34rem; }
.vehicle-copy p { display: flex; align-items: center; gap: 7px; margin: 4px 0; color: #dbe5ee; }
.vehicle-copy small { display: block; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--state, #647386); box-shadow: 0 0 0 4px color-mix(in srgb, var(--state, #647386) 18%, transparent); }
.price-plan { min-width: 145px; text-align: right; }
.price-plan strong, .price-plan span { display: block; }
.price-plan strong { color: #cfe6fa; font-size: 1.05rem; }
.price-plan span { margin-top: 4px; color: var(--muted); font-size: .87rem; }
.state-track { margin-top: 24px; }
.state-track progress { display: block; width: 100%; height: 12px; border: 0; border-radius: 99px; overflow: hidden; background: #07111c; }
.state-track progress::-webkit-progress-bar { background: #07111c; border-radius: 99px; }
.state-track progress::-webkit-progress-value { border-radius: 99px; background: var(--state, #667789); }
.state-track progress::-moz-progress-bar { border-radius: 99px; background: var(--state, #667789); }
.soc-estimate-track { display: block; width: 100%; height: 12px; overflow: visible; }
.soc-estimate-track line { vector-effect: non-scaling-stroke; stroke-width: 10; }
.soc-track-background { stroke: #07111c; }
.soc-track-base { stroke: var(--state, #667789); }
.soc-track-estimate { stroke: var(--state, #667789); stroke-width: 8 !important; stroke-dasharray: 6 5; }
.soc-caption { display: flex; justify-content: space-between; margin: 7px 1px 0; color: var(--muted); font-size: .82rem; }
.soc-caption strong { color: #dfe9f2; }
.soc-estimate-note { margin: 6px 1px 0; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.soc-source { display: inline-flex; margin-left: 7px; padding: 2px 7px; border-radius: 99px; background: #243548; color: #b8c8d7; font-size: .68rem; font-style: normal; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.soc-source.source-real { background: #163f2a; color: #9af0bc; }
.soc-source.source-manual { background: #3d3218; color: #ffd785; }
.soc-source.source-none { background: #2d3540; color: #a9b7c4; }
.manual-soc-details { margin: 18px 0 0; overflow: hidden; border: 1px solid #3c4e61; border-radius: 15px; background: #0b1724; }
.manual-soc-details > summary { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; color: #eaf2f8; font-weight: 800; cursor: pointer; list-style: none; }
.manual-soc-details > summary::-webkit-details-marker { display: none; }
.manual-soc-details > summary::after { content: '▾'; color: #9dcfff; font-size: 1rem; transition: transform .16s ease; }
.manual-soc-details[open] > summary { border-bottom: 1px solid #3c4e61; }
.manual-soc-details[open] > summary::after { transform: rotate(180deg); }
.manual-soc-details > summary:focus-visible { outline: 2px solid #72baff; outline-offset: -4px; border-radius: 13px; }
.manual-soc-form { margin: 0; padding: 16px; }
.manual-soc-form label { margin: 0; }
.manual-soc-entry { display: grid; grid-template-columns: minmax(90px, 150px) auto minmax(140px, auto); align-items: center; gap: 10px; margin-top: 8px; }
.manual-soc-entry span { color: var(--muted); font-weight: 800; }
.manual-soc-form small { display: block; margin-top: 9px; color: var(--muted); line-height: 1.45; }
.compact-notice { margin: 16px 0 0; }
.evcc-triplet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 26px 0 0; }
.evcc-triplet > div { min-width: 0; padding: 0 18px; border-right: 1px solid var(--line); }
.evcc-triplet > div:first-child { padding-left: 0; }
.evcc-triplet > div:last-child { padding-right: 0; border-right: 0; text-align: right; }
.evcc-triplet > div:nth-child(2) { text-align: center; }
.evcc-triplet dt { margin-bottom: 8px; color: #8398aa; font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.evcc-triplet dd { margin: 0; color: #f6f8fb; font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 820; overflow-wrap: anywhere; }
.manual-override { margin-top: 20px; padding: 12px 14px; border: 1px solid #9b762d; border-radius: 12px; background: #3d3018; color: #ffdf96; font-weight: 750; }
.diagnostics { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.diagnostics summary { min-height: 42px; color: #a8bacb; font-weight: 700; cursor: pointer; }
.live-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 0; }
.live-values div { min-width: 0; padding: 11px; border-radius: 11px; background: #0a1522; }
.live-values dt { color: var(--muted); font-size: .76rem; }
.live-values dd { margin: 4px 0 0; font-weight: 730; overflow-wrap: anywhere; }
.diagnostic-note, .live-updated { color: var(--muted); font-size: .86rem; }
.live-updated { text-align: right; }
.empty-live { display: flex; align-items: center; gap: 18px; }
.empty-live > span { display: grid; place-items: center; flex: 0 0 auto; width: 56px; height: 56px; border-radius: 18px; background: #17283a; color: #8397aa; font-size: 1.5rem; }
.empty-live h2, .empty-live p { margin: 0; }

.settings-dialog { width: min(760px, calc(100% - 28px)); max-height: min(88vh, 820px); padding: 0; border: 1px solid #3b4d61; border-radius: 24px; background: #101b29; color: var(--text); box-shadow: 0 30px 90px #000c; }
.settings-dialog::backdrop { background: #02070dbd; backdrop-filter: blur(7px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px; border-bottom: 1px solid var(--line); background: #101b29f5; }
.dialog-head h2 { margin: 0; font-size: 1.65rem; }
.icon-button.close { font-size: 1.65rem; }
.setting-block { padding: 26px; }
.setting-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.setting-title h3 { margin: 0; font-size: 1.35rem; }
.setting-title p { margin: 6px 0 0; color: var(--muted); }
.setting-state { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border-radius: 99px; background: #263545; color: #a9b7c4; font-size: .8rem; font-weight: 800; }
.setting-state.active { background: #163f2a; color: #9af0bc; }
.setting-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0 18px; }
.setting-stats > div { padding: 15px; border-radius: 14px; background: #0a1522; }
.setting-stats strong { display: block; overflow-wrap: anywhere; }
.price-range { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; }
.price-bars { display: grid; grid-template-columns: repeat(24, minmax(4px, 1fr)); align-items: end; gap: 4px; height: 175px; margin: 8px 0 54px; padding: 12px 8px 0; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #ffffff04, transparent); }
.price-bar { position: relative; display: flex; align-items: end; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 5px 5px 1px 1px; background: transparent; color: inherit; cursor: pointer; }
.price-bar:hover, .price-bar:focus-visible { filter: brightness(1.25); }
.price-bar:disabled { cursor: progress; opacity: .72; }
.price-bar i { display: block; width: 100%; height: 30%; min-height: 8px; border-radius: 5px 5px 1px 1px; background: #405268; }
.price-bar.cheap i { background: #2ba966; }
.price-bar.cheap.charge-needed i { background: #147a49; }
.price-bar.cheap.after-finish i { background: #72dca0; }
.price-bar.level-1 i { height: 10%; }.price-bar.level-2 i { height: 20%; }.price-bar.level-3 i { height: 30%; }.price-bar.level-4 i { height: 40%; }.price-bar.level-5 i { height: 50%; }.price-bar.level-6 i { height: 60%; }.price-bar.level-7 i { height: 70%; }.price-bar.level-8 i { height: 80%; }.price-bar.level-9 i { height: 90%; }.price-bar.level-10 i { height: 100%; }
.price-bar small { position: absolute; top: calc(100% + 9px); left: 0; color: #778b9d; font-size: .66rem; transform: rotate(28deg); transform-origin: left top; }
.price-chart-empty { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 130px; margin: 18px 0; border: 1px dashed #34485d; border-radius: 16px; color: var(--muted); }
.price-chart-empty span { font-size: 1.6rem; }
.price-chart-help { margin: 0 0 16px; color: var(--muted); font-size: .82rem; text-align: center; }
.price-scope-note { margin: 12px 0 0; font-size: .82rem; }
.price-bar-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: -8px 0 16px; color: var(--muted); font-size: .78rem; }
.price-bar-legend[hidden] { display: none; }
.price-bar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.price-bar-legend i { width: 11px; height: 11px; border-radius: 3px; background: #147a49; }
.price-bar-legend i.after { background: #72dca0; }
.price-save-status { flex-basis: 100%; min-height: 1.4em; margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.price-save-status.pending { color: #9fc9e8; }
.price-save-status.success { color: #72dca0; }
.price-save-status.error { color: #ff9aa5; }
.dashboard-tariff-card { margin-top: 24px; }
.dashboard-tariff-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.dashboard-tariff-heading h2 { margin-bottom: 6px; }
.dashboard-tariff-heading p:last-child { margin-bottom: 0; }
.dashboard-tariff-heading label { width: min(240px, 100%); margin: 0; }
.dashboard-tariff-heading select:focus-visible { outline: 2px solid #72baff; outline-offset: 2px; box-shadow: 0 0 0 4px #3e9eff24; }
.dashboard-tariff-bars { display: grid; grid-template-columns: repeat(24, minmax(5px, 1fr)); align-items: end; gap: 4px; height: 150px; margin: 8px 0 50px; padding: 10px 8px 0; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #ffffff04, transparent); }
.dashboard-tariff-bar { position: relative; display: flex; align-items: end; height: 100%; min-width: 0; border-radius: 5px 5px 1px 1px; }
.dashboard-tariff-bar i { display: block; width: 100%; min-height: 8px; border-radius: 5px 5px 1px 1px; background: #6588a7; box-shadow: inset 0 0 0 1px #d5e6f333; }
.dashboard-tariff-bar.reserved-free i { background: #6588a7; }
.dashboard-tariff-bar.reserved-own { background: transparent; box-shadow: inset 0 -3px #91d8ffcc; }
.dashboard-tariff-bar.reserved-own i { background: #63c4ff; box-shadow: inset 0 0 0 1px #ecf9ffff, 0 0 10px #3e9eff88; }
.dashboard-tariff-bar.reserved-other { background: transparent; box-shadow: inset 0 -3px #cf4c5999; }
.dashboard-tariff-bar.reserved-other i { background: #cf4c59; }
.dashboard-tariff-bar.level-1 i { height: 10%; }.dashboard-tariff-bar.level-2 i { height: 20%; }.dashboard-tariff-bar.level-3 i { height: 30%; }.dashboard-tariff-bar.level-4 i { height: 40%; }.dashboard-tariff-bar.level-5 i { height: 50%; }.dashboard-tariff-bar.level-6 i { height: 60%; }.dashboard-tariff-bar.level-7 i { height: 70%; }.dashboard-tariff-bar.level-8 i { height: 80%; }.dashboard-tariff-bar.level-9 i { height: 90%; }.dashboard-tariff-bar.level-10 i { height: 100%; }
.dashboard-tariff-bar-price { position: absolute; z-index: 2; top: 0; left: 1px; width: 44px; color: #c7d9e7; font-size: .58rem; font-weight: 750; line-height: 1; text-align: left; transform: rotate(-24deg); transform-origin: left top; pointer-events: none; }
.dashboard-tariff-bar small { position: absolute; top: calc(100% + 9px); left: 0; color: #a8bac9; font-size: .66rem; transform: rotate(28deg); transform-origin: left top; white-space: nowrap; }
.dashboard-reservation-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0 0 18px; color: var(--muted); font-size: .82rem; }
.dashboard-reservation-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dashboard-reservation-legend i { width: 13px; height: 13px; border-radius: 4px; background: #6588a7; box-shadow: inset 0 0 0 1px #d5e6f366; }
.dashboard-reservation-legend i.own { background: #63c4ff; box-shadow: inset 0 0 0 1px #d4f1ff99; }
.dashboard-reservation-legend i.other { background: #cf4c59; }
.dashboard-reservation-link { width: fit-content; border: 1px solid #356f9f; background: #173c60; }
.charge-forecast { margin: 0 0 20px; padding: 15px 16px; border: 1px solid #30475f; border-radius: 14px; background: #0a1522; color: #c9d6e2; }
.charge-forecast strong { display: block; color: var(--text); }
.charge-forecast span { display: block; margin-top: 5px; color: var(--muted); font-size: .88rem; }
.charge-forecast.warning { border-color: #825e25; background: #2a2113; }
.charge-forecast.warning strong { color: #ffd37f; }
.charge-forecast.success { border-color: #276645; background: #10271d; }
.charge-forecast.success strong { color: #9af0bc; }
.price-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: 22px; }
.price-controls form { margin: 0; }
.price-controls form:first-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.price-controls label { margin: 0; }
.price-controls.preview-only { grid-template-columns: minmax(0, 1fr) auto; }
.dialog-note { margin: 0; padding: 0 26px 26px; color: var(--muted); font-size: .84rem; }
.pwa-install-dialog { width: min(560px, calc(100% - 28px)); }
.pwa-install-dialog .setting-block > p:first-child { margin-top: 0; color: #d6e3ef; font-size: 1.05rem; line-height: 1.55; }
.pwa-install-steps { display: grid; gap: 10px; margin: 22px 0; padding-left: 24px; color: #dbe7f1; }
.pwa-install-steps li::marker { color: #72bcff; font-weight: 850; }

.reservation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.reservation-heading h2 { margin-bottom: 0; }
.reservation-planner { display: block; margin-top: 20px; }
.reservation-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); gap: 14px; }
.reservation-range { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 22px 0 10px; }
.reservation-range strong { min-height: 48px; display: grid; place-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: #091522; text-align: center; }
.reservation-range-edge { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.reservation-price-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; margin: 12px 0; padding: 12px 14px; border: 1px solid #34536f; border-radius: 13px; background: #0b1a29; }
.reservation-price-summary span { color: #a9bfd1; }
.reservation-price-summary strong { color: #eaf6ff; }
.reservation-price-summary small { grid-column: 1 / -1; color: var(--muted); line-height: 1.35; }
.reservation-charge-estimate { display: grid; gap: 4px; margin: 12px 0; padding: 14px; border: 1px solid #2f6f9b; border-radius: 13px; background: #0b2132; }
.reservation-charge-estimate[hidden] { display: none; }
.reservation-charge-estimate span { color: #79bfff; font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.reservation-charge-estimate strong { color: #f2f8ff; font-size: 1.08rem; }
.reservation-charge-estimate small { color: #b8cad8; line-height: 1.42; }
.reservation-profile-admin { margin: 20px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.reservation-profile-admin > summary { cursor: pointer; font-weight: 800; }
.reservation-profile-form { align-items: end; padding-top: 14px; border-top: 1px solid var(--line); }
.reservation-price-unavailable { margin: 12px 0; }
.reservation-bars-wrap { width: 100%; overflow-x: auto; overflow-y: hidden; padding: 8px 2px 48px; border: 1px solid var(--line-soft); border-radius: 14px; background: #091522; scrollbar-color: #536a82 #0b1724; }
.reservation-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 18px; align-items: end; gap: 4px; width: max-content; min-width: 100%; height: 136px; padding: 24px 12px 0; border-bottom: 1px solid #526b83; }
.reservation-bar { position: relative; display: flex; align-items: flex-end; width: 18px; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 5px 5px 1px 1px; background: transparent; cursor: pointer; }
.reservation-bar:disabled { opacity: 1; }
.reservation-bar i { display: block; width: 100%; height: 42%; min-height: 18px; border-radius: 5px 5px 1px 1px; background: #6588a7; box-shadow: inset 0 0 0 1px #a9c4da66; transition: filter .14s ease, background .14s ease; }
.reservation-bar:hover i, .reservation-bar:focus-visible i { filter: brightness(1.25); }
.reservation-bar.level-1 i { height: 18%; }.reservation-bar.level-2 i { height: 27%; }.reservation-bar.level-3 i { height: 36%; }.reservation-bar.level-4 i { height: 45%; }.reservation-bar.level-5 i { height: 54%; }.reservation-bar.level-6 i { height: 63%; }.reservation-bar.level-7 i { height: 72%; }.reservation-bar.level-8 i { height: 81%; }.reservation-bar.level-9 i { height: 90%; }.reservation-bar.level-10 i { height: 100%; }
.reservation-bar.selected i { background: #3bd986; box-shadow: inset 0 0 0 1px #b8f7d3aa; }
.reservation-bar.selected.selection-start i,
.reservation-bar.selected.selection-end i { background: #087a46; box-shadow: 0 0 0 2px #7cf0b2; }
.reservation-bar.occupied i { background: #c77d8b; box-shadow: inset 0 0 0 1px #ffd2d999; }
.reservation-bar-price { position: absolute; top: 0; left: 1px; width: 48px; color: #bcd0e0; font-size: .58rem; font-weight: 750; line-height: 1; text-align: left; transform: rotate(-24deg); transform-origin: left top; pointer-events: none; }
.reservation-bar small { position: absolute; top: calc(100% + 8px); left: 0; width: 70px; color: #7f93a6; font-size: .64rem; text-align: left; transform: rotate(25deg); transform-origin: left top; pointer-events: none; }
.reservation-legend { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 12px 0 20px; color: var(--muted); font-size: .84rem; }
.reservation-legend span { display: inline-flex; align-items: center; gap: 7px; }
.reservation-legend i { width: 13px; height: 13px; border-radius: 4px; background: #6588a7; box-shadow: inset 0 0 0 1px #a9c4da66; }
.reservation-legend i.selected { background: #3bd986; }
.reservation-legend i.occupied { background: #c77d8b; }
.reservation-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.reservation-note { margin: 18px 0 0; }
.reservation-list { display: grid; gap: 12px; margin-top: 18px; }
.reservation-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #0b1724; }
.reservation-item h3 { margin: 8px 0 4px; }
.reservation-item p { margin: 0; color: #c2d0dc; }
.reservation-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.reservation-item-actions form { margin: 0; }

footer { padding: 30px 20px 44px; text-align: center; color: #7f93a6; }
footer a { color: #9dcfff; }

.review-list { display: grid; gap: 14px; margin-top: 22px; }
.review-item { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #0b1724; }
.review-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.review-item-head strong, .review-item-head span { display: block; }
.review-item-head > div > span { margin-top: 5px; color: var(--muted); font-size: .88rem; }
.review-summary { margin: 14px 0 0; line-height: 1.5; }
.review-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.review-details summary { min-height: 42px; color: #b9cada; font-weight: 750; cursor: pointer; }
.review-detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.review-detail-grid > div { padding: 12px; border-radius: 12px; background: #07121e; }
.review-detail-grid strong, .review-detail-grid span { display: block; }
.review-detail-grid span { margin-top: 6px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.review-rerun { margin-top: 14px; }
.test-billing-card { border-color: #8b6a24; box-shadow: inset 0 3px 0 #e4a92f; }
.test-badge { border-color: #e4a92f; background: #4a3510; color: #ffd878; }
.test-warning { border-color: #8b6a24; background: #2a200d; color: #ffe5a6; }
.billing-screen-preview { margin-top: 22px; padding: clamp(18px, 3vw, 30px); overflow: hidden; border: 1px solid #1c3b57; border-radius: 20px; background: radial-gradient(circle at 92% 7%, #113e62 0, #113e6200 25%), linear-gradient(145deg, #061828, #08213a); box-shadow: 0 22px 46px #0007, inset 0 1px 0 #ffffff0a; color: #f5f9fc; }
.billing-screen-brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #21415d; color: #91a8bc; font-size: .78rem; }
.billing-screen-brand > div { display: flex; align-items: center; gap: 11px; }
.billing-screen-brand > div > span:last-child { display: grid; gap: 2px; }
.billing-screen-brand small { color: #74bfff; font-size: .62rem; font-weight: 900; letter-spacing: .12em; }
.billing-screen-brand strong { color: #fff; font-size: .86rem; letter-spacing: .04em; }
.billing-screen-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #ffd160, #f4a72c); box-shadow: 0 8px 18px #f0a62c28; color: #27364a; font-size: 1rem; }
.billing-screen-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 300px); align-items: center; gap: 24px; padding: 28px 0 20px; }
.billing-screen-intro h3 { margin: 4px 0 7px; color: #fff; font-size: clamp(2rem, 5vw, 3.35rem); line-height: .98; letter-spacing: -.045em; }
.billing-screen-intro p:not(.eyebrow) { max-width: 540px; margin: 0; color: #a9becf; }
.billing-screen-warning { display: grid; gap: 5px; padding: 16px 18px; border: 1px solid #a76e16; border-radius: 14px; background: linear-gradient(135deg, #4d370f, #2c220f); color: #ffe09b; }
.billing-screen-warning strong { color: #ffc84d; font-size: .9rem; }
.billing-screen-warning span { color: #dbc99c; font-size: .78rem; line-height: 1.4; }
.billing-screen-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 15px 18px; border: 1px solid #1d405e; border-radius: 14px; background: #0b2942; }
.billing-screen-meta div { display: grid; gap: 5px; }
.billing-screen-meta div + div { padding-left: 18px; border-left: 1px solid #28506f; }
.billing-screen-meta small, .billing-screen-kpis small { color: #78bfff; font-size: .66rem; font-weight: 900; letter-spacing: .11em; }
.billing-screen-meta strong { color: #fff; }
.billing-screen-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.billing-screen-kpis > div { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 2px 11px; min-width: 0; padding: 15px; border: 1px solid #1d405e; border-radius: 14px; background: linear-gradient(145deg, #0b2942, #0a2237); }
.billing-screen-kpis > div > span { grid-row: 1 / 4; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #164b72; color: #80c9ff; font-weight: 900; }
.billing-screen-kpis strong { color: #fff; font-size: 1.22rem; line-height: 1.2; overflow-wrap: anywhere; }
.billing-screen-kpis em { color: #8fa6ba; font-size: .68rem; font-style: normal; }
.billing-screen-energy, .billing-screen-sessions { margin-top: 14px; padding: 18px; border: 1px solid #1d405e; border-radius: 14px; background: #081e31; }
.billing-screen-energy h4, .billing-screen-sessions h4 { margin: 0; color: #fff; font-size: 1rem; }
.billing-screen-energy > p, .billing-screen-sessions > p { margin: 4px 0 16px; color: #8fa6ba; font-size: .75rem; }
.billing-screen-energy-bar { display: flex; width: 100%; height: 15px; overflow: hidden; border-radius: 999px; background: #173047; box-shadow: inset 0 1px 3px #0008; }
.billing-screen-energy-bar i { display: block; min-width: 0; height: 100%; }
.billing-screen-energy-bar .network { background: linear-gradient(90deg, #3691d0, #77c4fb); }
.billing-screen-energy-bar .solar { background: linear-gradient(90deg, #2abf66, #70db72); }
.billing-screen-energy-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.billing-screen-energy-values > div { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 2px 9px; }
.billing-screen-energy-values span { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #123d5c; color: #73c7ff; }
.billing-screen-energy-values div:last-child span { background: #12452c; color: #65e58d; }
.billing-screen-energy-values small { color: #a6bbca; }
.billing-screen-energy-values strong { color: #fff; }
.billing-screen-energy-values em { grid-column: 3; grid-row: 1 / 3; color: #91a8ba; font-size: .8rem; font-style: normal; }
.billing-screen-sessions .table-wrap { border-color: #1e425f; }
.billing-screen-sessions table { min-width: 760px; background: #0a2237; }
.billing-screen-sessions th { padding: 10px 12px; background: #102f48; color: #7fc3f2; font-size: .65rem; }
.billing-screen-sessions td { padding: 12px; border-color: #1d405e; color: #e9f2f8; font-size: .78rem; }
.billing-screen-sessions td span { color: #879fb2; font-size: .7rem; }
.billing-screen-note { display: flex; gap: 12px; margin-top: 14px; padding: 14px 16px; border: 1px solid #175694; border-radius: 14px; background: linear-gradient(135deg, #0c3e6b, #092e50); color: #d9efff; }
.billing-screen-note > span { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: #1767aa; color: #fff; }
.billing-screen-note strong { color: #fff; }
.billing-screen-note p { margin: 4px 0 0; color: #a8cce6; font-size: .76rem; line-height: 1.45; }
.billing-pdf-download { margin-top: 2px; }
.notification-device-card, .notification-test-card, .notification-master { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.notification-device-card h2, .notification-test-card h2, .notification-master h2 { margin: 0 0 6px; }
.notification-device-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.notification-settings-form { display: grid; gap: 22px; }
.notification-device-card + .notification-settings-form,
.notification-settings-form + .notification-test-card,
.notification-test-card + .card { margin-top: 20px; }
.notification-event-list { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; }
.notification-event { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px; cursor: pointer; }
.notification-event + .notification-event { border-top: 1px solid var(--line); }
.notification-event strong, .notification-event small { display: block; }
.notification-event small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.toggle { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span { position: relative; width: 50px; height: 29px; border: 1px solid #49627b; border-radius: 999px; background: #17283b; transition: .2s; }
.toggle > span::before { content: ''; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; border-radius: 50%; background: #a8b8c8; transition: .2s; }
.toggle input:checked + span { border-color: #3da2f4; background: #1768aa; }
.toggle input:checked + span::before { transform: translateX(21px); background: #fff; }
.toggle input:focus-visible + span { outline: 3px solid #ffb238; outline-offset: 3px; }
.push-error { color: #ff9aa4 !important; }

@media (max-width: 1100px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 701px) and (max-width: 1200px) {
  .top { align-items: flex-start; flex-direction: column; gap: 6px; }
  .top nav { width: 100%; flex-wrap: nowrap; gap: 2px; font-size: .9rem; }
  .top nav a, .nav-button { min-height: 42px; padding-inline: 8px; }
}

@media (max-width: 700px) {
  .top { position: static; align-items: flex-start; flex-direction: column; gap: 10px; }
  .top nav { width: 100%; gap: 2px; }
  .top nav a, .nav-button { min-height: 48px; padding-inline: 10px; }
  .page { width: min(100% - 20px, 1420px); margin-top: 18px; }
  .hero, .card, .charge-card { padding: 20px; border-radius: 18px; }
  .section-heading { align-items: flex-start; }
  .charge-card-top { align-items: flex-start; flex-direction: column; }
  .charge-card-controls { width: 100%; }
  .mode-switch { flex: 1; }
  .mode-switch form, .mode-option { flex: 1; }
  .mode-switch form .mode-option { width: 100%; }
  .vehicle-row { grid-template-columns: auto minmax(0, 1fr); }
  .price-plan { grid-column: 2; text-align: left; }
  .setting-stats { grid-template-columns: 1fr; }
  .price-controls, .price-controls form:first-child { grid-template-columns: 1fr; }
  .dashboard-tariff-heading { align-items: stretch; flex-direction: column; }
  .dashboard-tariff-heading label { width: 100%; }
  .dashboard-tariff-bars { gap: 2px; height: 132px; }
  .dashboard-reservation-link { width: 100%; margin: 4px 0 30px; justify-content: flex-start; }
  .price-controls button { width: 100%; }
  .manual-soc-entry { grid-template-columns: minmax(0, 1fr) auto; }
  .manual-soc-entry button { grid-column: 1 / -1; width: 100%; }
  .dialog-head, .setting-block { padding: 20px; }
  .dialog-note { padding: 0 20px 20px; }
  .row { display: grid; grid-template-columns: 1fr; }
  .row > * { min-width: 0; }
  .review-item-head { flex-direction: column; }
  .review-detail-grid { grid-template-columns: 1fr; }
  .reservation-heading, .reservation-item { align-items: flex-start; flex-direction: column; }
  .reservation-controls { grid-template-columns: 1fr; }
  .reservation-price-summary { grid-template-columns: 1fr; }
  .reservation-price-summary small { grid-column: auto; }
  .reservation-range { grid-template-columns: 1fr; gap: 7px; }
  .reservation-range-edge { display: none; }
  .reservation-actions, .reservation-actions > *, .reservation-item-actions, .reservation-item-actions > * { width: 100%; }
  .reservation-item-actions { justify-content: stretch; }
  .billing-screen-brand { align-items: flex-start; flex-direction: column; }
  .billing-screen-brand > span { display: none; }
  .billing-screen-intro { grid-template-columns: 1fr; }
  .billing-screen-meta, .billing-screen-kpis, .billing-screen-energy-values { grid-template-columns: 1fr; }
  .billing-screen-meta div + div { padding: 12px 0 0; border-top: 1px solid #28506f; border-left: 0; }
  .billing-screen-energy-values > div + div { padding-top: 10px; border-top: 1px solid #1d405e; }
  .billing-pdf-download { width: 100%; }
  .notification-device-card, .notification-test-card, .notification-master { align-items: stretch; flex-direction: column; }
  .notification-device-actions, .notification-device-actions button, .notification-test-card form, .notification-test-card button { width: 100%; }
  .notification-event { align-items: flex-start; }
}

@media (max-width: 420px) {
  .brand { font-size: .95rem; }
  .top nav { font-size: .9rem; }
  .top nav a, .nav-button { padding-inline: 8px; }
  .section-heading { flex-direction: column; }
  .primary-metrics { gap: 12px; }
  .primary-metrics strong { font-size: 1.75rem; }
  .mode-option { padding-inline: 9px; font-size: .82rem; }
  .vehicle-icon { width: 44px; height: 44px; }
  .vehicle-copy small { font-size: .77rem; }
  .evcc-triplet > div { padding-inline: 9px; }
  .evcc-triplet dd { font-size: .95rem; }
  .live-values { grid-template-columns: 1fr; }
  .settings-dialog { width: calc(100% - 14px); }
  .price-bars { gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
