/* ═══════════════════════════════════════════════════════════════
   Samuel's Quest — Global Stylesheet v2.0
   Galaxy Z Fold 5 optimiert (gefaltet 904px, geöffnet 1812px)
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables — Dark Mode (default) ────────────────────── */
:root {
  /* Base */
  --bg:       #081B26;
  --bg-deep:  #091e2e;
  --card:     #0f3448;
  --accent:   #1C6C8C;
  --active:   #3DADD9;
  --light:    #ACDEF2;
  --white:    #FFFFFF;
  --muted:    rgba(172,222,242,0.38);
  --border:   rgba(61,173,217,0.16);

  /* Semantic Accent Colors */
  --amber:  #EF9F27;
  --warn:   #EF9F27;  /* Alias für --amber */
  --bright: #3DADD9;  /* Alias für --active */
  --bronze: #C8863A;
  --error:  #c07878;

  /* Tint Backgrounds */
  --bg-active: rgba(61,173,217,0.10);
  --bg-amber:  rgba(239,159,39,0.10);
  --bg-bronze: rgba(200,134,58,0.12);
  --bg-error:  rgba(192,120,120,0.10);

  /* Borders */
  --border-amber:  rgba(239,159,39,0.22);
  --border-bronze: rgba(200,134,58,0.22);
  --border-error:  rgba(192,120,120,0.22);

  /* Glows */
  --glow:       0 0 18px rgba(61,173,217,0.30);
  --glow-light: 0 0 24px rgba(172,222,242,0.28);
  --glow-amber: 0 0 18px rgba(239,159,39,0.42);

  /* Icon Filters */
  --filter-white:  brightness(0) invert(1);
  --filter-active: brightness(0) saturate(100%) invert(65%) sepia(50%) saturate(600%) hue-rotate(165deg) brightness(105%);
  --filter-amber:  brightness(0) saturate(100%) invert(73%) sepia(55%) saturate(500%) hue-rotate(5deg) brightness(105%);
  --filter-coin:   brightness(0) saturate(100%) invert(60%) sepia(65%) saturate(450%) hue-rotate(12deg) brightness(88%);
  --filter-muted:  brightness(0) invert(0.5);

  /* Typography */
  --font:      'Cinzel', Georgia, serif;
  --font-body: 'Raleway', system-ui, sans-serif;

  /* Layout */
  --nav-h:    68px;
  --r:        12px;
  --r-sm:     8px;
  --ease:     0.2s ease;
  --filter-h: 60px;
}

@media (min-width: 1400px) {
  :root {
    --nav-h: 76px;
    --r:     14px;
    --r-sm:  10px;
  }
}

/* ── Checkbox Styling ────────────────────────────────────── */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--active);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  background-color: transparent;
}

input[type="checkbox"]:checked {
  background-color: transparent;
  border-color: var(--amber);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--amber);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:hover {
  border-color: var(--bronze);
}

/* ── Light Mode overrides ────────────────────────────────────── */
body.light-mode {
  --bg:      #dff0fb;
  --card:    #ffffff;
  --accent:  #1C6C8C;
  --active:  #1a8ab8;
  --light:   #0d4a66;
  --white:   #081B26;
  --muted:   rgba(13,74,102,0.5);
  --border:  rgba(28,108,140,0.25);
  --glow:    0 0 20px rgba(28,108,140,0.2);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100svh;
  padding-bottom: var(--nav-h);
  transition: background var(--ease), color var(--ease);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: var(--active); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; touch-action: manipulation; }
img { display: block; max-width: 100%; }

/* ── App Shell ──────────────────────────────────────────────── */
#app {
  max-width: 1920px;
  margin: 0 auto;
  position: relative;
  background-image: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(28,108,140,0.08) 0%, transparent 70%);
  background-attachment: fixed;
}
/* ── Views ──────────────────────────────────────────────────── */
.view {
  display: none;
  min-height: calc(100svh - var(--nav-h));
  animation: fadeIn 0.28s ease;
}
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-content {
  padding: 1rem 1rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Fold 5 gefaltet: 904px */
@media (min-width: 905px) {
  .view-content { padding: 0rem 2rem 2rem; max-width: 860px; }
}
/* Fold 5 geöffnet: 1812px */
@media (min-width: 1400px) {
  .view-content { max-width: 1400px; padding: 2rem 3rem 2rem; }
}


/* Narrower layout for content-light views */
#quests-view .view-content,
#tasks-view .view-content,
#rewards-view .view-content,
#shop-view .view-content,
#inventory-view .view-content {
  max-width: 480px;
}
@media (min-width: 905px) {
  #quests-view .view-content,
  #tasks-view .view-content,
  #rewards-view .view-content,
  #shop-view .view-content,
  #inventory-view .view-content {
    max-width: 580px;
  }
}
@media (min-width: 1400px) {
  #quests-view .view-content,
  #tasks-view .view-content,
  #rewards-view .view-content,
  #shop-view .view-content,
  #inventory-view .view-content {
    max-width: 680px;
  }
}

/* ── Rune Filter Bar ─────────────────────────────────────────── */
#rune-filter-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--filter-h);
  overflow: hidden;
}
.rune-filter-scroll {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  align-items: center;
}
.rune-filter-scroll::-webkit-scrollbar { display: none; }

.rune-filter-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  touch-action: manipulation;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  color: var(--muted);
}
.rune-filter-btn.active {
  border-color: var(--active);
  background: rgba(61,173,217,0.15);
  box-shadow: var(--glow);
  color: var(--active);
}
.rune-filter-btn:hover { border-color: var(--accent); color: var(--light); }
.rune-filter-all { font-size: 1.1rem; }
.rune-icon { width: 26px; height: 26px; object-fit: contain; }
.rune-icon-sm { width: 20px; height: 20px; }
.rune-icon-lg { width: 36px; height: 36px; }

/* ── Bottom Navigation ──────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  z-index: 100;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.45);
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#bottom-nav::-webkit-scrollbar { display: none; }
.nav-item {
  flex: 0 0 auto;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.1rem;
  transition: color var(--ease), background var(--ease);
  position: relative;
  text-transform: uppercase;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.nav-icon img { width: 22px; height: 22px; object-fit: contain; filter: brightness(0) saturate(100%) invert(38%) sepia(60%) saturate(600%) hue-rotate(168deg) brightness(85%); transition: filter var(--ease); }
.nav-item.active { color: var(--active); }
.nav-item.active .nav-icon img { filter: brightness(0) saturate(100%) invert(65%) sepia(50%) saturate(600%) hue-rotate(165deg) brightness(105%) drop-shadow(0 0 4px rgba(61,173,217,.6)); }
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--active);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 0 8px rgba(61,173,217,0.6);
}
.nav-item:hover { color: var(--light); background: rgba(61,173,217,0.05); }
@media (min-width: 600px) {
  #bottom-nav { justify-content: stretch; }
  .nav-item { flex: 1; min-width: 0; }
}
@media (min-width: 905px) {
  .nav-item { font-size: 0.58rem; gap: 4px; }
  .nav-icon img { width: 24px; height: 24px; }
}
@media (min-width: 1400px) {
  .nav-item { font-size: 0.65rem; }
  #bottom-nav { height: 76px; }
}

/* ── Cards ──────────────────────────────────────────────────── */
/* ── Shared: card base ─────────────────────────────────────────────── */
.card, .xp-card, .coin-card {
  background: var(--card);
  border-radius: var(--r);
}

.card {
  padding: 1rem;
  transition: background var(--ease), border-color var(--ease);
}
.card-sm { padding: 0.65rem 0.75rem; }
.card-hover:hover { border-color: var(--accent); }

.card-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (min-width: 1200px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Typography ─────────────────────────────────────────────── */
.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--light);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2rem;
  padding-top: 0.75rem;
  padding-bottom: 0.85rem;
  position: relative;
}
.page-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 52px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--active), transparent);
}
.section-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--light);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
  text-align: center;
  position: relative;
  padding-bottom: 0.55rem;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 48px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--active), transparent);
}
.section-title:first-child { margin-top: 0; }
.label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.value-xl { font-size: 2rem; font-weight: 700; color: var(--active); letter-spacing: 0.04em; }
.value-lg { font-size: 1.5rem; font-weight: 700; color: var(--active); letter-spacing: 0.04em; }
.value-md { font-size: 1.1rem; font-weight: 600; color: var(--light); }
.text-muted { color: var(--muted); font-size: 0.8rem; }
.text-warn  { color: var(--amber); }
.text-success { color: var(--amber); }
.text-error { color: var(--error); }
.mono { font-family: 'Courier New', monospace; }

/* ── Raleway — Fliesstext & dichte Texte ────────────────────── */
.quest-desc,
.task-desc,
.reward-desc,
.trophy-desc,
.sk-sheet-desc,
.sk-section-text,
.sk-sheet-row,
.sk-card-de,
.activity-desc,
.activity-meta,
.epos-kat,
.text-muted,
.settings-sub,
.kpi-row,
.kpi-name,
.kpi-vals,
.empty-state p,
.form-input,
.form-hint,
.coach-msg,
#coach-text,
#coach-foto-caption,
#coach-foto-placeholder,
.loading {
  font-family: var(--font-body);
}

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-wrap {
  background: rgba(8,27,38,0.6);
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
  margin-top: 0.4rem;
}
.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--active));
  transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px rgba(61,173,217,0.5);
}
.progress-bar.warn { background: linear-gradient(90deg, var(--accent), var(--amber)); }
.progress-bar.full { background: linear-gradient(90deg, var(--amber), var(--amber)); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all var(--ease);
  cursor: pointer;
  border: none;
  touch-action: manipulation;
}
.btn-primary { background: var(--active); color: var(--bg); }
.btn-primary:hover { background: var(--light); box-shadow: var(--glow); }
.btn-secondary { background: var(--panel); border: 1px solid var(--accent); color: var(--light); }
.btn-secondary:hover { border-color: var(--active); color: var(--active); }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--light); }
.btn-outline:hover { border-color: var(--active); color: var(--active); }
.btn-warn { background: var(--amber); color: var(--bg); }
.btn-warn:hover { box-shadow: var(--glow-amber); opacity: 0.9; }
.btn-success { background: var(--amber); color: var(--bg); }
.btn-danger { background: var(--error); color: var(--white); opacity: 0.85; }
.btn-danger:hover { opacity: 1; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.w-full { width: 100%; justify-content: center; }
.btn.mt-1 { margin-top: 0.5rem; }
.btn.mt-2 { margin-top: 1rem; }

/* ── Status Badges ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 99px;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid;
}
.badge-active    { background: var(--bg-active); color: var(--active); border-color: var(--active); }
.badge-available { background: var(--bg-active); color: var(--active); border-color: var(--border); }
.badge-locked    { background: transparent; color: var(--muted); border-color: var(--border); }
.badge-completed { background: var(--bg-amber); color: var(--amber); border-color: var(--border-amber); }
.badge-paused    { background: var(--bg-error);  color: var(--error); border-color: var(--border-error); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.form-input {
  width: 100%;
  background: rgba(8,27,38,0.7);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.form-input:focus { border-color: var(--active); box-shadow: 0 0 0 3px rgba(61,173,217,0.15); }
.form-input::placeholder { color: var(--muted); }
select.form-input option { background: var(--card); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ── Toggle Switch ───────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(172,222,242,0.15);
  border: 1px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--ease);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform var(--ease), background var(--ease);
}
.toggle input:checked + .toggle-slider { background: rgba(61,173,217,0.2); border-color: var(--active); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--active); }

/* ── Dashboard ───────────────────────────────────────────────── */
.hero {
  background: transparent;
  border-bottom: none;
  padding: 2rem 1rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 50% -10%, rgba(61,173,217,0.12), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.hero-title {
  font-size: 0.52rem;
  letter-spacing: 0.45em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hero-level {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--light);
  letter-spacing: 0.06em;
  text-shadow: 0 0 40px rgba(172,222,242,0.35), 0 0 80px rgba(61,173,217,0.15);
  line-height: 1.1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: text-shadow var(--ease);
}
.hero-level:hover {
  text-shadow: 0 0 50px rgba(172,222,242,0.6), 0 0 100px rgba(61,173,217,0.35);
}
.hero-sub {
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.28em;
  margin-top: 0.3rem;
  text-transform: uppercase;
}
.hero-xp {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.12em;
}
.hero-xp-num { color: var(--active); font-weight: 700; font-size: 0.82rem; }

/* ── Hero: Level-Fortschrittsbalken ─────────────────────────── */
.hero-level-progress-wrap {
  max-width: 220px;
  margin: 0.75rem auto 0;
}
.hero-progress-label {
  display: block;
  font-family: var(--font);
  font-size: 0.5rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-top: 4px;
  text-align: center;
}

/* ── Hero: Streak + heute XP Badges ─────────────────────────── */
.hero-stats-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.65rem 0 0;
}
.hero-stat-badge {
  background: rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 0.68rem;
  font-family: var(--font);
  color: var(--light);
  letter-spacing: 0.04em;
}
.hero-streak  { color: var(--amber); border: 1px solid rgba(239,159,39,0.3); }
.hero-today-xp { color: var(--active); border: 1px solid rgba(61,173,217,0.25); cursor: pointer; transition: background var(--ease); }
.hero-today-xp:hover { background: rgba(61,173,217,0.15); }

/* ── Hero: XP-Ticker ─────────────────────────────────────────── */
.hero-xp-ticker {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.4rem 0 0;
}
.ticker-item {
  font-size: 0.56rem;
  color: var(--muted);
  font-family: var(--font);
  opacity: 0.75;
}

/* ── Section-Title: einklappbar ──────────────────────────────── */
.section-title-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.section-title-toggle:hover { opacity: 0.75; }
.section-toggle-icon {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sync-age-badge {
  font-size: 0.5rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.65;
  flex-shrink: 0;
}
.dash-health-header-row { justify-content: flex-start; }
.dash-health-header-row .section-toggle-icon { margin-left: auto; }
.dash-sync-btn {
  background: none;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--ease), border-color var(--ease);
}
.dash-sync-btn:hover { color: var(--bright); border-color: var(--bright); }
.dash-sync-btn:disabled { opacity: 0.45; cursor: default; }

/* ── Einklappbare Sektion ─────────────────────────────────────── */
.dash-collapsible {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s ease;
}
.dash-collapsible.open {
  max-height: 4000px;
}

.xp-card {
  padding: 0.85rem 0.75rem;
  text-align: center;
  transition: opacity var(--ease);
}
.xp-card:hover { opacity: 0.85; }
.xp-card-icon { font-size: 1.6rem; margin-bottom: 0.4rem; }
.xp-card-icon img { width: 1.6rem; height: 1.6rem; object-fit: contain; filter: var(--filter-active); opacity: 0.7; }
.xp-card-name { font-size: 0.52rem; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }
.xp-card-val  { font-size: 1.15rem; font-weight: 700; color: var(--active); margin: 0.2rem 0 0.1rem; letter-spacing: 0.04em; }
.xp-card-sub  { font-size: 0.55rem; color: var(--muted); }

.coin-card {
  border: none;
  padding: 0.85rem 0.75rem;
  text-align: center;
  transition: opacity var(--ease);
}
.coin-card:hover { opacity: 0.85; }
.coin-card-icon { font-size: 1.6rem; margin-bottom: 0.4rem; }
.coin-card-icon img { width: 1.6rem; height: 1.6rem; object-fit: contain; filter: var(--filter-coin); }
.coin-card-name { font-size: 0.52rem; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }
.coin-card-val  { font-size: 1.15rem; font-weight: 700; color: var(--bronze); margin: 0.2rem 0 0.1rem; letter-spacing: 0.04em; }
.coin-card-sub  { font-size: 0.55rem; color: var(--muted); }

.epos-card {
  padding: 0.85rem;
  cursor: pointer;
  transition: box-shadow var(--ease);
}
.epos-card:hover { box-shadow: var(--glow); }
.epos-card-head { display: flex; align-items: flex-start; gap: 0.65rem; margin-bottom: 0.5rem; }
.epos-icon { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }
/* ── Shared: SVG white icon filter ─────────────────────────────── */
.epos-icon img, .sk-card-icon img, .sk-sheet-icon img,
.quest-icon img, .wz-chip-icon img { filter: brightness(0) invert(1); }

.epos-icon img { width: 2.2rem; height: 2.2rem; object-fit: contain; display: block; }
.epos-title { font-size: 0.85rem; font-weight: 700; color: var(--light); letter-spacing: 0.06em; }
/* ── Shared: category/epos meta label ──────────────────────────────── */
.epos-kat, .quest-epos {
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.epos-kat  { margin-top: 0.15rem; }
.quest-epos { margin-top: 0.1rem; }
.epos-progress { margin-top: 0.25rem; }
.epos-progress-nums {
  display: flex; justify-content: space-between;
  font-size: 0.6rem; color: var(--muted); margin-bottom: 0.25rem;
}

/* ── Activity Feed ───────────────────────────────────────────── */
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 30px; height: 30px;
  background: transparent;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.6;
}
.activity-info { flex: 1; min-width: 0; }
.activity-desc { font-size: 0.78rem; color: var(--light); font-weight: 500; letter-spacing: 0.01em; }
.activity-meta { font-size: 0.58rem; color: var(--muted); margin-top: 0.15rem; letter-spacing: 0.06em; }
.activity-xp { font-size: 0.75rem; font-weight: 700; color: var(--active); white-space: nowrap; }

/* ── Skilltree ───────────────────────────────────────────────── */
#skilltree-view { display: none; padding: 0; overflow: hidden; }
#skilltree-view.active {
  display: flex;
  flex-direction: column;
  height: calc(100svh - var(--nav-h));
  max-height: calc(100svh - var(--nav-h));
}

#sk-epos-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
}
#sk-epos-tabs::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 80%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  pointer-events: none;
}
#sk-epos-tabs::-webkit-scrollbar { display: none; }

.sk-epos-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 0.45rem 0.9rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--ease);
}
.sk-epos-tab:hover  { color: var(--light); }
.sk-epos-tab.active { color: var(--active); border-bottom-color: var(--active); }

/* ── Tree scroll area ── */
#sk-tree-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative;
}
#sk-tree-list { padding: 1.5rem 1rem 6rem; max-width: 580px; margin: 0 auto; }

#sk-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 60%;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
}

/* ── Epos info header ── */
.sk-epos-info {
  background: transparent;
  padding: .75rem 0 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.sk-epos-info-row {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}
.sk-epos-info-block {
  flex: 1;
  min-width: 70px;
  padding: 0 .5rem;
  border-right: 1px solid rgba(61,173,217,0.1);
}
.sk-epos-info-block:first-child { padding-left: 0; }
.sk-epos-info-block:last-child  { border-right: none; }
.sk-epos-info-label { font-size: .55rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem; }
.sk-epos-info-val   { font-size: .78rem; color: var(--light); font-weight: 600; }
.sk-epos-info-val--xp { color: var(--active); }

/* ── Tree path ── */
.sk-path { display: flex; flex-direction: column; align-items: center; gap: 0; }

/* Main level block */
.sk-level-block { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; }

/* ── Main node chip (pill — matches admin editor wz-chain-chip) ── */
.sk-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: center;
  width: 100%;
  user-select: none;
  touch-action: pan-y;
}
.sk-card--active .sk-card-title { color: var(--white); font-size: 0.92rem; }
.sk-card--active .sk-xp-chip  { display: none; }
.sk-card--completed                   { background: transparent; border: none; padding: 2px; gap: 0; opacity: 1; pointer-events: none; width: auto; }
.sk-card--completed::before           { content: none; }
.sk-card--completed .sk-icon-ring-wrap { width: 52px; height: 52px; }
.sk-card--completed .sk-card-icon     { width: 52px; height: 52px; }
.sk-card--completed .sk-card-icon img {
  width: 42px; height: 42px;
  filter: invert(65%) sepia(78%) saturate(597%) hue-rotate(349deg) brightness(118%) contrast(91%)
          drop-shadow(0 0 5px rgba(239,159,39,1.0)) drop-shadow(0 0 16px rgba(239,159,39,0.65)) drop-shadow(0 0 30px rgba(239,159,39,0.30));
}
.sk-card--completed .sk-card-body     { display: none; }
.sk-card--completed .sk-card-meta     { display: none; }
.sk-card--completed .sk-card-de       { display: none; }
.sk-card--completed .sk-card-status   { display: none; }
.sk-card--completed ~ .sk-xp-wrap     { display: none; }
.sk-card--locked              { opacity: 0.28; filter: grayscale(0.6); cursor: default; }

@keyframes pulseIconAmber {
  0%,100% { filter: invert(65%) sepia(78%) saturate(597%) hue-rotate(349deg) brightness(100%) contrast(91%) drop-shadow(0 0 6px rgba(239,159,39,0.55)); }
  50%     { filter: invert(65%) sepia(78%) saturate(597%) hue-rotate(349deg) brightness(132%) contrast(91%) drop-shadow(0 0 22px rgba(239,159,39,1.0)); }
}

