:root {
  --ground: #f2f4f7;
  --surface: #ffffff;
  --raised: #e9ecf0;
  --border: #e3e6eb;
  --rule: #eef0f3;
  --control: #d3d8df;
  --text: #0b0d10;
  --muted: #646b75;
  --faint: #9aa1ab;
  --accent: #15171a;
  --hue: #1d5fbf;
  --hue-pale: #e3ecf9;
  --grey-data: #b4bbc5;
  --grey-data-light: #d6dbe2;
  --positive: #1f7a37;
  --negative: #c4242a;
  --warning-pale: #fff4d6;
  --warning-ink: #6b4a00;
  --sheet: #f7f8fa;
  --person-sylke: #e6eefb;
  --person-sylke-ink: #1f3f73;
  --person-oma: #f6ece2;
  --person-oma-ink: #6a4018;
  --person-michi: #e5f3ea;
  --person-michi-ink: #1d5233;
  --radius-card: 10px;
  --radius-control: 8px;
  --gap: 24px;
  --pad: 24px;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--hue);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--ground); color: var(--text); font: 400 14px/20px var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; border-radius: 4px; }
.navigation-item:focus-visible, .button:focus-visible, .edit-button:focus-visible, .period-switch button:focus-visible, .unit-switch button:focus-visible, .segmented button:focus-visible, .meter-choice button:focus-visible, .icon-button:focus-visible, .add-floating:focus-visible, .text-button:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; border-radius: var(--radius-control); }
.reading-value input:focus-visible, .form-row input:focus-visible, .form-row select:focus-visible { outline: none; box-shadow: none; }
.input:focus-visible, .select:focus-visible, .form-row:focus-within, textarea:focus-visible { outline: none; border-color: var(--hue); box-shadow: 0 0 0 3px #d5e3f8; }
.form-row:focus-within { box-shadow: inset 0 0 0 2px var(--hue); border-radius: 10px; }
.figures, table, .kpi-value, .number { font-variant-numeric: tabular-nums; }

.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 20px 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--ground); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.product { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.product-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; flex: none; }
.product-name { font-weight: 600; font-size: 15px; line-height: 18px; }
.product-scope { color: var(--muted); font-size: 12px; line-height: 16px; }
.navigation-group { color: var(--muted); font-size: 12px; padding: 18px 10px 6px; }
.navigation-item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px; color: #2b3036; text-decoration: none; transition: background-color .15s ease; }
.navigation-item svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.navigation-item:hover { background: var(--raised); color: var(--text); }
.navigation-item.active { background: var(--raised); color: var(--text); font-weight: 500; }
.navigation-item.active svg { color: var(--text); }
.navigation-count { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
.avatar.account { background: var(--raised); color: var(--text); }
.avatar.sylke { background: var(--person-sylke); color: var(--person-sylke-ink); }
.avatar.oma { background: var(--person-oma); color: var(--person-oma-ink); }
.avatar.michi { background: var(--person-michi); color: var(--person-michi-ink); }
.user-name { display: block; font-weight: 500; line-height: 18px; }
.user-note { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.sign-out { margin-left: auto; }
.mobile-bar, .navigation-backdrop, .add-floating { display: none; }

.canvas { padding: 32px 40px 40px; min-width: 0; }
.loading { color: var(--muted); padding: 40px 0; }
.grid { display: grid; grid-template-columns: repeat(12, round(down, calc((100% - 11 * var(--gap)) / 12), 1px)); gap: var(--gap); align-items: start; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.stack { display: grid; gap: var(--gap); align-content: start; }

.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
h1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.title-line { color: var(--muted); font-size: 15px; line-height: 22px; margin-top: 4px; }
.title-line strong { color: var(--text); font-weight: 500; }
.title-line .negative { color: var(--negative); font-weight: 500; }
.headline-figures { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 15px; }
.headline-figures b { color: var(--text); font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.figure-pair { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.figure-pair + .figure-pair { margin-left: 16px; }
.headline-figures em { font-style: normal; margin-left: 20px; padding-left: 20px; border-left: 1px solid var(--border); }
.actions { display: flex; gap: 8px; align-items: center; }
.button { height: 36px; padding: 0 14px; border-radius: var(--radius-control); border: 0; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color .15s ease, transform .1s ease; }
.button:active { transform: translateY(1px); }
.button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: #2a2d32; }
.button.secondary { background: var(--raised); color: var(--text); }
.button.secondary:hover { background: #dfe3e8; }
.button.danger { background: #fbe9e9; color: var(--negative); }
.button.wide { width: 100%; height: 44px; justify-content: center; margin-top: 8px; font-size: 15px; }
.button[disabled] { opacity: .5; cursor: default; }
.period-switch { display: grid; grid-template-columns: repeat(3, auto); background: var(--raised); border-radius: 9px; padding: 2px; height: 36px; }
.period-switch button { display: grid; place-items: center; padding: 0 14px; border-radius: 7px; color: #3b424b; font-weight: 500; transition: background-color .2s ease, box-shadow .2s ease; }
.period-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 0 0 0.5px rgba(0,0,0,0.04); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); position: relative; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px var(--pad) 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; line-height: 22px; font-weight: 600; }
.card-caption { color: var(--muted); font-size: 13px; }
.card-body { padding: 0 var(--pad) var(--pad); }
.card-links { display: flex; gap: 16px; }
.link { color: var(--hue); text-decoration: none; font-size: 13px; font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 4px 0 8px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 400; color: var(--muted); font-size: 12px; line-height: 16px; padding: 0 12px 8px; white-space: nowrap; }
td { padding: 0 12px; height: 40px; border-top: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { padding-left: var(--pad); }
th:last-child, td:last-child { padding-right: var(--pad); }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover td { background: #f7f8fa; }
tbody tr:hover .edit-button { color: var(--text); }
.right { text-align: right; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.money { font-weight: 600; }
.unit { color: var(--muted); font-size: 12px; margin-left: 2px; font-weight: 400; }
.group-row td { height: 34px; padding-top: 10px; color: var(--muted); font-size: 12px; border-top: 0; }
tbody tr.group-row:hover td, tbody tr.total-row:hover td, tbody tr.more-row:hover td { background: none; }
.total-row td { border-top: 1px solid var(--border); height: 46px; font-weight: 600; }
.wrap-cell { white-space: normal; min-width: 180px; }
.area { display: flex; align-items: center; gap: 10px; text-decoration: none; }
a.area:hover .area-name { color: var(--hue); }
.area-icon { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.area-icon svg { width: 15px; height: 15px; stroke: #3b424b; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.area-name { font-weight: 500; line-height: 18px; }
.area-sub { color: var(--muted); font-size: 12px; line-height: 16px; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 3px; border-radius: 11px; font-size: 12px; flex: none; }
.person-chip .avatar { width: 16px; height: 16px; font-size: 9px; }
.person-chip.sylke { background: var(--person-sylke); color: var(--person-sylke-ink); }
.person-chip.oma { background: var(--person-oma); color: var(--person-oma-ink); }
.person-chip.michi { background: var(--person-michi); color: var(--person-michi-ink); }
.delta-negative { color: var(--negative); }
.delta-positive { color: var(--positive); }

.key-value { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-height: 32px; padding: 6px 0; border-top: 1px solid var(--rule); }
.key-value:first-child { border-top: 0; }
.key-value > span:last-child { text-align: right; overflow-wrap: anywhere; }

.todo { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.todo:first-child { border-top: 0; padding-top: 0; }
.todo-date { width: 76px; flex: none; color: var(--muted); font-size: 13px; }
.todo-title { font-weight: 500; }
.todo-text { color: var(--muted); font-size: 13px; line-height: 18px; }
.todo .link { white-space: nowrap; margin-left: auto; align-self: center; }
.signal { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--negative); margin-right: 6px; vertical-align: 1px; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.dash { width: 14px; height: 0; border-top: 1px dashed var(--text); border-radius: 0; }
.legend i.line { width: 14px; height: 0; border-top: 1.5px solid var(--text); border-radius: 0; }
.unit-switch { display: inline-grid; grid-template-columns: auto auto; background: var(--raised); border-radius: 7px; padding: 2px; }
.unit-switch button { padding: 1px 10px; border-radius: 5px; font-weight: 500; color: var(--muted); font-size: 12px; transition: background-color .2s ease; }
.unit-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.chart { display: block; width: 100%; overflow: visible; }
svg text { font-family: var(--font); font-variant-numeric: tabular-nums; }
.month-summary { display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: flex-end; margin-bottom: 12px; }
.month-summary div { display: grid; font-size: 12px; color: var(--muted); }
.month-summary b { font-size: 20px; line-height: 26px; font-weight: 600; color: var(--text); }
.month-summary b.muted-figure { color: #4a515b; font-weight: 500; }
.month-summary b.delta-positive { color: var(--positive); }
.month-summary b.delta-negative { color: var(--negative); }
.month-summary .summary-note { margin-left: auto; font-size: 12px; }

.kpis { display: grid; grid-template-columns: repeat(4, round(down, 25%, 1px)); }
.kpi { padding: 18px var(--pad) 20px; border-left: 1px solid var(--rule); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 28px; line-height: 34px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; white-space: nowrap; }
.kpi-value .unit { font-size: 15px; }
.kpi-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kpi-strong { color: var(--text); font-weight: 500; }

.field-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.select { width: 100%; height: 40px; border: 1px solid var(--control); border-radius: var(--radius-control); padding: 0 32px 0 12px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23646b75' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 12px center / 12px; appearance: none; -webkit-appearance: none; font-variant-numeric: tabular-nums; }
.compare-fields { display: grid; grid-template-columns: repeat(2, round(down, calc((100% - 12px) / 2), 1px)); gap: 12px; }
.saved-periods { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.compare-summary { display: grid; grid-template-columns: repeat(3, round(down, calc(100% / 3), 1px)); margin: 16px 0 8px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.compare-summary div { font-size: 12px; color: var(--muted); }
.compare-summary b { display: block; color: var(--text); font-size: 15px; font-weight: 600; }
.tariff { padding: 14px 0; border-top: 1px solid var(--rule); }
.compare-summary + .tariff { border-top: 0; }
.tariff-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tariff-name { font-weight: 500; }
.tariff-price { color: var(--muted); font-size: 12px; }
.tariff-tags { display: flex; align-items: center; gap: 2px; }
.tariff-bar { height: 8px; border-radius: 4px; background: var(--rule); margin: 8px 0 6px; overflow: hidden; }
.tariff-bar span { display: block; height: 100%; border-radius: 4px; background: var(--grey-data); transform-origin: left; animation: grow .6s cubic-bezier(.2,.7,.2,1) both; }
.tariff.current .tariff-bar span { background: var(--hue); }
.tariff-foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.tariff-foot b { color: var(--text); font-weight: 600; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 12px; background: var(--raised); color: #3d434b; flex: none; white-space: nowrap; }
.pill.positive { background: #dcf5e3; color: #11401f; }
.pill.negative { background: #fbe4e4; color: #7a1418; }
.pill.hue { background: var(--hue-pale); color: #123f82; }
.pill.warning { background: var(--warning-pale); color: var(--warning-ink); }

.edit-button { width: 28px; height: 28px; border-radius: 6px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--faint); cursor: pointer; vertical-align: middle; transition: background-color .15s ease, color .15s ease; }
.edit-button:hover { background: var(--raised); color: var(--text); }
.edit-button svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.consumption-warning { width: 22px; height: 22px; margin: 0 4px 0 0; border: 0; border-radius: 6px; background: transparent; display: inline-grid; place-items: center; color: var(--negative); cursor: pointer; vertical-align: -5px; transition: background-color .15s ease; }
.consumption-warning:hover, .consumption-warning:focus-visible { background: #fbe4e4; }
.consumption-warning:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; border-radius: 6px; }
.consumption-warning svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.consumption-popover { position: fixed; inset: auto; margin: 0; width: 240px; padding: 12px 14px; border: 0; border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: 0 8px 28px rgba(10,14,20,.18), 0 0 0 1px var(--border); font-size: 13px; line-height: 18px; text-align: left; white-space: normal; font-variant-numeric: tabular-nums; }
.consumption-popover-title { color: var(--negative); font-weight: 600; margin-bottom: 6px; }
.consumption-popover-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--rule); }
.consumption-popover-row > span:first-child, .consumption-popover-note { color: var(--muted); }
.consumption-popover-note { font-size: 12px; margin-top: 4px; }
.edit-cell { width: 52px; }
.note { padding: 14px 0; border-top: 1px solid var(--rule); }
.note:first-child { border-top: 0; padding-top: 2px; }
.note-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.note-text { line-height: 20px; white-space: pre-line; overflow-wrap: anywhere; }

.login { min-height: 100vh; display: grid; place-items: center; background: var(--ground); padding: 16px; }
.login-panel { width: 440px; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 40px; display: grid; gap: 24px; animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.login-product { display: flex; align-items: center; gap: 14px; }
.product-mark.large { width: 44px; height: 44px; border-radius: 11px; }
.login-product h1 { font-size: 24px; line-height: 30px; }
.first-login { display: grid; gap: 4px; padding: 14px 16px; border-radius: 10px; background: var(--hue-pale); color: #123f82; font-size: 14px; line-height: 20px; }
.first-login span { color: #2d4f80; }
.login-form { display: grid; gap: 16px; padding-top: 12px; }
.login-field { display: grid; }
.input { width: 100%; height: 40px; border: 1px solid var(--control); border-radius: var(--radius-control); padding: 0 12px; background: var(--surface); font-size: 15px; transition: border-color .15s ease, box-shadow .15s ease; }
.input.readonly, .input[readonly] { background: #f7f8fa; color: var(--muted); }
input[type="password"].input { letter-spacing: 2px; }
.field-hint { font-size: 13px; color: var(--muted); margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; min-height: 18px; }
.field-hint.positive { color: var(--positive); }
.field-hint.negative { color: var(--negative); }
.field-hint svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.form-error { color: var(--negative); font-size: 14px; }

.sheet { border: 0; padding: 0; margin: auto; width: 440px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 64px); background: var(--sheet); color: var(--text); border-radius: 14px; box-shadow: 0 24px 60px rgba(10,14,20,.25); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: rise .32s cubic-bezier(.2,.8,.2,1) both; }
.sheet::backdrop, .confirm::backdrop { background: rgba(10, 14, 20, 0.36); animation: fade .25s ease both; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: #c7ccd3; margin: 6px auto 0; display: none; }
.sheet-header { min-height: 50px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; flex: none; }
.sheet-header .text-button { color: var(--hue); font-size: 17px; justify-self: start; padding: 6px 0; }
.sheet-header .title { font-size: 17px; font-weight: 600; text-align: center; }
.sheet-content { padding: 6px 16px 16px; display: grid; gap: 16px; align-content: start; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.segmented { display: grid; grid-template-columns: repeat(3, round(down, calc((100% - 4px) / 3), 1px)); background: #e6e8ec; border-radius: 9px; padding: 2px; height: 36px; }
.segmented button { display: grid; place-items: center; font-size: 14px; font-weight: 500; border-radius: 7px; color: #2b3036; transition: background-color .2s ease, box-shadow .2s ease; }
.segmented button[aria-pressed="true"] { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.04); font-weight: 600; }
.meter-choice { display: grid; grid-template-columns: repeat(3, round(down, calc((100% - 16px) / 3), 1px)); gap: 8px; }
.meter-choice.four { grid-template-columns: repeat(4, round(down, calc((100% - 24px) / 4), 1px)); }
.meter-choice button { height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; padding: 0 4px; min-width: 0; white-space: nowrap; transition: border-color .15s ease; }
.meter-choice svg { width: 16px; height: 16px; stroke: #3b424b; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.meter-choice button[aria-pressed="true"] { border: 2px solid var(--text); }
.form-group { background: #fff; border-radius: 10px; }
.form-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; font-size: 17px; }
.form-row + .form-row { border-top: 1px solid var(--rule); }
.form-row .value { color: var(--hue); }
.form-row input:not([type="checkbox"]), .form-row select { border: 0; background: transparent; text-align: right; color: var(--hue); font-size: 17px; min-width: 0; flex: 1 1 auto; height: 46px; }
.form-row input::placeholder { color: var(--faint); }
.form-row .date-overlay { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.form-row .date-overlay::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.form-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--hue); }
.form-row .suffix { color: var(--muted); font-size: 15px; }
.form-textarea { width: 100%; min-height: 140px; border: 0; border-radius: 10px; padding: 14px 16px; background: #fff; font-size: 17px; line-height: 24px; resize: vertical; }
.form-hint { color: var(--muted); font-size: 13px; line-height: 18px; padding: 0 4px; }
.reading-field { background: #fff; border-radius: 10px; padding: 14px 16px; }
.reading-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.reading-value { display: flex; align-items: baseline; gap: 8px; margin: 6px -4px 0; border: 2px solid transparent; border-radius: 10px; padding: 2px 12px; background: #f7faff; cursor: text; transition: border-color .15s ease; }
.reading-value:focus-within { border-color: var(--hue); }
.reading-value.invalid { border-color: var(--negative); }
.field-error { margin: 6px 0 0; color: var(--negative); font-size: 13px; line-height: 18px; }
.form-group .field-error { margin: 0; padding: 0 16px 10px; }
.form-group .field-error + .form-row { border-top: 1px solid var(--rule); }
.reading-value input { border: 0; background: transparent; font-size: 48px; line-height: 56px; height: 56px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; width: 100%; min-width: 0; caret-color: var(--hue); }
.reading-value input::placeholder { color: #c7ccd3; }
.reading-value .unit { font-size: 20px; flex: none; }
.reading-edit { width: 20px; height: 20px; flex: none; align-self: center; stroke: var(--hue); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reading-check { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reading-check b { font-weight: 600; }
.reading-check .negative { color: var(--negative); font-weight: 500; }
.sheet-footer { flex: none; padding: 12px 16px 16px; display: grid; gap: 8px; }
.sheet-save { height: 50px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; display: grid; place-items: center; width: 100%; transition: background-color .15s ease, transform .1s ease; }
.sheet-save:hover { background: #2a2d32; }
.sheet-save:active { transform: translateY(1px); }
.sheet-save:focus-visible { outline: 2px solid var(--hue); outline-offset: 3px; }
.sheet-delete { height: 44px; border-radius: 12px; color: var(--negative); font-size: 17px; font-weight: 500; width: 100%; }
.sheet-delete:hover { background: #fbe9e9; }
.sheet-delete:focus-visible { outline: 2px solid var(--negative); outline-offset: 2px; }
.sheet-error { color: var(--negative); font-size: 14px; text-align: center; }

.confirm { border: 0; margin: auto; width: 320px; max-width: calc(100vw - 32px); border-radius: 14px; background: var(--surface); padding: 20px; box-shadow: 0 24px 60px rgba(10,14,20,.25); }
.confirm[open] { animation: rise .25s cubic-bezier(.2,.8,.2,1) both; }
.confirm h2 { font-size: 17px; line-height: 22px; font-weight: 600; margin-bottom: 6px; }
.confirm p { color: var(--muted); }
.confirm-actions { display: grid; grid-template-columns: repeat(2, round(down, calc((100% - 8px) / 2), 1px)); gap: 8px; margin-top: 18px; }
.confirm-actions .button { justify-content: center; height: 40px; }
.confirm-actions .button.danger { background: var(--negative); color: #fff; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 50; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; }
.icon-button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; }
.text-button { color: var(--hue); font-weight: 500; }
.view-enter { animation: rise .35s cubic-bezier(.2,.7,.2,1) both; }
.settings-form { display: grid; gap: 16px; max-width: 420px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 1280px) {
  .canvas { padding: 28px 28px 40px; }
  .span-8, .span-4, .span-6 { grid-column: span 12; }
  .kpis { grid-template-columns: repeat(2, round(down, 50%, 1px)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .headline-figures em { margin-left: 0; padding-left: 0; border-left: 0; flex-basis: 100%; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .mobile-bar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; height: 52px; padding: 0 8px; padding-top: env(safe-area-inset-top); background: rgba(242, 244, 247, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
  .mobile-title { font-weight: 600; font-size: 17px; flex: 1; }
  .mobile-bar .product-mark { margin-right: 8px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; height: 100dvh; z-index: 40; transform: translateX(-100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: none; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(10,14,20,.2); }
  .navigation-item { height: 40px; font-size: 15px; }
  .navigation-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(10, 14, 20, 0.36); animation: fade .25s ease both; }
  .title-row .actions .button.primary { display: none; }
  .add-floating { display: grid; place-items: center; position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 28px; background: var(--accent); color: #fff; z-index: 25; box-shadow: 0 8px 24px rgba(10,14,20,.25); transition: transform .15s ease; }
  .add-floating:active { transform: scale(.96); }
  .add-floating svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .canvas { padding-bottom: 104px; }
}
@media (max-width: 767px) {
  :root { --gap: 16px; --pad: 16px; }
  .canvas { padding: 16px 16px 104px; }
  .title-row { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 16px; }
  .title-row .actions { flex-wrap: wrap; }
  .period-switch { width: 100%; grid-template-columns: repeat(3, round(down, calc((100% - 4px) / 3), 1px)); }
  .period-switch button { padding: 0 2px; font-size: 12px; letter-spacing: -0.01em; white-space: nowrap; }
  .table-scroll td:first-child, .table-scroll th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--rule); }
  .table-scroll .group-row td:first-child { box-shadow: none; }
  .table-scroll .area > span:last-child { white-space: normal; max-width: 150px; }
  .table-scroll .area-sub { display: block; }
  h1 { font-size: 26px; line-height: 32px; }
  .headline-figures b { font-size: 24px; line-height: 30px; }
  .figure-pair + .figure-pair { margin-left: 0; }
  .headline-figures { column-gap: 20px; }
  .kpi { padding: 14px var(--pad) 16px; }
  .kpi-value { font-size: 22px; line-height: 28px; }
  .kpi-value .unit { font-size: 13px; }
  .kpi-sub { font-size: 12px; line-height: 16px; }
  .todo { flex-wrap: wrap; }
  .todo-date { width: 100%; }
  .todo > div:nth-child(2) { flex: 1 1 0; min-width: 0; }
  .month-summary { gap: 8px 24px; }
  .month-summary b { font-size: 17px; line-height: 22px; }
  .month-summary .summary-note { margin-left: 0; flex-basis: 100%; }
  .sheet { width: 100%; max-width: 100%; height: calc(100dvh - 64px); max-height: none; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .sheet[open] { animation: slide-up .38s cubic-bezier(.2,.8,.2,1) both; }
  .sheet-grabber { display: block; }
  .sheet-grabber, .sheet-header { touch-action: none; }
  .sheet-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  td, th { height: 44px; }
}
@media (max-width: 767px) {
  .cost-table thead { display: none; }
  .cost-table tr { display: grid; grid-template-columns: repeat(2, round(down, calc((100% - 16px) / 2), 1px)); gap: 4px 16px; padding: 12px var(--pad); border-top: 1px solid var(--rule); }
  .cost-table tr.group-row { padding: 14px var(--pad) 2px; border-top: 0; }
  .cost-table tr.total-row { border-top: 1px solid var(--border); }
  .table-scroll .cost-table td, .table-scroll .cost-table td:first-child { display: block; height: auto; padding: 0; border: 0; position: static; box-shadow: none; background: none; white-space: nowrap; text-align: left; }
  .cost-table td:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  .cost-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 400; }
  .table-scroll .cost-table td.optional { display: none; }
  .table-scroll .cost-table .area > span:last-child { max-width: none; }
  .cost-table tbody tr:hover td { background: none; }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: round(down, 100%, 1px); }
  .kpi { border-left: 0; border-top: 1px solid var(--rule); }
  .kpi:first-child { border-top: 0; }
  .compare-fields { grid-template-columns: round(down, 100%, 1px); }
}

.history-table td:nth-child(2) { white-space: normal; min-width: 120px; }
.history-table th, .history-table td { padding-left: 8px; padding-right: 8px; }
.history-table th:first-child, .history-table td:first-child { padding-left: var(--pad); }
.history-table th:last-child, .history-table td:last-child { padding-right: 12px; }
::selection { background: #cfe0f7; color: var(--text); }
html { accent-color: var(--hue); caret-color: var(--hue); scrollbar-color: #c7ccd3 transparent; }
.form-row input::placeholder, .reading-value input::placeholder, .form-textarea::placeholder { color: #6f7680; }
.sheet-save[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 767px) {
  .edit-button { width: 40px; height: 40px; }
  .link { display: inline-block; padding: 6px 0; }
}
@media (max-width: 767px) {
  .login { min-height: 100dvh; display: flex; flex-direction: column; padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .login-panel { width: 100%; max-width: 440px; margin: auto; padding: 24px 20px; gap: 20px; border-radius: 12px; grid-template-columns: minmax(0, 1fr); }
  .login-product { gap: 12px; }
  .login-product .product-mark.large { width: 40px; height: 40px; border-radius: 10px; }
  .login-product h1 { font-size: 22px; line-height: 28px; }
  .login-product .muted { overflow-wrap: anywhere; }
  .first-login { padding: 12px 14px; }
  .login-form { gap: 14px; padding-top: 0; grid-template-columns: minmax(0, 1fr); }
  .login-form .input { height: 44px; font-size: 16px; scroll-margin-bottom: 88px; }
  .login-form .field-hint { margin-top: 4px; }
  .login-form .button.wide { height: auto; min-height: 44px; padding: 10px 14px; margin-top: 6px; font-size: 16px; line-height: 22px; white-space: normal; text-align: center; }
}
@media (max-width: 359px) {
  .login-panel { padding: 20px 16px; gap: 16px; }
  .first-login { font-size: 13px; line-height: 18px; }
  .login-form { gap: 12px; }
  .login-form .button.wide { padding: 10px 8px; font-size: 15px; }
}
