/* ─── Exkursion Framework – Design-System (orientiert an Kratzdistel) ──────── */
:root {
  --green-dark:    #24481c;
  --green-forest:  #356b2e;
  --green-medium:  #52914a;
  --green-light:   #74bc60;
  --green-pale:    #e8f5e3;
  --green-ultra:   #f2f9ef;
  --earth:         #7a5c1e;
  --earth-light:   #a0803a;
  --earth-pale:    #f5edd8;
  --sky:           #3d7fa8;
  --sky-pale:      #e4f1f9;
  --amber:         #c48a0a;
  --amber-pale:    #fef3c7;
  --red:           #b83228;
  --red-pale:      #fde8e6;
  --purple:        #6d28d9;
  --purple-pale:   #f5f3ff;

  --bg:            #f4f1e8;
  --card:          #fffef8;
  --card-alt:      #f8f4ec;
  --border:        #d4c9b0;
  --border-light:  #e8e2d4;

  --text:          #1c1710;
  --text-2:        #4a3f2f;
  --text-muted:    #7a6e58;

  --radius:        10px;
  --radius-sm:     6px;
  --shadow-sm:     0 1px 4px rgba(20,16,8,.07);
  --shadow:        0 2px 10px rgba(20,16,8,.10);
  --shadow-lg:     0 5px 24px rgba(20,16,8,.14);

  --sidebar-bg:    #2a4a1f;
  --sidebar-active: rgba(106,173,87,.22);
  --sidebar-border: rgba(255,255,255,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ─── Utilities ──────────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.flex     { display: flex; }
.items-center { align-items: center; }
.gap-1    { gap: 8px; }
.gap-2    { gap: 16px; }
.w-full   { width: 100%; }
.text-muted { color: var(--text-muted); font-size: .875rem; }
.text-sm  { font-size: .875rem; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700;
}
.badge-green   { background: var(--green-pale); color: var(--green-forest); }
.badge-earth   { background: var(--earth-pale); color: var(--earth); }
.badge-amber   { background: var(--amber-pale); color: var(--amber); }
.badge-sky     { background: var(--sky-pale);   color: var(--sky); }
.badge-grey    { background: #e5e7eb; color: #374151; }
.badge-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-muted); }

.pts-chip {
  font-size: .72rem; font-weight: 800; color: var(--text-muted);
  background: var(--card-alt); border: 1px solid var(--border-light);
  padding: 2px 7px; border-radius: 12px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 8px; border: none;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: all .15s; text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--green-forest); color: #fff; }
.btn-primary:hover { background: var(--green-medium); transform: translateY(-1px); }
.btn-green { background: var(--green-medium); color: #fff; }
.btn-green:hover { background: var(--green-light); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--green-forest); border: 2px solid var(--green-forest); }
.btn-outline:hover { background: var(--green-pale); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--card-alt); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }
.btn-xs { padding: 3px 8px; font-size: .76rem; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 600; font-size: .88rem; color: var(--text-2); }
.form-group input,
.form-group textarea,
.form-group select {
  padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .9rem; font-family: inherit; background: var(--card);
  color: var(--text); transition: border-color .15s; resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--green-medium);
  box-shadow: 0 0 0 3px rgba(74,128,64,.12);
}
.form-hint { font-size: .78rem; color: var(--text-muted); }
.input-with-unit { display: flex; align-items: center; gap: 8px; }
.input-with-unit input { flex: 1; }
.input-unit { font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.messung-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px;
  border: 1px solid var(--border-light);
}
.card-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light); flex-wrap: wrap;
}
.card-header h3 { font-size: .95rem; font-weight: 700; display: flex; align-items: center; gap: 8px; flex: 1; }
.card + .card { margin-top: 14px; }

/* Card accordion collapse */
.card-body-acc.hidden { display: none; }
.card-collapse-btn {
  background: none; border: 1.5px solid rgba(0,0,0,.12); color: var(--text-muted);
  border-radius: 6px; width: 26px; height: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0; transition: all .15s; margin-left: auto;
}
.card-collapse-btn:hover { background: var(--card-alt); color: var(--text); }

/* ─── Auth Screen ────────────────────────────────────────────────────────────── */
#view-auth {
  min-height: 100vh;
  background: linear-gradient(145deg, #0f1e08 0%, #1a3011 40%, #2d5a27 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  position: relative;
}
.auth-container { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.auth-logo { text-align: center; margin-bottom: 10px; color: #fff; }
.auth-logo .logo-icon { font-size: 3.5rem; margin-bottom: 6px; display: block; }
.auth-logo h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.5px; }
.auth-logo p  { color: rgba(255,255,255,.65); font-size: .95rem; margin-top: 4px; }

/* Lehrkraft-Button oben rechts */
.teacher-corner-btn {
  position: fixed; top: 18px; right: 18px; z-index: 500;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.7); font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s; backdrop-filter: blur(4px);
}
.teacher-corner-btn:hover,
.teacher-corner-btn.active { background: rgba(255,255,255,.28); color: #fff; border-color: rgba(255,255,255,.5); }

/* Lehrkraft-Popover */
.teacher-popover {
  position: fixed; top: 68px; right: 18px; z-index: 500;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 300px; padding: 18px; border: 1px solid var(--border-light);
  animation: fadeSlideDown .18s ease;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.teacher-popover-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; color: var(--green-forest); font-weight: 800; font-size: .95rem;
}
.teacher-popover-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .9rem; padding: 2px 6px; border-radius: 4px;
}
.teacher-popover-close:hover { background: var(--card-alt); color: var(--text); }
.teacher-popover .form-group { margin-bottom: 12px; }

/* Login-Panel */
.auth-panel {
  background: var(--card); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-lg);
}
.auth-panel h2 { font-size: 1.1rem; margin-bottom: 18px; color: var(--green-forest); font-weight: 800; }
.auth-panel .form-group { margin-bottom: 14px; }
.auth-panel .btn { width: 100%; justify-content: center; margin-top: 6px; }
.auth-error {
  background: var(--red-pale); border: 1px solid #f6a39d; border-radius: 8px;
  padding: 9px 13px; color: var(--red); font-size: .875rem; margin-bottom: 10px;
}

/* «Neue Gruppe erstellen» Toggle-Button */
.neue-gruppe-toggle-btn {
  width: 100%; padding: 13px 20px;
  background: rgba(255,255,255,.08); border: 1.5px dashed rgba(255,255,255,.28);
  border-radius: var(--radius); color: rgba(255,255,255,.7);
  font-size: .9rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.neue-gruppe-toggle-btn:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.5); color: #fff; }
.neue-gruppe-toggle-btn.open  { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.45); color: #fff; border-style: solid; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* Einklappbares Register-Panel */
.register-collapse {
  overflow: hidden;
  max-height: 0;
  padding: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  transition: max-height .35s cubic-bezier(.4,0,.2,1), padding .25s;
}
.register-collapse.open {
  max-height: 700px;
  padding: 0;
}
.register-collapse .auth-panel-inner {
  padding: 22px 26px 26px;
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
}
.register-collapse h2 { border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }

.members-grid  { display: flex; flex-direction: column; gap: 7px; }
.member-row    { display: flex; align-items: center; gap: 8px; }
.member-num    {
  width: 24px; height: 24px; background: var(--green-pale); color: var(--green-forest);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800; flex-shrink: 0;
}

/* Session Info Banner (in Auth) */
.session-info-banner {
  background: var(--green-pale); border: 1.5px solid var(--green-light);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 10px;
}
.session-info-banner i { font-size: 1.2rem; color: var(--green-forest); margin-top: 2px; flex-shrink: 0; }
.session-info-banner .session-name { font-weight: 700; font-size: .9rem; color: var(--green-forest); }
.session-info-banner .session-meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ─── App Layout ──────────────────────────────────────────────────────────────── */
#view-app { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: 230px; background: var(--sidebar-bg); color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

/* Exkursion Info Block (NEU) */
.sidebar-exkursion {
  padding: 14px 16px; border-bottom: 1px solid var(--sidebar-border);
}
.exkursion-header {
  display: flex; align-items: flex-start; gap: 8px;
}
.exkursion-icon {
  font-size: 1.4rem; flex-shrink: 0; margin-top: 1px;
}
.exkursion-meta { flex: 1; min-width: 0; }
.exkursion-titel {
  font-size: .82rem; font-weight: 800; color: #fff; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.exkursion-sub {
  font-size: .68rem; color: rgba(255,255,255,.45); margin-top: 2px;
}
.exkursion-info-btn {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.3);
  color: #fff; font-size: .7rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s; margin-top: 1px;
  font-style: italic; font-family: Georgia, serif;
}
.exkursion-info-btn:hover { background: rgba(255,255,255,.35); }
.exkursion-info-btn.active { background: var(--green-medium); border-color: var(--green-light); }

/* Expandiertes Info-Panel */
.exkursion-info-panel {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--sidebar-border);
}
.info-section { margin-bottom: 10px; }
.info-section:last-child { margin-bottom: 0; }
.info-section-label {
  font-size: .62rem; font-weight: 800; letter-spacing: .10em;
  text-transform: uppercase; color: rgba(255,255,255,.38); margin-bottom: 5px;
}
.info-list {
  list-style: none; display: flex; flex-direction: column; gap: 4px;
}
.info-list li {
  font-size: .74rem; color: rgba(255,255,255,.72); line-height: 1.35;
  display: flex; align-items: flex-start; gap: 5px;
}
.info-list li::before {
  content: '▸'; color: var(--green-light); font-size: .65rem; margin-top: 2px; flex-shrink: 0;
}