/* ── Node icon ring wrap ── */
.sk-icon-ring-wrap {
  position: relative;
  width: 70px; height: 70px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sk-ring-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
.sk-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 5;
}
.sk-ring-arc {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}
.sk-ring-arc--active { stroke: var(--light); }
.sk-ring-arc--next   { stroke: var(--warn); }
.sk-ring-arc--locked { stroke: rgba(172,222,242,0.30); }

/* ── Node icon (no background circle — direct glow on img) ── */
.sk-card-icon {
  width: 56px; height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sk-card-icon img         { width: 48px; height: 48px; object-fit: contain; }
.sk-card-icon--active img { animation: pulseIconAmber 2.2s ease-in-out infinite; }
.sk-card-icon--locked img { filter: brightness(0) invert(0.18); }
.sk-card-icon--start img  { filter: brightness(0) invert(0.85) drop-shadow(0 0 6px rgba(172,222,242,0.4)); }

/* Card text */
.sk-card-body  { flex: 1; min-width: 0; text-align: center; }
.sk-card-title { font-size: 0.85rem; font-weight: 600; color: var(--light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-card-de    { font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.sk-card-meta  { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .25rem; align-items: center; justify-content: center; }

.sk-lvl-chip  { font-size: .62rem; color: var(--muted); letter-spacing: .06em; }
.sk-xp-chip   { font-size: .62rem; color: var(--active); }
.sk-coin-chip { font-size: .62rem; color: var(--bronze); }

/* Status badge (right side of chip) */
.sk-card-status {
  font-size: .58rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .18rem .5rem;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
  color: var(--muted);
}
.sk-card-status--active    { background: var(--bg-amber); color: var(--amber); font-weight: 700; }
.sk-card-status--completed { display: none; }
.sk-card-status--locked    { display: none; }

/* Ausstehende Bedingungen — Karte (innerhalb sk-card-body) */
.sk-pending {
  list-style: none;
  margin: .3rem 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sk-pending li {
  font-size: .6rem;
  color: var(--active);
  line-height: 1.35;
}
/* Sheet-Variante: etwas grössere Schrift, mehr Luft */
.sk-pending--sheet li {
  font-size: .72rem;
  padding: .15rem 0;
  border-bottom: 1px solid rgba(239,159,39,.1);
}
.sk-pending--sheet li:last-child { border-bottom: none; }

/* Sheet-Section Pending */
.sk-sheet-section--pending {
  background: rgba(239,159,39,.04);
  border: 1px solid rgba(239,159,39,.18);
  border-radius: var(--r-sm);
  padding: .65rem .75rem;
  margin-top: .75rem;
}
.sk-sheet-section--pending .sk-section-title { color: var(--amber); }

/* XP progress bar (used in epos info header, generic) */
.sk-xp-bar {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,.07);
  border-radius: 2px;
  overflow: hidden;
}
.sk-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--active));
  border-radius: 2px;
  transition: width .6s ease;
}
/* Sisu-Zahlen-Label unter dem Ring (kein Balken mehr) */
.sk-xp-wrap {
  width: 100%;
  padding: 2px 6px 0;
}
.sk-xp-label {
  font-size: .58rem;
  color: var(--muted);
  text-align: center;
}

/* ── Sub-nodes tree (recursive branches) ── */
.sk-sub-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
}
.sk-sub-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.sk-sub-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.sk-branch-connector {
  width: 1px; height: 16px;
  background: linear-gradient(180deg, var(--border), transparent);
  border-radius: 1px;
  margin: 4px 0;
}

/* Sub chip — matches wz-sub-chip */
.sk-sub-card {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  padding: .24rem .55rem .24rem .38rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  font-size: .78rem;
  color: var(--muted);
  transition: border-color var(--ease), color var(--ease);
  touch-action: pan-y;
}
.sk-sub-card:hover              { border-color: var(--active); color: var(--light); }
.sk-sub-card--active            { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 12px rgba(239,159,39,0.2); }
.sk-sub-card--completed         { opacity: .45; text-decoration: line-through; }
.sk-sub-card--locked            { opacity: .35; }
.sk-sub-icon-img { width: 20px; height: 20px; object-fit: contain; filter: brightness(0) invert(.55); }
.sk-sub-icon     { font-size: .88rem; line-height: 1; }
.sk-sub-title    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

/* ── Connector between level chips ── */
.sk-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 3rem;
  justify-content: center;
  gap: 0;
}
.sk-connector-line {
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(61,173,217,0.2), transparent);
  border-radius: 2px;
}
.sk-connector--completed .sk-connector-line {
  background: linear-gradient(180deg, rgba(239,159,39,0.4), rgba(239,159,39,0.7), rgba(239,159,39,0.4));
  opacity: 1;
}

/* ── Node Detail Sheet ── */
#sk-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,27,38,.75);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(6px);
}
#sk-sheet-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

#sk-sheet {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r) var(--r) 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 88svh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 1.25rem 3rem;
  position: relative;
  animation: slideUp .25s ease;
}
@media (min-width: 905px) {
  #sk-sheet { max-width: 820px; padding: 0 2rem 3rem; }
}
@media (min-width: 1400px) {
  #sk-sheet { max-width: 1000px; }
}
@keyframes slideUp { from { transform:translateY(40px); opacity:0; } to { transform:translateY(0); opacity:1; } }

#sk-sheet-bar {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: .75rem auto .5rem;
}
#sk-sheet-close {
  position: absolute;
  top: .75rem; right: 1rem;
  background: none; border: none;
  font-size: 1.3rem; color: var(--muted);
  cursor: pointer; padding: .5rem;
  transition: color var(--ease);
  touch-action: manipulation;
}
#sk-sheet-close:hover { color: var(--white); }

/* Sheet content */
.sk-sheet-head {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 0 .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .85rem;
}
.sk-sheet-icon {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.sk-sheet-icon img { width: 42px; height: 42px; object-fit: contain; }
.sk-sheet-icon--active    { background: var(--bg-amber);  border: 2px solid var(--border-amber); box-shadow: var(--glow-amber); }
.sk-sheet-icon--completed { background: var(--bg-amber);  border: 2px solid var(--border-amber); box-shadow: var(--glow-amber); }
.sk-sheet-icon--locked    { background: rgba(255,255,255,.05);border: 2px solid var(--border); filter: grayscale(.6); }
.sk-sheet-icon--start     { background: var(--active); border: 2px solid var(--light); }
.sk-sheet-head-text { flex: 1; min-width: 0; }
.sk-sheet-title { font-size: 1rem; font-weight: 700; color: var(--white); letter-spacing: .08em; text-transform: uppercase; }
.sk-sheet-de    { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.sk-sheet-desc  { font-size: .83rem; color: var(--light); line-height: 1.75; margin-bottom: 1rem; }

.sk-sheet-xp { margin-bottom: 1rem; }
.sk-sheet-xp-label { display: flex; justify-content: space-between; font-size: .65rem; color: var(--muted); margin-bottom: 4px; }

.sk-sheet-section {
  border-top: 1px solid var(--border);
  padding-top: .75rem;
  margin-top: .75rem;
}
.sk-sheet-section--test {
  background: rgba(239,159,39,.05);
  border: 1px solid rgba(239,159,39,.2);
  border-radius: var(--r-sm);
  padding: .75rem;
  margin-top: .75rem;
}
.sk-section-title {
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.section-icon { width: 1.1rem; height: 1.1rem; object-fit: contain; flex-shrink: 0; filter: brightness(0) invert(1); opacity: .7; }
.sk-section-text { font-size: .82rem; color: var(--light); line-height: 1.75; margin: 0; }
.sk-sheet-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  font-size: .8rem;
  color: var(--light);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.sk-sheet-row:last-child { border-bottom: none; }

/* Node edit form rows */
.sk-edit-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: .75rem;
}
.sk-edit-label {
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* KPI rows (shared) */
.kpi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .75rem;
}
.kpi-row:last-child { border-bottom: none; }
.kpi-name    { color: var(--light); }
.kpi-vals    { display: flex; gap: .4rem; align-items: center; color: var(--muted); }
.kpi-current { color: var(--active); font-weight: 700; }
.kpi-target  { color: var(--amber); font-weight: 600; }

/* ── Quests ──────────────────────────────────────────────────── */
.quest-epos-group { margin-bottom: 2rem; }
.quest-epos-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-size: 0.56rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0;
  padding-bottom: 0.6rem;
  text-align: center;
}
.quest-epos-header img { width: 0.9rem; height: 0.9rem; object-fit: contain; filter: brightness(0) invert(1); opacity: .4; }
.quest-locked-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.quest-locked-chip {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  opacity: 0.45;
}
.quest-locked-chip-icon { width: .9rem; height: .9rem; object-fit: contain; filter: brightness(0) invert(1); opacity: .6; flex-shrink: 0; }
.quest-locked-chip-title { font-size: .72rem; color: var(--light); }
.quest-locked-chip-meta { font-size: .58rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.quest-locked-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .7rem;
  border-radius: 2rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
  transition: all var(--ease);
  flex-shrink: 0;
}
.quest-locked-toggle.showing {
  border-color: rgba(172,222,242,.35);
  color: var(--light);
}
.quest-locked-toggle-icon {
  width: .7rem;
  height: .7rem;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .4;
  transition: opacity var(--ease);
}
.quest-locked-toggle.showing .quest-locked-toggle-icon { opacity: .7; }

.quest-card {
  background: transparent;
  border-radius: 0;
  padding: 1.1rem 0.25rem;
  margin-bottom: 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: opacity var(--ease);
  position: relative;
}
.quest-card::before {
  content: '';
  position: absolute;
  left: -0.25rem; top: 50%; transform: translateY(-50%);
  width: 2px; height: 0;
  background: var(--active);
  border-radius: 1px;
  transition: height var(--ease);
}
.quest-card:hover::before { height: 40%; }
.quest-card:hover .quest-title { color: var(--white); }
.quest-card.active::before { height: 60%; background: var(--amber); }
.quest-card.active .quest-title { color: var(--amber); }
.quest-card.completed { opacity: 0.5; }
.quest-card.locked { opacity: 0.38; cursor: default; }
.quest-card:last-child { border-bottom: none; }
.quest-head { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.35rem; }
.quest-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1; opacity: 0.7; }
.quest-icon img { width: 1.6rem; height: 1.6rem; object-fit: contain; display: block; filter: var(--filter-white); opacity: 0.6; }
.quest-info { flex: 1; min-width: 0; }
.quest-title { font-size: 0.82rem; font-weight: 600; color: var(--light); letter-spacing: 0.03em; transition: color var(--ease); }
.quest-desc  { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.45rem; line-height: 1.65; }
.quest-rewards { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.quest-reward-chip {
  font-size: 0.58rem;
  padding: 0.18rem 0.45rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.quest-reward-chip.xp   { border-color: rgba(61,173,217,0.4); color: var(--active); }
.quest-reward-chip.coin { border-color: var(--border-bronze); color: var(--bronze); }
.chip-icon { width: .95rem; height: .95rem; object-fit: contain; vertical-align: middle; filter: var(--filter-coin); margin-right: .15rem; }

/* Coin symbol inline */
.coin-sym { width: .85em; height: .85em; object-fit: contain; vertical-align: middle; filter: var(--filter-coin); margin-left: .1em; }

/* Quest sub-list */
.subquest-list { margin-top: 0.5rem; padding-left: 1rem; }
.subquest-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(61,173,217,0.08);
}
.subquest-item:last-child { border-bottom: none; }
.subquest-item.completed { color: var(--active); }
.subquest-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.subquest-dot.done { background: var(--active); box-shadow: 0 0 4px rgba(61,173,217,0.6); }

/* ── Tasks ───────────────────────────────────────────────────── */
.task-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
}
.task-tab {
  flex: 1;
  padding: 0.5rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all var(--ease);
  touch-action: manipulation;
}
.task-tab.active { background: rgba(61,173,217,0.1); border-color: var(--active); color: var(--active); }
.task-tab:hover:not(.active) { border-color: var(--accent); color: var(--light); }

.task-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.task-icon { font-size: 1.6rem; flex-shrink: 0; padding-top: 0.1rem; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 0.85rem; font-weight: 600; color: var(--light); }
.task-hashtag { font-size: 0.62rem; color: var(--active); letter-spacing: 0.08em; margin-top: 0.1rem; }
.task-desc  { font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.6; }
.task-meta  { display: flex; gap: 0.5rem; margin-top: 0.4rem; flex-wrap: wrap; }

/* ── Rewards ─────────────────────────────────────────────────── */

/* ── Trophäen-Inhalt ─────────────────────────────────────────── */
.trophies-content {
  padding: 1rem 0.5rem;
}

#shop-filter-bar {
  display: flex;
  align-items: center;
  gap: .35rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 0 .75rem;
  -webkit-overflow-scrolling: touch;
}
#shop-filter-bar::-webkit-scrollbar { display: none; }
.shop-chip {
  flex-shrink: 0;
  font-size: .72rem;
  font-family: 'Raleway', sans-serif;
  padding: .3rem .65rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.shop-chip.active {
  background: rgba(61,173,217,.18);
  color: var(--bright);
  border-color: var(--accent);
}
.shop-chip-leistbar.active {
  background: rgba(239,159,39,.15);
  color: var(--amber);
  border-color: var(--amber);
}
.shop-chip-sep {
  flex-shrink: 0;
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 .1rem;
}

.shop-coin-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.shop-coin-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1 1 0;
  padding: 0.6rem 0.25rem;
  border-right: 1px solid rgba(61,173,217,0.08);
}
.shop-coin-cat:last-child { border-right: none; }
.shop-coin-cat-icon {
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  opacity: 0.6;
}
.shop-coin-cat-icon-svg {
  width: 20px;
  height: 20px;
  background-color: var(--bronze);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.shop-coin-cat-name {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.shop-coin-cat-amount {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bronze);
  white-space: nowrap;
}
.shop-kat-coins {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bronze);
  font-family: inherit;
}
.kat-icon-sm { width: 1.4rem; height: 1.4rem; object-fit: contain; filter: brightness(0) invert(1); opacity: .7; }
.trophy-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 12px;
}

/* ── Trophy-Karten ───────────────────────────────────────────── */
.trophy-card {
  background: transparent;
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 88px;
  position: relative;
  transition: opacity var(--ease), transform var(--ease);
}
.trophy-earned:hover { transform: translateY(-2px); }
.trophy-icon-wrap {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.trophy-earned .trophy-icon-wrap {
  background: radial-gradient(circle, rgba(239,159,39,0.12) 0%, transparent 70%);
  box-shadow: 0 0 0 1px rgba(239,159,39,0.25);
}
.trophy-icon {
  width: 44px; height: 44px; object-fit: contain;
  filter: var(--filter-amber);
}
.trophy-earned .trophy-icon {
  animation: trophy-glow 1s ease-in-out infinite alternate;
}
@keyframes trophy-glow {
  from { filter: var(--filter-amber) drop-shadow(0 0 6px rgba(239,159,39,0.6)); }
  to   { filter: var(--filter-amber) drop-shadow(0 0 14px rgba(239,159,39,0.95)) drop-shadow(0 0 28px rgba(239,159,39,0.4)); }
}
.trophy-icon-locked {
  filter: brightness(0) invert(1);
  opacity: 0.25;
}
.trophy-pending { opacity: 0.45; }
.trophy-pending:hover { opacity: 0.8; }
.trophy-name {
  font-family: var(--font);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--light);
  line-height: 1.3;
}
.trophy-pending .trophy-name { color: var(--muted); }
.trophy-unlock-btn {
  display: none;
  padding: 3px 9px;
  font-family: var(--font);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  background: var(--accent);
  border: 1px solid var(--active);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.trophy-unlock-btn:hover { background: var(--active); }
.trophy-unlock-btn:disabled { opacity: 0.5; cursor: default; }
.trophy-pending:hover .trophy-unlock-btn { display: block; }
@media (hover: none) {
  .trophy-unlock-btn { display: block; }
}

/* ── Trophy Pin-Button (Dashboard-Auswahl) ───────────────────── */
.trophy-pin-btn {
  position: absolute;
  top: 2px; right: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--ease), color var(--ease);
  border-radius: 3px;
}
.trophy-card:hover .trophy-pin-btn { opacity: 0.55; }
.trophy-pin-btn.is-pinned { opacity: 1; color: var(--warn); }
.trophy-card-pinned { opacity: 0.85 !important; }
.trophy-card-pinned:hover { opacity: 1 !important; }
@media (hover: none) {
  .trophy-pin-btn { opacity: 0.3; }
  .trophy-pin-btn.is-pinned { opacity: 1; }
}

/* ── Trophy Icon Fill (pending) ──────────────────────────────── */
.trophy-icon-fill-wrap {
  width: 72px;
  height: 72px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.trophy-icon-base,
.trophy-icon-fill-img {
  position: absolute;
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.trophy-icon-base {
  filter: brightness(0) invert(1);
  opacity: 0.2;
  transition: opacity var(--ease);
}
.trophy-icon-fill-img {
  filter: var(--filter-amber);
  clip-path: inset(calc(100% - var(--fill-pct, 0%)) 0 0 0);
  transition: clip-path 0.6s ease;
}
.trophy-almost .trophy-icon-base { opacity: 0.35; }

/* ── Fast erreicht (≥75%) ────────────────────────────────────── */
.trophy-almost {
  opacity: 0.9 !important;
  border-radius: 8px;
  animation: trophy-almost-pulse 1.6s ease-in-out infinite;
}
.trophy-almost .trophy-icon-fill-img { filter: var(--filter-amber) drop-shadow(0 0 6px rgba(239,159,39,0.5)); }
@keyframes trophy-almost-pulse {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(239,159,39,0.5), 0 0 8px rgba(239,159,39,0.15); }
  50%       { box-shadow: 0 0 0 2px rgba(239,159,39,0.95), 0 0 18px rgba(239,159,39,0.35); }
}

.trophy-desc {
  font-size: 0.58rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Legacy reward-card (Shop) */
.reward-card {
  background: transparent;
  border-radius: var(--r);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: opacity var(--ease), transform var(--ease);
}
.reward-card:hover { opacity: 0.85; transform: translateY(-1px); }
.reward-card.redeemed { opacity: 0.4; }
.reward-icon  { font-size: 2rem; margin-bottom: 0.5rem; }
.reward-title { font-size: 0.85rem; font-weight: 700; color: var(--light); margin-bottom: 0.25rem; }
.reward-desc  { font-size: 0.72rem; color: var(--muted); line-height: 1.6; margin-bottom: 0.75rem; }
.reward-cost  { font-size: 1rem; font-weight: 700; color: var(--bronze); margin-bottom: 0.5rem; }

/* ── Dashboard: Nächste Trophäen Widget ─────────────────────── */
.next-trophies-widget {
  background: var(--panel);
  border-radius: var(--r);
  padding: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  transition: opacity var(--ease);
}
.next-trophies-widget:hover { opacity: 0.85; }
.next-trophy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
}
.next-trophy-icon-fill-wrap {
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}
.next-trophy-icon-base,
.next-trophy-icon-fill-img {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.next-trophy-icon-base {
  filter: brightness(0) invert(1);
  opacity: 0.25;
}
.next-trophy-icon-fill-img {
  filter: var(--filter-amber);
  clip-path: inset(calc(100% - var(--fill-pct, 0%)) 0 0 0);
  transition: clip-path 0.6s ease;
}
.next-trophy-name {
  font-family: var(--font);
  font-size: 0.62rem;
  color: var(--light);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.next-trophy-pct {
  font-family: var(--font);
  font-size: 0.58rem;
  color: var(--muted);
}

/* ── Inventory ───────────────────────────────────────────────── */
.inv-item-owned .trophy-icon-wrap {
  background: radial-gradient(circle, rgba(61,173,217,0.10) 0%, transparent 70%);
  box-shadow: 0 0 0 1px rgba(61,173,217,0.20);
}
.inv-item-locked {
  opacity: 0.32;
  transition: opacity 0.2s, transform 0.2s;
}
.inv-item-locked:hover {
  opacity: 0.7;
}
.inv-status-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.inv-status-purchased { color: var(--amber); }
.inv-status-owned     { color: var(--active); }
.inv-status-available { color: var(--muted); }
.inv-status-locked    { color: var(--muted); opacity: 0.5; }
.inv-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  margin: 1rem auto 0;
  transition: background 0.2s;
}
.inv-add-btn:hover { background: var(--active); }
.inv-manual-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem;
  margin-top: .75rem;
}
.inv-manual-form.hidden { display: none; }

/* ── Shop ────────────────────────────────────────────────────── */
.shop-card-purchased {
  opacity: 0.4;
  filter: grayscale(0.5);
}
.shop-card-purchased:hover { opacity: 0.55; }
/* Global Reward rows (list layout, always-visible button) */
.gr-list {
  display: flex;
  flex-direction: column;
}
.gr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  padding: 0.9rem 0.25rem;
  border-bottom: 1px solid var(--border);
  transition: opacity var(--ease);
}
.gr-row:last-child { border-bottom: none; }
.gr-row.shop-card-purchased { opacity: .35; filter: grayscale(.5); }
.gr-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border-radius: 50%;
  opacity: 0.7;
}
.gr-icon img {
  width: 30px; height: 30px; object-fit: contain;
  filter: var(--filter-amber);
}
.gr-body {
  flex: 1;
  min-width: 0;
}
.gr-title {
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  color: var(--light);
  line-height: 1.3;
}
.gr-desc {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gr-stock {
  font-size: .65rem;
  color: var(--muted);
  margin-top: 3px;
}
.gr-stock strong { color: var(--active); }
.gr-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.gr-cost {
  font-size: .82rem;
  font-weight: 700;
  color: var(--bronze);
  white-space: nowrap;
}
.gr-buy-btn {
  padding: 4px 12px;
  font-size: .68rem;
  letter-spacing: 0.06em;
  border-radius: 99px;
  background: transparent;
  color: var(--active);
  border: 1px solid rgba(61,173,217,0.35);
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: all var(--ease);
}
.gr-buy-btn:hover { background: rgba(61,173,217,0.1); border-color: var(--active); }
.gr-buy-btn:active { opacity: .8; }
.gr-buy-btn:disabled { opacity: .3; cursor: default; }
.gr-exhausted {
  font-size: .68rem;
  color: var(--muted);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.gr-locked { font-size: 1.1rem; opacity: .55; cursor: default; }
.gr-row-locked { opacity: .72; }
.gr-cond-list {
  list-style: none;
  margin: .4rem 0 0;
  padding: 0;
}
.gr-cond-item {
  font-size: .72rem;
  color: var(--muted);
  padding: .1rem 0;
  line-height: 1.5;
}
.gr-cond-item.gr-cond-met { color: var(--active); }
.gr-cond-progress { opacity: .7; font-variant-numeric: tabular-nums; }

/* Admin: Conditions in Global Rewards form */
.gr-conds-section {
  border-top: 1px solid var(--border);
  margin-top: .9rem;
  padding-top: .9rem;
}
.gr-conds-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .55rem;
  min-height: 1rem;
}
.gr-cond-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .78rem;
  background: rgba(255,255,255,.04);
  border-radius: 6px;
  padding: .28rem .6rem;
}
.gr-cond-label { flex: 1; }
.gr-cond-del {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: .82rem;
  padding: 0 .2rem;
  opacity: .7;
}
.gr-cond-del:hover { opacity: 1; }
.gr-cond-empty { font-size: .75rem; color: var(--muted); font-style: italic; }
.gr-cond-add {
  display: flex;
  gap: .4rem;
  align-items: center;
  flex-wrap: wrap;
}
.shop-stock-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: .7rem;
  gap: 6px;
}
.shop-stock-remaining {
  font-weight: 700;
  color: var(--active);
}
.shop-stock-bought {
  color: var(--muted);
}

