:root {
  --bg: #0f0f0f;
  --panel: #171717;
  --panel-2: #202020;
  --line: #303030;
  --text: #f4f4ef;
  --muted: #a8a8a0;
  --accent: #c8f55a;
  --accent-2: #66d9c8;
  --danger: #ff7171;
  --warning: #ffd166;
  --ok: #7ee38a;
  --shadow: 0 22px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; }

.shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

h1, h2, h3 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  margin: 0;
}

h1 { font-size: clamp(36px, 6vw, 74px); line-height: .9; }
h2 { font-size: clamp(24px, 3vw, 38px); line-height: 1; }
h3 { font-size: 20px; }
p { color: var(--muted); line-height: 1.5; margin: 8px 0 0; }

.brand-title, .hero-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-icons, .hero-brand span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(200, 245, 90, .1);
  border: 1px solid rgba(200, 245, 90, .24);
}

.hero-brand span:last-child {
  font-size: clamp(20px, 3vw, 30px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 800;
}

.top-actions, .segmented, .quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-btn, .primary, .secondary, .danger, .icon, .segmented button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-weight: 800;
}

.nav-btn { color: var(--muted); }
.nav-btn.active, .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #101010;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.secondary { background: transparent; }
.danger { color: #ffd2d2; border-color: rgba(255, 113, 113, .45); background: rgba(255, 113, 113, .08); }
.attention {
  border-color: rgba(255, 209, 102, .55);
  background: rgba(255, 209, 102, .12);
  color: #ffe5a3;
}
.full { width: 100%; justify-content: center; }
.icon { width: 42px; padding: 0; font-size: 24px; display: grid; place-items: center; }

.screen { display: none; margin-top: 22px; }
.screen.active { display: block; }
.hidden { display: none !important; }

.online-panel {
  position: fixed;
  right: 14px;
  bottom: 56px;
  z-index: 30;
  width: min(246px, calc(100vw - 28px));
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(102, 217, 200, .22);
  background: rgba(18, 18, 18, .9);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .32);
  backdrop-filter: blur(12px);
}

.online-panel.compact {
  width: 154px;
  max-height: 78px;
  overflow: hidden;
}

.online-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.online-toggle {
  width: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-weight: 900;
}

.online-panel.compact #onlineList {
  display: none;
}

.online-panel.compact .online-head {
  margin-bottom: 0;
}

.online-head strong {
  font-size: 13px;
}

.online-head div {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.online-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.online-head small {
  color: var(--muted);
  font-size: 10px;
}

.online-row {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.online-row > span {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(126, 227, 138, .12);
}

.online-row p {
  margin-top: 1px;
  font-size: 11px;
}

.member-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 16px;
  align-items: stretch;
}

.member-intro {
  display: grid;
  align-content: center;
}

.member-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.member-highlights span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(200, 245, 90, .24);
  background: rgba(200, 245, 90, .08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.intro, .panel, .question-card, .metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro { padding: clamp(22px, 5vw, 48px); }
.panel, .question-card { padding: 18px; }

.qr-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 12px;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.member-login-card {
  display: grid;
  align-content: center;
}

.member-login-card h3 {
  font-size: 26px;
}

.member-login-card input {
  min-height: 52px;
  font-size: 16px;
}

.member-login-card .primary {
  min-height: 50px;
}

.qr-box img {
  width: 96px;
  height: 96px;
  background: #fff;
  border-radius: 6px;
}

.qr-box span {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin-top: 4px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #111;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

.search-input {
  margin-top: 14px;
  margin-bottom: 2px;
}

textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 245, 90, .14); }

.status { min-height: 22px; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

.member-dashboard, .coach-layout, .admin-layout {
  display: grid;
  gap: 16px;
}

.member-dashboard { margin-top: 16px; }
#workoutContent { display: grid; gap: 16px; }
.dashboard-head, .section-head, .modal-head, .modal-actions, .exercise-card, .member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.attendance-card {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(320px, 1.25fr);
  align-items: center;
  gap: 14px;
}

.attendance-card .segmented {
  justify-content: flex-end;
}

.metric-row, .admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); margin-bottom: 16px; }

.metric {
  padding: 18px;
}

.metric strong {
  display: block;
  font-family: "Syne", system-ui, sans-serif;
  font-size: 34px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 7px;
}

.metric span { color: var(--muted); }

.coach-layout {
  grid-template-columns: minmax(330px, .9fr) minmax(0, 1.1fr);
}

.admin-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.coach-switcher {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border-color: rgba(200, 245, 90, .28);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.admin-tabs button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 13px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 900;
}

.admin-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #101010;
}

.tab-badge {
  min-width: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
}

.admin-section {
  display: none !important;
}

.admin-section.active {
  display: grid !important;
}

section.admin-section.active {
  display: block !important;
}