/* Gruppen-Info */
.sidebar-group-info {
  padding: 10px 16px; background: rgba(106,173,87,.12);
  border-bottom: 1px solid var(--sidebar-border);
}
.group-name { font-weight: 700; font-size: .88rem; color: #a5d498; }
.members-editor {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center;
}
.member-chip-edit {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(255,255,255,.12); border-radius: 20px;
  padding: 2px 8px 2px 9px; font-size: .73rem; color: rgba(255,255,255,.85);
}
.member-chip-x {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: .85rem; line-height: 1; cursor: pointer; padding: 0 1px;
  margin-left: 1px;
}
.member-chip-x:hover { color: #f87171; }
.member-add-wrap { display: flex; align-items: center; }
.member-add-input {
  background: rgba(255,255,255,.1); border: 1px dashed rgba(255,255,255,.25);
  border-radius: 20px; color: #fff; font-size: .73rem;
  padding: 3px 10px; width: 90px; outline: none; font-family: inherit;
}
.member-add-input::placeholder { color: rgba(255,255,255,.35); }
.member-add-input:focus { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.15); }

/* Feedback Panel (nur wenn Lehrkraft bewertet hat) */
#grade-feedback-banner {
  margin: 10px 14px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: 10px 12px;
}
.grade-feedback-score { font-size: 1rem; font-weight: 800; color: #86efac; margin-bottom: 3px; }
.grade-feedback-comment { font-size: .73rem; color: rgba(255,255,255,.55); line-height: 1.4; }
.grade-endnote { font-size: .78rem; font-weight: 600; color: #a7f3d0; margin-top: 3px; }

/* Kapitel-Navigation */
.sidebar-nav  { padding: 8px 0; border-bottom: 1px solid var(--sidebar-border); }
.nav-section-label {
  font-size: .65rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.28);
  padding: 8px 16px 3px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; color: rgba(255,255,255,.6);
  cursor: pointer; transition: all .15s; font-size: .85rem;
  border-left: 3px solid transparent;
}
.nav-item:hover  { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; border-left-color: var(--green-light); }
.nav-icon  { font-size: .95rem; flex-shrink: 0; }
.nav-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2); background: transparent;
  margin-left: auto; flex-shrink: 0; transition: all .3s;
}
.nav-status-dot.in-progress { border-color: var(--amber); background: var(--amber); }
.nav-status-dot.complete    { border-color: var(--green-light); background: var(--green-light); }

/* Timer */
.sidebar-timer {
  padding: 10px 14px; border-bottom: 1px solid var(--sidebar-border);
  background: rgba(0,0,0,.12);
}
.timer-section-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.32); margin-bottom: 5px;
}
.timer-row  { display: flex; align-items: center; gap: 6px; }
.timer-display {
  font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.9); letter-spacing: .05em; flex: 1;
  font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
}
.timer-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.3);
  color: #fff; cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.timer-btn:hover  { background: rgba(255,255,255,.32); }
.timer-btn.running { background: rgba(106,173,87,.4); border-color: var(--green-light); }

/* Mini-Karte in Sidebar */
.sidebar-map-section {
  padding: 10px 14px; border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-map-mini {
  height: 90px; border-radius: 7px; overflow: hidden;
  border: 1.5px solid rgba(255,255,255,.18); margin-top: 6px;
  background: rgba(0,0,0,.2);
}

/* Sidebar Footer – Buttons */
.sidebar-footer {
  margin-top: auto; padding: 10px 14px;
  border-top: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-footer .btn {
  font-size: .78rem; padding: 8px 12px; justify-content: center;
  border-radius: 8px; font-weight: 600; transition: all .15s;
}
.sidebar-footer .btn-outline {
  background: transparent; border: 1.5px solid rgba(255,255,255,.3); color: rgba(255,255,255,.82);
}
.sidebar-footer .btn-outline:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }
.sidebar-footer .btn-green { background: var(--green-medium); border: 1.5px solid var(--green-light); color: #fff; }
.sidebar-footer .btn-green:hover { background: var(--green-light); }
.sidebar-footer .btn-ghost {
  background: transparent; border: 1.5px solid rgba(255,255,255,.18); color: rgba(255,255,255,.55);
}
.sidebar-footer .btn-ghost:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }

/* ─── Main Wrapper ───────────────────────────────────────────────────────────── */
.main-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Sticky App-Header */
.app-header {
  background: var(--card); border-bottom: 2px solid var(--border-light);
  padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
  height: 52px; flex-shrink: 0; position: sticky; top: 0; z-index: 100;
}
.kapitel-titel-text {
  font-size: 1rem; font-weight: 800; color: var(--green-dark); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Runder Theorie-Button (Glühbirne) */
.theory-round-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-pale); border: 1.5px solid var(--green-medium);
  color: var(--green-forest); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: all .2s;
}
.theory-round-btn:hover  { background: var(--green-medium); color: #fff; }
.theory-round-btn.active { background: var(--green-forest); color: #fff; border-color: var(--green-forest); }

/* Kapitel-Info Button (i) */
.kapitel-info-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--card-alt); border: 1.5px solid var(--border);
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: all .2s;
}
.kapitel-info-btn:hover  { background: var(--sky-pale); border-color: var(--sky); color: var(--sky); }
.kapitel-info-btn.active { background: var(--sky-pale); border-color: var(--sky); color: var(--sky); }

/* Kapitel-Info Panel */
.kapitel-info-panel {
  background: var(--card); border-bottom: 2px solid var(--border-light);
  padding: 14px 20px;
}
.kip-inner { display: flex; gap: 16px; align-items: stretch; }
.kip-section { display: flex; flex-direction: column; gap: 5px; }
.kip-ziel-col  { flex: 2; min-width: 0; }
.kip-timer-col { flex-shrink: 0; min-width: 130px; }
.kip-map-col   { flex: 1.5; min-width: 180px; }
.kip-divider   { width: 1px; background: var(--border-light); align-self: stretch; flex-shrink: 0; }

.kip-label {
  font-size: .66rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px; margin-bottom: 3px;
}
.kip-value { font-size: .87rem; color: var(--text-2); line-height: 1.5; }

/* Timer im Kapitel-Info Panel */
.kip-timer-big {
  font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--green-dark); font-family: 'SF Mono','Fira Mono','Consolas',monospace;
  letter-spacing: .03em; line-height: 1;
}
.kip-timer-btns { display: flex; gap: 6px; margin-top: 6px; }
.kip-ctrl-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 7px; cursor: pointer;
  font-family: inherit; font-size: .8rem; font-weight: 600; transition: all .15s;
  background: var(--green-pale); border: 1.5px solid var(--green-medium); color: var(--green-forest);
}
.kip-ctrl-btn:hover  { background: var(--green-medium); color: #fff; }
.kip-ctrl-btn.running { background: var(--green-forest); color: #fff; border-color: var(--green-dark); }
.kip-ctrl-ghost {
  background: var(--card-alt); border-color: var(--border); color: var(--text-muted);
  padding: 5px 8px;
}
.kip-ctrl-ghost:hover { background: var(--card-alt); color: var(--text); }

/* Karte im Kapitel-Info Panel */
.kip-map-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.kip-expand-btn {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--card-alt); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; transition: all .15s;
}
.kip-expand-btn:hover { background: var(--sky-pale); color: var(--sky); border-color: var(--sky); }
.kip-map-box { height: 150px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--border); }

/* Blinkende Marker auf der Karte */
.kip-blink-marker {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green-forest); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800;
  box-shadow: 0 0 0 0 rgba(53,107,46,.7);
  animation: kip-pulse 1.8s ease-out infinite;
}
@keyframes kip-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(53,107,46,.7); }
  60%  { box-shadow: 0 0 0 12px rgba(53,107,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,107,46,0); }
}
.kip-main-marker {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--red); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* Vollbild-Karten-Modal */
.kip-map-modal {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.kip-map-modal-inner {
  width: 100%; max-width: 960px; height: 80vh;
  background: var(--card); border-radius: 14px; overflow: hidden;
  position: relative; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.kip-map-modal-body { display: flex; flex: 1; min-height: 0; }
.kip-map-modal-text {
  width: 260px; flex-shrink: 0;
  padding: 48px 20px 20px;
  overflow-y: auto; border-right: 1px solid var(--border-light);
  background: var(--card); font-size: .88rem; color: var(--text-2); line-height: 1.6;
}
.kip-map-modal-text h3 {
  font-size: .95rem; font-weight: 800; color: var(--green-dark);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.kip-map-modal-text h3::before { content: '📍'; font-size: 1rem; }
.kip-map-modal-text p { margin-bottom: 10px; }
.kip-map-modal-text strong { color: var(--green-forest); }
.kip-map-modal-map  { flex: 1; min-width: 0; }
#kip-map-fullscreen { width: 100%; height: 100%; }
.kip-modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 3001;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--border);
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); font-size: .9rem;
}
.kip-modal-close:hover { background: var(--red-pale); color: var(--red); }

/* Kleine Karte: Klick-Cursor */
.kip-map-clickable { cursor: zoom-in; }

/* Scrollbarer Hauptbereich */
.main-content { flex: 1; overflow-y: auto; min-width: 0; }

