@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-0: #0a0d14;
  --bg-1: #0e1220;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-hover: rgba(255, 255, 255, 0.16);
  --text-hi: #eef1f7;
  --text-mid: #b7c0d1;
  --text-low: #79839a;
  --accent-a: #63e6d4;
  --accent-b: #7c8bff;
  --accent-grad: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  --success: #4ade80;
  --danger: #fb7185;
  --warning: #fbbf6b;
  --field-bg: rgba(255,255,255,0.03);
  --field-text: var(--text-hi);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35);
}

body[data-theme="liquid-glass-dark"] {
  --bg-0: #0a0d14;
  --bg-1: #0e1220;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-hover: rgba(255, 255, 255, 0.16);
  --text-hi: #eef1f7;
  --text-mid: #b7c0d1;
  --text-low: #79839a;
  --accent-a: #63e6d4;
  --accent-b: #7c8bff;
  --accent-grad: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  --success: #4ade80;
  --danger: #fb7185;
  --warning: #fbbf6b;
  --field-bg: rgba(255,255,255,0.03);
  --field-text: var(--text-hi);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35);
}

body[data-theme="liquid-glass-light"] {
  --bg-0: #edf4ff;
  --bg-1: #f7f9ff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(120, 138, 185, 0.18);
  --glass-border-hover: rgba(80, 101, 171, 0.26);
  --text-hi: #172033;
  --text-mid: #394b66;
  --text-low: #6981a6;
  --accent-a: #4ecdc4;
  --accent-b: #6477ff;
  --accent-grad: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  --success: #2bb673;
  --danger: #e05269;
  --warning: #d5911f;
  --field-bg: rgba(255,255,255,0.74);
  --field-text: var(--text-hi);
  --shadow-glass: 0 14px 34px rgba(76, 96, 150, 0.16);
}

body[data-theme="liquid-glass-strong-dark"] {
  --bg-0: #070b12;
  --bg-1: #0f1524;
  --glass: rgba(255,255,255,0.10);
  --glass-strong: rgba(255,255,255,0.15);
  --glass-border: rgba(160, 180, 255, 0.25);
  --glass-border-hover: rgba(180, 197, 255, 0.32);
  --text-hi: #f6f9ff;
  --text-mid: #d8e2fb;
  --text-low: #9daed1;
  --accent-a: #6ee7d9;
  --accent-b: #8aa2ff;
  --accent-grad: linear-gradient(135deg, rgba(110,231,217,0.75), rgba(138,162,255,0.78));
  --success: #69f0a0;
  --danger: #ff7a9d;
  --warning: #ffc770;
  --field-bg: rgba(255,255,255,0.11);
  --field-text: var(--text-hi);
  --shadow-glass: 0 18px 48px rgba(2, 8, 24, 0.54);
}

body[data-theme="liquid-glass-strong-light"] {
  --bg-0: #f1f5ff;
  --bg-1: #f9fbff;
  --glass: rgba(255,255,255,0.52);
  --glass-strong: rgba(255,255,255,0.72);
  --glass-border: rgba(94, 117, 179, 0.22);
  --glass-border-hover: rgba(72, 96, 158, 0.32);
  --text-hi: #1b2233;
  --text-mid: #3f4d6b;
  --text-low: #6d7fa3;
  --accent-a: #5fe0d0;
  --accent-b: #7a8cff;
  --accent-grad: linear-gradient(135deg, rgba(95,224,208,0.78), rgba(122,140,255,0.76));
  --success: #34bd76;
  --danger: #dc5c72;
  --warning: #d38d2b;
  --field-bg: rgba(255,255,255,0.76);
  --field-text: var(--text-hi);
  --shadow-glass: 0 18px 52px rgba(96, 110, 162, 0.18);
}

body[data-text-mode="light"] {
  --text-hi: #eef1f7;
  --text-mid: #b7c0d1;
  --text-low: #79839a;
  --field-text: #eef1f7;
}

body[data-text-mode="dark"] {
  --text-hi: #172033;
  --text-mid: #394b66;
  --text-low: #6981a6;
  --field-text: #172033;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ambient-shift {
  0% {
    transform: translate3d(-2%, 0, 0) scale(1.02);
    opacity: 0.9;
  }
  50% {
    transform: translate3d(2%, 2%, 0) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: translate3d(-1%, -1%, 0) scale(1.04);
    opacity: 0.92;
  }
}

@keyframes float-particle {
  0% {
    transform: translate3d(0, 0, 0) scale(0.8);
    opacity: 0;
  }
  15%, 85% {
    opacity: 0.8;
  }
  100% {
    transform: translate3d(28px, -70px, 0) scale(1.35);
    opacity: 0;
  }
}

