/* ausgelagerte Styles von ausgabe.php */
:root{ --g-col-left:3rem; --g-col-right:3rem; --g-row-h:2.5rem; --light-blue:#d6ecff; }
html,body{height:100%;margin:0;font-family:Arial,Helvetica,sans-serif; background:var(--light-blue);} /* Seite hellblau */

/* Grid auf 3 Spalten (linke Leiste, Mitte, rechte Leiste) */
.grid{
  position: relative; /* für absolute/stacking children */
  display:grid;
  grid-template-columns: var(--g-col-left) 1fr var(--g-col-right); /* 3 Spalten */
  /* Zeile 1 passt sich maximal der tatsächlichen Header-Höhe an (min-content),
     Zeile 2 jetzt variabel über --g-row-h, Mitte flexibel, Footer auto */
  grid-template-rows: min-content var(--g-row-h) 1fr auto;
  gap:0; /* KEINE Lücken mehr zwischen den Grid-Reihen */
  height:100vh;
}

/* hellblauer Farbwert */
:root { --light-blue: #d6ecff; }

/* färbe Zeilen 1,2 und 4 hellblau */
.grid-header,
.grid-select,
.grid-footer {
  background: var(--light-blue);
  z-index: 2; /* über den Spaltenstreifen */
}

/* Erzeuge feste Hellblau-Streifen in Spalte 1 und 3 */
.col-left,
.col-right {
  grid-row: 1 / -1; /* über alle Zeilen */
  background: var(--light-blue);
  z-index: 0; /* hinter Inhalten */
  pointer-events: none;
}
.col-left { grid-column: 1; }
.col-right { grid-column: 3; }

/* Zellen sichtbar nummeriert (a1..e3) */
.cell{display:flex;align-items:center;justify-content:center;color:#084; font-weight:700; font-size:.9rem; pointer-events:none; opacity:.08}
.cell.small{opacity:.04;font-size:.8rem}

.grid-header{
  grid-column:1 / -1;
  grid-row:1;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--light-blue); /* geändert: hellblau */
  z-index:2;
  max-height: var(--g-row-h); /* schmaler, passend zur Variable */
  overflow: hidden;
  padding: 0.2rem; /* kleineres Padding, Header bleibt schlank */
}
.grid-header h1{margin:0;font-size:1.25rem}

.grid-select{grid-column:1 / -1; grid-row:2; display:flex;align-items:center;justify-content:center; z-index:2}

/* Mitte nur Spalte 2 (zweite Spalte) */
.grid-center{grid-column:2; grid-row:3; position:relative; overflow:auto; padding:1rem; z-index:3; background:#fff;} /* Mitte weiß, Ränder hellblau */
.grid-center img{max-width:100%;height:auto; display:block}
textarea.pos{
  width:100%;
  box-sizing:border-box;
  font-family:Arial;
  font-size:1.1rem;
  font-weight:700;
  background:transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding:.5rem;
  resize: none;      /* verhindert Größenänderung durch Benutzer */
  overflow: auto;    /* bei Überlauf scrollbar, bleibt aber fix in Größe */
}

/* Footer: Zeile 4 über alle 3 Spalten, Inhalt mittig */
.grid-footer{
  grid-column:1 / -1;
  grid-row:4;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--light-blue); /* geändert: hellblau */
  z-index:2;
  border-top:1px solid rgba(0,0,0,.06);
  padding: 0.4rem; /* kleineres Padding, Footer-Zeile bleibt schlank */
  height: auto;
  overflow: visible;
}
.grid-footer h1{margin:0;font-size:1.25rem}

.grid-bottom{display:none;} /* kein zusätzlicher weißer Bereich unten */

/* Hilfsklassen für die Zellen (3 Spalten) - korrigierte Syntax */
.a1 { grid-column: 1; grid-row: 1; }
.a2 { grid-column: 2; grid-row: 1; }
.a3 { grid-column: 3; grid-row: 1; }

.b1 { grid-column: 1; grid-row: 2; }
.b2 { grid-column: 2; grid-row: 2; }
.b3 { grid-column: 3; grid-row: 2; }

.c1 { grid-column: 1; grid-row: 3; }
.c2 { grid-column: 2; grid-row: 3; }
.c3 { grid-column: 3; grid-row: 3; }

.d1 { grid-column: 1; grid-row: 4; }
.d2 { grid-column: 2; grid-row: 4; }
.d3 { grid-column: 3; grid-row: 4; }

.e1 { grid-column: 1; grid-row: 5; }
.e2 { grid-column: 2; grid-row: 5; }
.e3 { grid-column: 3; grid-row: 5; }

/* Größeres, fettes Select in der Select-Area */
.grid-select select#row-select,
.grid-select select#row-select:focus {
  font-size: 1.25rem;   /* gewünschte Schriftgröße anpassen */
  font-weight: 700;     /* fett */
  padding: .45rem .6rem;
  line-height: 1.2;
  min-height: 2.2em;
  border-radius: 6px;
}

/* Versuch, Platzhalter-Option hervorzuheben (nicht in allen Browsern sichtbar) */
.grid-select select#row-select option.placeholder {
  font-weight: 700;
  font-size: 1.25rem;
}