/* ─── Theory Panel ───────────────────────────────────────────────────────────── */
.theory-panel {
  background: linear-gradient(135deg, var(--green-forest) 0%, var(--green-dark) 100%);
  color: #fff; padding: 0 28px; overflow: hidden;
  transition: max-height .4s ease, padding .3s ease;
  max-height: 0;
}
.theory-panel.open { max-height: 1200px; padding: 20px 28px; }
.theory-panel h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 12px; }

.theory-rich { display: flex; flex-direction: column; gap: 14px; }
.theory-section { }
.theory-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700;
  margin-bottom: 6px;
}
.theory-tag-green  { background: rgba(106,173,87,.3); color: #a5d498; }
.theory-tag-amber  { background: rgba(196,138,10,.3);  color: #fcd34d; }
.theory-tag-blue   { background: rgba(61,127,168,.3);  color: #93c5fd; }
.theory-tag-purple { background: rgba(109,40,217,.3);  color: #c4b5fd; }
.theory-section-h  { font-size: .88rem; font-weight: 700; color: #fff; margin-bottom: 5px; }
.theory-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.theory-table th { text-align: left; padding: 4px 8px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.7); font-weight: 700; }
.theory-table td { padding: 4px 8px; border-top: 1px solid rgba(255,255,255,.07); color: rgba(255,255,255,.8); }
.theory-callout {
  background: rgba(255,255,255,.08); border-radius: 8px; padding: 10px 12px;
  display: flex; align-items: flex-start; gap: 10px; font-size: .8rem;
  color: rgba(255,255,255,.85); line-height: 1.5;
}
.theory-callout i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ─── Kapitel-Ziel Panel ─────────────────────────────────────────────────────── */
.kapitel-ziel-panel {
  margin: 16px 24px; background: var(--green-ultra);
  border: 1.5px solid var(--green-light); border-radius: 10px; padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.kapitel-ziel-label {
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--green-forest); display: flex; align-items: center; gap: 5px;
  white-space: nowrap; margin-top: 1px;
}
.kapitel-ziel-text { font-size: .88rem; color: var(--text-2); line-height: 1.55; flex: 1; }

/* ─── Section Body (Zwei-Spalten-Layout wie Kratzdistel) ──────────────────────── */
.section-view { display: none; }
.section-view.active { display: flex; flex-direction: column; }

.section-body {
  display: grid; grid-template-columns: 5fr 7fr;
  flex: 1; min-height: 0;
}
.section-left {
  background: #eeeae0; border-right: 1px solid var(--border);
  padding: 18px; position: sticky; top: 52px; height: calc(100vh - 52px);
  overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
}
.section-right { padding: 18px 20px 86px; display: flex; flex-direction: column; gap: 14px; }

/* Info-Inhalte in section-left (typ: info) */
.info-left-content { font-size: .84rem; color: var(--text-2); line-height: 1.6; }
.info-left-content h3 { font-size: .85rem; font-weight: 800; color: var(--green-dark); margin: 10px 0 5px; }
.info-left-content h4 { font-size: .78rem; font-weight: 700; color: var(--text-muted); margin: 8px 0 3px; text-transform: uppercase; letter-spacing: .06em; }
.info-left-content p  { margin-bottom: 6px; }
.info-left-content ul, .info-left-content ol { margin: 4px 0 8px 16px; }
.info-left-content li { margin-bottom: 3px; }
.info-left-content strong { color: var(--text); }
.info-left-content svg { max-width: 100%; height: auto; }
.info-left-content table { width: 100%; border-collapse: collapse; font-size: .78rem; margin: 6px 0; }
.info-left-content th { text-align: left; padding: 4px 6px; background: var(--green-pale); color: var(--green-forest); font-weight: 700; border: 1px solid var(--border-light); }
.info-left-content td { padding: 4px 6px; border: 1px solid var(--border-light); }

/* Linke Seite: Vollbreite (kein rechtes Feld) */
.section-body.full-width { grid-template-columns: 1fr; }
.section-body.full-width .section-left { border-right: none; height: auto; position: static; }

/* ─── Foto-Upload / Kamera ───────────────────────────────────────────────────── */
.foto-area { display: flex; flex-direction: column; gap: 10px; }
.foto-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.foto-label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border: 1.5px dashed var(--border);
  border-radius: 8px; background: var(--card-alt); cursor: pointer;
  font-size: .85rem; font-weight: 600; color: var(--text-2); transition: all .15s;
}
.foto-label:hover { border-color: var(--sky); background: var(--sky-pale); color: var(--sky); }
.foto-preview {
  max-width: 100%; border-radius: 8px; border: 1.5px solid var(--border);
  object-fit: cover; display: block;
}

/* ─── Annotator (Bildbeschriftung, wie Kratzdistel) ──────────────────────────── */
.annotator-outer {
  position: relative; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--border); background: var(--card-alt);
  flex: 1; min-height: 260px;
}
.annotator-inner { width: 100%; height: 100%; transform-origin: center center; transition: transform .2s; }
.annotator-inner img { width: 100%; height: 100%; object-fit: contain; display: block; }
.annotator-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair; }
.zoom-bar { display: flex; align-items: center; gap: 4px; }
.zoom-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.zoom-btn:hover { background: var(--green-pale); border-color: var(--green-medium); }
.zoom-level { font-size: .75rem; color: var(--text-muted); min-width: 36px; text-align: center; }
.btn-add-overlay {
  position: absolute; top: 10px; right: 10px; z-index: 20;
  background: var(--green-forest); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.35);
  transition: all .15s;
}
.btn-add-overlay:hover { background: var(--green-medium); transform: scale(1.08); }
.btn-add-overlay.active { background: var(--earth); animation: pulse-add 1.5s infinite; }
@keyframes pulse-add {
  0%,100% { box-shadow: 0 0 0 0 rgba(122,92,30,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(122,92,30,0); }
}

/* Annotation-Karten */
.ann-cards-container { display: flex; flex-direction: column; gap: 10px; min-height: 50px; }
.ann-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px; transition: box-shadow .15s;
}
.ann-card:hover { box-shadow: var(--shadow); }
.ann-card-top { display: flex; gap: 10px; align-items: flex-start; }
.ann-card-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: .75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ann-card-label { font-size: .78rem; font-weight: 800; color: var(--green-forest); margin-bottom: 2px; }
.ann-card-text  { font-size: .86rem; line-height: 1.5; color: var(--text); flex: 1; }
.ann-card-actions { display: flex; gap: 4px; }
.ann-card-btn {
  font-size: .73rem; padding: 3px 8px; border-radius: 5px;
  border: 1px solid var(--border); background: transparent; cursor: pointer;
  color: var(--text-muted); font-family: inherit; transition: all .15s;
}
.ann-card-btn:hover     { background: var(--green-pale); border-color: var(--green-medium); color: var(--green-forest); }
.ann-card-btn.del:hover { background: var(--red-pale); border-color: var(--red); color: var(--red); }