@keyframes blob-drift {
  0% {
    transform: translate3d(-20px, 10px, 0) scale(0.95);
  }
  50% {
    transform: translate3d(24px, -16px, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-8px, 18px, 0) scale(1.02);
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-hi);
  background: linear-gradient(var(--page-bg-gradient-angle, 115deg), var(--page-bg-gradient-start, #0a0d14), var(--page-bg-gradient-end, #0e1220));
  min-height: 100vh;
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% -10% -10%;
  background:
    radial-gradient(700px 500px at 8% -5%, color-mix(in srgb, var(--page-bg-gradient-accent-a, #7c8bff) 55%, transparent), transparent 60%),
    radial-gradient(800px 600px at 100% 10%, color-mix(in srgb, var(--page-bg-gradient-accent-b, #63e6d4) 40%, transparent), transparent 55%),
    radial-gradient(900px 700px at 50% 110%, color-mix(in srgb, var(--page-bg-gradient-accent-a, #7c8bff) 28%, transparent), transparent 60%);
  opacity: 1;
  pointer-events: none;
  z-index: 0;
  animation: ambient-shift 18s ease-in-out infinite alternate;
}

body[data-bg-animate="false"]::before,
body[data-bg-animate="false"] .background-particles span {
  animation-play-state: paused;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--page-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.background-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  filter: blur(0.3px);
  opacity: 0.9;
}

.background-particles span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 12px rgba(255,255,255,0.35);
  animation: float-particle 18s linear infinite;
}

.background-blobs {
  position: fixed;
  inset: -12% -8%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.9;
}

.background-blobs span {
  position: absolute;
  left: var(--blob-x);
  top: var(--blob-y);
  width: var(--blob-size);
  height: var(--blob-size);
  border-radius: 50%;
  background: var(--blob-color);
  filter: blur(60px);
  opacity: 0.26;
  animation: blob-drift 22s ease-in-out infinite alternate;
  transform: translate3d(0, 0, 0) scale(1);
}

.app-shell {
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4 {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
p { color: var(--text-mid); line-height: 1.55; }

/* ---------- Layout ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(255, 255, 255, 0.025);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.sidebar-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 0 1px rgba(124, 139, 255, 0.08), 0 8px 18px rgba(124, 139, 255, 0.08);
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 22px 10px;
}

.brand-logo {
  display: block;
  width: 142px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(99, 230, 212, 0.18));
}
.login-brand-logo {
  width: 88px;
  max-width: 100%;
}

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  color: #0a0d14;
  font-size: 16px;
}

.brand-name {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 16px;
}

.nav-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-mid);
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, scale 0.22s ease;
  transform-origin: left center;
  will-change: transform, box-shadow;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-hi);
  transform: translateX(2px) scale(1.02);
  box-shadow: 0 8px 18px rgba(124, 139, 255, 0.08);
}

.nav-link:active {
  transform: translateX(1px) scale(0.99);
}

.nav-link.active {
  background: var(--glass-strong);
  color: var(--text-hi);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 0 1px rgba(124, 139, 255, 0.08), 0 8px 18px rgba(124, 139, 255, 0.08);
}

.nav-icon { width: 18px; text-align: center; opacity: 0.9; }

.sidebar-bmi-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124, 139, 255, 0.18), rgba(99, 230, 212, 0.12));
  color: var(--text-hi);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-bmi-box.muted {
  color: var(--text-low);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  object-fit: cover;
}
.user-avatar-image {
  width: 30px; height: 30px; min-width: 30px;
  object-fit: cover;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta .name { font-size: 13.5px; font-weight: 600; }
.user-meta .role { font-size: 11.5px; color: var(--text-low); }

.main {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  max-width: min(100%, 1460px);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 28px) clamp(12px, 2.4vw, 24px) 60px;
}

.mobile-topbar {
  display: none;
  animation: fadeInUp 0.2s ease;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title { font-size: 24px; }
.page-subtitle { color: var(--text-low); font-size: 14px; margin-top: -4px; }
.dashboard-subtitle {
  line-height: 1.4;
  margin-top: 0;
}

.profile-image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
  margin-bottom: 12px;
}
.profile-image-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #0a0d14;
}

.background-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 170px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  overflow: hidden;
  margin-bottom: 12px;
}
.background-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: rgba(255,255,255,0.04);
}
.background-preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-low);
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(99, 230, 212, 0.15), rgba(124, 139, 255, 0.12));
}

.week-day-duration {
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 140px;
}

.stat-value {
  font-size: clamp(26px, 2vw, 34px);
  font-weight: 800;
  color: var(--text-hi);
  line-height: 1.1;
}

.stat-label {
  color: var(--text-low);
  font-size: 13px;
  margin-top: 4px;
}

.stat-subvalue {
  margin-top: 8px;
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 600;
}

.weight-stat-card {
  background: linear-gradient(135deg, rgba(124, 139, 255, 0.12), rgba(99, 230, 212, 0.1));
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.dashboard-actions form {
  margin: 0;
}
.dashboard-actions .btn {
  margin-top: 0;
}

.note-card {
  padding: 18px;
}

.note-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 12px;
}

.note-tool {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-hi);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.note-tool:hover {
  transform: translateY(-1px);
  border-color: var(--glass-border-hover);
}

.note-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-mid);
  font-size: 12px;
  padding-left: 8px;
  border-left: 1px solid var(--glass-border);
}

.note-select-wrap select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-hi);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
}

.note-save-status {
  font-size: 12px;
  color: var(--text-low);
  margin-bottom: 10px;
  min-height: 16px;
}

.note-save-status.error {
  color: var(--danger);
}

.note-editor {
  min-height: 420px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-hi);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  outline: none;
}

.note-editor:empty::before {
  content: 'Schreib hier deine Notizen…';
  color: var(--text-low);
}

.note-editor ul,
.note-editor ol {
  margin: 10px 0 10px 20px;
  padding-left: 20px;
}

.note-editor li {
  margin: 4px 0;
}

.note-editor b,
.note-editor strong { font-weight: 700; }
.note-editor i,
.note-editor em { font-style: italic; }
.note-editor u { text-decoration: underline; }

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.leaderboard-card {
  padding: 18px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
}

.leaderboard-table th {
  color: var(--text-low);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.leaderboard-table td {
  color: var(--text-mid);
}

.leaderboard-table.compact th,
.leaderboard-table.compact td {
  padding: 8px 6px;
}

.exercise-rankings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.exercise-ranking-item {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  padding: 12px;
}

.exercise-ranking-item h3 {
  font-size: 15px;
  margin: 0 0 8px 0;
}

.full-span {
  grid-column: 1 / -1;
}

.invite-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 10px;
  min-width: 280px;
}

.invite-scroll-box {
  max-height: 280px;
  padding: 8px;
}

.invite-link-row code {
  display: block;
  white-space: normal;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  color: var(--text-hi);
}

.invite-link-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.invite-share-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.invite-inline-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.invite-share-options .btn,
.invite-inline-tools .btn,
.invite-link-actions form,
.invite-link-actions form .btn {
  white-space: nowrap;
}

.inline-form {
  display: inline;
}

@media (max-width: 768px) {
  .invite-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .invite-link-actions {
    justify-content: stretch;
    width: 100%;
  }

  .invite-share-options,
  .invite-inline-tools {
    width: 100%;
  }

  .invite-share-options .btn,
  .invite-inline-tools .btn,
  .invite-link-actions form,
  .invite-link-actions form .btn {
    flex: 1 1 calc(50% - 8px);
    width: 100%;
    justify-content: center;
  }
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.theme-option:hover,
.theme-option.selected {
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 18px rgba(124, 139, 255, 0.08);
}

.theme-option input {
  width: auto;
  margin: 0;
}

.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.theme-swatch-liquid_glass_dark {
  background: linear-gradient(135deg, #0d1320, #5a66d8 50%, #63e6d4 100%);
}

.theme-swatch-liquid_glass_light {
  background: linear-gradient(135deg, #eef5ff, #dfe8ff 45%, #79d0c8 100%);
}

.theme-swatch-liquid_glass_strong_dark {
  background: linear-gradient(135deg, rgba(9,14,24,0.92), rgba(103,116,255,0.9), rgba(110,231,217,0.85));
}

.theme-swatch-liquid_glass_strong_light {
  background: linear-gradient(135deg, rgba(255,255,255,0.86), rgba(173,193,255,0.8), rgba(95,224,208,0.82));
}

.theme-swatch-text-light {
  background: linear-gradient(135deg, #f6f7fb, #dfe5f9, #93d8ff);
  border-color: rgba(148, 163, 184, 0.8);
}

.theme-swatch-text-dark {
  background: linear-gradient(135deg, #111827, #334155, #94a3b8);
  border-color: rgba(15, 23, 42, 0.8);
}

/* ---------- Glass primitives ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-glass);
}

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-glass);
  transition: border-color 0.15s ease, transform 0.18s ease, box-shadow 0.18s ease;
  animation: fadeInUp 0.28s ease both;
}

.card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(10, 13, 20, 0.24);
}

.card-sm { padding: 14px 16px; border-radius: var(--radius-md); }

.grid {
  display: grid;
  gap: 16px;
}

.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-7 {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  width: min(100%, 1540px);
  margin: 0 auto;
  justify-items: stretch;
  align-items: stretch;
}

@media (min-width: 1200px) {
  .grid-7 {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 300px);
    grid-template-columns: unset;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }

  .week-day-card {
    min-height: 310px;
    min-width: 260px;
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .grid-7 {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .flash-stack {
    top: 62px;
    right: 12px;
    width: min(300px, calc(100vw - 24px));
  }

  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

  .grid-7 {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 82vw);
    grid-template-columns: unset;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .app-shell { flex-direction: column; }

  .week-day-card {
    min-height: unset;
    min-width: 0;
    width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    scroll-snap-align: start;
  }

  .week-day-exercise-list,
  .week-day-exercise-item,
  .week-day-label,
  .exercise-name,
  .exercise-meta {
    min-width: 0;
    width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .dashboard-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .dashboard-actions .btn,
  .dashboard-actions form,
  .dashboard-actions form button {
    width: 100%;
  }

  .dashboard-actions .btn,
  .dashboard-actions form button {
    justify-content: center;
  }

  .chat-bubble {
    max-width: 85%;
  }

  /* Mobiler Kopfbereich statt Sidebar-Brand */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 8px 12px;
    min-height: 50px;
    background: rgba(10, 13, 20, 0.72);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: padding 0.2s ease, min-height 0.2s ease, background 0.2s ease, transform 0.2s ease;
  }

  .mobile-topbar .brand-logo {
    width: 90px;
    max-width: 100%;
    height: auto;
    transition: width 0.2s ease, opacity 0.2s ease;
  }

  .mobile-topbar .user-avatar {
    width: 24px;
    height: 24px;
    font-size: 10.5px;
  }

  .mobile-topbar .btn {
    padding: 5px 9px;
    font-size: 11px;
  }

  /* Sidebar wird zur unteren Tab-Leiste */
  .sidebar {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--glass-border);
    overflow-x: auto;
    z-index: 70;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(10, 13, 20, 0.7);
    transition: padding 0.2s ease, background 0.2s ease, transform 0.2s ease;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    overflow-x: auto;
    gap: 6px;
    padding: 0 2px;
  }

  .nav-indicator {
    top: 4px;
    height: calc(100% - 8px);
  }

  .sidebar .brand,
  .sidebar-footer .user-chip,
  .sidebar-footer form {
    display: none;
  }

  .sidebar-footer { margin-top: 0; padding-top: 0; border-top: none; }

  .nav-link {
    flex-direction: column;
    gap: 3px;
    padding: 6px 10px;
    font-size: 10.5px;
    white-space: nowrap;
    min-width: max-content;
  }
  .nav-icon { font-size: 17px; }

    .main { padding: 12px 12px 96px; }

    .mobile-topbar.is-scrolled {
      padding: 6px 10px;
      min-height: 42px;
      background: rgba(10, 13, 20, 0.9);
      transform: translateY(-1px);
    }

    .mobile-topbar.is-scrolled .brand-logo {
      width: 76px;
    }

    .sidebar.is-scrolled {
      padding-top: 6px;
      padding-bottom: calc(6px + env(safe-area-inset-bottom));
      background: rgba(10, 13, 20, 0.82);
    }
}

/* ---------- Level progress / liquid fill ---------- */
.level-card {
  padding: 22px 22px 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border-color: rgba(170, 198, 255, 0.22);
  box-shadow: 0 20px 36px rgba(8, 11, 20, 0.38), inset 0 1px 0 rgba(255,255,255,0.08);
}

.level-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.level-label {
  color: var(--text-low);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.level-value {
  margin: 6px 0 4px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 0.95;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.level-xp-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-hi);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(124, 139, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.level-progress {
  position: relative;
  width: 100%;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(12,17,28,0.88), rgba(23,32,47,0.75));
  overflow: hidden;
  box-shadow: inset 0 10px 14px rgba(0, 0, 0, 0.38), inset 0 -8px 14px rgba(15, 31, 46, 0.28), 0 8px 18px rgba(18, 27, 43, 0.18);
}

.level-progress-bar {
  position: relative;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(145,239,255,0.98) 0%, rgba(92,218,255,0.96) 16%, rgba(38,170,246,0.94) 42%, rgba(17,122,225,0.92) 100%);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), inset 0 12px 18px rgba(255,255,255,0.12), inset -16px 0 24px rgba(7, 38, 68, 0.18), 0 0 22px rgba(87, 195, 255, 0.28);
  transition: width 0.6s ease;
}

.level-progress-bar::before {
  content: "";
  position: absolute;
  inset: -18% -8% 0 -8%;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.6), transparent 18%),
    radial-gradient(circle at 42% 12%, rgba(255,255,255,0.45), transparent 16%),
    radial-gradient(circle at 72% 16%, rgba(255,255,255,0.32), transparent 14%),
    linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.08) 32%, rgba(8,16,27,0.12) 100%);
  animation: level-wave 7.5s ease-in-out infinite;
}

.level-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.04) 28%, rgba(0,0,0,0.1) 100%);
  box-shadow: inset 0 -10px 18px rgba(8, 22, 35, 0.18);
}

.level-progress-bar .bubble {
  position: absolute;
  bottom: -12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(241, 249, 255, 0.72);
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: inset -3px -3px 4px rgba(255,255,255,0.2), 0 0 12px rgba(185, 230, 255, 0.4);
  opacity: 0.8;
  animation: bubble-rise 4.5s ease-in infinite;
  pointer-events: none;
}

.level-progress-bar .bubble-1 { left: 18%; animation-delay: 0s; }
.level-progress-bar .bubble-2 { left: 38%; width: 10px; height: 10px; animation-delay: 1.2s; }
.level-progress-bar .bubble-3 { left: 58%; width: 7px; height: 7px; animation-delay: 2.1s; }
.level-progress-bar .bubble-4 { left: 78%; width: 12px; height: 12px; animation-delay: 0.8s; }

.dashboard-liquid-card {
  position: relative;
  background: linear-gradient(135deg, rgba(11, 16, 26, 0.9), rgba(17, 24, 38, 0.76));
  border-color: rgba(158, 182, 255, 0.28);
  box-shadow: 0 24px 40px rgba(6, 10, 18, 0.5), inset 0 1px 0 rgba(255,255,255,0.08);
}

.dashboard-liquid-progress {
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(14,19,31,0.92), rgba(22,31,46,0.82));
  border: 1px solid rgba(178, 196, 255, 0.15);
  box-shadow: inset 0 10px 16px rgba(0, 0, 0, 0.42), inset 0 -10px 14px rgba(15, 27, 39, 0.28), 0 10px 18px rgba(13, 21, 35, 0.38);
}

