/* ——— Kurs-Flagge in der Kopfzeile ——— */
/* links in der Kopfzeile; weicht dem Zurück-Knopf */
.course-flag { grid-column: 1; grid-row: 1; width: 44px; height: 44px; border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; }
#backBtn:not(.hidden) ~ .course-flag { display: none; }

/* ——— Freunde heute (Tab Üben) ——— */
.friends-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin: 0 4px 10px; cursor: pointer; }
.friends-line b { color: var(--text); font-weight: 600; margin-left: 2px; }
.friends-line .avatar { vertical-align: middle; }

/* ——— Profilbilder ——— */
.avatar { display: inline-block; border-radius: 50%; object-fit: cover; flex: none; vertical-align: middle; }
.avatar.initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }

/* ——— Rangliste ——— */
.friends-card { padding: 8px 10px; }
.ranking { width: 100%; border-collapse: collapse; font-size: 14px; }
.ranking th { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: right; padding: 4px 6px; }
.ranking td { padding: 7px 6px; border-top: 1px solid var(--surface-2); }
.ranking tr.me td { background: var(--surface-2); }
.ranking .rank { color: var(--muted); width: 1.5em; text-align: center; }
.ranking .who { display: flex; align-items: center; gap: 10px; }
.ranking .who span { display: flex; flex-direction: column; line-height: 1.2; }
.ranking .who i { color: var(--muted); font-style: normal; font-size: 12px; }
.ranking .who small { font-size: 12px; }
.ranking .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ——— Profil ——— */
.profile-card { padding: 14px; }
.profile-row { display: flex; gap: 14px; align-items: center; }
.avatar-btn { position: relative; border: 0; background: none; padding: 0; cursor: pointer; flex: none; }
.avatar-btn .cam { position: absolute; right: -4px; bottom: -4px; background: var(--surface); border-radius: 50%; padding: 3px; font-size: 13px; box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.profile-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.profile-fields .search { margin: 4px 0 0; }
.profile-fields .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.profile-card > .btn { margin-top: 10px; }

/* ——— Verwaltung ——— */
.admin-card { padding: 12px; }
.invite-row { display: flex; gap: 8px; }
.invite-row .search { margin: 0; flex: 1; }
.invite-link code { word-break: break-all; font-size: 12px; }
.admin-users { list-style: none; margin: 12px 0 0; padding: 0; }
.admin-users li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--surface-2); }
.admin-users li > span:not(.avatar) { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.admin-users small { color: var(--muted); font-size: 12px; }
.danger-text { color: var(--bad, #c8432b); }

/* Einladung: Sprachwahl */
.invite-lang { display: flex; gap: 6px; margin-bottom: 8px; }
.invite-lang button { flex: 1; height: 44px; font-size: 24px; line-height: 1; border: 2px solid transparent; border-radius: 12px; background: var(--surface-2); touch-action: manipulation; }
.invite-lang button.on { border-color: var(--accent); background: var(--surface); }

/* ——— Darstellung (Farbthemen) ——— */
.appearance-card { padding: 14px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.theme-swatch { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; touch-action: manipulation; }
.sw-prev { position: relative; display: block; width: 100%; height: 64px; border-radius: 12px; border: 2px solid var(--line); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.sw-card { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 26px; border-radius: 7px; box-shadow: 0 0 0 1px rgb(128 128 128 / .25); display: flex; align-items: center; padding: 0 7px; }
.sw-card i { display: block; width: 55%; height: 7px; border-radius: 4px; }
.sw-dot { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; border-radius: 50%; }
.sw-check { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; display: none; place-items: center; line-height: 1; }
.theme-swatch.on .sw-prev { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.theme-swatch.on .sw-check { display: grid; }
.sw-name { font-size: 14px; color: var(--text); }
.theme-swatch.on .sw-name { font-weight: 600; }

/* Fehlerberichte (Admin) */
.err-head { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--surface-2); }
.err-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow: auto; }
.err-list li { padding: 6px 0; border-top: 1px solid var(--surface-2); font-size: 13px; }
.err-list summary { cursor: pointer; display: flex; flex-direction: column; line-height: 1.3; }
.err-list small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.err-msg { overflow-wrap: anywhere; }
.err-list pre { margin: 6px 0 0; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
