/* Zählerbuch 1.2 — lebendiges, professionelles Haushalt-UI */
:root {
  --paper: #eef4f0;
  --paper-2: #e2ebe5;
  --ink: #13241c;
  --muted: #5a6d64;
  --line: #c9d7cf;
  --line-soft: #dce6e0;
  --forest: #1a5c44;
  --forest-2: #247a58;
  --forest-deep: #0e3a2b;
  --copper: #c4622c;
  --honey: #e39a2e;
  --strom: #d89028;
  --wasser: #1d8494;
  --gas: #c25530;
  --pv: #4a9240;
  --einspeisung: #6a8538;
  --danger: #b42318;
  --ok: #1a7a4c;
  --card: #ffffff;
  --card-tint: #f6faf7;
  --shadow: 0 1px 2px rgba(19, 36, 28, 0.045), 0 12px 30px rgba(19, 36, 28, 0.07);
  --shadow-lg: 0 2px 6px rgba(19, 36, 28, 0.05), 0 22px 44px rgba(19, 36, 28, 0.11);
  --radius: 16px;
  --radius-sm: 11px;
  --sans: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { color-scheme: light; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1100px 560px at -8% -12%, rgba(36, 122, 88, 0.16), transparent 52%),
    radial-gradient(820px 480px at 108% -8%, rgba(227, 154, 46, 0.13), transparent 48%),
    radial-gradient(760px 420px at 92% 108%, rgba(29, 132, 148, 0.10), transparent 50%),
    radial-gradient(640px 360px at 12% 100%, rgba(74, 146, 64, 0.07), transparent 46%),
    var(--paper);
  color: var(--ink);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
::selection { background: rgba(36, 122, 88, 0.22); color: var(--ink); }

a { color: var(--forest); }
a:hover { color: var(--forest-2); }
code {
  font-size: 0.92em;
  background: var(--paper-2);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.85rem 1.1rem;
  flex-wrap: wrap;
  padding: 0.72rem 1.4rem 0.72rem 1.55rem;
  border-bottom: 1px solid rgba(19, 36, 28, 0.08);
  background: rgba(255, 255, 255, 0.78);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: 0 8px 28px rgba(19, 36, 28, 0.045);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--forest) 0%, var(--honey) 38%, var(--wasser) 68%, var(--pv) 100%);
  opacity: 0.85;
}
.topbar-public { position: relative; }
.topbar-public .top-user { margin-left: auto; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.03em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.22), transparent 46%),
    linear-gradient(155deg, #2d8a64, var(--forest-deep));
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.18),
    0 4px 10px rgba(14, 58, 43, 0.28);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.6px solid rgba(255, 248, 236, 0.88);
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 2px;
  background: var(--honey);
  border-radius: 2px;
  transform: translate(-10%, -70%) rotate(-42deg);
  transform-origin: left center;
  box-shadow: -1px 0 0 1.2px #fff8ec;
}
.hh-switch select {
  font: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  max-width: 16rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.nav {
  display: flex;
  gap: 0.18rem;
  flex-wrap: wrap;
  flex: 1;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a.is-active {
  color: #f4faf6;
  background: linear-gradient(180deg, var(--forest-2), var(--forest));
  box-shadow: 0 6px 14px rgba(26, 92, 68, 0.22);
}
.top-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.top-user a { text-decoration: none; color: var(--ink); font-weight: 650; }
.top-user a.muted { color: var(--muted); }
.top-user a:hover { color: var(--forest); }
.muted, .top-user .muted { color: var(--muted); font-weight: 500; }

.shell { padding: 1.45rem 1.55rem 2.6rem; max-width: 1120px; width: 100%; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.3rem;
}
.page-head h1, .auth-card h1, .hero h1 {
  font-family: var(--serif);
  font-weight: 550;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0.18rem 0 0;
  font-size: clamp(1.85rem, 3.1vw, 2.55rem);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--copper);
  font-weight: 750;
  margin: 0;
}
.lead { color: var(--muted); max-width: 44rem; font-size: 1.04rem; }

.flash {
  padding: 0.8rem 1.05rem;
  border-radius: 12px;
  margin: 0 0 1rem;
  border: 1px solid transparent;
}
.flash-ok { background: #e5f5ea; color: var(--ok); border-color: #c5e4cf; }
.flash-err { background: #fbecea; color: var(--danger); border-color: #f0cfc8; }
.flash-info { background: #f8efd8; color: #6a4a16; border-color: #ecd9a8; }

.grid { display: grid; gap: 1rem; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.split { grid-template-columns: 1.1fr 0.9fr; }
.two { grid-template-columns: 1fr 1fr; }
.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 980px) {
  .kpis, .split, .two, .three { grid-template-columns: 1fr 1fr; }
  .shell { padding: 1.15rem; }
}
@media (max-width: 640px) {
  .kpis, .split, .two, .three { grid-template-columns: 1fr; }
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), var(--card) 38%),
    var(--card);
  border: 1px solid rgba(201, 215, 207, 0.95);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.3rem;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.1rem;
  margin: 0 0 0.7rem;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.card > .muted:first-of-type { margin-top: -0.15rem; }
.kpi { position: relative; overflow: hidden; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.kpi::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -22px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.08;
  pointer-events: none;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi .label { font-size: 0.78rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.kpi .value { font-family: var(--serif); font-size: 1.9rem; margin: 0.22rem 0; letter-spacing: -0.03em; }
.kpi .value small { font-family: var(--sans); font-size: 0.72rem; color: var(--muted); font-weight: 650; letter-spacing: 0; }
.kpi .meta { color: var(--muted); font-size: 0.88rem; }
.kpi.strom { border-top: 3px solid var(--strom); color: var(--strom); background: linear-gradient(180deg, #fff8eb 0%, #fff 42%); }
.kpi.wasser { border-top: 3px solid var(--wasser); color: var(--wasser); background: linear-gradient(180deg, #eef8fa 0%, #fff 42%); }
.kpi.gas { border-top: 3px solid var(--gas); color: var(--gas); background: linear-gradient(180deg, #fdf1ec 0%, #fff 42%); }
.kpi.pv { border-top: 3px solid var(--pv); color: var(--pv); background: linear-gradient(180deg, #f0f7ec 0%, #fff 42%); }
.kpi .label, .kpi .value, .kpi .meta, .kpi .warn { color: var(--ink); }
.kpi .label { color: inherit; }
.trend-up { color: var(--danger); }
.trend-down { color: var(--ok); }
.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 750;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--paper-2);
}
.chip-strom { background: #f8e6c4; color: #7a4e10; }
.chip-wasser { background: #d3eef2; color: #14505c; }
.chip-gas { background: #f6ddd3; color: #7a3318; }
.chip-pv { background: #dcead0; color: #2d4f1c; }
.chip-locked { background: #f8e4e0; color: var(--danger); }
.chip-otp { background: #f4e7c8; color: #7a4e10; }
.otp-box {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 1.45rem;
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #f7fbf8, var(--paper));
  border: 1px dashed var(--forest);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-align: center;
  user-select: all;
  font-weight: 750;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 0.62rem 0.5rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(238, 244, 240, 0.65); }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
td.actions form { margin: 0; }
tr.is-editing { background: #fbecea; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font: inherit;
  font-weight: 750;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.btn:hover { background: var(--paper-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #2b8660, var(--forest));
  color: #f4faf6;
  border-color: var(--forest-deep);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 8px 18px rgba(26, 92, 68, 0.24);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #31936a, var(--forest-2));
  border-color: var(--forest);
  color: #fff;
}
.btn-danger { background: #fbecea; color: var(--danger); border-color: #efc8c0; box-shadow: none; }
.btn-danger:hover { background: #f6d7d1; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-small { padding: 0.32rem 0.65rem; font-size: 0.82rem; border-radius: 8px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.span-2 { grid-column: span 2; }
@media (max-width: 640px) {
  .form-grid, .form-grid .span-2 { grid-template-columns: 1fr; grid-column: auto; }
}
label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 650; font-size: 0.88rem; }
input, select, textarea {
  font: inherit;
  font-weight: 500;
  padding: 0.58rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 0 rgba(19, 36, 28, 0.02);
}
textarea { min-height: 5rem; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b7c8be; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(36, 122, 88, 0.18);
}
.check { flex-direction: row; align-items: center; font-weight: 500; gap: 0.55rem; }
.check input { width: auto; box-shadow: none; }

.topic-tabs, .period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.95rem;
  padding: 0.28rem;
  width: fit-content;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(19, 36, 28, 0.04);
}
.topic-tabs a, .period-tabs a {
  text-decoration: none;
  padding: 0.48rem 1rem;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.93rem;
  color: var(--ink);
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.topic-tabs a:hover, .period-tabs a:hover { background: var(--paper-2); }
.topic-tabs a.is-active {
  background: linear-gradient(180deg, var(--ink), #1c3328);
  color: #f4faf6;
  box-shadow: 0 6px 14px rgba(19, 36, 28, 0.18);
}
.period-tabs { margin-bottom: 1rem; }
.period-tabs a { padding: 0.4rem 0.95rem; font-size: 0.9rem; color: var(--muted); }
.period-tabs a.is-active {
  background: linear-gradient(180deg, var(--forest-2), var(--forest));
  color: #f4faf6;
  box-shadow: 0 6px 14px rgba(26, 92, 68, 0.2);
}
.warn-box {
  background: #fbecea;
  border: 1px solid #efc8c0;
  color: var(--danger);
  border-radius: 12px;
  padding: 0.78rem 0.95rem;
  margin: 0 0 0.8rem;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: end; margin-bottom: 1rem; }
.filters label { min-width: 9rem; }
.chart-card h2 { margin-top: 0.2rem; }
.chart-caption { color: var(--muted); font-size: 0.86rem; margin: -0.25rem 0 0.95rem; max-width: 54rem; line-height: 1.45; }
.chart-box {
  height: 320px;
  position: relative;
  background: linear-gradient(180deg, rgba(26, 92, 68, 0.035), transparent 72%);
  border-radius: 12px;
}
.chart-box-md { height: 380px; }
.chart-box-lg { height: 460px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }
@media (max-width: 640px) {
  .chart-box-lg { height: 340px; }
  .chart-box-md { height: 300px; }
}
.empty { padding: 1.7rem 1.2rem; color: var(--muted); text-align: center; }
.empty h2 { font-family: var(--serif); font-size: 1.45rem; color: var(--ink); margin: 0.25rem 0 0.45rem; }
.empty .btn { margin-top: 0.35rem; }

body.is-auth .auth-wrap,
.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 0.85rem;
  min-height: 0;
}
.auth-wrap { width: 100%; }
.auth-card {
  width: min(520px, 100%);
  background:
    linear-gradient(180deg, #fff 0%, var(--card-tint) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.7rem 1.55rem 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--forest), var(--honey), var(--wasser));
}
.install-card { width: min(760px, 100%); }
.auth-card h1 { font-size: 2rem; }
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.12rem;
  margin-bottom: 0.85rem;
}
.auth-lead { color: var(--muted); margin: 0.45rem 0 1rem; }
.install-card h2 { margin: 1.25rem 0 0.35rem; }
.hint { font-weight: 500; color: var(--muted); font-size: 0.82rem; margin: 0.85rem 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--forest-2), var(--forest));
  color: #f4faf6;
  font-size: 0.78rem;
  font-weight: 750;
  margin-right: 0.4rem;
}
.checks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.checks .is-ok { color: var(--ok); }
.checks .is-bad { color: var(--danger); font-weight: 750; }

.hero {
  max-width: 1080px;
  width: 100%;
  margin: 2.2rem auto 0;
  padding: 0 1.4rem 2.4rem;
  flex: 1;
}
.hero-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 247, 0.88)),
    radial-gradient(500px 240px at 90% 10%, rgba(227, 154, 46, 0.12), transparent 55%);
  border: 1px solid rgba(201, 215, 207, 0.95);
  border-radius: 24px;
  padding: 2.1rem 2rem 2rem;
  box-shadow: var(--shadow-lg);
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2.1rem; align-items: center; }
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { padding: 1.45rem 1.2rem 1.4rem; }
}
.hero-points {
  margin: 1.15rem 0 1.35rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}
.hero-points li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--ink);
  font-weight: 550;
}
.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--forest-2), var(--forest));
  box-shadow: 0 0 0 3px rgba(36, 122, 88, 0.16);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 0; }
.meter-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.meter-tile {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  color: #fff;
  min-height: 6rem;
  font-weight: 550;
  box-shadow: 0 10px 22px rgba(19, 36, 28, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.meter-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 28px rgba(19, 36, 28, 0.16); }
.meter-tile strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 650; margin-bottom: 0.15rem; }
.meter-tile.strom { background: linear-gradient(145deg, #e8a43c, #c47816); }
.meter-tile.wasser { background: linear-gradient(145deg, #2aa4b6, #176775); }
.meter-tile.gas { background: linear-gradient(145deg, #d66a3e, #a33e1e); }
.meter-tile.pv { background: linear-gradient(145deg, #5aaa44, #347628); }

.quick-confirm { display: flex; flex-direction: column; gap: 0.7rem; }
.warn { color: var(--copper); font-weight: 650; font-size: 0.88rem; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.role { font-size: 0.86rem; color: var(--muted); font-weight: 500; }
.big-input { font-size: 1.25rem !important; font-variant-numeric: tabular-nums; font-weight: 750; letter-spacing: 0.01em; }
.preview {
  background: var(--paper);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.heatmap { width: 100%; border-collapse: separate; border-spacing: 4px; }
.heatmap th, .heatmap td { border: 0; }
.heatmap th { text-transform: none; letter-spacing: 0; font-size: 0.78rem; padding: 0.3rem 0.2rem; }
.heatmap td {
  text-align: center;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  border-radius: 8px;
  min-width: 2.5rem;
  height: 2.35rem;
}
.hm-0 { background: #eef4ef; color: #a8b5ad; }
.hm-1 { background: #e4f0d8; color: #5d6d58; }
.hm-2 { background: #d4e8b0; color: #4a5a38; }
.hm-3 { background: #e8d48a; color: #4a3e20; }
.hm-4 { background: #e0b44a; color: #fff; }
.hm-5 { background: #d08a2c; color: #fff; }
.hm-6 { background: #b85c22; color: #fff; }
.hm-7 { background: #6a3414; color: #fff; }

.brand-ver {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--forest-deep);
  background: rgba(36, 122, 88, 0.12);
  border: 1px solid rgba(26, 92, 68, 0.16);
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  margin-left: 0.2rem;
}
.site-footer {
  border-top: 1px solid rgba(19, 36, 28, 0.08);
  margin-top: auto;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
}
.site-footer-inner {
  max-width: 1120px;
  padding: 0.95rem 1.55rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--muted);
}
.site-footer-inner span:first-child { font-weight: 750; color: var(--ink); }
.footer-tag { display: block; font-weight: 500; color: var(--muted); font-size: 0.8rem; margin-top: 0.12rem; }
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--card-tint), #fff);
}
.stat-row .k { display: block; font-size: 0.7rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat-row .v { font-family: var(--serif); font-size: 1.18rem; font-weight: 600; }
.meter-block {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, var(--card-tint));
  display: grid;
  gap: 0.4rem;
}
.meter-block + .meter-block { margin-top: 0.55rem; }
.meter-block .big-input, .big-input { font-size: 1.25rem; font-weight: 750; letter-spacing: 0.01em; }
.meter-extras { margin-top: 0.15rem; }
.meter-extras summary, .soft-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  list-style: none;
}
.meter-extras summary::-webkit-details-marker, .soft-details summary::-webkit-details-marker { display: none; }
.meter-extras[open] summary, .soft-details[open] summary { color: var(--ink); margin-bottom: 0.45rem; }
.soft-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.9rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: none;
}
.soft-details > summary { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.quick-save-bar {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.85rem;
  padding: 0.8rem 0.95rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.import-hint {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.95rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
.import-hint code { font-size: 0.86em; }
.mode-toggle { display: flex; flex-wrap: wrap; gap: 0.65rem 1rem; }
.quick-status { margin: 0; font-size: 0.84rem; color: var(--muted); }
.quick-status.is-edit { color: var(--copper); font-weight: 650; }
.quick-status.is-new { color: var(--muted); }
.warn { color: var(--danger); font-weight: 750; }
@media (max-width: 640px) {
  .site-footer-inner { padding: 0.9rem 1.1rem 1.15rem; }
  .topic-tabs, .period-tabs { border-radius: 14px; }
}

.site-footer-inner .muted {
  font-weight: 750;
  color: var(--ink) !important;
  font-size: 0.95rem;
}

/* Foto-Ablesung (1.3.0) */
.photo-read-card { border-left: 4px solid var(--copper); }
.photo-drop { display: inline-flex; flex-direction: column; gap: 0.4rem; cursor: pointer; margin: 0.4rem 0 0.2rem; }
.photo-drop input[type="file"] { font-size: 0.85rem; }
.photo-global-status { margin: 0.3rem 0 0.6rem; min-height: 1.2em; }
.photo-cards { display: grid; gap: 0.9rem; }
.photo-item {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
}
.photo-thumb img { width: 100%; max-height: 240px; object-fit: contain; border-radius: var(--radius-sm); background: #000; }
.photo-delta { margin: 0; font-size: 0.88rem; font-weight: 650; color: var(--ink); }
.photo-delta.is-warn { color: var(--danger); }
.photo-ocr-text { white-space: pre-wrap; font-size: 0.78rem; color: var(--muted); max-height: 8rem; overflow: auto; margin: 0.4rem 0 0; }
.photo-thumb-mini { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; vertical-align: middle; border: 1px solid var(--line); }
@media (max-width: 640px) {
  .photo-item { grid-template-columns: 1fr; }
}
