/* ----------------------------------------------------------- *
 * Klassenraum-App — iOS-9-kompatibles Stylesheet
 *
 * Bewusst ohne CSS Custom Properties, CSS Grid, flex-gap,
 * feste Klebe-Positionen, inset oder neue CSS-Funktionen. Das iPad im Kurssaal
 * laeuft noch mit iOS 9 / Mobile Safari.
 * ----------------------------------------------------------- */

* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #5b1313;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select {
  font-family: inherit;
  font-size: 1rem;
}

button,
a,
.roster-row,
#guest-search-results .result {
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.18);
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.topbar h1 {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0.8rem;
}

.nav-arrow {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 300;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
}
.nav-arrow:active { background: rgba(255, 255, 255, 0.08); }

/* ---------------- Day list ---------------- */
.day-list {
  padding: 1rem;
}

.day-session {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  min-height: 56px;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: #ffffff;
}
.day-session:active { background: rgba(255, 255, 255, 0.13); }

.day-session .time {
  font-size: 1.1rem;
  font-weight: 600;
  width: 5rem;
  min-width: 5rem;
}

.day-session .group {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  font-size: 1rem;
  min-width: 0;
  padding-right: 0.75rem;
}

.day-session .group .designation,
.day-session .group .staffing {
  display: block;
  color: rgba(255, 255, 255, 0.67);
  margin-top: 0.18rem;
}
.day-session .group .designation { font-size: 0.85rem; }
.day-session .group .staffing { font-size: 0.8rem; }