/* ── Settings ────────────────────────────────────────────────── */
.settings-section { margin-bottom: 0.5rem; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--card);
  border-radius: var(--r);
  margin-bottom: 0.5rem;
}
.settings-label { font-size: 0.82rem; font-weight: 600; color: var(--light); }
.settings-sub   { font-size: 0.65rem; color: var(--muted); margin-top: 0.1rem; }

.token-wrap { position: relative; }
.token-field { padding-right: 3rem; letter-spacing: 0.05em; font-size: 0.75rem; }
.token-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  transition: color var(--ease);
}
.token-toggle:hover { color: var(--light); }

.danger-zone { border: 1px solid rgba(224,80,80,0.2); border-radius: var(--r); padding: 0.85rem; }
.danger-zone .settings-row { border: none; margin-bottom: 0; padding: 0; background: none; }

/* ── Popup / Overlay ─────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,27,38,0.85);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.overlay.open { display: flex; animation: overlayIn 0.2s ease; }
.popup {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r) var(--r) 0 0;
  padding: 1.5rem 1.25rem 2rem;
  width: 100%;
  max-width: 640px;
  max-height: 80svh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: slideUp 0.25s ease;
}
.popup-lg { max-height: 90svh; }
@media (min-width: 905px) {
  .popup { max-width: 820px; padding: 1.75rem 2rem 2.5rem; }
}
@media (min-width: 1400px) {
  .popup { max-width: 1000px; }
}
.popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.popup-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.5rem;
  cursor: pointer;
  transition: color var(--ease);
  flex-shrink: 0;
  touch-action: manipulation;
}
.popup-close:hover { color: var(--white); }

.sort-bar { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sort-pill {
  padding: 0.3rem 0.65rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--ease);
}
.sort-pill.active { border-color: var(--active); color: var(--active); background: rgba(61,173,217,0.1); }

/* ── Toast ───────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.5rem 1.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--light);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 500;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--amber); color: var(--amber); }
#toast.error   { border-color: var(--error);   color: var(--error);   }
#toast.warn    { border-color: var(--amber);     color: var(--amber);    }

/* ── Spinner / Loading ───────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--active);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ─────────────────────────────────────────────────── */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-gap     { display: flex; align-items: center; gap: 0.5rem; }
.hidden       { display: none !important; }
.mb-1         { margin-bottom: 0.5rem; }
.mb-2         { margin-bottom: 1rem; }
.mb-3         { margin-bottom: 1.5rem; }
.mt-1         { margin-top: 0.5rem; }
.mt-2         { margin-top: 1rem; }
.w-full       { width: 100%; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Placeholder / Empty State ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state-icon img { width: 2.5rem; height: 2.5rem; object-fit: contain; filter: brightness(0) invert(1); }
.empty-state p    { font-size: 0.78rem; letter-spacing: 0.1em; line-height: 1.8; }

/* ── Responsive — Galaxy Z Fold 5 ────────────────────────────── */
@media (max-width: 480px) {
  .page-title { font-size: 1.1rem; }
  .hero-level { font-size: 1.8rem; }
  .gh-stat-grid { flex-wrap: wrap; }
}
@media (min-width: 905px) {
  /* Gefaltet: 904px */
  body { font-size: 15px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .gh-chart-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-epen-row { flex-wrap: wrap; overflow-x: unset; scroll-snap-type: none; }
  .epos-card { flex: 1 1 180px; scroll-snap-align: unset; }
  #sk-tree-list { max-width: 700px; }
}
@media (min-width: 1100px) {
  #sk-tree-scroll { height: calc(100svh - var(--nav-h) - 48px); }
}
@media (min-width: 1400px) {
  /* Geöffnet: 1812px */
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .gh-chart-grid { grid-template-columns: repeat(3, 1fr); }
  #sk-tree-list { max-width: 900px; }
  .sk-sub-title { max-width: 220px; }
}

/* ── Tasks Redesign ──────────────────────────────────────────────────────────── */
.tasks-epos-group { margin-bottom: 2rem; }
.tasks-epos-group + .tasks-epos-group {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.tasks-epos-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 0 4px 0.65rem;
  text-align: center;
  cursor: pointer;
  user-select:none;
}
.tasks-epos-icon {
  width: 22px; height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .7;
  flex-shrink: 0;
}
 /* Chat GPT-Input zu Task-Toggles */
.tasks-epos-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.tasks-epos-group.collapsed .tasks-epos-content {
  max-height: 0;
}

/* ── Task Node Groups ────────────────────────────────────────── */
.task-node-group { margin-bottom: 0; }
.task-node-group--level { margin-bottom: 1.5rem; }
.task-node-group--sub   { margin-bottom: 1rem; margin-left: 0.5rem; }

.task-node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 0.25rem 0.5rem;
}
.task-node-group--level .task-node-header {
  border-bottom: 1px solid rgba(61,173,217,0.2);
  margin-bottom: 0.15rem;
}
.task-node-group--sub .task-node-header {
  border-bottom: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-bottom: 0.1rem;
}

.task-node-lvl {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--active);
  letter-spacing: 0.1em;
  background: rgba(61,173,217,0.1);
  border: 1px solid rgba(61,173,217,0.28);
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}
.task-node-name {
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.06em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-node-level .task-node-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--light);
}
.task-node-sub .task-node-name {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  font-style: italic;
}
.task-node-xp {
  font-family: 'Raleway', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--amber);
  opacity: 0.85;
  flex-shrink: 0;
  white-space: nowrap;
}
.task-node-sub-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  opacity: 0.5;
}

/* Task card */
.task-card {
  display: block;
  background: transparent;
  border-radius: 0;
  padding: 0.9rem 0.25rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.task-card:last-child { border-bottom: none; }
.task-card[data-completed="1"] { opacity: 0.35; pointer-events: none; }

/* ── Aufgabe Card (composite, collapsible) ───────────────────────────────── */
.aufgabe-card { border-left: 3px solid var(--accent); }
.aufgabe-done { opacity: 0.35; pointer-events: none; }

.aufgabe-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 2px 0 6px;
  user-select: none;
}
.aufgabe-card-header:hover .task-card-title { color: var(--bright); }

.aufgabe-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--bright);
  background: rgba(61,173,217,.12);
  border: 1px solid rgba(61,173,217,.28);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pill-count { margin-right: 2px; }
.aufgabe-pill-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(172,222,242,.2);
  border: 1px solid rgba(172,222,242,.25);
  display: inline-block;
  flex-shrink: 0;
}
.aufgabe-pill-dot.done {
  background: var(--bright);
  border-color: var(--bright);
}


.aufgabe-body {
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Element Block ───────────────────────────────────────────────────────── */
.element-block {
  padding: 12px 4px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.element-block:first-child { border-top: none; }
.element-block.element-done .element-label { color: var(--bright); }
.element-block-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}
.element-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--active);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.element-done-badge {
  font-size: 0.75rem;
  color: var(--bright);
  font-weight: 700;
}
.element-content { width: 100%; display: flex; flex-direction: column; align-items: center; }
.element-content .task-log-fields,
.element-content .task-log-textarea,
.element-content .task-progress-bar { width: 100%; }
.element-content .task-checklist-list {
  width: 100%;
  max-width: 340px;
  align-self: center;
  text-align: left;
}
.aufgabe-elements { width: 100%; }

/* Element timer */
.el-timer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.el-timer-play {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.el-timer-play:hover { background: var(--active); }
.el-timer-play.running { background: var(--amber); animation: pulseAmber 1.5s ease-in-out infinite; }
.el-timer-sec { font-size: 0.75rem; color: var(--light); opacity: 0.7; margin-left: 1px; }
.el-timer-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.task-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--light);
  border-radius: var(--r);
  padding: 4px 12px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.task-btn-ghost:hover { border-color: var(--active); color: var(--bright); }
.task-btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  border-radius: var(--r);
  padding: 4px 14px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.task-btn-primary:hover { background: var(--active); }

/* Admin element builder block */
.wz4-element-block {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

/* Card header: title left, rewards right */
.task-card-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.5rem;
}
.task-card-title-group { flex: 1; min-width: 0; }
.task-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--light);
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.task-condition-line {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deadline-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .65rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  border: 1px solid;
  font-family: var(--font-ui);
  margin-top: 3px;
  width: fit-content;
}
.deadline-chip.upcoming { color: var(--bright);  border-color: var(--accent); }
.deadline-chip.today    { color: var(--warn);    border-color: var(--warn); }
.deadline-chip.overdue  { color: var(--danger);  border-color: var(--danger); background: rgba(224,80,80,.08); }
.task-done-tag {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--green);
  margin-left: 5px;
  vertical-align: middle;
}
.task-card-desc { font-size: 0.72rem; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.task-rewards   { display: flex; gap: 5px; flex-wrap: wrap; flex-shrink: 0; align-items: flex-start; padding-top: 1px; justify-content: center; }
.task-card-body .task-rewards,
.task-card-body .task-card-desc { width: 100%; }
.task-card-body { display: flex; flex-direction: column; align-items: center; }
.task-card-body .task-progress-bar,
.task-card-body .task-kpi-progress,
.task-card-body .task-log-progress,
.task-card-body .task-log-fields,
.task-card-body .task-checklist-progress,
.task-card-body .task-checklist-list,
.task-card-body .task-kpi-bar,
.task-card-body .task-counter-bar { width: 100%; }
.task-hint      { font-size: .72rem; color: var(--muted); margin: 0; }

/* ── Photo Element ───────────────────────────────────────────────────────── */
.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.photo-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}
.photo-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--accent);
  display: block;
}
.photo-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger, #E05050);
  color: #fff;
  border: none;
  font-size: .65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.photo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.photo-btn-label {
  cursor: pointer;
}
.photo-count {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Progress bar (shared) */
.task-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.task-progress-fill {
  height: 100%;
  background: var(--active);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Log entries */
.task-log-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.task-log-progress .task-progress-bar { flex: 1; margin: 0; }
.task-log-fields   { display: flex; flex-direction: column; gap: 8px; }
.task-log-entry    { display: flex; flex-direction: column; gap: 3px; }
.task-log-label    { font-size: .68rem; color: var(--muted); }
.task-log-field    { font-size: .8rem; resize: vertical; }
.rt-log-done-btn   { width: 100%; margin-top: 10px; }
.task-log-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: Raleway, sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 8px 10px;
  resize: vertical;
  min-height: 60px;
  transition: border-color .15s;
}
.task-log-textarea:focus { outline: none; border-color: var(--accent); }
.task-log-textarea::placeholder { color: var(--muted); }

/* Counter — compact */
.task-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4px 0;
}
.task-counter-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--white);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.task-counter-btn:hover { border-color: var(--active); background: rgba(61,173,217,.1); }
.task-counter-plus      { border-color: var(--active); color: var(--active); }
.task-counter-display   { display: flex; align-items: baseline; gap: 3px; }
.task-counter-val       { font-size: 1.5rem; font-weight: 700; color: var(--white); }
.task-counter-sep       { font-size: .85rem; color: var(--muted); }
.task-counter-target    { font-size: .85rem; color: var(--muted); }

/* Timer */
.task-timer-display { font-family: monospace; font-size: 1.2rem; color: var(--light); letter-spacing: .05em; text-align: right; }
.task-timer-btns    { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }
.task-timer-reset-btn { font-size: .7rem; }

/* Rating — hexagon */
.task-rating { display: flex; gap: 6px; margin-bottom: 4px; justify-content: center; }
.task-rating-hex {
  width: 36px; height: 36px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(255,255,255,.12);
  border: none; cursor: pointer;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.task-rating-hex:hover  { background: var(--accent); transform: scale(1.12); }
.task-rating-hex.active { background: var(--amber); }
.task-rating-hex:active { transform: scale(1.2); }
.task-rating-note { margin-top: 8px; }

/* Checklist */
.task-checklist-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.task-checklist-progress .task-progress-bar { flex: 1; margin: 0; }
.task-checklist-list     { display: flex; flex-direction: column; gap: 4px; }
.task-checklist-item     { border-radius: 6px; padding: 2px 0; }
.task-checklist-item.done .task-checklist-main span { text-decoration: line-through; opacity: .5; }
.task-checklist-main.task-done span { text-decoration: line-through; opacity: .5; }
.task-checklist-sub.task-done span  { text-decoration: line-through; opacity: .5; }
.task-checklist-item.locked { opacity: .45; }
.task-checklist-main,
.task-checklist-sub {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--light);
  line-height: 1.4;
  padding: 3px 0;
}
.task-checklist-sub  { padding-left: 24px; font-size: .78rem; color: var(--muted); }
.task-checklist-main input[type=checkbox],
.task-checklist-sub  input[type=checkbox] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--active); cursor: pointer; margin-top: 2px;
}
.task-checklist-subs { margin-top: 4px; }

/* Simple — inline row below title */
.task-simple-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 0;
  margin-top: 2px;
}
.task-simple-row.done { color: var(--amber); }
.task-simple-row.done span { text-decoration: line-through; opacity: .7; }
.task-simple-row input[type=checkbox] {
  width: 15px; height: 15px; flex-shrink: 0;
  accent-color: var(--amber); cursor: pointer;
}

/* KPI row */
.task-kpi-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* KPI Auto Progress */
.task-kpi-progress { margin-bottom: 8px; }
.task-kpi-progress:last-child { margin-bottom: 0; }
.task-kpi-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.task-kpi-progress-label { font-size: 0.78rem; color: var(--light); }
.task-kpi-progress-count { font-size: 0.82rem; font-weight: 700; color: var(--amber); white-space: nowrap; }
.task-kpi-badge-done     { font-size: 0.75rem; font-weight: 700; color: var(--amber); white-space: nowrap; }
.task-kpi-bar {
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  overflow: hidden;
}
.task-kpi-bar-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.task-kpi-bar-fill.task-kpi-bar-done { background: var(--amber); }
.task-kpi-complete-btn {
  margin-top: 10px;
  width: 100%;
  padding: 8px 0;
  background: var(--amber);
  color: #081B26;
  border: none;
  border-radius: var(--r);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.task-kpi-complete-btn:disabled { opacity: .5; cursor: default; }
.task-kpi-manual-btn { background: transparent; color: var(--muted); border: 1px solid rgba(255,255,255,0.15); font-weight: 400; }
.task-kpi-manual-btn:hover { color: var(--light); border-color: rgba(255,255,255,0.30); }

/* ═══════════════════════════════════════════════════════════════
   Dashboard
   ═══════════════════════════════════════════════════════════════ */

/* ── Epen-Reihe ──────────────────────────────────────────────── */
.dash-epen-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dash-epen-row::-webkit-scrollbar { display: none; }
.epos-card {
  background: transparent;
  flex: 0 0 72vw;
  scroll-snap-align: start;
  border-right: 1px solid rgba(61,173,217,0.08);
  cursor: pointer;
}
.epos-card:last-child { border-right: none; }
.epos-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 0.75rem;
}
.epos-hero-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.epos-hero-icon img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: var(--filter-white);
}
.epos-hero-icon .epos-hero-emoji { font-size: 2.2rem; line-height: 1; }
.epos-name {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--light);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  margin-bottom: 8px;
}
.epos-xp-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin-bottom: 4px;
}
.epos-level-name {
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.epos-xp-pct {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--active);
}
.epos-icon-fill-wrap {
  width: 60px;
  height: 60px;
  position: relative;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.epos-icon-base,
.epos-icon-fill {
  position: absolute;
  inset: 5px;
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.epos-icon-base {
  filter: var(--filter-active);
  opacity: 0.3;
  transition: opacity var(--ease);
}
.epos-icon-fill {
  filter: var(--filter-active);
  clip-path: inset(calc(100% - var(--fill-pct, 0%)) 0 0 0);
  transition: clip-path 0.6s ease, filter var(--ease);
}
.epos-card:hover .epos-icon-fill {
  filter: var(--filter-active) drop-shadow(0 0 6px rgba(61,173,217,0.7));
}
.epos-card:hover .epos-icon-base {
  opacity: 0.5;
}
.epos-nodes {
  font-size: 0.58rem;
  color: var(--muted);
}
@media (min-width: 905px) {
  .dash-epen-row { flex-wrap: wrap; overflow-x: unset; scroll-snap-type: none; }
  .epos-card { flex: 1 1 200px; scroll-snap-align: unset; }
}

/* ── Coins & Aktivität ───────────────────────────────────────── */
.dash-coins-row {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.coin-total-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 0.5rem;
  flex: 1 1 80px;
  min-width: 70px;
  cursor: pointer;
  border-right: 1px solid rgba(61,173,217,0.08);
  transition: opacity var(--ease);
}
.coin-total-card:hover,
.coin-total-card:active { opacity: 0.7; }
.coin-total-symbol {
  font-size: 2rem;
  line-height: 1;
  color: var(--bronze);
  flex-shrink: 0;
}
.coin-total-info { min-width: 0; }
.coin-total-amount {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bronze);
  line-height: 1.1;
}
.coin-total-label {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.coin-cat-card {
  background: transparent;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1 1 80px;
  min-width: 70px;
  border-right: 1px solid rgba(61,173,217,0.08);
}
.coin-cat-card:last-child { border-right: none; }
.coin-cat-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  opacity: 0.6;
}
.coin-cat-icon-svg {
  width: 22px;
  height: 22px;
  background-color: var(--bronze);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  flex-shrink: 0;
}
.coin-cat-info { text-align: center; min-width: 0; }
.coin-cat-name {
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coin-cat-amount {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bronze);
  line-height: 1.15;
}
.coin-cat-earned {
  font-size: 0.5rem;
  color: var(--muted);
  margin-top: 1px;
  opacity: 0.6;
}
.dash-activity-card {
  background: transparent;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1 1 80px;
  min-width: 70px;
  cursor: pointer;
  border-right: 1px solid rgba(61,173,217,0.08);
  transition: opacity var(--ease);
  text-decoration: none;
}
.dash-activity-card:last-child { border-right: none; }
.dash-activity-card:hover,
.dash-activity-card:active { opacity: 0.7; }
.dash-activity-icon { font-size: 18px; line-height: 1; flex-shrink: 0; opacity: 0.6; }
.dash-activity-icon img { width: 28px; height: 28px; object-fit: contain; filter: var(--filter-white); }
.dash-activity-info { text-align: center; flex: 1; }
.dash-activity-count {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
}
.dash-activity-label { font-size: 0.52rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }
.dash-activity-hint  { font-size: 0.5rem; color: var(--active); margin-top: 3px; }

/* ── Gesundheit Layout ───────────────────────────────────────── */
.gh-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.gh-week-grid {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.gh-week-grid::-webkit-scrollbar { display: none; }

/* ── Chart-Card ──────────────────────────────────────────────── */
.gh-chart-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
}
.gh-chart-card--compact {
  padding: 9px 12px;
}
.gh-chart-card--compact .gh-chart-title {
  margin-bottom: 6px;
}
.gh-chart-card--compact .sleep-phase-row {
  margin-bottom: 3px;
}
.gh-chart-card--compact .z2-bar-wrap {
  margin-top: 4px;
}
.gh-bar-week {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 48px;
  margin-top: 10px;
}
.gh-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
}
.gh-bar-wrap {
  flex: 1;
  width: 100%;
  background: rgba(28,108,140,.25);
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.gh-bar-fill {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height .4s ease;
}
.gh-bar-label {
  font-size: .55rem;
  color: var(--muted);
  white-space: nowrap;
}
.gh-chart-title {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--light);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.gh-chart-big-val { font-size: 1.1rem; font-weight: 700; color: var(--white); }
.gh-chart-sub {
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.gh-chart-meta { display: flex; gap: 12px; font-size: 0.58rem; }
.gh-chart-area {
  position: relative;
  width: 100%;
}
.gh-chart-area svg { display: block; width: 100%; overflow: visible; }
.gh-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.52rem;
  color: var(--muted);
  margin-top: 3px;
}
.gh-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.gh-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--light);
}
.gh-legend-dot {
  width: 8px;
  height: 3px;
  border-radius: 2px;
}

