/* Belegungsplan-Modul (Prototyp v2) – Layout richtet sich nach der Breite des Containers, nicht des Fensters. */
.tpb{--tpb-busy:#fdecc8;--tpb-busy-b:#e0a100;--tpb-text:#e3effc;--tpb-text-b:#2271b1;--tpb-free:#eef6ee;--tpb-line:#d6d9dd;--tpb-today:#2271b1;container-type:inline-size;container-name:tpb;width:100%!important;max-width:100%!important;margin:.5em 0 1.5em!important;padding:0!important;font-size:18px;line-height:1.45;text-align:left}
.tpb *,.tpb *::before,.tpb *::after{box-sizing:border-box}
.tpb-title{margin:0 0 .6em}
.tpb-nav{display:flex;align-items:center;gap:8px;margin:0 0 8px}
.tpb-nav--sub{margin-bottom:14px;flex-wrap:wrap}
.tpb-period{flex:1 1 auto;font-weight:700;text-align:center;min-width:0}
.tpb p,.tpb ul{margin-top:0}
.tpb a.tpb-btn{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;padding:10px 16px;min-height:44px;border-radius:6px;border:1px solid var(--tpb-today);background:var(--tpb-today);color:#fff!important;text-decoration:none!important;font-weight:400!important;font-size:.95em;line-height:1.2;white-space:nowrap}
.tpb a.tpb-btn:hover,.tpb a.tpb-btn:focus{opacity:.88;color:#fff!important;text-decoration:none!important}
.tpb a.tpb-btn--ghost{background:#fff;color:var(--tpb-today)!important}
.tpb a.tpb-btn--ghost:hover,.tpb a.tpb-btn--ghost:focus{color:var(--tpb-today)!important;background:#eef4fa;opacity:1}
.tpb-week,.tpb-month{display:grid;gap:8px}
.tpb-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}
.tpb-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.tpb-day,.tpb-cell{color:#1d2327;border:1px solid var(--tpb-line);border-radius:8px;padding:8px;background:var(--tpb-free);min-height:84px}
.tpb-day--busy{background:#fff}
.tpb-day--today{outline:2px solid var(--tpb-today);outline-offset:-1px}
.tpb-day-h{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;font-weight:700;margin:0 0 6px;font-size:1.05em}
.tpb-dn{margin:0}
.tpb-dd{color:#50575e;font-weight:400}
.tpb-free{margin:0;color:#2e7d32;font-size:.9em}
.tpb .tpb-items{list-style:none!important;margin:0!important;padding:0!important}
.tpb .tpb-item{list-style:none!important;margin:0 0 6px!important;padding:6px 8px!important;border-left:4px solid var(--tpb-busy-b);background:var(--tpb-busy);border-radius:4px;font-size:.95em;line-height:1.35}
.tpb .tpb-item::marker{content:""}
.tpb .tpb-item--text{border-left-color:var(--tpb-text-b);background:var(--tpb-text)}
.tpb-time{display:block;font-weight:700;white-space:nowrap}
.tpb-label{display:block;overflow-wrap:anywhere}
.tpb-mh{font-weight:700;text-align:center;padding:4px 0}
.tpb-cell{min-height:72px;padding:6px}
.tpb-cell--out{opacity:.45;background:#f6f7f7}
.tpb-cn{display:block;font-weight:700;margin-bottom:4px}
.tpb-cn-full{display:none;font-weight:700;white-space:nowrap}
.tpb-cell .tpb-item{font-size:.85em;padding:4px 6px!important}
.tpb-legend{margin:12px 0 0;font-size:.95em;opacity:.9}
.tpb-dot{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:-1px;margin:0 4px 0 12px}
.tpb-dot:first-child{margin-left:0}
.tpb-dot--busy{background:var(--tpb-busy);border:1px solid var(--tpb-busy-b)}
.tpb-dot--free{background:var(--tpb-free);border:1px solid var(--tpb-line)}

/* Schmaler Container (< 900px): Tage untereinander, Einträge nebeneinander */
@container tpb (max-width: 899px){
  .tpb-week,.tpb-month,.tpb-cols-7,.tpb-cols-5{grid-template-columns:1fr}
  .tpb-day{display:grid;grid-template-columns:104px minmax(0,1fr);gap:4px 12px;align-items:start;min-height:0;padding:10px}
  .tpb-day-h{margin:2px 0 0}
  .tpb-day .tpb-free{align-self:center}
  .tpb-day .tpb-items,.tpb-cell .tpb-items{display:flex!important;flex-wrap:wrap;gap:6px}
  .tpb .tpb-item{margin:0!important;min-width:170px}
  .tpb-mh{display:none}
  .tpb-cell{display:grid;grid-template-columns:104px minmax(0,1fr);gap:4px 12px;align-items:start;min-height:0;padding:10px}
  .tpb-cell:not(.tpb-day--busy),.tpb-cell--out{display:none}
  .tpb-cn{display:none}
  .tpb-cn-full{display:block;margin:2px 0 0}
  .tpb-cell .tpb-item{font-size:.95em}
}
/* Sehr schmal (< 480px): Pfeile ohne Text, Eintrag über volle Breite */
@container tpb (max-width: 479px){
  .tpb-btn-t{display:none}
  .tpb a.tpb-btn{padding:10px 18px;font-size:1.1em}
  .tpb-day,.tpb-cell{grid-template-columns:1fr}
  .tpb .tpb-item{flex:1 1 100%;min-width:0}
}

/* Bedienbarkeit / Barrierefreiheit */
.tpb a.tpb-btn:focus-visible{outline:3px solid #1d2327;outline-offset:2px}
.tpb-today-badge{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:10px;background:#2271b1;color:#fff;font-size:.75em;font-weight:700;vertical-align:1px}

/* Hochkontrast-Modus des Themes: Links wären sonst blau auf blau */
html.sb-high-contrast body .tpb .tpb-nav a.tpb-btn.tpb-btn{background:#000!important;color:#fff!important;border:2px solid #000!important;text-decoration:underline!important}
html.sb-high-contrast body .tpb .tpb-nav a.tpb-btn.tpb-btn--ghost{background:#fff!important;color:#000!important}
html.sb-high-contrast body .tpb .tpb-today-badge{background:#000;color:#fff}
html.sb-high-contrast body .tpb .tpb-day,html.sb-high-contrast body .tpb .tpb-cell{border:2px solid #000}

.tpb-empty{margin:0 0 12px;padding:10px 14px;background:#eef6ee;border:1px solid var(--tpb-line);border-radius:8px;color:#1d2327}
.tpb-dot--text{background:var(--tpb-text);border:1px solid var(--tpb-text-b)}