.dashboard-liquid-bar {
  background: linear-gradient(180deg, rgba(149,245,255,0.98) 0%, rgba(97,220,255,0.96) 12%, rgba(42,176,247,0.94) 42%, rgba(20,127,233,0.92) 68%, rgba(13,92,201,0.9) 100%);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), inset 0 12px 18px rgba(255,255,255,0.12), inset -18px 0 26px rgba(6, 33, 57, 0.18), 0 0 24px rgba(77, 192, 255, 0.34);
}

.dashboard-liquid-bar::before {
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,0.62), transparent 18%),
    radial-gradient(circle at 42% 12%, rgba(255,255,255,0.5), transparent 16%),
    radial-gradient(circle at 70% 18%, rgba(255,255,255,0.38), transparent 15%),
    linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.08) 26%, rgba(7, 13, 20, 0.12) 100%);
  filter: saturate(1.3);
}

.dashboard-liquid-bar::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.04) 28%, rgba(0,0,0,0.12) 100%);
  box-shadow: inset 0 -10px 22px rgba(7, 16, 25, 0.18);
}

.dashboard-liquid-bar .bubble {
  background: rgba(242, 250, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset -3px -3px 4px rgba(255,255,255,0.24), 0 0 14px rgba(199, 235, 255, 0.4);
}

.level-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--text-mid);
  font-size: 13px;
}

