/* ==========================================================
   Stundenaufzeichnung – Oberfläche
   Alles in einer Datei, keine Frameworks, kein Build-Schritt.
   ========================================================== */

:root {
  --grund: #f6f7f9;
  --flaeche: #ffffff;
  --rand: #dfe4e9;
  --rand-stark: #c6cfd7;
  --text: #16202b;
  --text-leise: #66727e;
  --akzent: #2f5f8f;
  --akzent-hell: #eaf1f8;
  --gruen: #2f7d55;
  --gelb: #b3801f;
  --rot: #b2413a;
  --gruen-hell: #e8f3ec;
  --gelb-hell: #fbf2e0;
  --rot-hell: #fbeceb;
  --schatten: 0 1px 2px rgba(20, 32, 43, .06), 0 6px 20px rgba(20, 32, 43, .07);
  --radius: 9px;
}

* { box-sizing: border-box; }

/* Ausgeblendetes bleibt ausgeblendet – auch bei Grid- und Flex-Layouts,
   die sonst die Standardregel für [hidden] überstimmen. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--grund);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
.z, .zahl { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.leise { color: var(--text-leise); }
.klein { font-size: 12.5px; }
.mini { font-size: 11.5px; }
.fett { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 18px; }

/* ---------------------------------------------------------- Gerüst */

#huelle { display: flex; min-height: 100vh; }