/* ── Stat-Card (Herzgesundheit) ──────────────────────────────── */
.gh-stat-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.gh-stat-grid::-webkit-scrollbar { display: none; }
.gh-stat-card {
  background: transparent;
  border: none;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  flex: 1 1 110px;
  min-width: 0;
}
.gh-stat-label {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  width: 100%;
}
.gh-stat-value {
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
}
.gh-stat-value.good  { color: var(--active); }
.gh-stat-value.warn  { color: var(--amber); }
.gh-stat-value.bad   { color: var(--error); }
.gh-stat-unit {
  font-size: 0.6rem;
  color: var(--muted);
}
.gh-stat-trend {
  font-size: 0.62rem;
  color: var(--muted);
}
.gh-stat-trend.pos { color: var(--amber); }
.gh-stat-trend.neg { color: var(--muted); }
.gh-stat-trend.up  { color: var(--active); }
.gh-stat-trend.dn  { color: var(--muted); }

/* ── Woche-Box ───────────────────────────────────────────────── */
.gh-week-box {
  background: transparent;
  padding: 0.8rem 0.5rem;
  text-align: center;
  flex: 1 0 80px;
  border-right: 1px solid rgba(61,173,217,0.08);
}
.gh-week-box:last-child { border-right: none; }
.gh-week-icon { display: none; }
.gh-week-value {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
}
.gh-week-label {
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
}
.gh-week-box.highlight { background: rgba(61,173,217,0.05); }
.gh-week-box.warn-box  { background: rgba(239,159,39,0.05); }

/* ── Vitals-Karte (Letzte 7 Tage + Kardio-KPIs) ─────────────── */
.gh-vitals-card .gh-week-grid {
  border-bottom: none;
  overflow-x: auto;
  margin: 6px -16px 0;
  padding: 0;
}
.gh-vitals-card .gh-week-box:first-child { border-left: none; }
.gh-vitals-sep {
  height: 1px;
  background: var(--border);
  margin: 0 -16px;
}
.gh-vitals-card .gh-stat-grid {
  margin: 0 -16px -14px;
  overflow-x: auto;
}
.gh-vitals-card .gh-stat-card { flex: 1 1 80px; }

/* ── Coach-Kommentar-Karte ───────────────────────────────────── */
#gh-coach-comment {
  display: flex;
  flex-direction: column;
}
#gh-coach-comment .gh-chart-card {
  flex: 1;
}
.gh-coach-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gh-coach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gh-coach-label {
  font-size: .58rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-head);
}
.gh-coach-refresh {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color .15s;
}
.gh-coach-refresh:hover { color: var(--bright); }
.gh-coach-text {
  font-size: .86rem;
  line-height: 1.6;
  color: var(--light);
  margin: 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.gh-coach-loading {
  color: var(--muted);
  font-size: .82rem;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .4; }
  50%       { opacity: 1; }
}
.gh-coach-meta {
  font-size: .58rem;
  color: var(--muted);
  text-align: right;
}

/* ── Zonen gestapelter Balken ────────────────────────────────── */
.z-stack-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
  background: rgba(255,255,255,.06);
}
.z-stack-seg { height: 100%; transition: width .5s ease; }
.z-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.z-legend-item {
  font-size: .62rem;
  display: flex;
  align-items: center;
  gap: 3px;
}
.z-legend-item b { font-size: .68rem; }
.z-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Zone-2-Balken ───────────────────────────────────────────── */
.z2-bar-wrap { margin-top: 10px; }
.z2-bar-header { display: flex; justify-content: space-between; font-size: 0.72rem; margin-bottom: 6px; }
.z2-bar-label { color: var(--light); }
.z2-bar-track { background: rgba(255,255,255,.07); border-radius: 3px; height: 6px; overflow: hidden; }
.z2-bar-fill  { height: 100%; border-radius: 3px; transition: width .5s ease; }
.z2-bar-note  { font-size: 0.55rem; color: var(--muted); margin-top: 4px; }

/* Sleep phases */
.sleep-phase-row  { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.sleep-phase-lbl  { width: 46px; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.sleep-phase-track { flex: 1; height: 6px; background: var(--panel); border-radius: 3px; overflow: hidden; }
.sleep-phase-fill  { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.sleep-phase-val   { width: 52px; text-align: right; font-size: 0.72rem; color: var(--light); flex-shrink: 0; }
.sleep-score-chart { margin-top: 10px; }

/* ═══════════════════════════════════════════════════════════════
   Coach
   ═══════════════════════════════════════════════════════════════ */

#coach-view {
  display: none;
  flex-direction: column;
  height: calc(100svh - var(--nav-h));
  overflow: hidden;
}
#coach-view.active { display: flex; }
#coach-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  max-width: 620px;
  margin-inline: auto;
  width: 100%;
}

/* ── Nachrichtenverlauf ──────────────────────────────────────── */
#coach-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

/* ── Einzelne Nachricht ──────────────────────────────────────── */
.coach-msg {
  max-width: 82%;
  padding: 0.7rem 1rem;
  border-radius: var(--r);
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
  animation: fadeIn 0.18s ease;
}
.coach-msg.from-coach {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--light);
  border-bottom-left-radius: 4px;
}
.coach-msg.from-user {
  align-self: flex-end;
  background: var(--active);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.coach-msg.from-user img {
  max-height: 160px;
  border-radius: var(--r-sm);
  margin-bottom: 0.4rem;
}

/* Coach-Markdown-Rendering */
.coach-msg.from-coach p {
  margin: 0 0 0.5em;
}
.coach-msg.from-coach p:last-child {
  margin-bottom: 0;
}
.coach-msg.from-coach .coach-h1 {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--active);
  margin: 0.6em 0 0.2em;
}
.coach-msg.from-coach .coach-h2 {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--light);
  margin: 0.5em 0 0.15em;
}
.coach-msg.from-coach strong {
  font-weight: 600;
  color: var(--white);
}

.coach-save-btn {
  display: block;
  margin-top: 0.6rem;
  padding: 0.45rem 0.9rem;
  background: var(--amber);
  color: var(--white);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  transition: opacity var(--ease);
}
.coach-save-btn:hover { opacity: 0.85; }
.coach-save-btn:disabled { background: var(--muted); cursor: default; opacity: 0.6; }

.coach-proposal-card {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(61,173,217,.08);
  border: 1px solid rgba(61,173,217,.3);
  border-radius: var(--r-sm);
}
.coach-proposal-header {
  font-size: 0.7rem;
  color: var(--bright);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 0.3rem;
}
.coach-proposal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.2rem;
}
.coach-proposal-desc {
  font-size: 0.8rem;
  color: var(--light);
  margin-bottom: 0.3rem;
}
.coach-proposal-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.coach-hevy-exlist {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin-bottom: .6rem;
}
.coach-hevy-ex {
  font-size: .78rem;
  color: var(--light);
  padding: .15rem 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.epos-preview-card {
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  padding: 1rem;
  margin-top: 0.75rem;
  max-width: 100%;
}
.epos-preview-header {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.epos-preview-icon { font-size: 2rem; line-height: 1; }
.epos-preview-title {
  font-family: var(--font);
  font-size: 1.1rem;
  color: var(--active);
  font-weight: 700;
}
.epos-preview-desc { font-size: 0.85rem; color: var(--light); margin-top: 0.25rem; }
.epos-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.epos-preview-stats span {
  background: var(--accent);
  color: var(--white);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.8rem;
}
.epos-preview-details { border-top: 1px solid var(--accent); padding: 0.5rem 0; }
.epos-preview-details summary {
  cursor: pointer;
  color: var(--active);
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
}
.epos-preview-details summary::before { content: '▶ '; }
.epos-preview-details[open] summary::before { content: '▼ '; }
.epos-preview-details ul {
  margin: 0.5rem 0 0 1rem;
  padding: 0;
  font-size: 0.82rem;
  color: var(--light);
}
.epos-preview-details ul li { margin-bottom: 0.2rem; }
.epos-preview-actions { display: flex; gap: 0.75rem; margin-top: 0.75rem; flex-wrap: wrap; }
.epos-confirm-btn { background: var(--amber) !important; }
.epos-regen-btn   { background: var(--accent) !important; }

/* Loading-Indikator */
.coach-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 0.7rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  border-bottom-left-radius: 4px;
}
.coach-typing span {
  width: 7px; height: 7px;
  background: var(--active);
  border-radius: 50%;
  animation: coach-bounce 1.2s infinite;
}
.coach-typing span:nth-child(2) { animation-delay: 0.2s; }
.coach-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes coach-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Eingabebereich ──────────────────────────────────────────── */
#coach-input-area {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 0.5rem 0.75rem max(0.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#mode-toggle { display: flex; gap: 0.4rem; }
.coach-mode-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.coach-mode-btn.active {
  background: var(--accent);
  border-color: var(--active);
  color: var(--white);
}
#chat-input-row { display: flex; gap: 0.5rem; align-items: flex-end; }
#coach-text {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--white);
  padding: 0.6rem 0.85rem;
  font-family: var(--font);
  font-size: 0.9rem;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.4;
}
#coach-text:focus { outline: none; border-color: var(--active); }
#coach-text::placeholder { color: var(--muted); }
#coach-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--active);
  color: var(--white);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--ease);
}
#coach-send:hover { opacity: 0.85; }
#coach-send:disabled { opacity: 0.4; cursor: default; }

#foto-input-row { display: flex; flex-direction: column; gap: 0.5rem; }
#coach-foto-label {
  display: block;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--r);
  cursor: pointer;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#coach-foto-placeholder { color: var(--muted); font-size: 0.85rem; padding: 1rem; text-align: center; }
#coach-foto-preview { width: 100%; max-height: 180px; object-fit: contain; }
#foto-caption-row { display: flex; gap: 0.5rem; }
#coach-foto-caption {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--white);
  padding: 0.55rem 0.85rem;
  font-family: var(--font);
  font-size: 0.85rem;
}
#coach-foto-caption:focus { outline: none; border-color: var(--active); }
#coach-foto-send {
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--r);
  font-size: 0.85rem;
  font-family: var(--font);
  transition: opacity var(--ease);
  border: none;
  cursor: pointer;
}
#coach-foto-send:hover { opacity: 0.85; }
#coach-foto-send:disabled { opacity: 0.4; cursor: default; }

@media (min-width: 900px) {
  #coach-messages { padding: 1.5rem 2rem 0.75rem; }
  #coach-input-area { padding: 0.75rem 2rem max(0.75rem, env(safe-area-inset-bottom)); }
  .coach-msg { max-width: 60%; }
}

/* ── Dashboard responsive ─────────────────────────────────── */
@media (min-width: 905px) {
  .hero-level { font-size: 3rem; }
  .dash-coins-row { flex-wrap: nowrap; }
  .gh-week-grid { flex-wrap: nowrap; }
  .gh-stat-grid { flex-wrap: nowrap; }
}
@media (min-width: 1400px) {
  .hero-level { font-size: 3.8rem; }
  .gh-chart-grid { grid-template-columns: repeat(4, 1fr); }
  .gh-stat-card { flex: 0 1 160px; }
}

/* ═══════════════════════════════════════════════════════════
   Admin — Datenquellen-Übersicht
   ═══════════════════════════════════════════════════════════ */

.ds-source-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}
.ds-source-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.ds-source-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}
.ds-source-name {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--active);
  letter-spacing: 0.03em;
}
.ds-source-desc {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 2px;
}
.ds-group-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0.4rem 0 0.3rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 0.25rem;
}
.ds-group-label:first-of-type { border-top: none; margin-top: 0; }

.ds-metric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin-bottom: 0.25rem;
}
.ds-metric-table tr { transition: background 0.1s; }
.ds-metric-table tr:hover { background: rgba(61,173,217,0.04); }
.ds-row-raw   { opacity: 0.7; }
.ds-row-empty { opacity: 0.55; }

/* Zellen */
.ds-td-dot   { width: 14px; padding: 3px 6px 3px 0; vertical-align: middle; }
.ds-td-label { padding: 3px 8px 3px 0; color: var(--light); white-space: nowrap; vertical-align: middle; }
.ds-td-type  { padding: 3px 8px 3px 0; color: var(--muted); vertical-align: middle; }
.ds-td-type code { font-size: 0.65rem; color: var(--light); background: rgba(172,222,242,0.08); padding: 1px 4px; border-radius: 3px; }
.ds-td-unit  { padding: 3px 8px 3px 0; color: var(--muted); font-size: 0.65rem; white-space: nowrap; vertical-align: middle; }
.ds-td-xp    { padding: 3px 4px; vertical-align: middle; }
.ds-td-badge { padding: 3px 6px; text-align: right; vertical-align: middle; white-space: nowrap; }
.ds-td-date  { padding: 3px 6px; color: var(--muted); font-size: 0.65rem; white-space: nowrap; vertical-align: middle; }
.ds-td-val   { padding: 3px 0; color: var(--light); font-size: 0.68rem; white-space: nowrap; vertical-align: middle; }

/* Status-Dots */
.ds-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ds-dot-ok    { background: var(--active); }
.ds-dot-raw   { background: var(--amber); }
.ds-dot-empty { background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25); }

/* Badges */
.ds-badge {
  display: inline-block;
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.ds-badge-ok    { background: var(--bg-active); color: var(--active); border: 1px solid var(--border); }
.ds-badge-raw   { background: var(--bg-amber); color: var(--amber); border: 1px solid rgba(239,159,39,0.35); }
.ds-badge-empty { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }

/* XP-Badge */
.ds-xp-badge {
  display: inline-block;
  font-size: 0.58rem;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(61,173,217,0.15);
  color: var(--active);
  border: 1px solid rgba(61,173,217,0.3);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Hinweis-Text */
.ds-note { font-size: 0.6rem; color: var(--muted); font-style: italic; }

/* Mobile */
@media (max-width: 600px) {
  .ds-td-val  { display: none; }
  .ds-td-unit { display: none; }
  .ds-td-type { display: none; }
}

/* ── Login Page ──────────────────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(28,108,140,0.18) 0%, transparent 70%),
    var(--bg);
}

.login-box {
  /* background: linear-gradient(160deg, rgba(17,62,89,0.95) 0%, rgba(8,27,38,0.98) 100%);
  border: 1px solid rgba(61,173,217,0.25);
  border-radius: 20px;
  padding: 3rem 2.5rem 2.5rem;
  box-shadow:
    0 0 0 1px rgba(61,173,217,0.06),
    0 8px 40px rgba(0,0,0,0.5),
    0 0 80px rgba(61,173,217,0.08);
  backdrop-filter: blur(8px); */
  width: 100%;
  max-width: 400px;
  text-align: center;
  
}

.login-emblem {
  font-size: 3.2rem;
  margin-bottom: .75rem;
  display: block;
  filter: drop-shadow(0 0 20px rgba(61,173,217,.55));
}

.login-icon {
  width: 50px;
  height: 50px;
  background-color: var(--active);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  flex-shrink: 0;
  margin: 0 auto;
  padding-bottom: 40px;
  -webkit-mask-image: url('../assets/icons/ui/node_default.svg');
  mask-image: url('../assets/icons/ui/node_default.svg');
  animation: login-icon-glow 1s ease-in-out infinite alternate;
}
@keyframes login-icon-glow {
  from { filter: drop-shadow(0 0 6px rgba(61,173,217,0.6)); }
  to   { filter: drop-shadow(0 0 14px rgba(61,173,217,0.95)) drop-shadow(0 0 28px rgba(61,173,217,0.4)); }
}

.login-box h1 {
  font-family: var(--font);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--active);
  letter-spacing: .14em;
  margin-bottom: .3rem;
  text-shadow: 0 0 24px rgba(61,173,217,.3);
}

.login-sub {
  font-family: var(--font-body);
  font-size: .68rem;
  color: var(--light);
  letter-spacing: .3em;
  opacity: .5;
  margin-bottom: 2.5rem;
  text-transform: uppercase;
}

.login-divider {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 0 auto 2rem;
}

.login-fg {
  position: relative;
  margin-bottom: 1rem;
}

.login-fg input[type=password],
.login-fg input[type=text] {
  width: 100%;
  background: rgba(8,27,38,.7);
  border: 1px solid rgba(28,108,140,.7);
  border-radius: 10px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .95rem 3.2rem .95rem 1.1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  letter-spacing: .08em;
  box-sizing: border-box;
}

.login-fg input:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(61,173,217,.15), 0 0 16px rgba(61,173,217,.08);
}

.login-fg input::placeholder {
  color: rgba(172,222,242,.35);
  letter-spacing: .05em;
}

.login-eye {
  position: absolute;
  right: .9rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--light);
  cursor: pointer;
  font-size: 1.1rem;
  opacity: .45;
  transition: opacity .2s;
  padding: 0;
  line-height: 1;
}
.login-eye:hover { opacity: .9; }

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--active) 0%, #2a8fc0 100%);
  border: none;
  border-radius: 10px;
  color: var(--bg);
  cursor: pointer;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .2em;
  padding: 1rem;
  margin-top: .25rem;
  transition: filter .2s, transform .1s, box-shadow .2s;
  text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(61,173,217,.2);
}
.login-btn:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 32px rgba(61,173,217,.4);
}
.login-btn:active { transform: scale(.98); filter: brightness(.95); }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--light);
  box-shadow: none;
}
.login-or {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .75rem;
  letter-spacing: .2em;
  margin: 1rem 0;
  text-align: center;
  text-transform: uppercase;
}
.login-err[hidden] { display: none; }

.login-err {
  background: rgba(224,80,80,.1);
  border: 1px solid rgba(224,80,80,.35);
  border-radius: 8px;
  color: #f08080;
  font-family: var(--font-body);
  font-size: .8rem;
  letter-spacing: .04em;
  margin-top: 1rem;
  padding: .7rem 1rem;
}

.login-rune {
  font-size: .58rem;
  color: rgba(172,222,242,.2);
  letter-spacing: .45em;
  margin-top: 2.5rem;
  text-transform: uppercase;
  font-family: var(--font);
}

/* ═══════════════════════════════════════════════════════════════
   Celebration Overlay
   ═══════════════════════════════════════════════════════════════ */
#celebration-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: rgba(8,27,38,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#celebration-overlay.active { display: flex; }

#celeb-lottie {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

#celebration-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  padding: 0 1.5rem;
  animation: celebCardIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
#celebration-overlay.outro #celebration-card {
  animation: celebCardOut 0.4s ease forwards;
}

@keyframes celebCardIn {
  from { opacity: 0; transform: scale(0.7) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes celebCardOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.88) translateY(-12px); }
}

#celebration-kat-icon {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  margin-bottom: 0.25rem;
}
#celebration-kat-icon img { width: 18px; height: 18px; object-fit: contain; filter: brightness(0) invert(1); }