.xp-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 10px;
  color: var(--text-mid);
}

.xp-list li {
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.xp-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.xp-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
}

.xp-history-label {
  font-weight: 600;
  color: var(--text-hi);
}

.xp-history-meta {
  color: var(--text-low);
  font-size: 12px;
  margin-top: 2px;
}

.xp-history-points {
  color: var(--success);
  font-weight: 700;
  white-space: nowrap;
}

@keyframes level-wave {
  0% { transform: translateX(-4%) translateY(0); }
  50% { transform: translateX(4%) translateY(5px); }
  100% { transform: translateX(-4%) translateY(0); }
}

@keyframes bubble-rise {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  18% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-120px) scale(1.35);
    opacity: 0;
  }
}

/* ---------- Stat tiles ---------- */
.stat-tile {
  padding: 18px;
}
.stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { color: var(--text-low); font-size: 13px; margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: var(--text-hi);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 8px 18px rgba(124, 139, 255, 0.12);
  transform: translateY(-1px);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent-grad);
  color: #0a0d14;
  border: none;
}
.btn-primary:hover { filter: brightness(1.07); }

.btn-danger {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.35);
  color: #ffc4cf;
}

.btn-ghost {
  background: transparent;
  border-color: var(--glass-border);
}

.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled {
  opacity: 0.8;
  cursor: wait;
}
.plan-day-form > *,
.plan-day-form .btn,
.plan-exercise-row > *,
.plan-exercise-row form .btn {
  flex-shrink: 0;
}