/* Annotation Modal */
.ann-modal-overlay {
  position: fixed; inset: 0; background: rgba(20,16,8,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px; backdrop-filter: blur(2px);
}

/* Kamera-Modal: immer über allen anderen Modals */
#camera-modal { z-index: 4000; }
.ann-modal-card {
  background: var(--card); border-radius: 14px;
  max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); overflow: hidden;
}
.ann-modal-header {
  padding: 14px 18px; background: var(--green-forest); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.ann-modal-body   { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.ann-modal-footer {
  padding: 12px 18px; display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--border-light); background: var(--card-alt);
}
.ann-modal-close {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: .85rem;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.ann-modal-close:hover { background: rgba(255,255,255,.3); }

/* ─── Verständnisfragen (footer) ─────────────────────────────────────────────── */
.section-footer {
  padding: 18px 24px 24px;
  border-top: 2px solid var(--border-light);
  background: var(--bg);
  display: flex; flex-direction: column; gap: 14px;
}

.card-versteh {
  background: #f4f8ff; border-color: #c7d9f8;
}
.card-versteh .card-header { background: #f4f8ff; border-bottom-color: #c7d9f8; }
.card-versteh .card-header h3 { color: #2d5a9e; }
.card-versteh-toggle {
  margin-left: auto; background: rgba(45,90,158,.08); border: 1.5px solid #93c5fd;
  color: #2d5a9e; border-radius: 6px; width: 26px; height: 26px; cursor: pointer;
  font-size: .75rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-versteh-toggle:hover { background: rgba(45,90,158,.15); }

.question-block {
  background: var(--card); border: 1px solid var(--border-light); border-radius: 10px; overflow: hidden;
}
.question-header {
  padding: 10px 14px; background: var(--green-ultra); border-bottom: 1px solid var(--border-light);
  display: flex; align-items: flex-start; gap: 10px;
}
.q-num {
  width: 24px; height: 24px; background: var(--green-forest); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; flex-shrink: 0; margin-top: 1px;
}
.question-header p { font-weight: 600; font-size: .87rem; flex: 1; }
.question-body { padding: 12px 14px; }
.mc-options { display: flex; flex-direction: column; gap: 7px; }
.mc-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: all .15s; font-size: .86rem;
}
.mc-option:hover   { border-color: var(--green-medium); background: var(--green-ultra); }
.mc-option.correct { border-color: var(--green-forest); background: var(--green-pale); font-weight: 600; }
.mc-option.wrong   { border-color: var(--red); background: var(--red-pale); }
.mc-option input[type=radio] { accent-color: var(--green-forest); }
.mc-option.mc-locked { pointer-events: none; opacity: .65; cursor: default; }

.grade-badge {
  margin-top: 8px; padding: 6px 11px; border-radius: 8px;
  font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.grade-badge.auto-correct { background: var(--green-pale); color: var(--green-forest); }
.grade-badge.auto-wrong   { background: var(--red-pale); color: var(--red); }
.grade-badge.graded       { background: var(--amber-pale); color: var(--amber); }
.teacher-comment {
  margin-top: 8px; padding: 8px 12px; background: var(--amber-pale);
  border-radius: 7px; font-size: .82rem; border-left: 3px solid var(--amber);
}

/* Abschluss-Checkbox */
/* Completion-Bar: fixed am unteren rechten Rand, immer sichtbar */
.completion-bar {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  display: flex; align-items: center; gap: 10px;
}
.completion-label {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none; padding: 0 20px 0 16px; height: 50px;
  border-radius: 25px; border: 2px solid var(--border);
  background: var(--card); box-shadow: 0 4px 18px rgba(0,0,0,.18);
  transition: all .18s; white-space: nowrap; font-weight: 700; font-size: .88rem;
  color: var(--text-muted);
}
.completion-label input[type=checkbox] { display: none; }
.completion-check-icon { font-size: 1.2rem; color: var(--text-muted); transition: color .18s; pointer-events: none; }
.completion-label:hover { background: #374151; border-color: #374151; color: #fff; }
.completion-label:hover .completion-check-icon { color: #fff; }
.completion-label:has(input:checked) {
  background: var(--green-forest); border-color: var(--green-forest); color: #fff;
  box-shadow: 0 4px 18px rgba(26,75,40,.35);
}
.completion-label:has(input:checked) .completion-check-icon { color: #fff; }
.completion-tooltip {
  font-size: .82rem; font-weight: 700; pointer-events: none;
}

/* ─── Submit-Lock Banner (Pill, fixed unten wie Preview-Banner) ──────────────── */
#submit-lock-banner {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 500; background: rgba(28,55,20,.92); color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; font-size: .82rem; font-weight: 600;
  border-radius: 30px; box-shadow: 0 4px 16px rgba(0,0,0,.3);
  backdrop-filter: blur(8px); border: 1px solid rgba(116,188,96,.25);
  white-space: nowrap;
}
#submit-lock-banner.hidden { display: none; }
#submit-lock-banner span { flex: 1; }
#submit-lock-banner i { opacity: .75; }
#submit-lock-banner button {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px; padding: 4px 11px; color: #fff;
  cursor: pointer; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; gap: 5px; font-family: inherit;
  transition: background .15s;
}
#submit-lock-banner button:hover { background: rgba(255,255,255,.28); }

/* Sidebar-Footer nach Abgabe ausblenden (Navigation bleibt) */
.submitted-locked .sidebar-footer { display: none; }

/* Foto-Upload nach Abgabe deaktivieren */
.submitted-locked .foto-label { pointer-events: none; opacity: .45; cursor: not-allowed; }
.submitted-locked .fsk-canvas,
.submitted-locked .twe-canvas { pointer-events: none; opacity: .7; cursor: default; }
.submitted-locked .fsk-toolbar,
.submitted-locked .twe-toolbar { pointer-events: none; opacity: .4; }
.submitted-locked .fs-add-card { pointer-events: none; opacity: .45; cursor: not-allowed; }
.submitted-locked .btn-add-overlay { display: none; }
.submitted-locked .fan-src-btn { display: none; }

/* Save-Indicator */
.save-indicator {
  position: fixed; top: 14px; right: 14px; z-index: 9999;
  background: var(--green-forest); color: #fff; padding: 7px 16px;
  border-radius: 8px; font-size: .82rem; font-weight: 700; box-shadow: var(--shadow-lg);
  transform: translateY(-56px); transition: transform .3s;
  display: flex; align-items: center; gap: 6px;
}
.save-indicator.show { transform: translateY(0); }

/* ─── Foto-Sammlung (Karten-Grid + Modal) ────────────────────────────────────── */
.fs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; margin-top: 4px;
}
.fs-card {
  border: 2px solid var(--border); border-radius: 10px; overflow: hidden;
  cursor: pointer; transition: all .15s; background: var(--card-alt);
  display: flex; flex-direction: column; min-height: 120px;
}
.fs-card:hover { border-color: var(--green-medium); box-shadow: var(--shadow); transform: translateY(-1px); }
.fs-card-img  { width: 100%; height: 80px; object-fit: cover; display: block; }
.fs-card-info { padding: 6px 8px; flex: 1; }
.fs-card-name { font-size: .76rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.fs-card-ort  { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }
.fs-card-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--border);
}
.fs-card-empty i { font-size: 1.6rem; }

.fs-add-card {
  border-style: dashed; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-muted); flex-direction: column; min-height: 120px;
}
.fs-add-card:hover { border-color: var(--green-medium); color: var(--green-forest); background: var(--green-ultra); }
.fs-add-icon { font-size: 1.4rem; }

.fs-card-diff { border-color: var(--amber-pale); background: linear-gradient(135deg, var(--amber-pale), #fff9e6); }
.fs-card-diff .fs-card-name { color: var(--earth); }
.fs-card-diff .fs-card-empty { color: var(--amber); opacity: .5; }

/* Differenzierungs-Button */
.diff-btn {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--amber-pale); border: 1.5px solid var(--amber);
  color: var(--amber); cursor: pointer; font-size: .88rem;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.diff-btn:hover  { background: var(--amber); color: #fff; }
.diff-btn.active { background: var(--amber); color: #fff; }

/* Name-Chips im Modal */
.fs-name-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.fs-chip {
  padding: 3px 10px; border-radius: 20px; font-size: .74rem; font-weight: 600;
  background: var(--green-pale); border: 1px solid var(--green-light);
  color: var(--green-forest); cursor: pointer; transition: all .15s;
}
.fs-chip:hover { background: var(--green-medium); color: #fff; border-color: var(--green-medium); }

/* Foto-Sammlung Modal Inhalt */
.fs-modal-inner { display: flex; gap: 16px; }
.fs-modal-photo-side  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fs-modal-fields-side { flex: 1.3; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fs-modal-photo-area {
  background: var(--card-alt); border: 2px solid var(--border); border-radius: 9px;
  min-height: 160px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fs-modal-img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.fs-modal-no-photo {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: .82rem;
}
.fs-modal-no-photo i { font-size: 2.2rem; opacity: .4; }

/* Zwei-Spalten-Layout innerhalb einer Aufgabe */
.card-body-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Teacher Dashboard ──────────────────────────────────────────────────────── */
#view-teacher { min-height: 100vh; }
.teacher-header {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-forest) 100%);
  color: #fff; padding: 18px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.teacher-header h1 { font-size: 1.3rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.teacher-header p  { color: rgba(255,255,255,.6); font-size: .84rem; margin-top: 2px; }
.teacher-content { padding: 20px 26px; }
.teacher-tabs {
  display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap;
  border-bottom: 2px solid var(--border-light); padding-bottom: 12px;
}
.tab-btn {
  padding: 7px 16px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-2); font-size: .84rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.tab-btn:hover  { border-color: var(--green-medium); background: var(--green-ultra); }
.tab-btn.active { background: var(--green-forest); color: #fff; border-color: var(--green-forest); }

/* Session-Filter */
.session-filter {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  background: var(--card); border-radius: 10px; padding: 14px 16px;
  border: 1px solid var(--border-light); margin-bottom: 18px;
}
.session-filter .form-group { min-width: 160px; }
.filter-field {
  height: 40px; box-sizing: border-box;
  padding: 0 13px; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: .88rem; width: 100%; background: #fff;
}

/* Session-Karten */
.sessions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; }
.session-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; border: 1px solid var(--border-light); transition: all .15s;
}
.session-card:hover { box-shadow: var(--shadow); border-color: var(--green-medium); }
.session-card-header { background: var(--green-forest); color: #fff; padding: 12px 14px; }
.session-card-cover {
  position: absolute; top: 8px; left: 12px;
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,.35);
}
.session-card-header h3 { font-size: .92rem; font-weight: 800; }
.session-card-body { padding: 12px 14px; font-size: .84rem; }
.session-meta-row { display: flex; align-items: center; gap: 6px; color: var(--text-muted); margin-bottom: 5px; }
.session-meta-row i { font-size: .9rem; }

/* Gruppen-Karten */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 12px; }
.group-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; cursor: pointer; transition: all .15s; border: 1px solid var(--border-light);
}
.group-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--green-medium); }
.group-card-header { background: var(--green-forest); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 8px; }
.group-card-header .btn-danger { background: rgba(255,255,255,.18); border: none; flex-shrink: 0; }
.group-card-header .btn-danger:hover { background: rgba(220,50,50,.7); }
.group-card-header h3 { font-size: .9rem; font-weight: 800; }
.group-card-header .date { font-size: .72rem; opacity: .65; margin-top: 2px; }
.group-card-body { padding: 10px 12px; }
.member-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-pale); border-radius: 20px;
  padding: 3px 9px; font-size: .75rem; font-weight: 600; color: var(--green-forest); margin: 2px;
}
.submitted-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-dark); color: #86efac;
  padding: 3px 9px; border-radius: 20px; font-size: .72rem; font-weight: 700;
}