#celebration-icon-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#celebration-icon-wrap.type-level {
  background: radial-gradient(circle, rgba(239,159,39,0.18) 0%, transparent 70%);
  box-shadow: 0 0 0 1px rgba(239,159,39,0.3);
  animation: celebGlowAmber 1.8s ease-in-out infinite;
}
#celebration-icon-wrap.type-trophy {
  background: radial-gradient(circle, rgba(239,159,39,0.15) 0%, transparent 70%);
  box-shadow: 0 0 0 1px rgba(239,159,39,0.25);
  animation: celebGlowAmber 1.8s ease-in-out infinite;
}
@keyframes celebGlowAmber {
  0%,100% { box-shadow: 0 0 0 1px rgba(239,159,39,0.25), 0 0 24px rgba(239,159,39,0.2); }
  50%     { box-shadow: 0 0 0 2px rgba(239,159,39,0.55), 0 0 52px rgba(239,159,39,0.45); }
}

#celebration-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: var(--filter-amber);
  animation: celebIconPulse 1.8s ease-in-out infinite;
}
@keyframes celebIconPulse {
  0%,100% { filter: var(--filter-amber) drop-shadow(0 0 6px rgba(239,159,39,0.5)); }
  50%     { filter: var(--filter-amber) drop-shadow(0 0 18px rgba(239,159,39,0.95)) drop-shadow(0 0 36px rgba(239,159,39,0.4)); }
}

#celebration-label {
  font-size: 0.52rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.5rem;
}
#celebration-title {
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.06em;
  line-height: 1.25;
  max-width: 280px;
}
#celebration-rewards {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.celeb-reward-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 99px;
  border: 1px solid var(--border-amber);
  color: var(--amber);
  letter-spacing: 0.05em;
}

/* ── Routine-Tasks ────────────────────────────────────────── */
.routine-section-header {
  margin-bottom: 0.5rem;
}
#routine-tasks-section {
  margin-bottom: 2rem;
}
#routine-tasks-section + #tasks-list {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

/* Routine task card — collapsible */
.rt-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.rt-card-header:hover .rt-card-title { color: var(--bright); }
.card-actions {
  display: flex;
  gap: .3rem;
  align-items: center;
  margin-top: .25rem;
}
.card-action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: .75rem;
  padding: .15rem .4rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: color .15s, border-color .15s, background .15s;
  line-height: 1.4;
}
.card-action-btn:hover { color: var(--light); border-color: var(--muted); }
.card-action-btn.card-del-confirming { color: var(--amber); border-color: var(--amber); background: rgba(239,159,39,.1); }
.card-action-btn:disabled { opacity: .45; cursor: default; }
.ft-simple-row { display: flex; align-items: center; gap: .5rem; }
.ft-simple-row .ft-task-row { flex: 1; min-width: 0; }
.rt-card-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}
.rt-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  transition: color .15s;
}
.rt-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.rt-card-body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rt-card-body .aufgabe-elements,
.rt-card-body .task-simple-row,
.rt-card-body .task-counter,
.rt-card-body .task-rating,
.rt-card-body .task-progress-bar,
.rt-card-body .rt-timer-btns,
.rt-card-body .task-rewards { width: 100%; }
.rt-done {
  display: none;
}
.routine-wrapper,
.ft-wrapper {
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.routine-wrapper.collapsed,
.ft-wrapper.collapsed {
  max-height: 0;
}

/* ── Freestyle aufgabe card — left-aligned layout ─────────────────────────── */
.ft-task-card .rt-card-header {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 8px;
}
.ft-task-card .rt-card-header .rt-card-title {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.ft-task-card .rt-card-header .card-actions {
  margin-top: 0;
}
.ft-task-card .rt-card-body {
  align-items: flex-start;
}
.ft-task-card .element-block-header {
  justify-content: flex-start;
}
.ft-task-card .element-content {
  align-items: flex-start;
}
.ft-task-card .element-content .task-checklist-list {
  align-self: flex-start;
  max-width: 100%;
}
.ft-chevron {
  color: var(--muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: transform .2s;
  line-height: 1;
}
.ft-task-card.ft-expanded .ft-chevron {
  transform: rotate(180deg);
}

.routine-period-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.routine-period-badge.weekly  { background: rgba(61,173,217,.12); color: var(--active); border: 1px solid rgba(61,173,217,.3); }
.routine-period-badge.daily   { background: rgba(76,175,80,.1);   color: #4CAF50;       border: 1px solid rgba(76,175,80,.3); }
.routine-period-badge.monthly { background: rgba(239,159,39,.1);  color: var(--amber);  border: 1px solid rgba(239,159,39,.3); }
.routine-period-badge.sisu    { background: rgba(61,173,217,.07); color: var(--active); border: 1px solid rgba(61,173,217,.3); }
.routine-period-badge.coin    { background: rgba(239,159,39,.07); color: var(--amber);  border: 1px solid rgba(239,159,39,.35); }
.routine-period-badge.coach-draft-badge { background: rgba(61,173,217,.12); color: var(--bright); border: 1px solid rgba(61,173,217,.35); }
.rt-timer-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.routine-count-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
  background: rgba(76,175,80,.12);
  color: var(--green);
  border: 1px solid rgba(76,175,80,.3);
  letter-spacing: 0.04em;
}
.rt-drag-handle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: grab;
  opacity: 0;
  user-select: none;
  padding: 4px;
  line-height: 1;
  transition: opacity .15s;
}
.rt-drag-handle:active { cursor: grabbing; }
.rt-card-header { position: relative; }
.routine-task-card:not(.rt-done):hover .rt-drag-handle { opacity: 0.55; }
@media (hover: none) { .rt-drag-handle { opacity: 0.4; } }
.drag-dragging { opacity: 0.3 !important; box-shadow: 0 4px 20px rgba(0,0,0,.5); }
.rt-inline-check {
  display: flex;
  align-items: center;
  line-height: 0;
  cursor: pointer;
}
.rt-inline-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--bright);
  cursor: pointer;
}
.rt-plus-btn {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(61,173,217,.12);
  color: var(--bright);
  border: 1px solid rgba(61,173,217,.3);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.6;
  transition: background .15s;
  white-space: nowrap;
  font-family: inherit;
}
.rt-plus-btn:hover:not(:disabled) { background: rgba(61,173,217,.25); }
.rt-plus-btn:disabled { opacity: 0.4; cursor: default; }
.task-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.routine-period-group { margin-bottom: 0.25rem; }
.routine-empty {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem 0 0.5rem;
}
.routine-add-trigger {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.55rem;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, color 0.2s;
}
.routine-add-trigger:hover { border-color: var(--active); color: var(--active); }
.routine-add-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem;
  margin-top: 0.75rem;
}
.routine-add-panel.hidden { display: none; }
.routine-add-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.routine-add-form { display: flex; flex-direction: column; gap: 0.5rem; }
.routine-add-row  { display: flex; gap: 0.5rem; }

/* ── Inline Edit Card (Karte transformiert sich in Edit-Modus) ── */
.routine-task-card.rt-editing {
  border-color: var(--active);
  background: var(--panel);
}
.rt-edit-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.rt-edit-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.rt-edit-title-inp {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.1rem 0;
  width: 100%;
  font-family: inherit;
}
.rt-edit-title-inp:focus {
  outline: none;
  border-bottom-color: var(--active);
}
.rt-edit-desc {
  font-size: 0.82rem;
  color: var(--muted);
  resize: vertical;
}
.rt-edit-close-btn {
  flex-shrink: 0;
  margin-top: 2px;
}
.rt-edit-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.routine-add-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.task-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-size: 0.82rem;
  font-family: inherit;
}
.task-input:focus { outline: none; border-color: var(--active); }
.task-select {
  flex: 1;
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-size: 0.78rem;
  font-family: inherit;
}
.task-input-sm {
  width: 3.5rem;
  padding: 0.35rem 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-size: 0.78rem;
  font-family: inherit;
  text-align: center;
}
.routine-add-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }

/* ── Routine-Task Formular: Prominenter Titel ─────────────────── */
.rt-titel-field {
  font-size: 1rem;
  font-weight: 600;
  color: var(--light);
}

/* ── Routine-Task Formular: Period Dropdown ───────────────────── */
.rt-per-drop-wrap { position: relative; display: inline-flex; }
.rt-per-badge {
  padding: 0.28rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.15s;
}
.rt-per-badge:hover { opacity: 0.8; }
.rt-per-badge.period-daily   { color: var(--light);  border-color: rgba(172,222,242,0.35); background: rgba(172,222,242,0.07); }
.rt-per-badge.period-weekly  { color: var(--active); border-color: rgba(61,173,217,0.35);  background: rgba(61,173,217,0.07); }
.rt-per-badge.period-monthly { color: var(--amber);  border-color: rgba(239,159,39,0.35);  background: rgba(239,159,39,0.07); }
.rt-per-drop {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 200;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.6rem 0.7rem;
  min-width: 170px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.rt-per-row { display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.rt-per-lbl { font-size: 0.75rem; color: var(--light); min-width: 6.5rem; text-align: center; }
.rt-freq-row {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  margin-top: 0.4rem; padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}
.rt-freq-lbl { font-size: 0.68rem; color: var(--muted); }
.rt-counter-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--light);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; font-family: inherit;
  touch-action: manipulation;
  transition: border-color 0.15s, color 0.15s;
}
.rt-counter-btn:hover { border-color: var(--active); color: var(--active); }
.rt-counter-val { font-size: 0.8rem; color: var(--light); min-width: 2.2rem; text-align: center; }

/* ── RT Sisu/Coin Badge Dropdowns ────────────────────────────── */
.rt-xp-badge   { color: var(--active); border-color: rgba(61,173,217,0.35);  background: rgba(61,173,217,0.07); }
.rt-coin-badge { color: var(--amber);  border-color: rgba(239,159,39,0.35); background: rgba(239,159,39,0.07); }
.rt-pills-row { display: flex; gap: 0.5rem; align-items: flex-start; flex-wrap: wrap; }
.rt-xp-row { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.3rem; }
.rt-drop-lbl { font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.rt-factor-ctrl { display: flex; align-items: center; gap: 0.25rem; }
.rt-factor-val { font-size: 0.7rem; color: var(--light); min-width: 6rem; text-align: center; }
.rt-coin-row { display: flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0; }
.rt-coin-inp {
  width: 2.8rem; text-align: center;
  font-size: 1rem; font-family: inherit; font-weight: 600;
  color: var(--amber); background: transparent;
  border: none; border-bottom: 1px solid var(--border); outline: none;
  padding: 0 2px 2px; -moz-appearance: textfield;
}
.rt-coin-inp:focus { border-bottom-color: var(--amber); }
.rt-coin-inp::-webkit-inner-spin-button,
.rt-coin-inp::-webkit-outer-spin-button { -webkit-appearance: none; }
.rt-coin-unit { font-size: 0.9rem; color: var(--amber); line-height: 1; }
.rt-drop-chf { font-size: 0.65rem; color: var(--muted); margin-top: 0.4rem; text-align: center; }

/* ── Reminder Pill ────────────────────────────────────────── */
.rt-rem-badge     { color: var(--muted); border-color: rgba(255,255,255,0.12); background: transparent; }
.rt-rem-badge--set { color: var(--amber); border-color: rgba(239,159,39,0.35); background: rgba(239,159,39,0.07); }
.rt-rem-section.hidden { display: none; }
.rt-rem-row { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem; }
.rt-rem-time-row { margin-top: 0.4rem; padding-top: 0.35rem; border-top: 1px solid var(--border); }
.rt-rem-days { display: flex; flex-wrap: wrap; gap: 0.25rem 0.4rem; margin-bottom: 0.2rem; }
.rt-rem-day { display: flex; align-items: center; gap: 0.2rem; font-size: 0.72rem; color: var(--light); cursor: pointer; }
.rt-rem-day input { accent-color: var(--active); cursor: pointer; }
.rt-rem-num-inp {
  width: 3rem; text-align: center; font-size: 0.82rem; font-family: inherit;
  color: var(--light); background: transparent;
  border: none; border-bottom: 1px solid var(--border); outline: none;
  padding: 0 2px 2px; -moz-appearance: textfield;
}
.rt-rem-num-inp::-webkit-inner-spin-button,
.rt-rem-num-inp::-webkit-outer-spin-button { -webkit-appearance: none; }
.rt-rem-num-inp:focus { border-bottom-color: var(--active); }
.rt-rem-time-inp {
  font-size: 0.82rem; font-family: inherit;
  color: var(--light); background: transparent;
  border: none; border-bottom: 1px solid var(--border); outline: none;
  padding: 0 2px 2px;
}
.rt-rem-time-inp:focus { border-bottom-color: var(--active); }
.rt-rem-clear-btn {
  display: block; width: 100%; margin-top: 0.5rem;
  font-size: 0.68rem; color: var(--muted); background: transparent;
  border: none; cursor: pointer; text-align: center; font-family: inherit;
  padding: 0.2rem; transition: color 0.15s;
}
.rt-rem-clear-btn:hover { color: var(--error); }

/* ── Routine Form: 3-Spalten-Auswahl (Typ + Subkat + Kat) ────── */
/* Mobile: Typ nimmt ganze Breite, Subkat + Kat teilen eine Zeile */
.rt-cats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.rt-cats-row select:first-child {
  grid-column: 1 / -1;
}
@media (min-width: 600px) {
  .rt-cats-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .rt-cats-row select:first-child {
    grid-column: auto;
  }
}

/* ── Formular-Buttons: strecken sich auf volle Breite ──────────── */
.routine-add-actions > button { flex: 1; }

/* ── Erweitert-Toggle ─────────────────────────────────────────── */
.rt-erweitert-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.15rem 0;
  margin-top: 0.1rem;
  transition: color 0.15s;
}
.rt-erweitert-toggle:hover { color: var(--light); }
#rt-erweitert,
#ft-erweitert { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.3rem; }
#rt-erweitert.hidden,
#ft-erweitert.hidden { display: none; }

/* ── Erweitert: Felder ────────────────────────────────────────── */
.rt-field-wrap { display: flex; flex-direction: column; gap: 0.25rem; }
.rt-field-wrap.hidden { display: none; }
.rt-field-label {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.rt-coins-row { margin-top: 0.1rem; }

/* ── Element-Pills (Freestyle-Formular) ──────────────────────── */
.ft-el-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}
.ft-el-pill {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-family: inherit;
  border-radius: 20px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--bright);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ft-el-pill:hover { background: var(--accent); color: #fff; }

/* ── Elemente-Bereich ─────────────────────────────────────────── */
.rt-elements-hdr {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.rt-elements-hdr .rt-field-label { flex: 1; min-width: 4rem; }
.rt-el-add-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 5px;
}
.rt-elements-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.rt-el-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
  padding: 0.3rem 0.5rem;
}
.rt-el-label {
  font-size: 0.75rem;
  color: var(--light);
  min-width: 5rem;
}
.rt-el-cfg {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
}
.rt-el-unit {
  font-size: 0.72rem;
  color: var(--muted);
}
.rt-el-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.rt-el-remove:hover { color: var(--error); }
/* Checklisten-Element in Freestyle-Form */
.rt-el-row--block { flex-direction: column; align-items: stretch; }
.rt-el-row--block .rt-el-top { display: flex; align-items: center; gap: 0.4rem; }
.rt-el-row--block .rt-el-top .rt-el-cfg { display: none; }
.rt-el-cl-body { margin-top: 0.3rem; }
.ft-cl-tagbox {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
  min-height: 2rem;
}
.ft-cl-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent);
  color: var(--light);
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 12px;
}
.ft-cl-tag-rm {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
}
.ft-cl-tag-rm:hover { opacity: 1; }
.ft-cl-inp {
  flex: 1;
  min-width: 6rem;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.1rem 0.2rem;
}
.ft-el-ta {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 0.78rem;
  font-family: inherit;
  line-height: 1.5;
  padding: 0.35rem 0.5rem;
  resize: vertical;
}
.ft-el-ta:focus { outline: none; border-color: var(--bright); }
.ft-el-prompt {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.3rem 0.5rem;
}
.ft-el-prompt:focus { outline: none; border-color: var(--bright); }
.rt-el-empty {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Schwierigkeitsfaktoren ───────────────────────────────────── */
.rt-faktoren {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.rt-faktor-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.rt-faktor-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rt-sisu-preview {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bright);
  margin-left: auto;
  white-space: nowrap;
}

/* ── task-select-sm (kompaktes Select für Faktoren + El-Typ) ──── */
.task-select-sm {
  padding: 0.28rem 0.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--light);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}
.task-select-sm:focus { outline: none; border-color: var(--bright); }

/* ── Freestyle-Tasks (einmalig) ──────────────────────────────── */
#freestyle-tasks-section { margin-bottom: 1.5rem; }
#freestyle-tasks-section + #routine-tasks-section { border-top: 1px solid var(--border); padding-top: 1rem; }

.ft-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: default;
}
.ft-section-header span { flex: 1; }
.ft-add-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.ft-add-btn:hover { border-color: var(--active); color: var(--active); }

.ft-add-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.85rem;
  margin-top: 0.5rem;
}
.ft-add-panel.hidden { display: none; }
.ft-form { display: flex; flex-direction: column; gap: 0.5rem; }

.ft-task-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.ft-task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.6rem 0.85rem;
}
.ft-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.ft-task-row input[type=checkbox] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--amber);
  cursor: pointer;
}
.ft-task-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
}
.xp-pill, .coin-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  white-space: nowrap;
}
.xp-pill   { background: rgba(61,173,217,.12); color: var(--bright); border: 1px solid rgba(61,173,217,.3); }
.coin-pill  { background: rgba(239,159,39,.10); color: var(--amber);  border: 1px solid rgba(239,159,39,.3); }

/* ── Mobile Optimierungen ────────────────────────────────────── */

/* touch-action auf interaktive Elemente ohne button-Tag */
.sk-epos-tab,
.sk-card,
.sk-sub-card,
.quest-card,
.task-card,
.epos-card,
.nav-item a,
.sort-pill,
.gr-buy-btn,
.coach-mode-btn,
.trophy-card,
.aufgabe-card-header {
  touch-action: manipulation;
}

/* iOS: Verhindert automatischen Zoom bei Input-Fokus (< 16px) */
@media (max-width: 905px) {
  .form-input,
  textarea.form-input,
  .task-log-textarea,
  .task-input,
  .task-select,
  .task-input-sm,
  .task-select-sm,
  #coach-text,
  #coach-foto-caption {
    font-size: 16px;
  }
}

/* Touch-Geräte: grössere Tipp-Ziele für Karten-Buttons und Period-Pills */
@media (hover: none) {
  .card-action-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
  }
  .rt-counter-btn { width: 32px; height: 32px; font-size: 1.05rem; }
}

/* Touch-Geräte: Trophy-Button immer sichtbar (kein hover-State) */
@media (hover: none) {
  .trophy-pending .trophy-unlock-btn {
    display: block;
  }
}

/* ── Smartflasche Widget ────────────────────────────────────────────────────── */
.bottle-widget {
  background: var(--panel);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bottle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bottle-drop-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.bottle-drop-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(62%) sepia(74%) saturate(381%) hue-rotate(170deg) brightness(95%) contrast(92%);
}

.bottle-info {
  flex: 1;
  min-width: 0;
}

.bottle-device-name {
  font-family: 'Cinzel', Georgia, serif;
  font-size: .85rem;
  color: var(--light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottle-status-text {
  font-size: .75rem;
  color: var(--muted-blue);
  margin-top: 1px;
}

.bottle-connect-btn {
  flex-shrink: 0;
  font-size: .8rem;
  padding: 6px 14px;
}

.bottle-btn-active {
  background: var(--accent);
}

.bottle-progress-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bottle-hidden {
  display: none !important;
}

.dash-bottle-connect {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-bottle-btn {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.dash-bottle-btn:hover:not(:disabled) { background: var(--bright); }
.dash-bottle-btn:disabled { opacity: .5; cursor: default; }
.dash-bottle-btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-family: var(--font-ui);
  font-size: .72rem;
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
}
.dash-bottle-btn-ghost:hover:not(:disabled) { color: var(--bright); border-color: var(--bright); }
.dash-bottle-btn-ghost:disabled { opacity: .4; cursor: default; }

.dash-bottle-status {
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--muted-blue);
}

.bottle-progress-track {
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
  overflow: hidden;
}

.bottle-progress-fill {
  height: 100%;
  background: var(--bright);
  border-radius: 4px;
  transition: width .4s ease;
  width: 0%;
}

.bottle-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .73rem;
  color: var(--muted-blue);
}

.bottle-goal-label {
  opacity: .7;
}

.bottle-meta {
  font-size: .72rem;
  color: var(--muted-blue);
  padding-top: 2px;
}

/* Batterie */
.bottle-battery-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottle-battery-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  max-width: 120px;
}

.bottle-battery-bar {
  flex: 1;
  height: 10px;
  background: var(--accent);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--accent);
}