.coach-switcher label {
  min-width: min(320px, 100%);
}

.request-panel {
  margin-top: 16px;
}

.member-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.program-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.trainer-admin-panel, .exercise-admin-panel, .template-admin-panel {
  margin-bottom: 16px;
}

.trainer-form, .custom-exercise-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.access-form {
  grid-template-columns: minmax(180px, .7fr) minmax(180px, .7fr) minmax(280px, 1.6fr) auto;
}

.permission-box {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}

.permission-box legend {
  padding: 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.permission-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.permission-box input {
  width: auto;
}

.program-template-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.program-template-form textarea {
  min-height: 92px;
}

.program-template-form #programTemplateExercises {
  min-height: 130px;
}

.soft-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(102, 217, 200, .18);
  background: rgba(102, 217, 200, .07);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.soft-note.warn {
  border-color: rgba(255, 209, 102, .34);
  background: rgba(255, 209, 102, .08);
  color: #ffe5a3;
}

.template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.combo-fields {
  display: grid;
  gap: 10px;
}

.program-notes-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.template-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
}

.program-notes {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.note-card {
  background: #111;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
}

.note-card span {
  color: var(--muted);
  font-size: 12px;
}

.trainer-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.wide { grid-column: 1 / -1; }

.member-list, .exercise-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.message-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.history-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.member-card, .exercise-card, .message-card, .history-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.history-card {
  display: grid;
  gap: 10px;
}

.exercise-list.mini {
  margin-top: 0;
}

.history-exercise {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #111;
  border: 1px solid var(--line);
}

.history-exercise span {
  color: var(--muted);
}

.nested-panel {
  box-shadow: none;
  margin-top: 12px;
}

.message-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.message-card p {
  margin-top: 6px;
}

.text-link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  text-align: left;
}

.text-link:hover {
  color: var(--accent);
}

.audit-detail {
  min-width: min(560px, 100%);
}

.message-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.reply-text {
  color: var(--text);
  background: rgba(102, 217, 200, .1);
  border: 1px solid rgba(102, 217, 200, .26);
  border-radius: 8px;
  padding: 9px 10px;
}

.inbox-notice {
  min-height: 22px;
}

.inbox-notice.active {
  color: var(--accent);
  font-weight: 800;
}

.guest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.guest-landing {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 0;
}

.guest-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.guest-actions span {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.guest-showcase {
  display: grid;
  gap: 10px;
}

.showcase-card {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(200, 245, 90, .22);
  background: #111;
}

.showcase-card.accent {
  border-color: rgba(102, 217, 200, .32);
  background: rgba(102, 217, 200, .08);
}

.showcase-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.showcase-card strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.showcase-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.guest-steps {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.guest-steps div {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #111;
  border: 1px solid var(--line);
}

.guest-steps strong {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #101010;
}

.guest-steps span,
.guest-mini-metrics span {
  color: var(--muted);
  font-weight: 800;
}

.guest-mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.guest-mini-metrics span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #111;
  border: 1px solid var(--line);
  font-size: 12px;
}

.limited-admin-note {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 209, 102, .28);
  background: rgba(255, 209, 102, .08);
  color: #ffe5a3;
  font-weight: 800;
}

.inline-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.member-card strong, .exercise-card strong { display: block; text-transform: capitalize; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #111;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gif-thumb, .gif-shell, .silhouette, .animated-thumb {
  width: 94px;
  height: 70px;
  flex: 0 0 auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b0b0b;
}

.gif-thumb {
  object-fit: cover;
  cursor: zoom-in;
}

.gif-shell {
  position: relative;
  overflow: hidden;
  background: #101010;
  cursor: zoom-in;
}

.gif-shell .animated-thumb,
.gif-shell .gif-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gif-shell .gif-thumb {
  opacity: 0;
  transition: opacity .18s ease;
}

.gif-shell.loaded .gif-thumb {
  opacity: 1;
}

.silhouette {
  background:
    radial-gradient(circle at 50% 25%, #555 0 10px, transparent 11px),
    radial-gradient(ellipse at 50% 76%, #4b4b4b 0 29px, transparent 30px),
    #111;
}

.animated-thumb {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: end center;
  padding: 7px;
  background:
    radial-gradient(circle at 50% 38%, rgba(200, 245, 90, .24), transparent 35%),
    linear-gradient(135deg, rgba(102, 217, 200, .26), rgba(200, 245, 90, .18)),
    #101010;
  outline: 1px solid rgba(102, 217, 200, .28);
}

.animated-thumb::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
  animation: headBob 1.15s ease-in-out infinite;
}

.animated-thumb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 31px;
  width: 48px;
  height: 28px;
  border: 5px solid var(--accent-2);
  border-top: 0;
  border-radius: 0 0 30px 30px;
  transform: translateX(-50%) rotate(0deg);
  animation: repMotion 1.15s ease-in-out infinite;
}