/* Bewertungs-Ansicht */
.grading-section-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.grading-item {
  background: var(--card); border: 1px solid var(--border-light); border-radius: 10px;
  overflow: hidden; margin-bottom: 12px;
}
.grading-item-header {
  padding: 10px 14px; background: var(--card-alt); border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px;
}
.grading-item-label { font-weight: 700; font-size: .88rem; color: var(--text-2); }
.grading-item-body  { padding: 12px 14px; }
.answer-box {
  background: var(--bg); border-radius: 8px; padding: 10px 12px;
  font-size: .86rem; line-height: 1.6; color: var(--text);
  min-height: 34px; white-space: pre-wrap; border: 1px solid var(--border-light);
}
.no-answer { font-style: italic; color: var(--text-muted); }
.grade-stars { display: flex; gap: 4px; margin-top: 8px; }
.star { font-size: 1.2rem; cursor: pointer; color: var(--border); transition: color .1s; }
.star.active, .star:hover { color: var(--amber); }
.grade-comment-field {
  width: 100%; border: 1.5px solid var(--border); border-radius: 7px;
  padding: 7px 10px; font-size: .84rem; font-family: inherit; resize: vertical;
  margin-top: 7px; min-height: 44px; background: var(--card-alt);
}
.grade-comment-field:focus { outline: none; border-color: var(--green-medium); }
.save-grade-btn {
  margin-top: 7px; padding: 5px 12px; background: var(--green-forest); color: #fff;
  border: none; border-radius: 7px; font-size: .8rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.save-grade-btn:hover { background: var(--green-medium); }

/* Exkursion-Erstellen Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,16,8,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 3000; padding: 20px; backdrop-filter: blur(2px);
}
.modal-card {
  background: var(--card); border-radius: 14px;
  max-width: 640px; width: 100%; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 20px; background: var(--green-forest); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0;
}
.modal-header h2 { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.modal-body   { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  padding: 14px 20px; display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--border-light); background: var(--card-alt);
  position: sticky; bottom: 0;
}
.modal-close {
  background: rgba(255,255,255,.18); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: .9rem; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,.35); }

/* Kapitel-Builder */
.kapitel-builder-item {
  border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 10px;
}
.kapitel-builder-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--card-alt); border-bottom: 1px solid var(--border-light); cursor: pointer;
}
.kapitel-builder-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.kapitel-builder-body.collapsed { display: none; }

/* Tags-Input (Kompetenzen / Lernziele) */
.tags-input { display: flex; flex-direction: column; gap: 8px; }
.tags-list   { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-pale); color: var(--green-forest);
  padding: 4px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600;
}
.tag-chip-del {
  background: none; border: none; cursor: pointer; color: var(--green-forest);
  font-size: .7rem; padding: 0; line-height: 1; display: flex; align-items: center;
}
.tag-chip-del:hover { color: var(--red); }
.tags-add-row { display: flex; gap: 8px; }
.tags-add-row input { flex: 1; padding: 7px 11px; border: 1.5px solid var(--border); border-radius: 7px; font-size: .86rem; font-family: inherit; }
.tags-add-row input:focus { outline: none; border-color: var(--green-medium); }

/* ─── Responsive ──────────────────────────────────────────────────────────────── */

/* Hamburger-Button – auf Desktop versteckt */
.hamburger-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
  background: transparent; border: 1.5px solid var(--border);
  color: var(--text-2); cursor: pointer; font-size: 1.15rem; transition: all .15s;
}
.hamburger-btn:hover { background: var(--card-alt); color: var(--text); }