.day-session .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.67);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.day-session .badge.confirmed { background: #5fd17a; color: #003a18; }
.day-session .badge.running { background: #f4ad42; color: #4a2900; }
.day-session .badge.past { background: rgba(255, 255, 255, 0.13); color: rgba(255, 255, 255, 0.67); }
.day-session .badge.upcoming { background: transparent; border: 1px solid rgba(255, 255, 255, 0.13); }

/* ---------------- Session detail ---------------- */
.session-meta {
  padding: 0.5rem 1rem 0.75rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.95rem;
}

.session-meta .session-team {
  margin-top: 0.4rem;
  text-align: center;
}

.session-meta .team-chip {
  display: inline-block;
  margin: 0.16rem 0.12rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.8rem;
}
.session-meta .team-chip span { color: rgba(255, 255, 255, 0.67); }

.staffing-card {
  margin: 0.25rem 1rem 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
}

.staffing-card-header {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.staffing-card-header > div {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  padding-right: 0.75rem;
}
.staffing-card h2 {
  margin: 0.1rem 0 0.2rem;
  font-size: 1rem;
}
.staffing-card .muted {
  margin: 0;
  font-size: 0.85rem;
}
.section-eyebrow {
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-staffing-grid,
.modal .staffing-grid {
  border: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.session-staffing-grid label,
.modal .staffing-grid > label {
  display: block;
  float: left;
  width: 50%;
  padding: 0 0.38rem 0.75rem;
}
.session-staffing-grid label:nth-child(2n+1),
.modal .staffing-grid > label:nth-child(2n+1) {
  clear: left;
}
.session-staffing-grid label > span,
.modal .staffing-grid > label > span {
  display: block;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}
.session-staffing-grid select,
.modal select,
.modal input[type="password"],
.modal input[type="text"] {
  width: 100%;
  padding: 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #6e1818;
  color: #ffffff;
  font-size: 0.95rem;
}
.session-staffing-grid select:disabled { opacity: 0.65; }

.staffing-save-status {
  clear: both;
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.85rem;
}
.staffing-save-status.dirty { color: #f4ad42; }
.staffing-save-status.error { color: #f08585; }

/* ---------------- Guest search ---------------- */
.add-guest-bar {
  position: relative;
  padding: 0.5rem 1rem 1rem;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
}
.add-guest-bar input {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1rem;
  min-width: 0;
}
.add-guest-bar input::-webkit-input-placeholder { color: rgba(255, 255, 255, 0.67); }
.add-guest-bar input::placeholder { color: rgba(255, 255, 255, 0.67); }
.add-guest-bar input:focus { outline: 2px solid #ffffff; }
#guest-search-clear {
  width: 56px;
  margin-left: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 1.4rem;
  cursor: pointer;
}
#guest-search-results {
  position: absolute;
  top: 100%;
  left: 1rem;
  right: 1rem;
  background: #6e1818;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  max-height: 60%;
  overflow-y: auto;
  z-index: 10;
}
#guest-search-results:empty { display: none; }
#guest-search-results .result {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  cursor: pointer;
  min-height: 56px;
}
#guest-search-results .result:last-child { border-bottom: none; }
#guest-search-results .result:active { background: rgba(255, 255, 255, 0.13); }

/* ---------------- Roster ---------------- */
.roster { padding: 0 1rem; }
.roster-row {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  cursor: pointer;
  min-height: 56px;
}
.roster-row .marker {
  width: 2.4rem;
  height: 2.4rem;
  line-height: 2.4rem;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  -webkit-box-flex: 0;
  -webkit-flex: 0 0 2.4rem;
  flex: 0 0 2.4rem;
}
.roster-row.absent .marker { color: rgba(255, 255, 255, 0.67); }
.roster-row.present .marker { color: #ffffff; }
.roster-row .name {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  font-size: 1.05rem;
  padding: 0 1rem;
}
.roster-row .meta {
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.8rem;
  white-space: nowrap;
}
.roster-row.scan .meta { color: #5fd17a; }

/* ---------------- Guests section ---------------- */
.guests-section {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  margin-top: 1rem;
}
.guests-section h2 {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.67);
  margin: 0 0 0.5rem;
}
.guests-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.guests-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}
.guests-list li:last-child { border-bottom: none; }
.guests-list .guest-couple-group {
  list-style: none;
  padding: 0;
  border-bottom: 0;
}
.guest-couple-group .guest-row {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  padding: 0.44rem 0.35rem;
  min-height: 42px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.guest-couple-group .guest-row:last-child { border-bottom: none; }
.guest-couple-group .guest-name {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  font-size: 0.95rem;
  padding-right: 0.55rem;
}
.guest-couple-group .guest-meta {
  white-space: nowrap;
}

/* ---------------- Confirm button ---------------- */
.confirm-button {
  display: block;
  margin: 1.5rem 1rem 1.2rem;
  width: -webkit-calc(100% - 2rem);
  width: calc(100% - 2rem);
  padding: 1.1rem;
  background: #ffffff;
  color: #5b1313;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.confirm-button:active { -webkit-transform: translateY(1px); transform: translateY(1px); }
.confirm-button.disabled { opacity: 0.5; pointer-events: none; }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #5b1313;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  padding: 1.5rem;
  width: 420px;
  max-width: 100%;
  margin: 0 auto;
}
.modal h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 700;
}
.modal .staffing-grid {
  margin: 1rem -0.38rem 0.25rem;
}
.pin-label,
.pin-teacher-label {
  display: block;
  margin-top: 0.75rem;
}
.pin-label > span,
.pin-teacher-label > span {
  display: block;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}
.checkbox-label {
  display: block;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}
.modal-actions {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  margin-top: 1rem;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
}
.modal-actions .btn-primary { margin-left: 0.75rem; }

.btn-primary,
.btn-secondary {
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: #ffffff;
  color: #5b1313;
  border: none;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.error-banner {
  background: #f08585;
  color: #4a0000;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.muted { color: rgba(255, 255, 255, 0.67); }
.center { text-align: center; }

/* ---------------- Bottom actions ---------------- */
.bottom-actions {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  margin-top: 2rem;
}
.btn-link {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.inline-form { display: inline; }

/* ---------------- Setup screen ---------------- */
.setup-body {
  padding: 2rem 1rem;
}
.setup-card {
  width: 440px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  padding: 2rem;
  margin: 0 auto;
}
.setup-card h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}
.setup-card form.stack {
  margin-top: 1rem;
}
.setup-card label {
  display: block;
  margin-bottom: 0.85rem;
}
.setup-card label > span {
  display: block;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.setup-card input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1rem;
}
.setup-card .btn-primary {
  width: 100%;
  margin-top: 0.2rem;
}

@media (max-width: 520px) {
  .topbar h1 { font-size: 1.05rem; margin: 0 0.4rem; }
  .nav-arrow { width: 48px; height: 48px; }
  .day-session { padding: 1rem 0.75rem; }
  .day-session .time { width: 4.2rem; min-width: 4.2rem; font-size: 1rem; }
  .day-session .badge { display: none; }
  .session-staffing-grid label,
  .modal .staffing-grid > label {
    float: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
  .staffing-card-header {
    display: block;
  }
  .staffing-card-header > div { padding-right: 0; margin-bottom: 0.75rem; }
  .staffing-card-header .btn-secondary,
  #staffing-save { width: 100%; }
}

/* ---------------- v800 Compact classroom refinements ---------------- */
.view-session {
  padding-bottom: 6rem;
}

.compact-topbar {
  padding: 0.45rem 0.6rem;
}
.compact-topbar h1 {
  font-size: 1.02rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.15;
}
.compact-topbar .nav-arrow {
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
}

.quick-nav {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.quick-btn {
  display: block;
  padding: 0.45rem 0.62rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.86rem;
  white-space: nowrap;
}
.quick-btn:active { background: rgba(255, 255, 255, 0.18); }
.quick-btn.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.compact-list {
  padding: 0.55rem 0.6rem;
}
.compact-day-session,
.day-session.compact-day-session,
.week-session.compact-day-session {
  padding: 0.58rem 0.62rem;
  min-height: 44px;
  margin-bottom: 0.42rem;
  border-radius: 8px;
}
.compact-day-session .time,
.day-session.compact-day-session .time,
.week-session.compact-day-session .time {
  width: 3.85rem;
  min-width: 3.85rem;
  font-size: 0.95rem;
}
.compact-day-session .group,
.day-session.compact-day-session .group,
.week-session.compact-day-session .group {
  font-size: 0.92rem;
  padding-right: 0.45rem;
}
.compact-day-session .group .designation,
.compact-day-session .group .staffing {
  font-size: 0.77rem;
  line-height: 1.15;
}
.compact-day-session .badge {
  padding: 0.18rem 0.42rem;
  font-size: 0.68rem;
}

.week-day {
  margin-bottom: 0.75rem;
}
.week-day h2 {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.67);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.week-session {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  text-decoration: none;
  color: #ffffff;
}

.compact-session-meta {
  padding: 0.32rem 0.6rem 0.42rem;
  font-size: 0.84rem;
}
.compact-session-meta .team-chip {
  margin: 0.08rem 0.06rem;
  padding: 0.12rem 0.36rem;
  font-size: 0.7rem;
}
.session-quick-nav {
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
}
.compact-guest-bar {
  padding: 0.45rem 0.6rem 0.55rem;
}
.compact-guest-bar input {
  padding: 0.58rem 0.72rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.compact-guest-bar #guest-search-clear,
#guest-search-clear {
  width: 44px;
  border-radius: 8px;
}

.compact-roster {
  padding: 0 0.6rem;
}
.compact-roster .roster-row,
.roster-row {
  padding: 0.44rem 0.35rem;
  min-height: 42px;
}
.compact-roster .roster-row .marker,
.roster-row .marker {
  width: 1.9rem;
  height: 1.9rem;
  line-height: 1.9rem;
  -webkit-box-flex: 0;
  -webkit-flex: 0 0 1.9rem;
  flex: 0 0 1.9rem;
  font-size: 1.28rem;
}
.compact-roster .roster-row .name,
.roster-row .name {
  font-size: 0.95rem;
  padding: 0 0.55rem;
}
.compact-roster .roster-row .meta,
.roster-row .meta {
  font-size: 0.72rem;
}

.couple-group {
  margin: 0 0 0.36rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
}
.couple-group .roster-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  margin: 0;
}
.couple-group .roster-row:last-child { border-bottom: none; }
.couple-group.single {
  border-style: dashed;
}

.compact-confirm-button {
  margin: 0.7rem 0.6rem 1rem;
  width: -webkit-calc(100% - 1.2rem);
  width: calc(100% - 1.2rem);
  padding: 0.82rem;
  border-radius: 8px;
  font-size: 0.98rem;
}

.staffing-bottom-drawer {
  position: fixed;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.55rem;
  z-index: 60;
  margin: 0;
  padding: 0.62rem;
  border-radius: 12px;
  background: #6e1818;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}
.staffing-bottom-drawer .staffing-card-header {
  margin-bottom: 0;
  cursor: pointer;
}
.staffing-bottom-drawer .staffing-card-header h2 {
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staffing-bottom-drawer .staffing-card-header .muted {
  font-size: 0.72rem;
}
.staffing-bottom-drawer .section-eyebrow {
  font-size: 0.64rem;
}
.staffing-bottom-drawer #staffing-toggle-button {
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
}
.staffing-drawer-body {
  padding-top: 0.62rem;
  overflow: hidden;
}
.staffing-bottom-drawer.collapsed .staffing-drawer-body {
  display: none;
}
.staffing-bottom-drawer .session-staffing-grid label {
  padding-bottom: 0.48rem;
}
.staffing-bottom-drawer .session-staffing-grid select {
  padding: 0.52rem;
  font-size: 0.86rem;
}
.staffing-bottom-drawer #staffing-save {
  display: block;
  clear: both;
  width: 100%;
  padding: 0.62rem;
  font-size: 0.9rem;
}
.staffing-bottom-drawer .staffing-save-status {
  min-height: 0.9rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.compact-bottom-actions {
  padding: 0.6rem;
  margin-top: 0.8rem;
}

@media (max-width: 520px) {
  .quick-nav { padding-left: 0.45rem; padding-right: 0.45rem; }
  .quick-btn { font-size: 0.8rem; padding-left: 0.5rem; padding-right: 0.5rem; }
  .compact-day-session .badge { display: none; }
  .staffing-bottom-drawer { left: 0.35rem; right: 0.35rem; bottom: 0.35rem; }
  .view-session { padding-bottom: 5.7rem; }
}

/* ---------------- Auto refresh ---------------- */
.auto-refresh-status {
  margin: 0.15rem 1rem 5.5rem 1rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  text-align: center;
}
.auto-refresh-status.error {
  background: rgba(255, 105, 105, 0.16);
  color: #ffd0d0;
}

/* v813: lesbarer Abstand zwischen Kurs-/Workshop-Handle und Titel in kompakten Listen. */
.compact-day-session .group .designation {
  display: inline-block;
  margin-left: 0.4rem;
}

.compact-day-session .group .staffing {
  margin-left: 0;
}

/* v820: mehrere Suchtreffer im Hinzufügen-Feld klar und schnell auswählbar. */
.add-guest-bar {
  z-index: 80;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
}
#guest-search-results {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  -webkit-box-flex: 0;
  -webkit-flex: 0 0 100%;
  flex: 0 0 100%;
  width: 100%;
  margin-top: 0.45rem;
  max-height: 21rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}
#guest-search-results:not(:empty) {
  min-height: 9rem;
}
#guest-search-results .result-info {
  padding: 0.55rem 0.75rem;
  color: rgba(255, 255, 255, 0.70);
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(0, 0, 0, 0.10);
}
#guest-search-results .addable-result {
  display: block;
  position: relative;
  padding-right: 4.2rem;
}
#guest-search-results .result-name {
  display: block;
  font-size: 0.98rem;
}
#guest-search-results .result-meta {
  display: block;
  margin-top: 0.16rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
}
#guest-search-results .result-action {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  margin-top: -0.85rem;
  width: 2.2rem;
  height: 1.7rem;
  line-height: 1.7rem;
  text-align: center;
  border-radius: 999px;
  background: #5fd17a;
  color: #003a18;
  font-weight: 700;
  font-size: 1.05rem;
}

.guests-list li span:first-child { display: inline-block; }
.guest-meta { display: inline-block; margin-left: 0.55em; color: rgba(255, 255, 255, 0.58); font-size: 0.85em; }

/* v832: Gäste/Nachholer aus konkreter Kursteilnahme entfernen */
.guest-content {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  width: 100%;
}
.guest-main {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  min-width: 0;
  padding-right: 0.55rem;
}
.guest-main .guest-name,
.guest-main > span:first-child {
  display: block;
}
.guest-main .guest-meta {
  display: block;
  margin-left: 0;
  margin-top: 0.12rem;
}
.guest-remove-button {
  -webkit-box-flex: 0;
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 999px;
  padding: 0.42rem 0.62rem;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
  font-size: 0.82rem;
  font-weight: 600;
}
.guest-remove-button:active {
  background: rgba(255, 255, 255, 0.24);
}

/* v849: kompakte Anwesenheitszaehler fuer die laufende Stunde. */
.attendance-counts {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  padding: 0.12rem 0.6rem 0.34rem;
  margin: 0;
}
.attendance-count-card {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  min-width: 0;
  padding: 0.42rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  text-align: center;
}
.attendance-count-card + .attendance-count-card {
  margin-left: 0.45rem;
}
.attendance-count-label {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attendance-count-card strong {
  display: block;
  font-size: 1.32rem;
  line-height: 1.1;
  margin-top: 0.08rem;
}
.attendance-count-card small {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
  line-height: 1.15;
  margin-top: 0.06rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.present-count strong { color: #5fd17a; }
.absent-count strong { color: #f4ad42; }

@media (max-width: 420px) {
  .attendance-counts { padding-left: 0.45rem; padding-right: 0.45rem; }
  .attendance-count-card { padding-left: 0.35rem; padding-right: 0.35rem; }
  .attendance-count-card + .attendance-count-card { margin-left: 0.32rem; }
  .attendance-count-label { font-size: 0.62rem; }
  .attendance-count-card small { font-size: 0.64rem; }
}