.animated-thumb span {
  position: absolute;
  left: 13%;
  right: 13%;
  top: 28px;
  height: 5px;
  border-radius: 999px;
  background: rgba(244, 244, 239, .82);
  animation: barMotion 1.15s ease-in-out infinite;
}

.animated-thumb i,
.animated-thumb b {
  position: absolute;
  top: 50px;
  width: 30px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
  animation: legMotion 1.15s ease-in-out infinite;
}

.animated-thumb i {
  left: 27%;
  transform-origin: right center;
}

.animated-thumb b {
  right: 27%;
  transform-origin: left center;
  animation-direction: reverse;
}

.animated-thumb strong {
  position: relative;
  z-index: 2;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .42);
  color: var(--text);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.animated-thumb em {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 2;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .58);
  color: var(--accent);
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
}

@keyframes repMotion {
  0%, 100% { transform: translateX(-50%) translateY(0) scaleX(1); }
  50% { transform: translateX(-50%) translateY(-9px) scaleX(.82); }
}

@keyframes headBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-7px); }
}

@keyframes barMotion {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-5deg); }
}

@keyframes legMotion {
  0%, 100% { transform: rotate(16deg); }
  50% { transform: rotate(-22deg); }
}

.exercise-main { min-width: 0; flex: 1; }

dialog {
  width: min(920px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(0, 0, 0, .74); }
.modal { padding: 18px; }
.modal.large { width: min(1120px, calc(100vw - 24px)); }
.modal.small { width: min(460px, calc(100vw - 24px)); }
.modal-tools { margin-top: 18px; }
.modal-actions { justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.profile-cell {
  background: #111;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.profile-cell span { color: var(--muted); font-size: 12px; display: block; }
.profile-cell strong { display: block; margin-top: 4px; }

.library-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.library-title {
  font-size: clamp(22px, 4vw, 30px);
}

.body-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.body-filter {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  background: #111;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.body-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #101010;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 9px;
  max-height: min(62vh, 680px);
  overflow: auto;
  padding-right: 4px;
}

.library-card {
  display: grid;
  gap: 7px;
  text-align: left;
  min-height: 164px;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.library-card:hover { border-color: var(--accent); }
.library-card .gif-thumb, .library-card .gif-shell, .library-card .silhouette, .library-card .animated-thumb { width: 100%; height: 82px; }
.library-card strong { font-size: 14px; line-height: 1.2; }
.library-card .pill { min-height: 24px; font-size: 11px; padding: 0 7px; }

.library-more {
  margin-top: 12px;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

canvas {
  width: 100%;
  height: auto;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-panel { overflow: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px; vertical-align: top; }
th { color: var(--muted); background: #121212; font-size: 13px; }

.state {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.state.good { color: var(--ok); }
.state.normal { color: var(--accent); }
.state.warn { color: var(--warning); }
.state.bad { color: var(--danger); }

.gif-preview {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  background: #070707;
  border: 1px solid var(--line);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 12px;
  max-width: 520px;
}

.calendar-weekday {
  min-height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-day {
  min-height: 34px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  position: relative;
  font-weight: 800;
  font-size: 12px;
}

.calendar-day.empty {
  opacity: 0;
}

.calendar-day.done {
  border-color: rgba(102, 217, 200, .8);
  background: rgba(102, 217, 200, .12);
  color: #dffdfa;
}

.calendar-day.done strong {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-2);
  color: #071513;
  font-size: 11px;
}

.signature {
  position: fixed;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: min(520px, calc(100% - 28px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(102, 217, 200, .24);
  background: rgba(15, 15, 15, .72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.signature span {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(102, 217, 200, .12);
}

@media (max-width: 900px) {
  .topbar, .dashboard-head, .section-head, .modal-head, .coach-switcher, .admin-session, .member-actions, .message-card { align-items: flex-start; flex-direction: column; }
  .member-hero, .attendance-card, .guest-landing, .guest-grid, .coach-layout, .admin-layout, .metric-row, .admin-grid, .form-grid, .library-filters, .profile-grid {
    grid-template-columns: 1fr;
  }
  .program-settings, .template-bar, .program-notes-editor, .trainer-form, .custom-exercise-form, .access-form, .inline-editor { grid-template-columns: 1fr; }
  .action-row { justify-content: flex-start; }
  .top-actions { width: 100%; }
  .nav-btn { flex: 1; }
  .compact-action { align-items: stretch; flex-direction: column; }
  .attendance-card .segmented { justify-content: flex-start; }
  .exercise-card { align-items: flex-start; }
  th, td { font-size: 13px; padding: 10px 8px; }
  .online-panel { right: 10px; bottom: 60px; width: min(230px, calc(100vw - 20px)); }
  .signature { position: static; transform: none; margin: 0 auto 14px; text-align: center; }
}