nav {
  width: 214px; flex: 0 0 214px; background: #16202b; color: #c7d1db;
  padding: 16px 12px; display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
nav .marke {
  color: #fff; font-weight: 650; font-size: 14.5px; letter-spacing: -.01em;
  padding: 4px 10px 14px; line-height: 1.3;
}
nav .marke small { display: block; font-weight: 400; font-size: 11.5px; color: #7e8c9a; }
nav button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: 0; color: inherit; padding: 8px 10px;
  border-radius: 7px; cursor: pointer; font-size: 13.5px;
}
nav button:hover { background: #24313f; color: #fff; }
nav button.aktiv { background: var(--akzent); color: #fff; font-weight: 550; }
nav .abstand { flex: 1; }
nav .fuss { font-size: 11px; color: #6d7b89; padding: 10px; line-height: 1.5; }
.beenden-knopf {
  background: none; border: 1px solid #33404e; color: #97a4b1; border-radius: 7px;
  padding: 7px 10px; cursor: pointer; font-size: 12.5px; text-align: center; width: 100%;
}
.beenden-knopf:hover { border-color: #5a6b7c; color: #fff; background: #24313f; }

main { flex: 1; min-width: 0; padding: 22px 26px 70px; max-width: 1500px; }

header.seite {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
header.seite h1 { font-size: 21px; margin: 0; letter-spacing: -.015em; }
header.seite p { margin: 2px 0 0; color: var(--text-leise); font-size: 13px; }
.werkzeuge { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------- Bedienelemente */

.knopf {
  background: var(--flaeche); border: 1px solid var(--rand-stark); border-radius: 7px;
  padding: 6.5px 13px; cursor: pointer; font-size: 13.5px; white-space: nowrap;
  color: var(--text); text-decoration: none; display: inline-block; line-height: 1.5;
}
a.knopf:visited { color: var(--text); }
a.knopf.haupt, a.knopf.haupt:visited { color: #fff; }
.knopf:hover { border-color: #9aa7b3; background: #fbfcfd; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 550; }
.knopf.haupt:hover { background: #26507a; }
.knopf.gefahr { color: var(--rot); border-color: #e6bfbc; }
.knopf.gefahr:hover { background: var(--rot-hell); }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf.klein { padding: 3.5px 9px; font-size: 12.5px; }

input, select, textarea {
  background: var(--flaeche); border: 1px solid var(--rand-stark); border-radius: 7px;
  padding: 6.5px 9px; width: 100%; font-size: 13.5px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--akzent-hell); border-color: var(--akzent); outline-offset: 0;
}
textarea { resize: vertical; min-height: 62px; }
label.feld { display: block; }
label.feld > span {
  display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-leise); font-weight: 600; margin-bottom: 4px;
}
.raster { display: grid; gap: 12px; }
.r2 { grid-template-columns: 1fr 1fr; }
.r3 { grid-template-columns: 1fr 1fr 1fr; }
.r4 { grid-template-columns: repeat(4, 1fr); }
.reihe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ankreuz { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.ankreuz input { width: auto; }

/* ---------------------------------------------------------- Flächen */

.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--schatten);
}
.karte + .karte { margin-top: 14px; }
.karte h2 {
  font-size: 14px; margin: 0 0 12px; letter-spacing: -.005em;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-leise); font-weight: 600; padding: 7px 8px;
  border-bottom: 1px solid var(--rand); position: sticky; top: 0; background: var(--flaeche);
}
td { padding: 7px 8px; border-bottom: 1px solid #f0f3f5; vertical-align: top; }
tbody tr:hover { background: #fafbfc; }
tr.anklickbar { cursor: pointer; }
.tabelle-rahmen { max-height: 68vh; overflow: auto; margin: 0 -18px -16px; padding: 0 18px; }

.marke-punkt {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 7px; vertical-align: middle; flex: 0 0 auto;
}

.etikett {
  display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 20px;
  border: 1px solid var(--rand-stark); background: #f7f9fa; white-space: nowrap;
  font-weight: 550;
}
.etikett.geplant     { background: #eef2f7; border-color: #cdd8e3; color: #46586c; }
.etikett.erledigt    { background: var(--gruen-hell); border-color: #bcdcc8; color: var(--gruen); }
.etikett.abgerechnet { background: var(--akzent-hell); border-color: #c3d8ea; color: var(--akzent); }
.etikett.bezahlt     { background: #efeaf6; border-color: #d3c8e4; color: #5c4585; }
.etikett.offen       { background: var(--gelb-hell); border-color: #e6d3a8; color: var(--gelb); }
.etikett.versendet   { background: var(--akzent-hell); border-color: #c3d8ea; color: var(--akzent); }
.etikett.storniert   { background: #f2f3f4; color: #8a95a0; text-decoration: line-through; }

/* ---------------------------------------------------------- Kennzahlen */

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; }
.kachel {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--schatten);
}
.kachel .titel {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-leise); font-weight: 600;
}
.kachel .wert {
  font-size: 25px; font-weight: 650; letter-spacing: -.02em; margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.kachel .zusatz { font-size: 12px; color: var(--text-leise); margin-top: 1px; }

/* ---------------------------------------------------------- Jahresauslastung */

.jahre { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.jahr {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--schatten);
}
.jahr .oben { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.jahr .gross { font-size: 30px; font-weight: 680; letter-spacing: -.025em;
               font-variant-numeric: tabular-nums; line-height: 1; }
.jahr.gelb .gross { color: var(--gelb); }
.jahr.rot  .gross { color: var(--rot); }
.gross-balken { height: 13px; margin: 14px 0 12px; }
.jahr .werte { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.jahr .werte span { display: block; font-size: 10.5px; text-transform: uppercase;
                    letter-spacing: .05em; color: var(--text-leise); font-weight: 600; }
.jahr .werte b { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.jahr .werte b.rot { color: var(--rot); }
.warnton { color: #7a5a13; font-weight: 550; }
.rechenzeile:has(.warnton) { background: var(--gelb-hell); }
.jahr .takt { margin-top: 11px; padding-top: 9px; border-top: 1px solid #f0f3f5;
              font-size: 12px; color: var(--text-leise); }
.mini-knopf { background: none; border: 0; color: var(--akzent); cursor: pointer;
              font-size: 11.5px; padding: 1px 4px; border-radius: 4px; text-decoration: underline; }
.mini-knopf:hover { background: var(--akzent-hell); }

/* ---------------------------------------------------------- Kontingente */

.balken { height: 9px; background: #edf0f3; border-radius: 6px; overflow: hidden; display: flex; }
.balken i { display: block; height: 100%; background: var(--akzent); }
.balken i.gelb { background: var(--gelb); }
.balken i.rot  { background: var(--rot); }
.balken i.plan { background: repeating-linear-gradient(45deg,
  #adc0d2, #adc0d2 3px, #cfdae5 3px, #cfdae5 6px); }

.kundenblock { border: 1px solid var(--rand); border-radius: var(--radius);
               padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.kundenblock:hover { border-color: var(--rand-stark); background: #fafbfc; }
.kundenblock .kopfzeile { display: flex; justify-content: space-between; gap: 12px;
                          align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; }
.kundenblock .name { font-weight: 620; font-size: 14px; display: flex; align-items: center; }

.vliste { display: flex; flex-direction: column; gap: 7px; }
.vzeile { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(90px, 1fr) auto;
          gap: 12px; align-items: center; font-size: 13px; }
.vzeile.schlicht { grid-template-columns: 1fr auto; padding: 6px 0;
                   border-bottom: 1px solid #f0f3f5; }
.vname { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vzahlen { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.vzahlen .offen { color: var(--akzent); font-weight: 600; margin-left: 7px; }
.vzeit { grid-column: 1 / -1; margin-top: -3px; }
.etikett.mini { font-size: 10px; padding: 1px 6px; font-weight: 600; }
.etikett.stueck { background: #f0ecf7; border-color: #d6cbe8; color: #5c4585; }
.rot { color: var(--rot); }
.warnton { color: #7a5a13; font-weight: 550; }
.rechenzeile:has(.warnton) { background: var(--gelb-hell); }

/* ---------------------------------------------------------- Kunden */

.kundenkarte h2 { align-items: flex-start; }
.unterkopf { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
             color: var(--text-leise); font-weight: 600; margin-bottom: 7px;
             display: flex; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { background: #f2f5f7; border: 1px solid var(--rand); border-radius: 20px;
        padding: 3px 11px; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent); }
.chip.inaktiv { color: var(--text-leise); background: #f7f8f9; border-style: dashed; }
.vtabelle td, .vtabelle th { padding: 6px 8px; }
.geplantwert { color: var(--akzent); font-weight: 600; }

/* ---------------------------------------------------------- Auswahl im Dialog */

.wahlreihe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wahl { border: 1px solid var(--rand-stark); border-radius: 8px; padding: 11px 13px;
        cursor: pointer; display: block; }
.wahl:hover { border-color: #9aa7b3; }
.wahl.aktiv { border-color: var(--akzent); background: var(--akzent-hell);
              box-shadow: inset 0 0 0 1px var(--akzent); }
.wahl input { width: auto; margin-right: 7px; }
.wahl b { font-size: 13.5px; }
.wahl span { display: block; font-size: 12px; color: var(--text-leise); margin-top: 3px; }

.logo-feld { border: 1px dashed var(--rand-stark); border-radius: 8px; padding: 10px 14px;
             min-width: 170px; min-height: 74px; display: flex; align-items: center;
             justify-content: center; background: #fafbfc; }
.logo-feld img { max-height: 54px; max-width: 220px; display: block; }

.zeile-kurz { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
              overflow: hidden; }
.r5 { grid-template-columns: repeat(5, 1fr); }
.r6 { grid-template-columns: repeat(6, 1fr); }
.r1 { grid-template-columns: 1fr; }
.partnerbox { border: 1px solid var(--rand-stark); border-radius: 8px; padding: 10px 14px;
              margin-bottom: 14px; }
.partnerbox table { margin: 0; }
.gelb-text { color: var(--gelb); }
/* In den Einträgen folgen auf die Tabelle noch weitere Blöcke – dort darf
   der Rahmen nicht nach unten überstehen, sonst überlappt er sie. */
#e-rahmen { margin-bottom: 0; }
tr.zeile-offen td { background: #fffcf4; }

/* Standortauswahl beim Anlegen mehrerer Vereinbarungen */
.ortkaesten { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
              gap: 4px; max-height: 240px; overflow-y: auto; padding: 2px;
              border: 1px solid var(--rand); border-radius: 8px; }
.ortkasten { display: flex; align-items: center; gap: 8px; padding: 6px 9px;
             border-radius: 6px; cursor: pointer; font-size: 13px; }
.ortkasten:hover { background: var(--akzent-hell); }
.ortkasten input { width: auto; flex: 0 0 auto; }
.ortkasten span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------- Kalender */

.kal-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.kal-kopf .monat { font-size: 17px; font-weight: 600; min-width: 195px; letter-spacing: -.01em; }

.kalender { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--rand);
            border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; }
.kalender .wtag {
  background: #f2f4f6; padding: 7px 9px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-leise);
}
.tag {
  background: var(--flaeche); min-height: 108px; padding: 5px 6px 7px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
}
.tag:hover { background: #fafbfc; }
.tag.fremd { background: #fafbfc; }
.tag.fremd .nr { color: #b6c0c9; }
.tag.heute { box-shadow: inset 0 0 0 2px var(--akzent); }
.tag.wochenende { background: #f8f9fa; }
.tag .nr { font-size: 12px; font-weight: 600; color: var(--text-leise); display: flex;
           justify-content: space-between; align-items: center; }
.tag .nr b { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--akzent); font-weight: 650; }
.termin {
  font-size: 11.5px; padding: 2.5px 6px; border-radius: 5px; cursor: pointer;
  border-left: 3px solid var(--akzent); background: var(--akzent-hell);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35;
}
.termin.geplant { background: #fff; border: 1px dashed var(--rand-stark); border-left: 3px dashed var(--akzent); }
.termin b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------------------------------------------------- Dialog */

.hintergrund {
  position: fixed; inset: 0; background: rgba(16, 25, 34, .42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.dialog {
  background: var(--flaeche); border-radius: 12px; width: 100%; max-width: 760px;
  box-shadow: 0 16px 60px rgba(16, 25, 34, .3); overflow: hidden;
}
.dialog.breit { max-width: 1050px; }
.dialog .kopf {
  padding: 15px 20px; border-bottom: 1px solid var(--rand);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.dialog .kopf h2 { font-size: 16px; margin: 0; }
.dialog .koerper { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.dialog .fuss {
  padding: 13px 20px; border-top: 1px solid var(--rand); background: #fafbfc;
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.schliessen { background: none; border: 0; font-size: 21px; cursor: pointer; color: var(--text-leise);
              line-height: 1; padding: 2px 6px; border-radius: 5px; }
.schliessen:hover { background: #f0f2f4; color: var(--text); }

fieldset { border: 1px solid var(--rand); border-radius: 8px; padding: 13px 15px 15px; margin: 16px 0 0; }
legend { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
         color: var(--text-leise); font-weight: 600; padding: 0 6px; }

.rechenzeile {
  background: var(--akzent-hell); border-radius: 7px; padding: 9px 12px; margin-top: 12px;
  font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap;
}
.rechenzeile b { font-variant-numeric: tabular-nums; }

.warnung {
  background: var(--gelb-hell); border: 1px solid #e8d5a8; color: #7a5a13;
  border-radius: 8px; padding: 10px 13px; font-size: 13px; margin-bottom: 12px;
}
.warnung strong { color: #5f460e; }

/* ---------------------------------------------------------- Meldungen */

#meldungen { position: fixed; bottom: 20px; right: 20px; display: flex;
             flex-direction: column; gap: 8px; z-index: 90; }
.meldung {
  background: #16202b; color: #fff; padding: 10px 16px; border-radius: 8px;
  box-shadow: 0 8px 26px rgba(16, 25, 34, .3); font-size: 13.5px; max-width: 400px;
  animation: rein .18s ease-out;
}
.meldung.fehler { background: var(--rot); }
.meldung.gut { background: var(--gruen); }
@keyframes rein { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------- Erste Schritte */

.schritt { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid #f0f3f5; }
.schritt:last-child { border-bottom: 0; padding-bottom: 2px; }
.schritt .nummer {
  flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--akzent-hell);
  color: var(--akzent); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.schritt.fertig .nummer { background: var(--gruen-hell); color: var(--gruen); }
.schritt .text { min-width: 0; }
.schritt h3 { margin: 3px 0 4px; font-size: 14.5px; }
.schritt.fertig h3 { color: var(--text-leise); }
.schritt p { margin: 0 0 10px; color: var(--text-leise); font-size: 13.5px; max-width: 74ch; }

ul.liste { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-leise); }
ul.liste li { margin-bottom: 9px; }
ul.liste b { color: var(--text); }
code {
  background: #f0f3f5; border-radius: 4px; padding: 1px 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px;
}

.leer { text-align: center; padding: 46px 20px; color: var(--text-leise); }
.leer h3 { margin: 0 0 5px; font-size: 15px; color: var(--text); }

/* ---------------------------------------------------------- Verlauf */

.verlauf { display: flex; align-items: flex-end; gap: 5px; height: 110px; margin-top: 6px; }
.verlauf .saeule { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
                   align-items: center; gap: 4px; height: 100%; }
.verlauf .saeule i { display: block; width: 100%; background: var(--akzent);
                     min-height: 0; }
.verlauf .saeule i:first-of-type { border-radius: 4px 4px 0 0; }
.verlauf .saeule i.plan { background: repeating-linear-gradient(45deg,
  #adc0d2, #adc0d2 3px, #cfdae5 3px, #cfdae5 6px); border-radius: 4px 4px 0 0; }
.verlauf .saeule span { font-size: 10.5px; color: var(--text-leise); }
.verlauf .saeule b { font-size: 11px; font-variant-numeric: tabular-nums; }

@media (max-width: 1150px) {
  .jahre { grid-template-columns: 1fr; }
  .r5, .r6 { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 900px) {
  #huelle { flex-direction: column; }
  nav { width: auto; flex: none; height: auto; position: static; flex-direction: row;
        overflow-x: auto; padding: 8px; }
  nav .marke, nav .fuss, nav .abstand { display: none; }
  main { padding: 16px; }
  .r2, .r3, .r4, .r5, .r6, .wahlreihe { grid-template-columns: 1fr; }
  .vzeile { grid-template-columns: 1fr; gap: 4px; }
  .vzahlen { text-align: left; }
}

@media print {
  nav, .werkzeuge, #meldungen { display: none !important; }
  main { padding: 0; }
  .karte { box-shadow: none; border: 0; }
}

/* ---------------------------------------------------------- Anmeldung (online) */

.anmeldung-hg {
  position: fixed; inset: 0; z-index: 200; background: var(--grund);
  display: flex; align-items: flex-start; justify-content: center;
  padding: max(12vh, 40px) 16px 40px; overflow-y: auto;
}
.anmeldung-box {
  width: 100%; max-width: 360px; background: var(--flaeche); border-radius: 12px;
  box-shadow: var(--schatten); padding: 26px 24px 24px;
}
.anmeldung-box .knopf { width: 100%; justify-content: center; padding: 10px; font-size: 15px; }
.anmeldung-box input { font-size: 16px; }      /* verhindert das Hineinzoomen am iPhone */
.anmeldung-marke { font-weight: 650; font-size: 18px; letter-spacing: -.01em; margin-bottom: 16px; }
.anmeldung-marke small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-leise); }
.anmeldung-fehler { color: var(--rot); font-size: 13.5px; margin: 12px 0 0; }

/* ---------------------------------------------------------- Umzugs-Hinweis (Mac) */

.umzug-band {
  background: var(--gelb-hell); border-bottom: 1px solid #e8d5a8; color: #5f460e;
  padding: 10px 26px; font-size: 13.5px;
}
.umzug-band a { color: inherit; font-weight: 600; }

/* ---------------------------------------------------------- Tabellen auf schmalen Schirmen */

.tabelle-rollen { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------- iPhone & schmale Fenster */

@media (max-width: 900px) {
  body { font-size: 15px; }
  nav { gap: 2px; position: sticky; top: 0; z-index: 40;
        padding: 6px max(8px, env(safe-area-inset-left)); }
  nav button { white-space: nowrap; width: auto; padding: 8px 11px; }
  nav .beenden-knopf { width: auto; flex: 0 0 auto; white-space: nowrap; margin-left: 6px; }
  #nav-punkte { display: flex; gap: 2px; }
  main { padding: 14px 12px 60px; }
  /* Breite Tabellen seitlich wischbar statt Seite zu sprengen */
  .karte { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* iOS zoomt bei Feldern unter 16px hinein – verhindern */
  input, select, textarea { font-size: 16px !important; }
  .hintergrund { padding: 0; align-items: stretch; }
  .dialog, .dialog.breit { max-width: none; border-radius: 0; min-height: 100%;
                           display: flex; flex-direction: column; }
  .dialog .koerper { max-height: none; flex: 1; }
  .dialog .fuss { position: sticky; bottom: 0; padding-bottom: max(13px, env(safe-area-inset-bottom)); }
  .umzug-band { padding: 10px 12px; }
  /* Kalender: alle 7 Tage passen aufs iPhone, Termine werden knapper */
  .kal-kopf { flex-wrap: wrap; }
  .kal-kopf .monat { min-width: 0; }
  .kalender .wtag { padding: 5px 2px; font-size: 10px; text-align: center; letter-spacing: 0; }
  .tag { min-height: 70px; padding: 3px 2px 4px; gap: 2px; }
  .tag .nr { font-size: 11px; }
  .tag .nr b { font-size: 9.5px; }
  .termin { font-size: 9.5px; padding: 1px 3px; border-left-width: 2px; }
  #meldungen { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .meldung { max-width: none; }
}