/* Sidebar-Overlay – auf Desktop versteckt */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* Tablet (961–960px): section-body einspaltig, Sidebar etwas schmaler */
@media (max-width: 960px) {
  .section-body { grid-template-columns: 1fr; }
  .section-left { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar { width: 210px; }
}

/* Mobile (≤ 700px): Sidebar als Schiebe-Drawer, alle Grids einspaltig */
@media (max-width: 700px) {

  /* Sidebar: Drawer von links */
  .sidebar {
    position: fixed; top: 0; left: -270px; height: 100vh; height: 100dvh;
    width: 260px; z-index: 1000;
    transition: left .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
    overflow-y: auto;
  }
  .sidebar.open { left: 0; }

  /* Hamburger einblenden */
  .hamburger-btn { display: flex; }

  /* App-Header */
  .app-header { padding: 0 10px; gap: 8px; }
  .kapitel-titel-text { font-size: .9rem; }

  /* Inhaltsbereich */
  .section-right { padding: 12px 12px 76px; }
  .kapitel-ziel-panel { margin: 10px 12px; }

  /* Zweispaltige Layouts → einspaltig */
  .messung-grid { grid-template-columns: 1fr; }
  .card-body-split { grid-template-columns: 1fr; }

  /* Foto-Sammlung Modal: gestapelt */
  .fs-modal-inner { flex-direction: column; }
  .fs-modal-fields-side { flex: none; }

  /* KapitelInfo-Panel: gestapelt */
  .kip-inner { flex-direction: column; gap: 10px; }
  .kip-divider { display: none; }
  .kip-map-col { min-width: 0; }
  .kip-map-box { height: 160px; }
  .kip-timer-col { min-width: 0; }

  /* Modals: von unten als Sheet */
  .ann-modal-overlay { padding: 0; align-items: flex-end; }
  .ann-modal-card { max-width: 100%; border-radius: 20px 20px 0 0; width: 100%; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card { max-width: 100%; max-height: 95vh; max-height: 95dvh; border-radius: 20px 20px 0 0; }

  /* Kartenmodal: Vollbild */
  .kip-map-modal { padding: 0; }
  .kip-map-modal-inner { border-radius: 0; height: 100vh; height: 100dvh; }
  .kip-map-modal-body { flex-direction: column; }
  .kip-map-modal-text {
    width: 100%; border-right: none; border-bottom: 1px solid var(--border-light);
    padding: 10px 14px; max-height: 38%; overflow-y: auto;
  }

  /* Theory Panel */
  .theory-panel.open { padding: 16px; }

  /* Completion-Button */
  .completion-bar { bottom: 10px; right: 10px; }
  .completion-label { height: 44px; font-size: .8rem; padding: 0 14px 0 12px; }

  /* Teacher-Dashboard */
  .teacher-header { padding: 14px 16px; }
  .teacher-header h1 { font-size: 1.05rem; }
  .teacher-content { padding: 12px; }
  .sessions-grid, .groups-grid, #excursions-grid { grid-template-columns: 1fr; }
  .session-filter { flex-direction: column; }
  .session-filter .form-group { min-width: 0; width: 100%; }

  /* Teacher-Popover: volle Breite auf Mobile */
  .teacher-popover { left: 12px; right: 12px; width: auto; }

  /* Auth-Seite */
  .auth-container { padding: 0 4px; }
}

/* ─── Vorschau-Banner (fixed, schwebend am unteren Rand) ────────────────────── */
.preview-banner {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 500; background: rgba(28,23,16,.82); color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; font-size: .8rem; font-weight: 600;
  border-radius: 30px; box-shadow: 0 4px 16px rgba(0,0,0,.3);
  backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.12);
  white-space: nowrap;
}
.preview-banner i    { font-size: .9rem; opacity: .7; }
.preview-banner span { font-size: .8rem; opacity: .9; }
.preview-banner button {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px; padding: 4px 11px; color: #fff;
  cursor: pointer; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; gap: 5px; font-family: inherit;
  transition: background .15s;
}
.preview-banner button:hover { background: rgba(255,255,255,.28); }

/* Im Vorschau- und Korrektur-Modus: vollständig interaktiv */
#view-app.preview-mode .sidebar-footer { display: none; }
#view-app.preview-mode #submit-btn { display: none; }
#view-app.grading-mode .sidebar-footer { display: none; }
#view-app.grading-mode #submit-btn { display: none; }

/* ─── Korrektur-Banner ───────────────────────────────────────────────────────── */
.grading-banner {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 500; background: rgba(90,40,0,.9); color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; font-size: .8rem; font-weight: 600;
  border-radius: 30px; box-shadow: 0 4px 16px rgba(0,0,0,.3);
  backdrop-filter: blur(8px); border: 1px solid rgba(255,180,0,.25);
  white-space: nowrap;
}
.grading-banner i { font-size: .9rem; opacity: .75; }
.grading-banner-score {
  background: rgba(255,180,0,.22); border-radius: 12px;
  padding: 2px 10px; font-size: .75rem; color: #fcd34d; font-weight: 800;
}
.grading-banner button {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px; padding: 4px 11px; color: #fff;
  cursor: pointer; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; gap: 5px; font-family: inherit;
  transition: background .15s;
}
.grading-banner button:hover { background: rgba(255,255,255,.28); }

/* ─── Lehrkraft-Bewertungs-Panel (auf jeder Aufgabe) ────────────────────────── */
.teacher-grade-panel {
  margin-top: 14px; padding-top: 12px;
  border-top: 2px dashed var(--amber);
}
.tgp-header {
  display: flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--amber); margin-bottom: 9px;
}
.tgp-header i { font-size: .85rem; }
.tgp-maxpts { margin-left: auto; color: var(--text-muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.tgp-pts-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.tgp-pts-row label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.tgp-pts-input {
  width: 76px; padding: 5px 8px; text-align: center;
  border: 1.5px solid var(--amber); border-radius: 7px;
  font-size: .95rem; font-family: inherit; font-weight: 700;
  background: var(--amber-pale); color: var(--earth);
}
.tgp-pts-input:focus { outline: none; border-color: var(--earth); box-shadow: 0 0 0 3px rgba(196,138,10,.15); }
.tgp-maxlabel { font-size: .82rem; color: var(--text-muted); }
.tgp-comment {
  width: 100%; border: 1.5px solid var(--border); border-radius: 7px;
  padding: 7px 10px; font-size: .84rem; font-family: inherit; resize: vertical;
  min-height: 52px; background: var(--card-alt); margin-bottom: 8px; display: block;
}
.tgp-comment:focus { outline: none; border-color: var(--amber); }
.tgp-footer { display: flex; align-items: center; gap: 10px; }
.tgp-save-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; background: var(--amber); color: #fff;
  border: none; border-radius: 7px; font-size: .8rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.tgp-save-btn:hover { background: var(--earth); }
.tgp-saved-ok {
  font-size: .75rem; color: var(--green-medium); font-weight: 700;
  display: flex; align-items: center; gap: 4px;
}

/* ─── Punkte-Übersicht im Dashboard ─────────────────────────────────────────── */
.score-overview {
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: 10px; overflow: hidden; margin-top: 16px;
}
.score-overview-header {
  padding: 10px 14px; background: var(--green-forest); color: #fff;
  font-size: .85rem; font-weight: 800; display: flex; align-items: center; gap: 8px;
}
.score-kapitel-row {
  padding: 10px 14px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px;
}
.score-kapitel-row:last-child { border-bottom: none; }
.score-kapitel-name { font-weight: 700; font-size: .88rem; flex: 1; }
.score-bar-wrap {
  flex: 2; height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden;
}
.score-bar-fill { height: 100%; border-radius: 4px; background: var(--green-medium); transition: width .4s; }
.score-pts { font-size: .82rem; font-weight: 800; color: var(--green-forest); min-width: 70px; text-align: right; }
.score-total-row {
  padding: 10px 14px; background: var(--green-pale);
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; color: var(--green-forest);
  border-top: 2px solid var(--green-light);
}
.score-aufgabe-row {
  padding: 4px 28px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-2);
}
.score-aufgabe-row:last-child { border-bottom: none; }

/* ─── Exkursions-Karten (klickbar) ──────────────────────────────────────────── */
.excursion-preview-card { cursor: pointer; }
.excursion-preview-card:hover { box-shadow: var(--shadow-lg); border-color: var(--green-medium); transform: translateY(-2px); }
.exc-preview-hint {
  font-size: .75rem; color: var(--green-medium); font-weight: 600;
  display: flex; align-items: center; gap: 5px; margin-top: 6px;
}

/* ─── Profilfoto Avatar ──────────────────────────────────────────────────────── */
/* Excursion cover thumbnail in sidebar */
.sidebar-exc-cover {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.15); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.sidebar-exc-cover img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-cover-fallback { font-size: 1.2rem; opacity: .7; }

/* Cover image upload area in excursion modal */
.em-cover-area {
  width: 100%; height: 140px; border-radius: 10px;
  border: 2px dashed var(--border); background: var(--card-alt);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
  margin-bottom: 16px; transition: border-color .15s;
}
.em-cover-area:hover { border-color: var(--green-medium); }
.em-cover-area img { width: 100%; height: 100%; object-fit: cover; }
#em-cover-placeholder { font-size: .85rem; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }

/* Round cover avatar top-left in excursion card */
.exc-card-cover-wrap {
  position: absolute; top: 12px; left: 12px;
  width: 52px; height: 52px; border-radius: 50%;
  overflow: hidden; border: 2.5px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
  background: var(--green-light);
  z-index: 1;
}
.exc-card-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.excursion-preview-card { position: relative; }

/* ─── Foto-Annotiert ─────────────────────────────────────────────────────────── */
.fan-container { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fan-left  { display: flex; flex-direction: column; gap: 10px; }
.fan-right { display: flex; flex-direction: column; gap: 12px; }

.fan-area {
  background: var(--card-alt); border: 2px dashed var(--border);
  border-radius: 12px; min-height: 200px; overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}
.fan-empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 20px;
}
.fan-empty-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.fan-photo-actions { display: flex; gap: 8px; }
.fan-change-row { padding: 6px 8px; display: flex; gap: 8px; border-top: 1px solid var(--border-light); }
.fan-src-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-family: inherit;
  font-size: .81rem; font-weight: 700; border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-2); transition: all .12s;
}
.fan-src-btn:hover { background: var(--green-pale); border-color: var(--green-medium); color: var(--green-forest); }
.fan-photo-wrap { position: relative; }
.fan-img { display: block; width: 100%; height: auto; }
.fan-pin-zone { position: absolute; inset: 0; cursor: crosshair; }
.fan-pin {
  position: absolute; transform: translate(-50%,-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-forest); color: #fff;
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4);
  border: 2px solid #fff; z-index: 10; transition: transform .1s;
}
.fan-pin:hover { transform: translate(-50%,-50%) scale(1.25); }
/* Diff-Chips */
.fan-diff-panel {
  padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 5px;
  background: var(--amber-pale); border-bottom: 1px solid #f0d08a;
}
.fan-diff-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--amber); color: #fff;
  font-size: .76rem; font-weight: 700; cursor: grab; user-select: none;
  transition: opacity .15s;
}
.fan-diff-chip:active { cursor: grabbing; }
.fan-diff-chip.placed { opacity: .3; cursor: default; pointer-events: none; }
.fan-diff-num {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0,0,0,.25); display: flex; align-items: center;
  justify-content: center; font-size: .65rem; flex-shrink: 0;
}
.fan-pin-zone.drag-over { background: rgba(53,107,46,.12); }

.fan-change-btn {
  background: none; border: none; padding: 5px 8px;
  font-size: .76rem; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  align-self: flex-start; margin: 4px 4px 0;
}
.fan-change-btn:hover { color: var(--green-forest); }
.fan-desc {
  width: 100%; min-height: 56px; resize: vertical;
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: .85rem; color: var(--text);
  background: var(--card); font-family: inherit;
}

.fan-right-header { display: flex; flex-direction: column; gap: 5px; }
.fan-instr { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-2); }
.fan-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--green-medium);
  color: #fff; font-size: .68rem; font-weight: 800; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.fan-anno-list { display: flex; flex-direction: column; gap: 7px; }
.fan-anno-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-alt); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 9px 12px; cursor: pointer;
  transition: background .12s;
}
.fan-anno-card:hover { background: var(--green-ultra); border-color: var(--green-light); }
.fan-anno-badge {
  width: 24px; height: 24px; border-radius: 50%; background: var(--green-forest);
  color: #fff; font-size: .7rem; font-weight: 800; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.fan-anno-info  { flex: 1; min-width: 0; }
.fan-anno-name  { font-size: .86rem; font-weight: 700; color: var(--text); }
.fan-anno-detail{ font-size: .74rem; color: var(--text-muted); margin-top: 1px; }

/* ─── Tragwerk-Editor ────────────────────────────────────────────────────────── */
.twe-container { display: flex; flex-direction: column; gap: 8px; }
.twe-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  background: var(--card-alt); border-radius: 10px; padding: 8px;
  border: 1px solid var(--border-light);
}
.twe-tool {
  padding: 5px 10px; border: 1.5px solid var(--border);
  border-radius: 6px; background: var(--card);
  color: var(--text-2); font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .12s; font-family: inherit;
}
.twe-tool:hover { background: var(--green-ultra); border-color: var(--green-light); }
.twe-tool.active           { background: var(--green-forest); color: #fff; border-color: var(--green-forest); }
.twe-tool.twe-stuetze.active   { background: #15803d; border-color: #15803d; }
.twe-tool.twe-traeger.active   { background: #1d4ed8; border-color: #1d4ed8; }
.twe-tool.twe-diagonale.active { background: #7e22ce; border-color: #7e22ce; }
.twe-tool.twe-auflager.active  { background: #92400e; border-color: #92400e; }
.twe-tool.twe-del.active       { background: var(--red); border-color: var(--red); }
.twe-sep { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; margin: 0 2px; }
.twe-reset-btn {
  margin-left: auto; padding: 5px 8px; background: var(--card);
  border: 1.5px solid var(--border); border-radius: 6px;
  color: var(--text-muted); font-size: .78rem; cursor: pointer; font-family: inherit;
}
.twe-reset-btn:hover { background: var(--red-pale); color: var(--red); border-color: var(--red); }
.twe-canvas {
  width: 100%; background: #f9f7f2; border: 1.5px solid var(--border);
  border-radius: 10px; cursor: crosshair; display: block; touch-action: none;
}
.twe-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.twe-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .75rem; color: var(--text-2); }
.twe-legend span { display: flex; align-items: center; gap: 4px; }
.twe-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.twe-hint { font-size: .76rem; color: var(--text-muted); min-height: 1.2em; font-style: italic; }

/* ─── Map ────────────────────────────────────────────────────────────────────── */
#map-container {
  height: 300px; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--border);
}
.map-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Leaflet icon fix */
.leaflet-default-icon-path { background-image: url("https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png"); }

/* ─── Rollenspiel-Chat ──────────────────────────────────────────────────────── */
.rsp-container { display: flex; flex-direction: column; gap: 16px; }

.rsp-situation {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--amber-pale); border: 1.5px solid var(--amber);
  border-radius: 12px; padding: 12px 14px;
  font-size: .84rem; font-weight: 500; color: #92400e; line-height: 1.5;
}

.rsp-chat { display: flex; flex-direction: column; gap: 18px; }

.rsp-wrap { display: flex; width: 88%; }
.rsp-links  { align-self: flex-start; margin-right: auto; }
.rsp-rechts { align-self: flex-end;   margin-left: auto;  flex-direction: row-reverse; }

.rsp-bubble { border-radius: 14px; overflow: hidden; flex: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,.09); }