/* ---------- Forms ---------- */
label { font-size: 13px; color: var(--text-mid); font-weight: 500; display: block; margin-bottom: 6px; }

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--field-bg);
  color: var(--field-text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-b);
  background: rgba(255, 255, 255, 0.08);
}
::placeholder { color: var(--text-low); }

select {
  background-color: var(--field-bg);
  color: var(--field-text);
  color-scheme: light dark;
  cursor: pointer;
}
select option {
  background-color: var(--bg-1);
  color: var(--text-hi);
}
select option:checked,
select option:hover {
  background-color: rgba(124, 139, 255, 0.18);
  color: var(--text-hi);
}

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row > * { flex: 1 1 180px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-mid);
}
.badge-success { color: #b8f5cf; border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.1); }
.badge-danger { color: #fecaca; border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.1); }
.badge-warning { color: #ffdfb0; border-color: rgba(251, 191, 107, 0.35); background: rgba(251, 191, 107, 0.1); }
.badge-info { color: #d3d8ff; border-color: rgba(124, 139, 255, 0.4); background: rgba(124, 139, 255, 0.12); }
.badge-warn { color: #ffdfb0; border-color: rgba(251, 191, 107, 0.35); background: rgba(251, 191, 107, 0.1); }
.badge-accent { color: #d3d8ff; border-color: rgba(124, 139, 255, 0.4); background: rgba(124, 139, 255, 0.12); }
.badge-rest { color: var(--text-low); }

/* ---------- Flash messages ---------- */
.flash-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  width: min(360px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.auth-flash-stack {
  top: 18px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(380px, calc(100vw - 22px));
}
.flash {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(14, 18, 32, 0.92);
  box-shadow: var(--shadow-glass);
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: slideDown 0.18s ease forwards;
}
.flash.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.flash.is-hiding {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}
.flash-success { border-color: rgba(74, 222, 128, 0.4); color: #c3f7d6; }
.flash-error { border-color: rgba(251, 113, 133, 0.4); color: #ffd0d8; }
.flash-info { border-color: rgba(124, 139, 255, 0.4); color: #dbe0ff; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: auto; }

.table-scroll,
.moderation-table-wrap,
.chat-window,
.dashboard-chat-window {
  max-height: 360px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 139, 255, 0.6) rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.table-scroll:hover,
.moderation-table-wrap:hover,
.chat-window:hover,
.dashboard-chat-window:hover {
  border-color: var(--glass-border-hover);
  box-shadow: inset 0 0 0 1px rgba(124, 139, 255, 0.04);
}

.table-scroll table,
.moderation-table-wrap table {
  margin: 0;
}

.table-scroll::-webkit-scrollbar,
.moderation-table-wrap::-webkit-scrollbar,
.chat-window::-webkit-scrollbar,
.dashboard-chat-window::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-scroll::-webkit-scrollbar-thumb,
.moderation-table-wrap::-webkit-scrollbar-thumb,
.chat-window::-webkit-scrollbar-thumb,
.dashboard-chat-window::-webkit-scrollbar-thumb {
  background: rgba(124, 139, 255, 0.45);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.02);
}

.table-scroll::-webkit-scrollbar-track,
.moderation-table-wrap::-webkit-scrollbar-track,
.chat-window::-webkit-scrollbar-track,
.dashboard-chat-window::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
}
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--glass-border); vertical-align: top; word-break: break-word; }
th { color: var(--text-low); font-weight: 600; font-size: 12px; text-transform: none; }
tr:last-child td { border-bottom: none; }
td:last-child { white-space: normal; }

.shared-filter-panel {
  padding: 18px 18px 16px;
  margin-bottom: 16px;
}

.shared-search-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shared-filter-row {
  align-items: end;
}

.shared-sort-wrap {
  min-width: 180px;
}

.shared-sort-control {
  position: relative;
}

.shared-sort-control::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-mid);
  pointer-events: none;
  font-size: 12px;
}

.sort-select {
  appearance: none;
  padding-right: 34px;
}

.shared-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shared-plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.shared-plan-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 240px;
  padding: 18px;
  width: 100%;
}

.shared-plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.shared-plan-head h3 {
  margin: 0 0 4px;
  font-size: 1.12rem;
}

.shared-plan-meta {
  color: var(--text-low);
  font-size: 12px;
  line-height: 1.4;
}

.shared-plan-description {
  margin: 0;
  color: var(--text-mid);
  line-height: 1.5;
}

.shared-plan-preview-header {
  margin-top: -4px;
}

.shared-plan-days {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  padding-bottom: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 139, 255, 0.5) rgba(255,255,255,0.02);
}

.shared-plan-day {
  display: flex;
  flex-direction: column;
  flex: 0 0 150px;
  width: 150px;
  min-width: 150px;
  max-height: 210px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  padding: 10px 10px 8px;
  min-height: 96px;
  scroll-snap-align: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 139, 255, 0.5) rgba(255,255,255,0.02);
}

.shared-plan-day::-webkit-scrollbar {
  width: 8px;
}

.shared-plan-day::-webkit-scrollbar-thumb {
  background: rgba(124, 139, 255, 0.5);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.02);
}