.bottle-battery-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease, background .4s ease;
}

.bottle-battery-cap {
  width: 4px;
  height: 6px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  flex-shrink: 0;
}

.bottle-battery-label {
  font-size: .75rem;
  color: var(--muted-blue);
  min-width: 32px;
}

/* XP-Label im Fortschritt */
.bottle-xp-label {
  font-size: .73rem;
  color: var(--amber);
  font-weight: 700;
}

/* Trennlinie */
.bottle-divider {
  height: 1px;
  background: var(--accent);
  opacity: .4;
  margin: 4px 0;
}

/* Abschnitts-Label */
.bottle-section-label {
  font-size: .72rem;
  color: var(--muted-blue);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

/* LED */
.bottle-led-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bottle-led-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bottle-color-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  color: var(--muted-blue);
  cursor: pointer;
}

.bottle-color-input {
  width: 36px;
  height: 28px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px;
  background: var(--panel);
  cursor: pointer;
}

.bottle-led-btn {
  font-size: .78rem;
  padding: 5px 12px;
  margin-left: auto;
}

.bottle-led-status,
.bottle-manual-status {
  font-size: .75rem;
  min-height: 18px;
}

/* Hydration & Ernährung Split */
.hydra-nut-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.hydra-nut-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
@media (min-width: 905px) {
  .hydra-nut-split {
    justify-content: center;
    grid-template-columns: minmax(0, 340px) minmax(0, 340px);
  }
}

/* Card-Header (Hydration & Ernährung) */
.hn-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hn-title {
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-head);
  flex-shrink: 0;
}
.hn-value-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.hn-value {
  font-size: .88rem;
  font-weight: 700;
  font-family: var(--font-head);
}
.hn-pct {
  font-size: .7rem;
  font-weight: 700;
  opacity: .85;
}

/* Drop-Icon Zeile */
.hn-drop-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hn-drop-row .hydration-drop-fill-wrap {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.hn-drop-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.hn-goal-text {
  font-size: .65rem;
  color: var(--muted);
}

/* Quick-Log Buttons */
.hn-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.hn-quick-btn {
  background: transparent;
  border: 1px solid rgba(61,173,217,.22);
  color: var(--bright);
  border-radius: var(--r-sm);
  font-size: .72rem;
  padding: 5px 4px;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s, border-color .15s;
}
.hn-quick-btn:hover  { background: rgba(61,173,217,.1);  border-color: var(--bright); }
.hn-quick-btn:active { background: rgba(61,173,217,.2); }

/* Makro-Badges */
.hn-macro-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.hn-macro {
  font-size: .68rem;
  background: rgba(255,255,255,.04);
  border-radius: 4px;
  padding: 2px 6px;
}
.hn-macro b { margin-left: 2px; }

/* Mobile: Hydration & Ernährung untereinander */
@media (max-width: 904px) {
  .hydra-nut-split {
    grid-template-columns: 1fr;
  }
}

/* Gemeinsamer Erfassen-Button */
.hn-log-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px dashed rgba(61,173,217,.35);
  border-radius: var(--r-sm);
  color: var(--bright);
  font-family: var(--font);
  font-size: .8rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.hn-log-toggle-btn:hover {
  background: rgba(61,173,217,.07);
  border-color: var(--bright);
}
.hn-log-btn-icon {
  font-size: 1rem;
  line-height: 1;
  font-weight: 400;
  transition: transform .2s;
}
.hn-log-toggle-btn.open .hn-log-btn-icon { transform: rotate(45deg); }
.hn-log-btn-label {
  font-weight: 500;
}
@media (min-width: 905px) {
  .hn-log-toggle-btn {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Erfassungs-Bereich */
.hn-log-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.hn-log-section {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hn-log-title {
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-head);
}
.hn-log-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}
.hn-food-input-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.hn-food-textarea {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--white);
  font-family: var(--font);
  font-size: .82rem;
  padding: 7px 10px;
  resize: none;
  min-height: 52px;
}
.hn-food-textarea:focus {
  outline: none;
  border-color: var(--bright);
}

/* Parse-Ergebnis */
.hn-parse-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .78rem;
}
.hn-parse-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.hn-parse-name {
  color: var(--light);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hn-parse-vals {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 600;
}
.hn-parse-total {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 5px;
  font-size: .75rem;
  font-weight: 700;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 2px;
}
.hn-parse-unknown {
  font-size: .7rem;
  color: var(--amber);
  font-style: italic;
  padding-top: 2px;
}
.hn-save-btn {
  align-self: flex-start;
  margin-top: 4px;
  font-size: .78rem;
  padding: 6px 14px;
}

/* Manuelle Eingabe */
.bottle-manual-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Dashboard Hydration Drop-Fortschritt ────────────────────── */
.hydration-drop-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hydration-drop-fill-wrap {
  width: 64px;
  height: 64px;
  position: relative;
}
.hydration-drop-base,
.hydration-drop-fill-img {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.hydration-drop-base {
  filter: brightness(0) invert(1);
  opacity: 0.15;
}
.hydration-drop-fill-img {
  clip-path: inset(calc(100% - var(--fill-pct, 0%)) 0 0 0);
  transition: clip-path 0.6s ease;
}
.hydration-lvl-done .hydration-drop-fill-img { filter: var(--filter-active); }
.hydration-lvl-mid  .hydration-drop-fill-img { filter: var(--filter-active); }
.hydration-lvl-low  .hydration-drop-fill-img { filter: var(--filter-amber); }
.hydration-remaining {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
}
.hydration-lvl-done .hydration-remaining { color: var(--active); }
.hydration-lvl-mid  .hydration-remaining { color: var(--bright); }
.hydration-lvl-low  .hydration-remaining { color: var(--amber); }

.bottle-quick-btn {
  font-size: .78rem;
  padding: 5px 10px;
}

.bottle-custom-wrap {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 100px;
}

.bottle-manual-input {
  flex: 1;
  min-width: 60px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--white);
  font-size: .82rem;
  padding: 5px 8px;
}

.bottle-manual-input::placeholder {
  color: var(--muted-blue);
}

.bottle-status-ok  { color: var(--active); }
.bottle-status-err { color: var(--error); }
.bottle-empty-hint { color: var(--muted-blue); font-size: .78rem; padding: 4px 0; }

/* Prozentzahl im Stats-Widget */
.bottle-pct-badge {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* 7-Tage Balkendiagramm */
.bottle-week-chart {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 36px;
  padding-top: 4px;
}

.bottle-week-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
}

.bottle-week-bar-wrap {
  flex: 1;
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bottle-week-bar-fill {
  width: 100%;
  border-radius: 3px 3px 0 0;
  transition: height .3s ease;
  min-height: 2px;
}

.bottle-week-day {
  font-size: .58rem;
  color: var(--muted-blue);
  white-space: nowrap;
}

/* Active-State-Feedback für Touch */
@media (hover: none) {
  .btn:active,
  .task-tab:active,
  .sk-epos-tab:active,
  .quest-card:active,
  .epos-card:active,
  .gr-buy-btn:active,
  .sort-pill:active {
    opacity: 0.7;
  }
}

/* ── Level-Info Dot & Tooltip ──────────────────────────────── */
.lv-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem; height: 1.1rem;
  border-radius: 50%;
  background: var(--active);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  cursor: default;
  outline: none;
  line-height: 1;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.lv-dot::before { content: 'i'; }

#lv-tooltip-box {
  position: fixed;
  z-index: 9999;
  width: 270px;
  background: var(--bg-deep);
  border: 1.5px solid var(--active);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--light);
  box-shadow: 0 6px 28px rgba(0,0,0,0.75);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-family: 'Raleway', system-ui, sans-serif;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
#lv-tooltip-box.visible { opacity: 1; }
#lv-tooltip-box strong { color: var(--active); font-size: 0.88rem; margin-bottom: 0.2rem; }
#lv-tooltip-box em { color: var(--light); font-style: italic; opacity: 0.85; }
#lv-tooltip-box b  { color: var(--muted); font-weight: 600; }
.ltt-sep { display: block; height: 1px; background: var(--border); margin: 0.3rem 0; }
.ltt-row { display: block; }
#lv-tooltip-box::after { content: ''; position: absolute; border: 7px solid transparent; }
#lv-tooltip-box[data-arrow="down"]::after {
  top: 100%; left: 50%; transform: translateX(-50%);
  border-top-color: var(--active);
}
#lv-tooltip-box[data-arrow="up"]::after {
  bottom: 100%; left: 50%; transform: translateX(-50%);
  border-bottom-color: var(--active);
}

/* ── Sisu-Log Bottom Sheet ───────────────────────────────── */
#sisu-log-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,27,38,.75);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(6px);
}
#sisu-log-overlay.open { display: flex; animation: fadeIn .2s ease; }

#sisu-log-sheet {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r) var(--r) 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 88svh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 1.25rem 3rem;
  position: relative;
  animation: slideUp .25s ease;
}
@media (min-width: 905px)  { #sisu-log-sheet { max-width: 820px;  padding: 0 2rem 3rem; } }
@media (min-width: 1400px) { #sisu-log-sheet { max-width: 1000px; } }

#sisu-log-bar {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: .75rem auto .5rem;
}
#sisu-log-close {
  position: absolute;
  top: .75rem; right: 1rem;
  background: none; border: none;
  font-size: 1.3rem; color: var(--muted);
  cursor: pointer; padding: .5rem;
  transition: color var(--ease);
  touch-action: manipulation;
}
#sisu-log-close:hover { color: var(--white); }

.sisu-log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: .9rem 0 .6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}
.sisu-log-head-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sisu-log-head-total { font-size: .68rem; color: var(--muted); }

.sisu-log-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.sisu-log-row:last-child { border-bottom: none; }

.sisu-log-amount {
  flex-shrink: 0;
  min-width: 2.8rem;
  text-align: right;
  font-size: .82rem;
  font-weight: 700;
  color: var(--amber);
}
.sisu-log-info { flex: 1; min-width: 0; }
.sisu-log-desc {
  font-size: .8rem;
  color: var(--light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sisu-log-meta { font-size: .65rem; color: var(--muted); margin-top: 2px; }

.sisu-log-loading { color: var(--muted); font-size: .8rem; padding: 1rem 0; text-align: center; }

.sisu-log-more-btn {
  display: block;
  width: 100%;
  margin-top: .75rem;
  padding: .55rem;
  background: rgba(28,108,140,.2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--light);
  font-size: .75rem;
  cursor: pointer;
  transition: background var(--ease);
}
.sisu-log-more-btn:hover { background: rgba(28,108,140,.4); }

/* ── Tagebuch ────────────────────────────────────────────────── */
#diary-view .view-content { max-width: 620px; }
@media (min-width: 905px)  { #diary-view .view-content { max-width: 680px; } }
@media (min-width: 1400px) { #diary-view .view-content { max-width: 780px; } }

.diary-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
}
.diary-header-row .page-title { margin-bottom: 0; }

.diary-add-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--bright);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .25s cubic-bezier(.34,1.56,.64,1);
  flex-shrink: 0;
  touch-action: manipulation;
}
.diary-add-btn.active { background: var(--accent); transform: rotate(45deg); }
@media (hover: hover) { .diary-add-btn:hover:not(.active) { background: rgba(28,108,140,.4); } }

.diary-tabs {
  display: flex;
  margin-bottom: .9rem;
  border-bottom: 2px solid var(--border);
}
.diary-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .8rem;
  padding: .55rem .9rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  touch-action: manipulation;
  white-space: nowrap;
}
.diary-tab-btn.active { color: var(--bright); border-bottom-color: var(--bright); }
@media (hover: hover) { .diary-tab-btn:hover:not(.active) { color: var(--light); } }

.diary-note-form {
  display: none;
  background: rgba(17,62,89,.6);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: .9rem;
  margin-bottom: 1rem;
  animation: fadeIn .18s ease;
}
.diary-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(8,27,38,.7);
  border: 1px solid rgba(61,173,217,.35);
  border-radius: 8px;
  color: var(--light);
  font-family: var(--font-body);
  font-size: .9rem;
  line-height: 1.6;
  padding: .65rem .8rem;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
}
.diary-textarea::placeholder { color: var(--muted); opacity: .7; }
.diary-textarea:focus { border-color: var(--bright); }
.diary-note-actions {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
  justify-content: flex-end;
}
.diary-note-actions .task-btn-primary,
.diary-note-actions .task-btn-ghost { min-height: 2.2rem; padding: .4rem 1rem; font-size: .8rem; }

.diary-card-note { background: rgba(17,62,89,.45); border-color: rgba(61,173,217,.2) !important; }
.diary-note-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.diary-note-icon { font-size: .85rem; opacity: .7; }
.diary-note-del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .75rem;
  min-height: 2rem;
  min-width: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  touch-action: manipulation;
}
@media (hover: hover) { .diary-note-del:hover { color: var(--red); background: rgba(224,80,80,.1); } }

/* Activity timeline */
.diary-activity-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
}
.diary-activity-item:last-child { border-bottom: none; }
.da-icon { font-size: 1.25rem; flex-shrink: 0; width: 1.8rem; text-align: center; margin-top: .05rem; }
.da-body { flex: 1; min-width: 0; }
.da-title { font-size: .84rem; font-weight: 600; color: var(--light); line-height: 1.35; word-break: break-word; }
.da-sub { font-size: .71rem; color: var(--muted); margin-top: .1rem; }
.da-meta {
  font-size: .67rem;
  color: var(--muted);
  margin-top: .2rem;
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  align-items: center;
}
.da-xp    { color: var(--amber); font-weight: 600; }
.da-coins { color: var(--bright); font-weight: 600; }
.da-undo-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: .8rem;
  padding: .2rem .45rem;
  cursor: pointer;
  align-self: center;
  transition: color .15s, border-color .15s, background .15s;
}
.da-undo-btn:hover { color: var(--light); border-color: var(--muted); }
.da-undo-btn.da-undo-confirming { color: var(--amber); border-color: var(--amber); background: rgba(239,159,39,.1); }
.da-undo-btn:disabled { opacity: .5; cursor: default; }

.diary-coach-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem .9rem;
  margin-bottom: .65rem;
}
.dc-ts { font-size: .63rem; color: var(--muted); margin-bottom: .55rem; }
.dc-user, .dc-reply { font-size: .83rem; line-height: 1.65; margin-bottom: .55rem; word-break: break-word; }
.dc-user:last-child, .dc-reply:last-child { margin-bottom: 0; }
.dc-label {
  display: inline-block;
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: .4rem;
  vertical-align: middle;
}
.dc-user  .dc-label { color: var(--bright); background: rgba(61,173,217,.13); }
.dc-reply .dc-label { color: var(--amber);  background: rgba(239,159,39,.11); }
.dc-user  { color: var(--light); }
.dc-reply { color: var(--muted); }

.diary-coach-session { margin-bottom: 1rem; }
.dcs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
  padding: 0 .1rem;
}
.dcs-ts { font-size: .63rem; color: var(--muted); }
.dcs-resume-btn {
  font-size: .72rem;
  padding: .25rem .65rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--bright);
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
  transition: background .15s;
}
.dcs-resume-btn:hover { background: rgba(61,173,217,.12); }

/* More button */
.diary-more-wrap {
  text-align: center;
  margin: 1.25rem 0;
  display: none;
}

/* Date groups */
.diary-date-group { margin-bottom: 1.5rem; }

.diary-date-hdr {
  font-family: var(--font-display);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--bright);
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .65rem;
}

/* Entry cards */
.diary-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .8rem .9rem;
  margin-bottom: .5rem;
}

.diary-card-task {
  font-size: .8rem;
  font-weight: 600;
  color: var(--light);
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
  line-height: 1.4;
}

.diary-epos-tag, .diary-kat-tag {
  font-size: .6rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.diary-kat-tag {
  color: var(--amber);
  border-color: rgba(239,159,39,.2);
  background: rgba(239,159,39,.07);
}

.diary-field { margin-bottom: .5rem; }
.diary-field:last-child { margin-bottom: 0; }

.diary-field-lbl {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .15rem;
}

.diary-field-txt {
  font-size: .84rem;
  color: var(--light);
  line-height: 1.65;
  word-break: break-word;
}

.diary-empty {
  text-align: center;
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.75;
  padding: 2rem .5rem;
}

/* ── Diary Photos ─────────────────────────────────────────────────────────── */
.diary-camera-btn { cursor: pointer; font-size: 1.1rem; padding: 4px 10px; }

.diary-photo-preview-wrap {
  position: relative;
  display: inline-block;
  margin: .5rem 0;
}
.diary-photo-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  display: block;
}
.diary-photo-preview-del {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger, #E05050);
  color: #fff;
  border: none;
  font-size: .7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Diary note: full-width photo */
.diary-note-photo {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: .5rem;
  cursor: pointer;
  display: block;
}

/* Element-photos grid in diary */
.diary-el-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: .5rem;
}
.diary-el-photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--accent);
  cursor: pointer;
}

/* Lightbox */
.diary-photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.diary-photo-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 8px;
  object-fit: contain;
}
.diary-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Diary Rating Stars ────────────────────────────────────────────────────── */
.diary-rating-stars {
  display: flex;
  gap: 3px;
  margin: .4rem 0 .2rem;
}
.diary-star {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--panel);
}
.diary-star.filled {
  color: var(--amber);
}

/* ── Diary Filter Chips & Subkat ───────────────────────────────────────────── */
.diary-filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: .5rem 0 .75rem;
  scrollbar-width: none;
}
.diary-filter-row::-webkit-scrollbar { display: none; }
.diary-filter-chip {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--light);
  font-family: var(--font-body);
  font-size: .72rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.diary-filter-chip.active {
  background: var(--accent);
  color: #fff;
}
.diary-note-subkat-badge {
  font-size: .62rem;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  font-family: var(--font-body);
}
.diary-subkat-select {
  width: 100%;
  margin-top: .4rem;
  background: var(--panel);
  color: var(--light);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--font-body);
  font-size: .85rem;
}

/* ── Nutrition Widget ──────────────────────────────────────────── */
.nutrition-widget {
  background: var(--panel);
  border-radius: var(--r);
  padding: .9rem;
}
.nut-widget-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.nut-kcal-block {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  flex-wrap: wrap;
}
.nut-info-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--light);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: .72rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.nut-info-btn[aria-expanded="true"] {
  background: var(--accent);
  color: var(--white);
}
.nutrition-kcal-val {
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--white);
}
.nutrition-kcal-goal {
  font-size: .72rem;
  color: var(--muted-blue);
}
.nutrition-bar-track {
  height: 6px;
  background: var(--accent);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .75rem;
}
.nutrition-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.nut-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .5rem;
  margin: .4rem 0 .2rem;
}
.nut-gauge-card {
  text-align: center;
}
.nut-gauge-svg {
  width: 100%;
  height: auto;
  display: block;
}
.nut-gauge-sub {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  font-size: .68rem;
  margin-top: -.15rem;
}
.nut-gauge-rest {
  color: var(--muted-blue);
}
.nut-gauge-done {
  color: var(--active);
  font-weight: 700;
}
.nut-gauge-goal {
  color: var(--muted-blue);
}
.nut-unit {
  font-size: .6rem;
  color: var(--muted-blue);
  margin-left: 2px;
}
.nutrition-meta {
  margin-top: .6rem;
  font-size: .65rem;
  color: var(--muted-blue);
  line-height: 1.6;
}
.nutrition-empty {
  color: var(--muted-blue);
  font-size: .8rem;
  padding: .5rem 0;
}
.nutrition-link {
  color: var(--bright);
  text-decoration: underline;
}

/* ── Nutrition Info Panel ────────────────────────────────────── */
.nut-info-panel {
  display: none;
  flex-direction: column;
  margin-top: .75rem;
  border-top: 1px solid var(--accent);
  max-height: 58vh;
}
.nut-info-panel.open {
  display: flex;
}
.nut-info-body {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  padding-top: .1rem;
}
.nut-info-section {
  padding: .55rem 0;
  border-bottom: 1px solid rgba(28,108,140,.25);
}
.nut-info-section:last-child { border-bottom: none; }
.nut-info-title {
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-blue);
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.nut-pct-badge {
  color: var(--amber);
  font-size: .72rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.nut-calc-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  font-size: .78rem;
}
.nut-calc-grid span { color: var(--light); }
.nut-calc-num {
  font-weight: 600;
  color: var(--white);
  text-align: right;
}
.nut-calc-op {
  color: var(--muted-blue) !important;
  font-size: .68rem;
  text-align: right;
}
.nut-week-goal {
  font-size: .65rem;
  color: var(--muted);
  text-align: right;
  margin-top: .3rem;
}
.nut-calc-result {
  color: var(--white) !important;
  font-weight: 700;
  border-top: 1px solid var(--accent);
  padding-top: 4px;
  margin-top: 2px;
}
.nut-units-table {
  font-size: .78rem;
  border-collapse: collapse;
  width: 100%;
}
.nut-units-table td {
  padding: 2px 8px 2px 0;
  color: var(--light);
  vertical-align: middle;
}
.nut-unit-abbr {
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-head);
  white-space: nowrap;
}