.rsp-role-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-weight: 800; font-size: .88rem;
}

.rsp-args {
  padding: 12px 14px; display: flex; flex-direction: column; gap: 14px;
  background: var(--card);
}

.rsp-arg-prompt {
  font-size: .77rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px;
}

.rsp-input {
  width: 100%; resize: vertical; min-height: 58px; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-family: inherit; font-size: .83rem;
  color: var(--text-1); background: var(--bg); line-height: 1.45;
  transition: border-color .15s;
}
.rsp-input:focus { outline: none; border-color: var(--green-medium); box-shadow: 0 0 0 3px rgba(74,139,102,.12); }

/* ─── Flächen-Skizze ──────────────────────────────────────────────────────── */
.fsk-container { display: flex; flex-direction: column; gap: 8px; }

.fsk-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 6px 0;
}

.fsk-tool {
  padding: 5px 10px; border-radius: 6px; font-size: .78rem; font-weight: 700;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text-1); cursor: pointer; display: flex; align-items: center; gap: 4px;
  transition: background .12s, border-color .12s;
}
.fsk-tool.active { background: var(--green-forest); border-color: var(--green-forest); color: #fff; }
.fsk-tool.fsk-del { border-color: #fca5a5; color: #dc2626; }
.fsk-tool.fsk-del.active { background: #dc2626; border-color: #dc2626; color: #fff; }

.fsk-reset-btn {
  margin-left: auto; padding: 5px 8px; border-radius: 6px; font-size: .78rem;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text-muted); cursor: pointer;
}
.fsk-reset-btn:hover { border-color: var(--green-medium); color: var(--green-forest); }

.fsk-canvas {
  width: 100%; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--card); cursor: crosshair; display: block;
}

.fsk-hint {
  font-size: .73rem; color: var(--text-muted); font-style: italic; text-align: center;
}

/* ─── Groups Management Modal ──────────────────────────────────────────────── */
.gmgmt-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--card-alt); border-radius: 8px;
  border: 1.5px solid var(--border-light);
}
.gmgmt-row-name { font-weight: 700; font-size: .9rem; flex: 1; min-width: 0; }
.gmgmt-row-pw {
  display: flex; align-items: center; gap: 4px;
  font-size: .82rem; color: var(--text-muted); font-family: monospace;
  background: var(--card); border: 1px solid var(--border-light);
  padding: 2px 8px; border-radius: 6px; flex-shrink: 0;
}
.gmgmt-row-status { flex-shrink: 0; }
.gmgmt-row-status .badge-green,
.gmgmt-row-status .badge-grey,
.gmgmt-row-status .badge-outline {
  font-size: .7rem; padding: 2px 7px;
}


/* ─── Intro-Tour ─────────────────────────────────────────────────────────── */
.tour-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(5px);
}
.tour-overlay.hidden { display: none; }

.tour-card {
  background: #fff; border-radius: 22px;
  width: min(480px, 96vw);
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
  overflow: hidden; position: relative;
  display: flex; flex-direction: column;
}