.shared-plan-day::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
}

.shared-plan-day-name {
  font-size: 10px;
  color: var(--text-low);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 700;
}

.shared-plan-exercise-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.35;
}

.shared-plan-thumb {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 6px;
}

.shared-plan-expanded-content {
  margin-top: 8px;
  border-top: 1px solid var(--glass-border);
  padding-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.expanded-view {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  padding-bottom: 6px;
  flex-wrap: nowrap;
  scroll-snap-type: x proximity;
}

.expanded-day {
  flex: 0 0 150px;
  width: 150px;
  min-width: 150px;
  scroll-snap-align: start;
}

@media (max-width: 520px) {
  .shared-plan-card {
    overflow: hidden;
    padding: 14px;
    gap: 12px;
  }

  .shared-plan-head {
    flex-direction: column;
    align-items: stretch;
  }

  .shared-plan-head .inline-form {
    width: 100%;
  }

  .shared-plan-head .inline-form .btn {
    width: 100%;
    justify-content: center;
  }

  .shared-plan-meta {
    font-size: 11px;
    line-height: 1.45;
  }

  .shared-plan-day,
  .expanded-day {
    min-width: 150px;
    max-height: 180px;
  }

  .shared-plan-day-name {
    font-size: 9px;
  }

  .shared-plan-exercise-item {
    font-size: 11px;
  }

  .shared-plan-actions {
    justify-content: stretch;
  }

  .shared-plan-action-group {
    flex-direction: column;
    align-items: stretch;
  }

  .shared-plan-action-group form {
    width: 100%;
  }

  .shared-plan-action-group .btn,
  .shared-plan-action-group form .btn {
    width: 100%;
    justify-content: center;
  }
}

.expanded-day {
  min-height: 110px;
}

.shared-plan-exercises {
  color: var(--text-hi);
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}

.shared-plan-exercises.muted {
  color: var(--text-low);
}

.shared-plan-rest {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(124, 139, 255, 0.12);
  border: 1px solid rgba(124, 139, 255, 0.35);
  padding: 4px 8px;
  color: #dfe4ff;
  font-size: 11px;
  margin-top: 2px;
}

.shared-plan-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.shared-plan-action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}

.shared-like-btn {
  min-width: 90px;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
}

.shared-like-btn.liked {
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.22), rgba(255, 154, 167, 0.18));
  border-color: rgba(251, 113, 133, 0.45);
  color: #ffd7df;
  box-shadow: 0 8px 20px rgba(251, 113, 133, 0.12);
}

.shared-like-btn.not-liked {
  background: rgba(255,255,255,0.02);
  color: var(--text-hi);
}