/* Sticky footer mit Prozentwert-Regler */
.nut-info-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--accent);
  padding-top: .6rem;
  padding-bottom: .1rem;
}
.nut-pct-range {
  width: 100%;
  accent-color: var(--bright);
  margin: .35rem 0 .25rem;
  cursor: pointer;
}
.nut-pct-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.nut-pct-num {
  width: 54px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: .85rem;
  padding: 3px 6px;
  text-align: center;
}
.nut-pct-unit {
  font-size: .7rem;
  color: var(--muted-blue);
}
.nut-pct-preview {
  margin-left: auto;
  font-size: .78rem;
  color: var(--amber);
  font-weight: 600;
}
.nut-save-btn {
  width: 100%;
  margin-bottom: .3rem;
}

/* ── Nutrition Log Form ─────────────────────────────────────── */
.nutlog-form-wrap {
  background: var(--panel);
  border-radius: var(--r);
  padding: .85rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.nutlog-input-text {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: .85rem;
  padding: 7px 10px;
  box-sizing: border-box;
}
.nutlog-input-text::placeholder { color: var(--muted-blue); }
.nutlog-macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
}
.nutlog-macro-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nutlog-macro-label {
  font-size: .62rem;
  color: var(--muted-blue);
  letter-spacing: .06em;
  text-align: center;
}
.nutlog-input-num {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-head);
  font-size: 1rem;
  padding: 6px 4px;
  text-align: center;
  box-sizing: border-box;
}
.nutlog-input-num::placeholder { color: rgba(172,222,242,.25); }
.nutlog-actions {
  display: flex;
  gap: .5rem;
}
.nutlog-status {
  font-size: .75rem;
  min-height: 1rem;
}
.nutlog-status.ok  { color: var(--active); }
.nutlog-status.err { color: var(--error); }

/* ── Nutrition Log Entries ──────────────────────────────────── */
.nutlog-entries {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.nutlog-entry {
  background: var(--panel);
  border-radius: 8px;
  padding: .55rem .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.nutlog-entry-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.nutlog-entry-label {
  font-size: .82rem;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nutlog-entry-macros {
  font-size: .7rem;
  color: var(--light);
}
.nutlog-entry-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.nutlog-entry-time {
  font-size: .68rem;
  color: var(--muted-blue);
}
.nutlog-del-btn {
  background: none;
  border: none;
  color: var(--muted-blue);
  font-size: .75rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD — Responsive layout
   Mobile (<905px):  single column, stacked
   Tablet (≥905px):  wider content, Gesundheitsdaten auto-expanded
   ═══════════════════════════════════════════════════════════════════════ */

/* Dashboard bricht aus dem generischen view-content max-width heraus */
@media (min-width: 905px) {
  #dashboard-view .view-content { max-width: 1100px; }
}
@media (min-width: 1400px) {
  #dashboard-view .view-content { max-width: 1700px; padding: 0 3rem 2rem; }
}

@media (min-width: 905px) {
  /* Hero: kompakter */
  .hero { padding: 1rem 1rem 0.9rem; }

  /* Coins-Reihe */
  .dash-coins-row { overflow-x: visible; flex-wrap: nowrap; }

  /* Epen: wrappen, grössere Karten */
  .dash-epen-row {
    flex-wrap: wrap;
    overflow-x: visible;
    scroll-snap-type: none;
    border-top: none;
    border-bottom: none;
  }
  .epos-card { flex: 1 1 200px; scroll-snap-align: unset; }

  /* 7-Tage: Grid 3×2 */
  .gh-week-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
    scrollbar-width: auto;
  }
  .gh-week-box { flex: unset; }
  .gh-week-box:nth-child(3n) { border-right: none; }
  .gh-week-box:nth-child(-n+3) { border-bottom: 1px solid rgba(61,173,217,0.08); }

  /* Nutrition Gauges */
  .nut-gauges { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

  /* Cardio-Karten */
  .gh-stat-grid { flex-wrap: wrap; overflow-x: visible; justify-content: flex-start; }
  .gh-stat-card { flex: 1 1 130px; }

  /* Gesundheitsdaten-Charts */
  .gh-chart-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

  /* Gesundheitsdaten-Header: Toggle-Chevron verstecken (immer offen auf Desktop) */
  #dash-health-chevron { display: none; }
  #dash-health-header  { cursor: default; }
}

@media (min-width: 1400px) {
  /* Epos: noch mehr Karten pro Zeile */
  .epos-card { flex: 1 1 175px; }

  /* 7-Tage: alle 6 in einer Reihe */
  .gh-week-grid { grid-template-columns: repeat(6, 1fr); }
  .gh-week-box:nth-child(3n)  { border-right: 1px solid rgba(61,173,217,0.08); }
  .gh-week-box:nth-child(-n+3){ border-bottom: none; }
  .gh-week-box:last-child     { border-right: none; }

  /* Health Charts: bis zu 4 nebeneinander */
  .gh-chart-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

  /* Nut/Hydration: fix 2 Spalten */
  #gh-nuthydr-section { grid-template-columns: repeat(2, 1fr); }
}
.nutlog-del-btn:hover { color: var(--error); }

/* ══════════════════════════════════════════════════════════════
   Epos-Overlay (Fokus-Ansicht)
   ══════════════════════════════════════════════════════════════ */
#epos-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  align-items: stretch;
  justify-content: center;
}
#epos-overlay.open { display: flex; animation: fadeIn .2s ease; }

#epos-sheet {
  background: var(--bg);
  width: 100%;
  max-width: 960px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 0 6rem;
  position: relative;
}
@media (min-width: 1600px) { #epos-sheet { max-width: 1100px; } }

#epos-bar { display: none; }

/* Header */
.epos-ov-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.4rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.epos-ov-icon {
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 8px;
}
.epos-ov-icon-emoji {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.epos-ov-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epos-ov-skilltree-btn {
  flex-shrink: 0;
  background: rgba(28,108,140,.25);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--bright);
  font-size: .8rem;
  font-weight: 600;
  padding: .4rem .75rem;
  cursor: pointer;
  transition: background var(--ease);
  touch-action: manipulation;
  white-space: nowrap;
}
@media (hover: hover) { .epos-ov-skilltree-btn:hover { background: rgba(28,108,140,.5); } }
.epos-ov-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  padding: .4rem;
  line-height: 1;
  touch-action: manipulation;
  transition: color var(--ease);
}
@media (hover: hover) { .epos-ov-close:hover { color: var(--white); } }

/* Level Hero — nächstes Level prominent oben */
.epos-level-hero {
  padding: 1.5rem 1.4rem 1.3rem;
  border-bottom: 2px solid var(--border);
  background: rgba(17,62,89,.3);
}
.epos-level-hero-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bright);
  margin-bottom: .6rem;
}
.epos-level-hero-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  line-height: 1.3;
}
.epos-level-hero-bar-wrap {
  height: 10px;
  background: rgba(255,255,255,.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: .6rem;
}
.epos-level-hero-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--bright));
  border-radius: 5px;
  transition: width .5s ease;
}
.epos-level-hero-nums {
  font-size: .84rem;
  color: var(--muted);
}

/* Sections */
.epos-section {
  padding: 1.3rem 1.4rem 0;
  border-bottom: 1px solid var(--border);
}
.epos-section:last-of-type {
  border-bottom: none;
  padding-bottom: 1rem;
}
.epos-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
  gap: .5rem;
}
.epos-section-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bright);
}
.epos-section-empty {
  font-size: .9rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
  font-style: italic;
}
.epos-add-btn {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--bright);
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .25s cubic-bezier(.34,1.56,.64,1);
  touch-action: manipulation;
}
.epos-add-btn.active { background: var(--accent); transform: rotate(45deg); }
@media (hover: hover) { .epos-add-btn:hover:not(.active) { background: rgba(28,108,140,.4); } }

/* Quick-add form */
.epos-quick-add-form {
  background: rgba(17,62,89,.55);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .75rem;
  animation: fadeIn .15s ease;
}
.epos-quick-add-form.hidden { display: none; }
.epos-qa-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(8,27,38,.7);
  border: 1px solid rgba(61,173,217,.35);
  border-radius: 8px;
  color: var(--light);
  font-family: var(--font-body);
  font-size: .95rem;
  padding: .6rem .85rem;
  outline: none;
  transition: border-color .15s;
  margin-bottom: .55rem;
}
.epos-qa-input::placeholder { color: var(--muted); opacity: .7; }
.epos-qa-input:focus { border-color: var(--bright); }
.epos-qa-select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(8,27,38,.7);
  border: 1px solid rgba(61,173,217,.35);
  border-radius: 8px;
  color: var(--light);
  font-family: var(--font-body);
  font-size: .88rem;
  padding: .55rem .7rem;
  outline: none;
  margin-bottom: .6rem;
}
.epos-qa-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}
.epos-qa-actions .task-btn-primary,
.epos-qa-actions .task-btn-ghost { min-height: 2.2rem; padding: .4rem 1rem; font-size: .82rem; }

/* Task cards (aufklappbar) */
.epos-task-card {
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.epos-task-card:last-child { border-bottom: none; }
.epos-task-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.epos-task-expand-icon {
  font-size: 1.1rem;
  color: var(--muted);
  transition: transform .2s ease, color .2s;
  flex-shrink: 0;
  line-height: 1;
}
.epos-task-expand-icon.open { transform: rotate(90deg); color: var(--bright); }
.epos-task-expand-icon.invis { visibility: hidden; }
.epos-task-title {
  flex: 1;
  font-size: .98rem;
  color: var(--light);
  min-width: 0;
  line-height: 1.4;
}
.epos-task-node {
  font-size: .72rem;
  color: var(--muted);
}
.epos-task-done-btn {
  flex-shrink: 0;
  background: rgba(28,108,140,.2);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--bright);
  font-size: .82rem;
  padding: .38rem .75rem;
  cursor: pointer;
  transition: background var(--ease);
  touch-action: manipulation;
  white-space: nowrap;
}
@media (hover: hover) { .epos-task-done-btn:hover { background: rgba(28,108,140,.5); } }
.epos-task-done-btn.done { background: rgba(76,175,80,.15); border-color: rgba(76,175,80,.4); color: #4CAF50; cursor: default; }

/* Task body (ausgeklappt) */
.epos-task-body {
  padding: 0 0 1rem 1.85rem;
  animation: fadeIn .15s ease;
}
.epos-task-body.hidden { display: none; }
.epos-task-body-desc {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 .65rem;
}
.epos-task-body-meta {
  font-size: .84rem;
  color: var(--muted);
  margin: 0 0 .55rem;
}
.epos-task-checklist {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-bottom: .65rem;
}
.epos-cl-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .9rem;
  color: var(--light);
}
.epos-cl-item.done { color: var(--muted); }
.epos-cl-item.done .epos-cl-label { text-decoration: line-through; }
.epos-cl-dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  flex-shrink: 0;
}
.epos-cl-dot.done { background: var(--active); border-color: var(--active); }
.epos-task-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .65rem;
}
.epos-task-prompt-tag {
  font-size: .78rem;
  background: rgba(28,108,140,.2);
  border: 1px solid rgba(61,173,217,.25);
  border-radius: 4px;
  padding: .2rem .55rem;
  color: var(--bright);
}
.epos-task-body-link {
  display: inline-block;
  font-size: .82rem;
  color: var(--bright);
  text-decoration: none;
  opacity: .65;
  transition: opacity .15s;
}
@media (hover: hover) { .epos-task-body-link:hover { opacity: 1; } }

/* Routine task rows */
.epos-rt-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.epos-rt-row:last-child { border-bottom: none; }
.epos-rt-title { flex: 1; font-size: .98rem; color: var(--light); line-height: 1.4; }
.epos-rt-row.done .epos-rt-title { text-decoration: line-through; color: var(--muted); }
.epos-rt-period {
  font-size: .72rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Coach section (beibehalten für potenzielle Nutzung) */
.epos-coach-msgs {
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .25rem 0 .5rem;
  overscroll-behavior: contain;
}
.epos-coach-msg {
  max-width: 88%;
  padding: .6rem .85rem;
  border-radius: 12px;
  font-size: .83rem;
  line-height: 1.6;
  animation: fadeIn .15s ease;
  word-break: break-word;
}
.epos-coach-msg.from-coach {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--light);
  border-bottom-left-radius: 4px;
}
.epos-coach-msg.from-user {
  align-self: flex-end;
  background: var(--active);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.epos-coach-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: .6rem .85rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.epos-coach-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: coach-bounce 1.2s infinite;
}
.epos-coach-typing span:nth-child(2) { animation-delay: .2s; }
.epos-coach-typing span:nth-child(3) { animation-delay: .4s; }
.epos-coach-input-row {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  margin-top: .5rem;
}
.epos-coach-textarea {
  flex: 1;
  background: rgba(8,27,38,.7);
  border: 1px solid rgba(61,173,217,.35);
  border-radius: 10px;
  color: var(--light);
  font-family: var(--font-body);
  font-size: .86rem;
  padding: .55rem .75rem;
  resize: none;
  outline: none;
  min-height: 2.4rem;
  max-height: 100px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color .15s;
}
.epos-coach-textarea::placeholder { color: var(--muted); opacity: .7; }
.epos-coach-textarea:focus { border-color: var(--bright); }
.epos-coach-send {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--active);
  border: none;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), transform .15s;
  touch-action: manipulation;
}
@media (hover: hover) { .epos-coach-send:hover { background: var(--bright); } }
.epos-coach-send:active { transform: scale(.92); }
.epos-coach-section { padding-bottom: 1.25rem; }

/* ══════════════════════════════════════════════════════════════
   Focus Session — Panel im Coach-Tab
   ══════════════════════════════════════════════════════════════ */
#focus-session-panel {
  border-bottom: 1px solid var(--border);
  padding: .85rem 1.25rem .9rem;
  flex-shrink: 0;
}

/* Setup */
.focus-setup-header {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .65rem;
}
.focus-setup-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--white);
}
.focus-setup-hint {
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .04em;
}
.focus-duration-row {
  display: flex;
  gap: .4rem;
  margin-bottom: .55rem;
}
.focus-dur-btn {
  flex: 1;
  padding: .35rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--light);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
  touch-action: manipulation;
}
.focus-dur-btn.active {
  background: rgba(28,108,140,.3);
  border-color: var(--bright);
  color: var(--bright);
}
@media (hover: hover) { .focus-dur-btn:hover:not(.active) { background: rgba(255,255,255,.05); } }

#focus-custom-row {
  display: none;
  margin-bottom: .5rem;
}
#focus-custom-min {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  padding: .4rem .65rem;
  font-size: .88rem;
}
#focus-custom-min:focus { outline: none; border-color: var(--bright); }

#focus-task-label {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  padding: .4rem .65rem;
  font-size: .88rem;
  box-sizing: border-box;
  margin-bottom: .55rem;
}
#focus-task-label::placeholder { color: var(--muted); }
#focus-task-label:focus { outline: none; border-color: var(--bright); }

#focus-start-btn {
  width: 100%;
  padding: .5rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--ease);
  touch-action: manipulation;
}
@media (hover: hover) { #focus-start-btn:hover { opacity: .85; } }

/* Aktiv-Ansicht */
.focus-active-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
}
#focus-active-label {
  font-size: .82rem;
  color: var(--light);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}
.focus-stop-btn {
  font-size: .72rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .2rem .5rem;
  cursor: pointer;
  touch-action: manipulation;
}
@media (hover: hover) { .focus-stop-btn:hover { color: var(--white); } }

#focus-countdown-ring {
  position: relative;
  width: 80px;
  margin: 0 auto .4rem;
}
#focus-countdown-ring svg { width: 80px; height: 80px; transform: rotate(-90deg); }
.focus-ring-bg  { fill: none; stroke: var(--border); stroke-width: 4; }
.focus-ring-arc {
  fill: none;
  stroke: var(--bright);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset .9s linear;
}
#focus-countdown-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.focus-active-hint {
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  margin: 0;
}
.focus-done-list {
  list-style: none;
  margin: .55rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.focus-done-item {
  font-size: .75rem;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* ── Floating Timer Badge (app-weit) ────────────────────────── */
#focus-timer-badge {
  display: none;
  position: fixed;
  bottom: calc(4rem + env(safe-area-inset-bottom) + .5rem);
  right: .85rem;
  background: var(--accent);
  border-radius: 20px;
  padding: .3rem .65rem .3rem .5rem;
  gap: .3rem;
  align-items: center;
  z-index: 190;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
  animation: fadeIn .2s ease;
  cursor: pointer;
}
#focus-timer-badge.visible { display: flex; }
#focus-timer-icon { font-size: .85rem; }
#focus-timer-display {
  font-size: .8rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  min-width: 2.4ch;
}
#focus-timer-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  font-size: .75rem;
  cursor: pointer;
  padding: 0 0 0 .2rem;
  line-height: 1;
  touch-action: manipulation;
}

/* ── Comeback-Banner ────────────────────────────────────────── */
#comeback-banner {
  display: none;
  position: fixed;
  top: .75rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #1a7fa8);
  border: 1px solid var(--bright);
  border-radius: 12px;
  padding: .65rem 1.1rem;
  z-index: 210;
  max-width: min(90vw, 340px);
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
  animation: slideDown .3s ease;
}
#comeback-banner.visible { display: block; }
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.comeback-emoji { font-size: 1.4rem; display: block; margin-bottom: .15rem; }
.comeback-title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .15rem;
}
.comeback-sub { font-size: .78rem; color: var(--light); }
.comeback-close {
  position: absolute;
  top: .4rem; right: .5rem;
  background: none; border: none;
  color: rgba(255,255,255,.55);
  font-size: .85rem; cursor: pointer;
}

/* ── Focus Plan ─────────────────────────────────────────────── */
.tasks-plan-btn {
  display: block;
  width: 100%;
  background: rgba(61,173,217,.12);
  border: 1px solid rgba(61,173,217,.3);
  border-radius: 10px;
  color: var(--bright);
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  padding: .65rem 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
  letter-spacing: .03em;
}
.tasks-plan-btn:active { background: rgba(61,173,217,.22); }

/* Session View */
.session-view {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--nav-h);
  grid-template-rows: auto auto 1fr auto;
  background: var(--bg);
  z-index: 10;
}
.session-view.active { display: grid; }

.session-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.session-back-btn {
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: .1rem .4rem .1rem 0;
  flex-shrink: 0;
}
.session-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--white);
  font-weight: 600;
  flex: 1;
}