.tour-skip-btn {
  position: absolute; top: 12px; right: 14px; z-index: 20;
  background: rgba(0,0,0,.25); border: none; border-radius: 20px;
  padding: 3px 10px; font-size: .72rem; color: rgba(255,255,255,.85); cursor: pointer;
}
.tour-skip-btn:hover { background: rgba(0,0,0,.45); color: #fff; }

/* Scene outer with arrow buttons */
.tour-scene-outer {
  position: relative;
  height: 265px;
  background: linear-gradient(150deg, #e6f4e1 0%, #f4faf2 100%);
  overflow: hidden;
}
.tour-scene-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.tour-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(45,90,39,.65); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; backdrop-filter: blur(4px); transition: all .18s;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.tour-arrow:hover { background: rgba(45,90,39,.9); transform: translateY(-50%) scale(1.08); }
.tour-arrow-left  { left: 10px; }
.tour-arrow-right { right: 10px; }
.tour-arrow.ts-hidden { opacity: 0; pointer-events: none; }

/* Text + footer */
.tour-text { padding: 16px 20px 4px; }
.tour-title { font-weight: 700; font-size: 1.02rem; color: #1a3a17; margin-bottom: 5px; }
.tour-caption { font-size: .84rem; color: #555; line-height: 1.48; min-height: 36px; }
.tour-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 18px;
}
.tour-dots { display: flex; gap: 5px; align-items: center; }
.tour-dot {
  height: 7px; width: 7px; border-radius: 4px;
  background: #d1e8c4; transition: background .3s, width .3s;
}
.tour-dot.active { background: #2d5a27; width: 18px; }

/* ── Scaled phone wrapper ────────────────────────────────────────────────── */
.ts-scale { transform: scale(0.68); transform-origin: center center; display: flex; }
.ts-phone {
  width: 220px; height: 240px; background: #fff; border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  overflow: hidden; display: flex; flex-direction: column;
  border: 2px solid #e0e0e0;
}
.ts-topbar {
  background: #2d5a27; color: #fff;
  padding: 7px 10px; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.ts-topbar-title { font-size: .72rem; font-weight: 600; flex: 1; min-width: 0; }
.ts-body { flex: 1; overflow: hidden; position: relative; background: #f9fafb; padding: 8px; }

/* ── Scene 0: Willkommen ─────────────────────────────────────────────────── */
.ts-s0-icon { font-size: 4rem; display: block; text-align: center; animation: ts-bounce 2.2s ease-in-out infinite; }
.ts-s0-name { font-size: 1.1rem; font-weight: 700; color: #2d5a27; text-align: center; margin-top: 10px; animation: ts-fadein .7s ease both; }
.ts-s0-sub  { font-size: .75rem; color: #888; text-align: center; margin-top: 4px; animation: ts-fadein .7s .35s ease both; }
@keyframes ts-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes ts-fadein { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ── Scene 1: Navigation ─────────────────────────────────────────────────── */
.ts-ham-anim {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  background: transparent; border: 1.5px solid rgba(255,255,255,.35);
  color: #fff; font-size: .9rem;
  animation: ts-ham-tap 4s ease-in-out infinite;
}
@keyframes ts-ham-tap {
  0%,14%,100% { background: transparent; transform: scale(1); }
  7% { background: rgba(255,255,255,.2); transform: scale(.82); }
}
/* Nav items: dot on the RIGHT with margin-left:auto */
.ts-nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 6px; font-size: .68rem; color: rgba(255,255,255,.85);
  border-radius: 6px;
}
.ts-nav-item.active { background: rgba(106,173,87,.22); color: #fff; border-left: 3px solid #6aad57; }
.ts-nav-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-left: auto; }
.ts-nav-dot.empty    { border: 2px solid rgba(255,255,255,.25); background: transparent; }
.ts-nav-dot.progress { border-color: #f59e0b; background: #f59e0b; }
.ts-nav-dot.done     { border-color: #6aad57; background: #6aad57; }

/* Nav sidebar slide-in */
.ts-s1-sidebar {
  position: absolute; top: 0; left: 0; width: 78%; bottom: 0;
  background: #1e3d1a; padding: 8px 6px;
  animation: ts-sidebar-slide 5s ease-in-out infinite;
}
@keyframes ts-sidebar-slide {
  0%,8%  { transform: translateX(-105%); }
  18%,82% { transform: translateX(0); }
  92%,100% { transform: translateX(-105%); }
}

/* Dot animation: empty → orange → green */
.ts-dot-seq { animation: ts-dot-states 5s ease-in-out infinite; }
@keyframes ts-dot-states {
  0%,18%  { border-color: rgba(255,255,255,.25); background: transparent; }
  30%,55% { border-color: #f59e0b; background: #f59e0b; }
  67%,100% { border-color: #6aad57; background: #6aad57; }
}

/* Completion pill appearing and being pressed */
.ts-pill-appear {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 14px 0 12px; height: 36px; border-radius: 18px;
  border: 2px solid #d1d5db; background: #fff;
  font-weight: 700; font-size: .65rem; color: #9ca3af;
  box-shadow: 0 3px 12px rgba(0,0,0,.15); white-space: nowrap;
  animation: ts-pill-anim 5s ease-in-out infinite;
  position: absolute; bottom: 10px; right: 6px;
}
@keyframes ts-pill-anim {
  0%,20%  { opacity:0; transform: scale(.85) translateY(8px); }
  30%,52% { opacity:1; transform: scale(1) translateY(0); }
  60%,65% { opacity:1; transform: scale(.93); background: #2d5a27; border-color: #2d5a27; color: #fff; }
  72%,100% { opacity:0; }
}

/* ── Scene 2: Aufbau (echte Farben) ─────────────────────────────────────── */
.ts-s2-aufgabe {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 8px; padding: 7px 9px; margin-bottom: 5px;
  animation: ts-hl-warm 4.5s ease infinite;
}
.ts-s2-versteh {
  background: #f4f8ff; border: 1px solid #c7d9f8;
  border-radius: 8px; padding: 7px 9px;
  animation: ts-hl-cool 4.5s 2.2s ease infinite;
}
.ts-s2-sec-label { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.ts-s2-aufgabe  .ts-s2-sec-label { color: #374151; }
.ts-s2-versteh  .ts-s2-sec-label { color: #2d5a9e; }
.ts-s2-bar { height: 4px; border-radius: 3px; margin-bottom: 3px; }
.ts-s2-aufgabe .ts-s2-bar { background: #e5e7eb; }
.ts-s2-versteh .ts-s2-bar { background: #93c5fd; }
.ts-s2-divider { border: none; border-top: 1px dashed #d1d5db; margin: 4px 0; }
@keyframes ts-hl-warm { 0%,22%,55%,100% { box-shadow:none; } 35% { box-shadow: 0 0 0 2.5px #d97706; } }
@keyframes ts-hl-cool { 0%,22%,55%,100% { box-shadow:none; } 35% { box-shadow: 0 0 0 2.5px #3d7fa8; } }

/* ── Scene 3: Info-Button (ⓘ) + Panel Was/Wie lange/Wo ──────────────────── */
.ts-kip-demo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ts-kip-header-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 10px; padding: 7px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08); border: 1px solid #e5e7eb;
  font-size: .78rem; color: #555;
}
.ts-kib-real {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
  transition: all .2s;
  animation: ts-kib-tap 4s ease infinite;
}
.ts-kib-real.info-style {
  background: #e0f2fe; border: 1.5px solid #38bdf8; color: #0284c7;
}
@keyframes ts-kib-tap {
  0%,14%,100% { transform: scale(1); box-shadow: none; }
  7% { transform: scale(1.18); box-shadow: 0 0 0 5px rgba(56,189,248,.22); }
}
.ts-kip-panel {
  background: #fff; border-radius: 10px; padding: 10px 12px; width: 240px;
  box-shadow: 0 4px 18px rgba(0,0,0,.12); border-bottom: 2px solid #e5e7eb;
  animation: ts-panel-pop 4s ease infinite;
}
.ts-kip-inner { display: flex; gap: 10px; }
.ts-kip-col { flex: 1; }
.ts-kip-lbl { font-size: .5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; margin-bottom: 3px; }
.ts-kip-val { font-size: .65rem; color: #374151; line-height: 1.4; }
.ts-kip-divider { width: 1px; background: #e5e7eb; align-self: stretch; flex-shrink: 0; }
@keyframes ts-panel-pop {
  0%,16% { opacity:0; transform: translateY(-10px); }
  26%,70% { opacity:1; transform: translateY(0); }
  80%,100% { opacity:0; }
}

/* ── Scene 4: Theorie-Button + Panel ────────────────────────────────────── */
.ts-theory-demo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ts-trb-real {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #f0f7ee; border: 1.5px solid #6aad57; color: #2d5a27;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
  animation: ts-trb-tap 4s ease infinite;
}
@keyframes ts-trb-tap {
  0%,14%,100% { transform: scale(1); background: #f0f7ee; }
  7% { transform: scale(1.18); background: #2d5a27; color: #fff; box-shadow: 0 0 0 5px rgba(45,90,39,.18); }
}
.ts-theory-panel {
  background: #f9fafb; border-top: 3px solid #2d5a27; border-radius: 0 0 10px 10px;
  padding: 10px 14px; width: 240px;
  box-shadow: 0 6px 16px rgba(0,0,0,.1); font-size: .7rem; color: #374141; line-height: 1.5;
  animation: ts-theory-slide 4s ease infinite;
}
.ts-theory-head { font-weight: 700; font-size: .75rem; color: #2d5a27; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
@keyframes ts-theory-slide {
  0%,16% { opacity:0; transform: translateY(-12px) scaleY(.85); transform-origin: top; }
  27%,70% { opacity:1; transform: translateY(0) scaleY(1); }
  80%,100% { opacity:0; }
}

/* ── Scene 5: Differenzierung (echte Farbe + Kontext) ───────────────────── */
.ts-diff-demo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ts-diff-card-header {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 8px 12px; width: 230px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.ts-diff-card-title { font-size: .72rem; font-weight: 700; color: #374151; flex: 1; }
.ts-diff-btn-real {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: #fef3c7; border: 1.5px solid #c48a0a; color: #b45309;
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
  animation: ts-diff-tap 4s ease infinite;
}
@keyframes ts-diff-tap {
  0%,14%,100% { transform: scale(1); background: #fef3c7; }
  7% { transform: scale(.82); background: #c48a0a; color: #fff; box-shadow: 0 0 0 6px rgba(196,138,10,.18); }
}
.ts-diff-help-card {
  background: linear-gradient(135deg, #fef3c7, #fff9e6); border: 1.5px solid #fde68a;
  border-radius: 10px; padding: 9px 12px; width: 230px;
  animation: ts-card-in 4s ease infinite;
}
.ts-diff-help-label { font-size: .55rem; font-weight: 700; text-transform: uppercase; color: #c48a0a; letter-spacing: .04em; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.ts-diff-bar { height: 4px; border-radius: 2px; background: #fde68a; margin-bottom: 3px; }
@keyframes ts-card-in { 0%,20% { opacity:0; transform: translateY(8px); } 32%,82% { opacity:1; transform: translateY(0); } 94%,100% { opacity:0; } }

/* ── Scene 6: PDF & Abgabe ───────────────────────────────────────────────── */
.ts-sidebar-footer-demo {
  background: #1e3d1a; border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; width: 200px;
}
.ts-sfooter-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 8px; font-size: .78rem; font-weight: 600;
  border: 1.5px solid;
}
.ts-sfooter-btn-pdf    { background: transparent; border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.75); animation: ts-btn-hl 5s ease infinite; }
.ts-sfooter-btn-submit { background: #2d5a27; border-color: #6aad57; color: #fff; animation: ts-btn-hl 5s 2.5s ease infinite; }
.ts-lock-badge { display: flex; align-items: center; gap: 6px; font-size: .7rem; color: rgba(255,255,255,.45); padding: 2px 12px; animation: ts-lock-appear 5s ease infinite; }
@keyframes ts-btn-hl { 0%,12%,100% { filter: none; } 6% { filter: brightness(1.4); box-shadow: 0 0 0 3px rgba(255,255,255,.25); } }
@keyframes ts-lock-appear { 0%,55% { opacity:0; transform: translateX(-6px); } 65%,90% { opacity:1; transform: translateX(0); } 100% { opacity:0; } }

/* ── Scene 7: Bewertung ──────────────────────────────────────────────────── */
.ts-grade-demo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ts-grade-sidebar-banner {
  background: #1e3d1a; border-radius: 12px; padding: 12px 14px; width: 200px;
  animation: ts-fadein .6s ease both;
}
.ts-grade-banner-head { font-size: .55rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.45); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.ts-grade-score { font-size: 1.3rem; font-weight: 700; color: #86efac; margin-bottom: 4px; }
.ts-grade-comment { font-size: .65rem; color: rgba(255,255,255,.65); line-height: 1.4; }
.ts-grade-modal-preview {
  background: #fff; border-radius: 10px; padding: 10px 14px; width: 200px;
  box-shadow: 0 4px 18px rgba(0,0,0,.15); border-left: 3px solid #f59e0b;
  animation: ts-panel-pop 5s 1s ease infinite;
}
.ts-grade-modal-head { font-size: .7rem; font-weight: 700; color: #c48a0a; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.ts-grade-bar-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.ts-grade-bar-lbl { font-size: .55rem; color: #666; width: 60px; flex-shrink: 0; }
.ts-grade-bar { height: 5px; border-radius: 3px; background: #f59e0b; flex: 1; }

/* ── Scene 8: Ausloggen ──────────────────────────────────────────────────── */
.ts-s7-flow { display: flex; align-items: center; gap: 10px; }
.ts-s7-step { text-align: center; flex: 1; }
.ts-s7-icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.ts-s7-lbl  { font-size: .65rem; color: #555; line-height: 1.3; font-weight: 600; }
.ts-s7-arr  { color: #bbb; font-size: 1.1rem; flex-shrink: 0; }
.ts-s7-step:nth-child(1) { animation: ts-step-pop 5s ease infinite; }
.ts-s7-step:nth-child(3) { animation: ts-step-pop 5s 1.6s ease infinite; }
.ts-s7-step:nth-child(5) { animation: ts-step-pop 5s 3.2s ease infinite; }
@keyframes ts-step-pop { 0%,5% { opacity:0; transform:scale(.75) translateY(8px); } 16%,78% { opacity:1; transform:scale(1) translateY(0); } 90%,100% { opacity:.15; } }

/* ── Tour replay button in sidebar ───────────────────────────────────────── */
.tour-replay-btn {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1px dashed rgba(255,255,255,.2);
  color: rgba(255,255,255,.45); border-radius: 7px;
  padding: 5px 10px; font-size: .72rem; cursor: pointer; width: 100%;
  transition: all .18s;
}
.tour-replay-btn:hover { border-color: rgba(255,255,255,.45); color: rgba(255,255,255,.75); }