.plan-share-box {
  padding: 18px 18px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-share-header h3,
.plan-share-header p {
  margin: 0;
}

.plan-share-header p {
  color: var(--text-low);
  margin-top: 4px;
}

.plan-share-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-share-actions {
  display: flex;
  justify-content: flex-start;
}

.plan-share-restore {
  margin-top: 8px;
}

.inline-form {
  display: inline-flex;
}

.field-grow {
  flex: 1 1 280px;
}

@media (max-width: 760px) {
  .shared-plan-card {
    padding: 14px;
  }

  .shared-plan-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .shared-plan-action-group {
    justify-content: space-between;
  }

  .shared-plan-days {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .shared-plan-day {
    min-height: 90px;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: normal;
    table-layout: fixed;
  }

  tbody {
    display: block;
    width: 100%;
  }

  tr {
    display: block;
    width: 100%;
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 0;
  }

  th {
    display: none;
  }

  td {
    display: block;
    width: 100%;
    padding: 6px 0;
    border-bottom: none;
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--text-low);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .goal-action-cell,
  .admin-action-cell {
    width: 100%;
  }

  .goal-action-cell form,
  .admin-action-cell form,
  .admin-action-cell .flex,
  .goal-action-cell .flex {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .goal-action-cell button,
  .admin-action-cell button,
  .admin-action-cell summary {
    width: 100%;
    justify-content: center;
  }

  .admin-action-cell details {
    width: 100%;
  }

  .admin-action-cell details > div {
    min-width: 0 !important;
    width: 100%;
  }

  .admin-action-cell details form,
  .admin-action-cell details .flex {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .admin-action-cell details input,
  .admin-action-cell details select {
    width: 100% !important;
    min-width: 0;
    flex: 1 1 100%;
  }
}

.admin-users-table-wrap {
  max-height: 440px;
}

.admin-user-action-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: min(100%, 420px);
  padding-top: 8px;
  animation: slideDown 0.2s ease;
}

.admin-user-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.admin-user-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.admin-user-inline-form,
.admin-user-action-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.admin-user-inline-form {
  width: 100%;
}

.admin-user-inline-form input,
.admin-user-inline-form select {
  flex: 1 1 120px;
  min-width: 0;
}

.admin-user-inline-form.compact-form input {
  max-width: 90px;
}

.admin-user-toggle-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.admin-user-suspend-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 250px;
}

.admin-user-suspend-form .field-row {
  gap: 8px;
}

.admin-user-suspend-form input[type="number"] {
  width: 80px;
}

/* ---------- Training Session ---------- */
.training-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.training-timer-card,
.training-progress-card,
.training-exercise-card {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
}

.training-timer-card {
  padding: 20px;
}

.training-timer-label {
  color: var(--text-low);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}

.training-timer {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  font-family: 'Sora', sans-serif;
}

.training-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.training-stat-line {
  margin-top: 14px;
  color: var(--text-mid);
}

.training-progress-card {
  padding: 20px;
}

.progress-meter {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  margin: 12px 0 16px;
}

.progress-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-grad);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.training-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.training-stat-label {
  color: var(--text-low);
  font-size: 12px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.training-stat-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.training-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.training-exercise-card {
  padding: 16px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.training-exercise-card.is-active {
  border-color: rgba(99, 230, 212, 0.8);
  box-shadow: 0 0 0 1px rgba(99, 230, 212, 0.25), var(--shadow-glass);
}

.training-exercise-card.is-complete {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.45);
}

.training-exercise-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.training-exercise-image {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  display: block;
  cursor: pointer;
}

.training-exercise-copy {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.training-exercise-topline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.training-exercise-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0;
  text-align: left;
}

.training-exercise-meta {
  color: var(--text-mid);
  font-size: 0.9rem;
  text-align: left;
}

.training-exercise-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.training-exercise-time {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: var(--accent-a);
  min-width: 52px;
  text-align: right;
}

.training-rest-time {
  font-family: 'Sora', sans-serif;
  font-size: 0.8rem;
  color: var(--warning);
  min-width: 90px;
  text-align: right;
}

.training-rest-btn:disabled,
.training-finish-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.training-finish-btn.is-done {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.28);
  color: var(--success);
}

.training-exercise-card.is-ready {
  border-color: rgba(251, 191, 107, 0.6);
  box-shadow: 0 0 0 1px rgba(251, 191, 107, 0.18), var(--shadow-glass);
}

.training-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.info-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(124, 139, 255, 0.08);
  border-color: rgba(124, 139, 255, 0.34);
  color: var(--text-hi);
}

@media (max-width: 900px) {
  .training-overview {
    grid-template-columns: 1fr;
  }

  .training-exercise-card {
    padding: 14px;
  }

  .training-exercise-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .training-exercise-image {
    width: 64px;
    height: 64px;
  }

  .training-exercise-copy,
  .training-exercise-topline,
  .training-exercise-name,
  .training-exercise-meta {
    width: 100%;
    text-align: left;
  }

  .training-exercise-side {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .training-rest-btn,
  .training-finish-btn {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* ---------- Week grid (Dashboard) ---------- */
.week-day-card {
  padding: 10px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  position: relative;
  min-width: 0;
  justify-self: stretch;
  margin: 0;
  overflow: visible;
}
.week-day-card.today { border-color: var(--accent-b); box-shadow: 0 0 0 1px rgba(124,139,255,0.3), var(--shadow-glass); }
.week-day-card.done { border-color: rgba(74, 222, 128, 0.4); }
.week-day-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 14px; }
.week-day-date { color: var(--text-low); font-size: 11.5px; }
.week-day-label { color: var(--text-mid); font-size: 13px; font-weight: 600; margin-top: 2px; }
.week-day-exercise-list {
  list-style: none;
  margin: 0;
  padding: 0 2px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  width: 100%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 170px;
  scrollbar-width: thin;
}
.week-day-exercise-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.025);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex: 1 1 auto;
}
.muscle-group-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  padding: 5px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.muscle-group-thumb:hover,
.muscle-group-thumb:focus-visible {
  transform: translateY(-1px) scale(1.08);
  border-color: rgba(124, 139, 255, 0.7);
  box-shadow: 0 12px 26px rgba(124, 139, 255, 0.18);
  outline: none;
}
.exercise-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 0%;
  max-width: 100%;
}
.exercise-name {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-hi);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}
.exercise-meta {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-low);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}
.week-day-card .btn {
  margin-top: auto;
  max-width: 100%;
}

/* ---------- Notifications ---------- */
.notif-card {
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-color: rgba(251, 191, 107, 0.35);
  background: rgba(251, 191, 107, 0.06);
}