/* Grundannahme: 1rem = 16px */
/* Gerätegruppen (max-width in rem) */
/* 320px  = 20rem  -> kleine Phones (z. B. iPhone SE, alte Modelle) */
/* 360px  = 22.5rem -> viele Android Phones (Samsung Galaxy S-Reihe) */
/* 375px  = 23.4375rem -> iPhone 6/7/8/SE(2)/X/11 Pro (Portrait) */
/* 400px  = 25rem  -> breitere Phones / kleine Phablets */
/* 480px  = 30rem  -> große Phones, kleine Tablets im Portrait */
/* 768px  = 48rem  -> iPad Portrait */
/* 1024px = 64rem  -> iPad Landscape / kleine Laptops */
/* 1440px = 90rem  -> große Desktops */

@media screen and (max-width: 20rem) { /* ≤320px - sehr kleine Phones */
  /* Beispiel: vereinfachtes Layout, größere Touch‑Targets */
  body { font-size: 0.95rem; }
  .nav { display: none; }
}

@media screen and (max-width: 22.5rem) { /* ≤360px - viele Android Phones (Galaxy S) */
  /* Anpassungen für schmalere Bildschirme */
  .container { padding: 0 0.5rem; }
  .card { grid-template-columns: 1fr; }
}

@media screen and (max-width: 23.4375rem) { /* ≤375px - iPhones */
  /* iPhone-spezifische Feinheiten (Portrait) */
  .hero { height: 32rem; background-position: center top; }
}

@media screen and (max-width: 25rem) { /* ≤400px - breitere Phones */
  /* ggf. Schrift- und Abstandsanpassungen */
  h1 { font-size: 1.25rem; }
}

@media screen and (max-width: 30rem) { /* ≤480px - große Phones / kleine Tablets */
  /* responsive Grid / Navigation */
  .grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 48rem) { /* ≤768px - iPad Portrait */
  /* Tablet-spezifische Layouts */
  .sidebar { display: none; }
  .main { width: 100%; padding: 1rem; }
}

@media screen and (max-width: 64rem) { /* ≤1024px - iPad Landscape / kleine Laptops */
  /* Layoutanpassungen für mittlere Bildschirme */
  .container { max-width: 90%; }
}

@media screen and (max-width: 90rem) { /* ≤1440px - große Desktops */
  /* Feinere Anpassungen für große Viewports */
  .content { max-width: 1200px; margin: 0 auto; }
}

/* -------------------------
   Compact / Slim Buttons
   gelten immer (Desktop + Mobile)
   ------------------------- */
/* kompaktere Buttons - noch kleiner */
.btn,
button,
input[type="button"],
input[type="submit"],
a[role="button"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: .15rem .35rem !important; /* weniger Innenabstand */
  font-size: .85rem !important;
  line-height: 1 !important;
  min-height: 1.6rem !important;
  height: auto !important;
  border-radius: 3px !important;
  border-width: 1px !important;
  gap: .15rem !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

/* Select- und Suchfelder an Button-Größe angleichen */
.grid-select select,
.grid-select input[type="search"],
.grid-select input[type="text"],
.grid-select select#row-select {
  padding: .18rem .35rem !important;
  font-size: .85rem !important;
  line-height: 1 !important;
  min-height: 1.6rem !important;
  height: auto !important;
  border-radius: 3px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

/* starke Regel für Buttons im Select-Bereich (überschreibt Inline-Stile) */
.grid-select a[role="button"],
.grid-select a,
.grid-select .btn {
  padding: .15rem .35rem !important;
  font-size: .85rem !important;
  border-radius: 3px !important;
  margin: 0 !important;
}

/* Icon-Buttons noch kompakter */
.btn.icon,
button.icon {
  padding: .12rem !important;
  min-width: 1.6rem !important;
  width: auto !important;
}

/* Gruppierte Buttons: minimaler Horizontal-Abstand */
.btn-group > * { margin: 0 .2rem 0 0 !important; }

/* Form-Felder global leicht kleiner */
input[type="text"],
input[type="search"],
select {
  padding: .2rem .35rem !important;
  font-size: .85rem !important;
  box-sizing: border-box !important;
}

/* Mobile: Touch-Ziele leicht größer, aber kompakt bleiben */
@media (max-width: 600px) {
  .btn,
  a[role="button"],
  .grid-select .btn,
  .grid-select select,
  .grid-select input[type="search"] {
    padding: .25rem .4rem !important;
    font-size: .95rem !important;
    min-height: 2.2rem !important;
  }
}

/* Explizite Anpassung für den "zurück zu MEINE KINDERWELT"-Link in .grid-select
   überschreibt Inline‑Styles und macht ihn kompakt */
.grid-select a[role="button"],
.grid-select a[href="index.php"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: .15rem .35rem !important;
  font-size: .85rem !important;
  line-height: 1 !important;
  min-height: 1.6rem !important;
  margin: 0 !important;
  border-radius: 3px !important;
  border: 1px solid #888 !important; /* behalte bisherigen Rahmenfarbe */
  background: #f0f0f0 !important;     /* behalte bisherigen Hintergrund */
  color: #000 !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
}

/* Falls zusätzliche Inline-Margen gesetzt sind, zwingend entfernen */
.grid-select a[role="button"][style],
.grid-select a[href="index.php"][style] {
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  padding-left: .35rem !important;
  padding-right: .35rem !important;
}