.fp-tabs-wrap {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.fp-tab-panel {
  display: none;
  padding: .5rem 1rem .5rem;
}
.fp-tab-panel.active { display: block; }
.fp-tab-panel.anim-from-right { animation: fp-slide-from-right .2s ease; }
.fp-tab-panel.anim-from-left  { animation: fp-slide-from-left  .2s ease; }
@keyframes fp-slide-from-right {
  from { transform: translateX(18%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes fp-slide-from-left {
  from { transform: translateX(-18%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.fp-panel-label {
  display: none;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding-bottom: .3rem;
  margin-bottom: .3rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

@media (min-width: 1024px) {
  .fp-tab-bar { display: none; }
  .session-view.active { grid-template-rows: auto 1fr auto; }

  .fp-tabs-wrap {
    display: flex;
    flex-direction: row;
    overflow-y: hidden;
  }
  .fp-tab-panel {
    display: block !important;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: .5rem .75rem .5rem;
  }
  #fp-panel-available {
    border-right: 1px solid rgba(255,255,255,.08);
  }
  .fp-panel-label { display: block; }

  .fp-bottom {
    max-width: 560px;
    margin-inline: auto;
    width: 100%;
    border-left: 1px solid rgba(255,255,255,.07);
    border-right: 1px solid rgba(255,255,255,.07);
    border-radius: 0 0 var(--r) var(--r);
  }
}

.fp-tab-bar {
  display: flex;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.fp-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .85rem;
  padding: .55rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.fp-tab-btn.active {
  color: var(--white);
  border-bottom-color: var(--bright);
}
.fp-available-item {
  background: rgba(255,255,255,.04);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--white);
  font-size: .82rem;
  padding: .42rem .6rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: .45rem;
  width: 100%;
  flex-shrink: 0;
  transition: background .12s;
}
.fp-available-item:active { background: rgba(255,255,255,.09); }
.fp-avail-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  flex-shrink: 0;
  padding-bottom: .25rem;
}
.fp-avail-chip {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  color: var(--light);
  font-size: .7rem;
  padding: .18rem .55rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.fp-avail-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.fp-available-type {
  font-size: .64rem;
  color: var(--light);
  background: rgba(255,255,255,.07);
  border-radius: 3px;
  padding: .08rem .3rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.fp-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .5rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.07);
}
.fp-freetext-row {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.fp-freetext-row .fp-freetext { flex: 1; min-width: 0; }
.fp-break-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.fp-break-row .fp-add-break-btn { flex: 1; text-align: center; }
.fp-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 1.6rem;
}


.fp-drag-handle {
  font-size: .95rem;
  cursor: grab;
  color: rgba(255,255,255,.2);
  flex-shrink: 0;
  transition: color .15s;
  user-select: none;
}
.fp-drag-handle:active { cursor: grabbing; }
.fp-plan-item:hover .fp-drag-handle { color: rgba(255,255,255,.5); }
@media (hover: none) { .fp-drag-handle { color: rgba(255,255,255,.35); } }

.fp-plan-item {
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  padding: .6rem .75rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.fp-plan-break {
  background: rgba(61,173,217,.07);
  border: 1px solid rgba(61,173,217,.15);
}
.fp-break-icon {
  font-size: .9rem;
  flex-shrink: 0;
}
.fp-plan-num {
  color: var(--light);
  font-size: .78rem;
  min-width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}
.fp-plan-label {
  flex: 1;
  color: var(--white);
  font-size: .88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-dur-btns { display: flex; gap: .3rem; flex-shrink: 0; }
.fp-dur-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--light);
  font-size: .73rem;
  padding: .18rem .42rem;
  cursor: pointer;
}
.fp-dur-btn.active { border-color: var(--bright); color: var(--bright); }
.fp-remove-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.25);
  cursor: pointer;
  font-size: .9rem;
  padding: .2rem .25rem;
  flex-shrink: 0;
}
.fp-remove-btn:hover { color: var(--red); }

.fp-empty {
  color: var(--light);
  font-size: .85rem;
  text-align: center;
  padding: 1.2rem 0;
}

.fp-add-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.fp-freetext {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: var(--white);
  font-size: .9rem;
  padding: .5rem .7rem;
}
.fp-freetext::placeholder { color: rgba(255,255,255,.35); }
.fp-add-btn, .fp-pick-btn {
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  color: var(--white);
  font-size: .88rem;
  padding: .5rem .75rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.fp-add-btn { font-size: 1.2rem; font-weight: 700; padding: .4rem .8rem; }

.fp-break-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.fp-break-label { color: var(--light); font-size: .82rem; flex-shrink: 0; }
.fp-break-input {
  width: 4rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  color: var(--white);
  font-size: .9rem;
  padding: .3rem .5rem;
  text-align: center;
  flex-shrink: 0;
}
.fp-break-input:focus { outline: none; border-color: var(--bright); }
.fp-add-break-btn {
  background: rgba(61,173,217,.15);
  border: 1px solid rgba(61,173,217,.35);
  border-radius: 6px;
  color: var(--bright);
  font-size: .82rem;
  padding: .3rem .7rem;
  cursor: pointer;
  flex-shrink: 0;
}
.fp-add-break-btn:hover { background: rgba(61,173,217,.25); }

.fp-total {
  color: var(--light);
  font-size: .8rem;
  text-align: right;
  min-height: 1.1em;
}

.fp-start-btn {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  padding: .82rem;
  cursor: pointer;
  width: 100%;
  letter-spacing: .04em;
}
.fp-start-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Task Picker */
#fp-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: none;
  align-items: flex-end;
}
#fp-picker-overlay.open { display: flex; }

#fp-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#fp-picker-sheet {
  position: relative;
  width: 100%;
  max-height: 60vh;
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  padding: 0 1.2rem calc(2rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
#fp-picker-bar {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  margin: .8rem auto 0;
  flex-shrink: 0;
}
.fp-picker-item {
  background: rgba(255,255,255,.05);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-size: .88rem;
  padding: .65rem .8rem;
  text-align: left;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.fp-picker-item:active { background: rgba(255,255,255,.1); }
.fp-picker-type {
  font-size: .68rem;
  color: var(--light);
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  padding: .1rem .35rem;
  flex-shrink: 0;
  letter-spacing: .03em;
}

/* Flow Overlay */
#fp-flow-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#fp-flow-overlay.open { display: flex; }

#fp-flow-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 380px;
}

.fp-flow-phase {
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .18em;
  font-weight: 700;
  padding: .25rem .9rem;
  border-radius: 20px;
}
.fp-flow-phase.task {
  background: rgba(61,173,217,.12);
  color: var(--bright);
  border: 1px solid rgba(61,173,217,.3);
}
.fp-flow-phase.break {
  background: rgba(76,175,80,.12);
  color: var(--green);
  border: 1px solid rgba(76,175,80,.3);
}

.fp-flow-progress {
  color: var(--light);
  font-size: .8rem;
}

.fp-flow-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--white);
  font-weight: 600;
  text-align: center;
  max-width: 100%;
  overflow-wrap: break-word;
}

#fp-flow-ring {
  position: relative;
  width: 190px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#fp-flow-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.fp-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,.07);
  stroke-width: 4;
}
.fp-ring-arc {
  fill: none;
  stroke: var(--bright);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset .5s linear, stroke .4s;
}
#fp-flow-time {
  font-family: var(--font-display);
  font-size: 2.9rem;
  color: var(--white);
  position: relative;
  z-index: 1;
  letter-spacing: .05em;
}

#fp-flow-btns {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.fp-btn-done {
  background: var(--amber);
  border: none;
  border-radius: 10px;
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  padding: .8rem 1.6rem;
  cursor: pointer;
  flex: 1;
  min-width: 120px;
}
.fp-btn-extend, .fp-btn-skip {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  color: var(--light);
  font-size: .88rem;
  padding: .8rem 1rem;
  cursor: pointer;
}
.fp-stop-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.28);
  font-size: .8rem;
  cursor: pointer;
  padding: .5rem;
  margin-top: .25rem;
}

#fp-flow-tasks {
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.fp-flow-task-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: rgba(172,222,242,.4);
  padding: .3rem .45rem;
  border-radius: 6px;
  border: 1px solid transparent;
}
.fp-flow-task-item.current {
  color: var(--white);
  background: rgba(61,173,217,.1);
  border-color: rgba(61,173,217,.2);
}
.fp-flow-task-item.done {
  color: rgba(172,222,242,.2);
  text-decoration: line-through;
}
.fp-ft-icon {
  font-size: .75rem;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.fp-ft-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* FP: Reward-Zeile im Plan-Sheet */
.fp-plan-reward-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem 0;
}
.fp-reward-row-label {
  font-size: .75rem;
  color: var(--light);
  flex-shrink: 0;
  min-width: 3rem;
}
#fp-plan-reward-display {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: .4rem .65rem;
  cursor: pointer;
  min-height: 36px;
  transition: border-color .15s;
}
#fp-plan-reward-display:hover { border-color: rgba(61,173,217,.4); }
#fp-plan-reward-display.fp-pr-selected { border-color: rgba(239,159,39,.35); }
.fp-pr-placeholder { font-size: .8rem; color: rgba(172,222,242,.45); }
.fp-pr-icon { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.fp-pr-name { flex: 1; font-size: .82rem; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-pr-cost { font-size: .75rem; color: var(--amber); flex-shrink: 0; }
.fp-pr-clear { background: none; border: none; color: rgba(255,255,255,.35); font-size: .8rem; cursor: pointer; padding: 0 .1rem; flex-shrink: 0; }
.fp-pr-clear:hover { color: var(--red); }

/* FP: Reward-Pick-Overlay */
#fp-reward-pick-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: none;
  align-items: flex-end;
}
#fp-reward-pick-overlay.open { display: flex; }
#fp-reward-pick-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
#fp-reward-pick-sheet {
  position: relative;
  width: 100%;
  max-height: 70dvh;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  padding: .5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
#fp-reward-pick-bar {
  width: 36px; height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  margin: .25rem auto .1rem;
  flex-shrink: 0;
}
.fp-reward-card.fp-reward-active {
  border-color: var(--amber);
  background: rgba(239,159,39,.1);
}

/* FP: Finish-Screen Labels */
.fp-finish-pinned-label,
.fp-finish-rest-label {
  font-size: .72rem;
  color: var(--light);
  letter-spacing: .08em;
  text-transform: uppercase;
  align-self: flex-start;
  margin-top: .25rem;
}
.fp-reward-card.fp-reward-pinned {
  border-color: rgba(239,159,39,.5);
  background: rgba(239,159,39,.08);
}

/* FP: Session-Finish / Reward-Picker */
#fp-finish-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  padding: 2rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 420px;
  max-height: 100dvh;
  overflow-y: auto;
}
.fp-finish-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: .06em;
}
.fp-finish-summary {
  color: var(--light);
  font-size: .85rem;
}
.fp-finish-reward-heading {
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .12em;
  color: var(--light);
  text-transform: uppercase;
  align-self: flex-start;
  margin-top: .25rem;
}
#fp-finish-rewards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.fp-reward-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: .7rem .9rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: var(--white);
  transition: background .15s, border-color .15s;
}
.fp-reward-card:hover { background: rgba(61,173,217,.12); border-color: rgba(61,173,217,.3); }
.fp-reward-card.fp-reward-locked { opacity: .45; }
.fp-reward-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}
.fp-reward-name {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-reward-cost {
  font-size: .82rem;
  color: var(--amber);
  flex-shrink: 0;
  font-weight: 600;
}

/* FP: Neuer-Plan-Button + Speichern-Hint im Header */
.fp-new-plan-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: var(--light);
  font-size: .73rem;
  padding: .25rem .55rem;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
}
.fp-new-plan-btn:hover { border-color: var(--bright); color: var(--bright); }
.fp-save-hint {
  font-size: .72rem;
  color: var(--active);
  min-width: 4.5rem;
  text-align: right;
}

/* FP: Abgeschlossene Items im Plan */
.fp-plan-item--done {
  opacity: .45;
}
.fp-plan-label--done {
  text-decoration: line-through;
  color: var(--light);
}

/* ── Tagesspiel: Coach-Panel im Plan-Sheet ────────────────────────────── */
.fp-coach-area {
  padding: 0 .75rem .25rem;
}
.fp-coach-btn {
  width: 100%;
  padding: .55rem 0;
  background: transparent;
  border: 1px solid rgba(61,173,217,.35);
  border-radius: var(--r);
  color: var(--bright);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.fp-coach-btn:hover { background: rgba(61,173,217,.08); border-color: var(--bright); }
.fp-coach-panel {
  margin-top: .6rem;
  background: rgba(17,62,89,.7);
  border: 1px solid rgba(61,173,217,.2);
  border-radius: 10px;
  padding: .75rem .85rem;
  font-size: .82rem;
  color: var(--light);
  line-height: 1.55;
}
.fp-coach-thinking { color: var(--muted); font-style: italic; }
.fp-coach-err      { color: var(--error); }
.fp-coach-text     { white-space: pre-wrap; }
.fp-coach-chips    { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.fp-suggestion-chip {
  background: rgba(61,173,217,.12);
  border: 1px solid rgba(61,173,217,.35);
  border-radius: 20px;
  color: var(--bright);
  font-size: .78rem;
  padding: .3rem .75rem;
  cursor: pointer;
  transition: background .15s;
}
.fp-suggestion-chip:hover   { background: rgba(61,173,217,.25); }
.fp-suggestion-chip.fp-chip-added { opacity: .4; cursor: default; }

/* ── Tagesspiel: Rätsel-Overlay ───────────────────────────────────────── */
#fp-riddle-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(8,27,38,.92);
  align-items: flex-end;
  justify-content: center;
}
#fp-riddle-overlay.open { display: flex; }

#fp-riddle-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 80dvh;
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fp-riddle-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.1rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.fp-riddle-badge {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bright);
  background: rgba(61,173,217,.12);
  border: 1px solid rgba(61,173,217,.3);
  border-radius: 20px;
  padding: .2rem .6rem;
  flex-shrink: 0;
}
.fp-riddle-task-done {
  font-size: .78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-riddle-msgs {
  flex: 1;
  overflow-y: auto;
  padding: .8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.fp-riddle-msg {
  max-width: 88%;
  font-size: .88rem;
  line-height: 1.55;
  padding: .6rem .85rem;
  border-radius: 14px;
}
.fp-riddle-msg--coach {
  background: rgba(61,173,217,.1);
  border: 1px solid rgba(61,173,217,.18);
  color: var(--light);
  align-self: flex-start;
}
.fp-riddle-msg--user {
  background: rgba(239,159,39,.1);
  border: 1px solid rgba(239,159,39,.2);
  color: var(--amber);
  align-self: flex-end;
  text-align: right;
}
.fp-riddle-typing {
  display: flex; gap: 5px; align-items: center;
  padding: .5rem .85rem;
  align-self: flex-start;
}
.fp-riddle-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bright);
  animation: riddleDot 1.2s ease-in-out infinite;
}
.fp-riddle-typing span:nth-child(2) { animation-delay: .2s; }
.fp-riddle-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes riddleDot {
  0%,80%,100% { opacity: .25; transform: scale(.8); }
  40%          { opacity: 1;   transform: scale(1.1); }
}
.fp-riddle-bottom {
  flex-shrink: 0;
  padding: .6rem .85rem .85rem;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.fp-riddle-input-row {
  display: flex;
  gap: .5rem;
}
.fp-riddle-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 22px;
  color: var(--white);
  font-family: var(--font-ui);
  font-size: .85rem;
  padding: .5rem 1rem;
  outline: none;
}
.fp-riddle-input:focus { border-color: var(--bright); }
.fp-riddle-send-btn {
  background: rgba(61,173,217,.18);
  border: 1px solid rgba(61,173,217,.4);
  border-radius: 50%;
  color: var(--bright);
  width: 38px; height: 38px;
  flex-shrink: 0;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s;
}
.fp-riddle-send-btn:hover { background: rgba(61,173,217,.35); }
.fp-riddle-continue-btn {
  width: 100%;
  padding: .65rem 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: .85rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.fp-riddle-continue-btn:hover { color: var(--light); border-color: rgba(255,255,255,.35); }

/* Dashboard Session-Plan-Karte */
.dsp-card {
  background: var(--panel);
  border: 1px solid rgba(61,173,217,.25);
  border-radius: 14px;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
}
.dsp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.dsp-title {
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--bright);
  font-weight: 600;
}
.dsp-progress {
  font-size: .82rem;
  color: var(--light);
  background: rgba(255,255,255,.07);
  border-radius: 20px;
  padding: .15rem .6rem;
}
.dsp-progress.done { color: var(--active); background: rgba(76,175,80,.12); }
.dsp-next {
  font-size: .82rem;
  color: var(--warn);
  margin-bottom: .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsp-all-done {
  font-size: .82rem;
  color: var(--active);
  margin-bottom: .5rem;
}
.dsp-items {
  display: flex;
  flex-direction: column;
  gap: .22rem;
  margin-bottom: .7rem;
}
.dsp-item {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  color: var(--white);
}
.dsp-item.done { color: var(--light); }
.dsp-check {
  color: var(--active);
  width: 1rem;
  flex-shrink: 0;
  font-size: .8rem;
}
.dsp-item.done .dsp-check { color: var(--active); }
.dsp-item:not(.done) .dsp-check { color: rgba(255,255,255,.3); }
.dsp-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsp-item.done .dsp-label { text-decoration: line-through; opacity: .65; }
.dsp-dur {
  font-size: .7rem;
  color: var(--muted);
  flex-shrink: 0;
}
.dsp-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.dsp-btn { min-height: 2.1rem; padding: .35rem .9rem; font-size: .8rem; }

/* ── task_creator ──────────────────────────────────────────────────────────── */
.tc-tasks-list { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .75rem; min-height: 1.5rem; }
.tc-task-item  { display: flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.05); border-radius: .4rem; padding: .4rem .6rem; }
.tc-task-title { flex: 1; font-size: .9rem; color: var(--light); }
.tc-task-del   { background: none; border: none; color: var(--red); cursor: pointer; padding: 0 .25rem; font-size: .85rem; opacity: .7; }
.tc-task-del:hover { opacity: 1; }
.tc-input-row  { display: flex; gap: .4rem; margin-bottom: .6rem; }
.tc-new-input  { flex: 1; }
.tc-done-btn   { width: 100%; }
.tc-done-msg   { color: var(--amber); font-size: .85rem; text-align: center; padding: .4rem 0; }
.tc-prompt     { font-size: .82rem; color: var(--light); margin: 0 0 .6rem; }

/* Freestyle-Task ohne Kategorie */
.ft-no-cat        { border-left: 3px solid var(--accent); }
.ft-setcat-btn    { background: rgba(28,108,140,.25); border: 1px solid var(--accent); color: var(--bright); border-radius: .4rem; padding: .25rem .7rem; font-size: .78rem; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.ft-setcat-btn:hover { background: rgba(28,108,140,.45); }
.ft-setcat-form   { display: flex; gap: .5rem; align-items: center; padding: .5rem .75rem .75rem; flex-wrap: wrap; }
.ft-setcat-form .task-select { flex: 1; min-width: 0; }
.ft-setcat-form .task-btn-primary { white-space: nowrap; }

/* ── Tagebuch: Ernährung & Hydration ────────────────────────── */
.dfood-date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.dfood-nav-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--bright);
  font-size: 1.1rem;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  touch-action: manipulation;
}
.dfood-nav-btn:disabled { color: var(--muted); cursor: default; }
.dfood-nav-btn:not(:disabled):hover { background: var(--accent); }
.dfood-date-label {
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--white);
  min-width: 7rem;
  text-align: center;
}
.dfood-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem .9rem;
  margin-bottom: .9rem;
}
.dfood-section-hdr {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .55rem;
}
.dfood-section-title {
  font-family: var(--font-display);
  font-size: .85rem;
  color: var(--light);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.dfood-section-total {
  flex: 1;
  font-size: .72rem;
  color: var(--amber);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dfood-add-btn {
  background: rgba(61,173,217,.15);
  border: 1px solid rgba(61,173,217,.35);
  border-radius: 8px;
  color: var(--bright);
  font-size: 1.1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
  touch-action: manipulation;
}
.dfood-add-btn:hover { background: rgba(61,173,217,.3); }
.dfood-form {
  background: rgba(17,62,89,.5);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: .7rem .8rem;
  margin-bottom: .65rem;
}
.dfood-form-row {
  display: flex;
  gap: .5rem;
  margin-bottom: .5rem;
  align-items: center;
}
.dfood-input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--white);
  padding: .4rem .6rem;
  font-size: .83rem;
  font-family: var(--font-body);
}
.dfood-input:focus { outline: none; border-color: var(--bright); }
.dfood-input-date  { width: 9rem; flex-shrink: 0; }
.dfood-input-time  { width: 6.5rem; flex-shrink: 0; }
.dfood-input-label { flex: 1; min-width: 0; }
.dfood-macros-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
  margin-bottom: .55rem;
}
.dfood-macro-field {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.dfood-macro-lbl {
  font-size: .62rem;
  color: var(--muted);
  text-align: center;
}
.dfood-input-num {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--white);
  font-size: .83rem;
  padding: .38rem .4rem;
  text-align: center;
  font-family: var(--font-body);
}
.dfood-input-num:focus { outline: none; border-color: var(--bright); }
.dfood-hyd-ml-field { flex: 1; }
.dfood-form-actions {
  display: flex;
  gap: .5rem;
}
/* Nutrition entries */
.dfood-nut-list { display: flex; flex-direction: column; gap: .4rem; }
.dfood-entry {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  padding: .5rem .65rem;
}
.dfood-entry-top {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.dfood-entry-time {
  font-size: .72rem;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 2.8rem;
  font-variant-numeric: tabular-nums;
}
.dfood-entry-label {
  flex: 1;
  font-size: .83rem;
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dfood-entry-btns {
  display: flex;
  gap: .2rem;
  flex-shrink: 0;
}
.dfood-edit-btn {
  background: none;
  border: none;
  color: var(--bright);
  font-size: .85rem;
  cursor: pointer;
  padding: .1rem .25rem;
  opacity: .65;
  transition: opacity .15s;
}
.dfood-edit-btn:hover { opacity: 1; }
.dfood-del-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
  padding: .1rem .25rem;
  transition: color .15s;
}
.dfood-del-btn:hover { color: var(--error); }
.dfood-entry-macros {
  font-size: .7rem;
  color: var(--muted);
  margin-top: .2rem;
}
.dfood-entry-edit {
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
/* Hydration entries */
.dfood-hyd-list { display: flex; flex-direction: column; gap: .3rem; }
.dfood-hyd-entry {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  padding: .3rem .2rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.dfood-hyd-entry:last-child { border-bottom: none; }
.dfood-hyd-ml {
  font-weight: 600;
  color: var(--bright);
  min-width: 3.5rem;
}
.dfood-hyd-src {
  flex: 1;
  color: var(--muted);
  font-size: .72rem;
}
.dfood-empty {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  padding: .5rem 0;
  margin: 0;
}