/* ---------- Chat ---------- */
.chat-window {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  padding: 4px 4px 4px 0;
}
.dashboard-chat-window {
  max-height: 320px;
}
.chat-bubble {
  max-width: 70%;
  padding: 9px 13px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  font-size: 13.5px;
  align-self: flex-start;
}
.chat-bubble.system {
  background: rgba(124, 139, 255, 0.08);
  border-color: rgba(124, 139, 255, 0.25);
}
.chat-bubble.me {
  align-self: flex-end;
  background: var(--accent-grad);
  color: #0a0d14;
  border: none;
}
.chat-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.14);
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}
.chat-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #0a0d14;
  font-size: 10.5px;
  font-weight: 700;
}
.chat-meta { font-size: 11px; color: var(--text-low); margin-bottom: 3px; }
.chat-bubble.me .chat-meta { color: rgba(10,13,20,0.6); }
.chat-input-row { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- Plan day editor ---------- */
.plan-day {
  padding: 18px;
  margin-bottom: 16px;
}
.plan-day-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.plan-day-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}
.plan-day-form input[type="text"] {
  max-width: 220px;
  min-width: 0;
}
.plan-exercise-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13.5px;
  flex-wrap: wrap;
}
.plan-exercise-row:last-child { border-bottom: none; }
.plan-exercise-name {
  flex: 1 1 220px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.plan-exercise-detail { color: var(--text-low); font-size: 12.5px; }

@media (max-width: 760px) {
  .plan-day-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-day-form {
    width: 100%;
    align-items: stretch;
  }

  .plan-day-form input[type="text"] {
    width: 100% !important;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .plan-day-form .checkbox-row {
    width: 100%;
    justify-content: flex-start;
  }

  .plan-day-form .btn {
    width: auto;
    margin-left: auto;
  }

  .plan-exercise-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-exercise-row form {
    width: 100%;
    flex-wrap: wrap;
  }

  .plan-exercise-row form input {
    min-width: 0;
    flex: 1 1 70px;
  }
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  width: min(100%, 420px);
  max-width: 420px;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-title { text-align: center; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--text-low); font-size: 13.5px; margin-bottom: 26px; }

.muscle-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  padding: 24px;
}
.muscle-lightbox.hidden {
  display: none;
}
.muscle-lightbox-inner {
  position: relative;
  max-width: min(82vw, 760px);
  max-height: 85vh;
  padding: 18px;
  border-radius: 22px;
  background: rgba(17, 22, 33, 0.9);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}
.muscle-lightbox-image {
  display: block;
  width: min(80vw, 650px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}
.muscle-lightbox-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-hi);
  font-size: 18px;
  cursor: pointer;
}

/* ---------- Utilities ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-low { color: var(--text-low); }
.text-mid { color: var(--text-mid); }
.text-sm { font-size: 12.5px; }
.section-title { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.empty-state { color: var(--text-low); font-size: 13.5px; padding: 20px 0; text-align: center; }
.divider { height: 1px; background: var(--glass-border); margin: 18px 0; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.support-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 18px;
  margin-bottom: 20px;
}

.support-panel,
.support-list-panel,
.support-detail-header,
.support-message-card,
.support-thread-panel,
.support-admin-panel,
.support-reply-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  padding: 22px;
}

.support-list-panel {
  margin-top: 0;
}

.support-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.support-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text-mid);
}

.support-help-list li {
  position: relative;
  padding-left: 18px;
  line-height: 1.55;
}

.support-help-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-a);
}

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-list-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.ticket-row {
  display: block;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 16px 18px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ticket-row:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

.ticket-code {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-low);
  font-weight: 700;
  text-transform: uppercase;
}

.ticket-code-large {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}

.ticket-meta-row,
.ticket-footer,
.support-detail-topline,
.support-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ticket-type,
.ticket-subject {
  display: block;
}

.ticket-subject {
  margin: 10px 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-hi);
}

.ticket-footer {
  color: var(--text-low);
  font-size: 12px;
}

.ticket-processor {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-low);
}

.support-detail-header,
.support-message-card,
.support-thread-panel,
.support-admin-panel,
.support-reply-panel {
  margin-bottom: 18px;
}

.support-detail-meta {
  margin-top: 12px;
  color: var(--text-low);
  font-size: 12.5px;
}

.support-message-card p,
.support-reply p {
  margin: 0;
  color: var(--text-mid);
  line-height: 1.6;
  white-space: pre-line;
}

.support-thread-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-thread-scroll {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-reply {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
}

.support-reply-admin {
  border-left: 3px solid #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.support-reply-user {
  border-left: 3px solid #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.support-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-low);
  font-size: 12px;
  margin-bottom: 8px;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.alert-box {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
  background: rgba(255,255,255,0.04);
  color: var(--text-mid);
}

.alert-warning {
  border-color: rgba(251, 191, 107, 0.5);
  background: rgba(251, 191, 107, 0.08);
}

@media (max-width: 820px) {
  .support-layout {
    grid-template-columns: 1fr;
  }
}

.level-card {
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(99, 230, 212, 0.09), rgba(124, 139, 255, 0.09));
  border: 1px solid rgba(124, 139, 255, 0.22);
}

.level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.level-label {
  color: var(--text-low);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.level-value {
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0;
}

.level-xp-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-a);
}

.level-progress {
  position: relative;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.level-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-grad);
  box-shadow: 0 0 18px rgba(99, 230, 212, 0.4);
}

.level-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--text-mid);
  font-size: 0.88rem;
}

.level-links {
  margin-top: 14px;
}

.xp-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--text-mid);
}

.xp-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.xp-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.xp-history-label {
  font-weight: 600;
  color: var(--text-hi);
}

.xp-history-meta {
  font-size: 0.8rem;
  color: var(--text-low);
}

.xp-history-points {
  font-weight: 700;
  color: var(--accent-a);
}

@media (max-width: 640px) {
  .level-header,
  .level-progress-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
