/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand:       #141414;
  --accent:      #339285;
  --accent-hover:#2b7c71;
  --text:        #141414;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --bg:          #f9fafb;
  --white:       #ffffff;
  --radius:      8px;
  --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
}

body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo {
  height: 1.75rem;
  width: auto;
  flex-shrink: 0;
}

.auth-logo {
  display: block;
  height: 160px;
  width: auto;
  margin: 0 auto 1rem;
}

.brand-sub {
  color: var(--text-muted);
  font-size: 1.125rem;
  text-align: center;
  margin-top: 0;
  margin-bottom: 1.75rem;
}

.auth-back {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8125rem;
}

.auth-back a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-back a:hover {
  color: var(--text-muted);
}

/* ============================================================
   FORMS
   ============================================================ */
.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}

.field.needs-name {
  border-left: 3px solid #dc2626;
  padding-left: 0.75rem;
  margin-left: -0.75rem;
}

.field.needs-name input {
  border-color: #dc2626;
  background: #fff5f5;
}

.field.needs-name input:focus {
  border-color: #dc2626;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover  { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   UTILITIES
   ============================================================ */
.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.hidden { display: none !important; }

.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-top: 0.375rem;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--brand);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav .brand {
  color: var(--white);
  font-size: 1.1rem;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.nav-signout {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  font-size: 0;
  overflow: hidden;
}

.nav-user {
  position: relative;
}

.nav-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.75rem);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  min-width: 150px;
  overflow: hidden;
  z-index: 20;
}

.nav-user-menu a,
.nav-user-menu button {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
}

.nav-user-menu a:hover,
.nav-user-menu button:hover {
  background: var(--accent);
  color: var(--white);
}

.nav-user-signout {
  color: #dc2626 !important;
  border-top: 1px solid var(--border) !important;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  border: 1.5px solid rgba(255,255,255,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.nav-avatar:hover {
  background: var(--accent-hover);
  border-color: rgba(255,255,255,0.6);
}

.nav-menu-separator {
  border-top: 1px solid var(--border) !important;
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* ============================================================
   PILL CHECKBOXES (muscle groups)
   ============================================================ */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.375rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.pill input[type="checkbox"] {
  display: none;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pill:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ============================================================
   FILE DROP ZONE
   ============================================================ */
.file-drop {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, padding 0.2s;
}

.file-drop.compact {
  aspect-ratio: unset;
  padding: 1rem 2rem;
}

.single-preview {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto 1rem;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  line-height: 0;
}

#single-thumb {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 480px;
  border-radius: var(--radius);
}

.thumb-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  color: white;
  font-size: 2rem;
  opacity: 0;
  transition: background 0.15s, opacity 0.15s;
}

.single-preview:hover .thumb-play-overlay,
.bulk-thumb:hover .thumb-play-overlay {
  background: rgba(0, 0, 0, 0.45);
  opacity: 1;
}

.bulk-thumb {
  position: relative;
  cursor: pointer;
}

.bulk-thumb .thumb-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  color: white;
  font-size: 1.25rem;
  opacity: 0;
  transition: background 0.15s, opacity 0.15s;
  pointer-events: none;
  border-radius: 4px;
}

/* ── Video modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-box {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  max-width: 90vw;
  max-height: 90vh;
}

#modal-video {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
}

.modal-close {
  position: absolute;
  top: -2.25rem;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.modal-close:hover {
  opacity: 1;
}

.file-drop:hover {
  border-color: var(--accent);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-drop p {
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-wrap {
  margin-bottom: 1.25rem;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0%;
  transition: width 0.2s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================================
   FORM EXTRAS
   ============================================================ */
.required {
  color: var(--accent);
}

/* ============================================================
   CATALOG
   ============================================================ */
.catalog-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--accent);
}

.btn-sort {
  white-space: nowrap;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-sort:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-pill {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.movement-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.movement-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.movement-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.movement-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.movement-groups {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.movement-alias {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

.movement-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
  line-height: 1;
}

.status-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
  font-size: 0.9375rem;
}

.status-msg.error {
  color: var(--accent);
}

/* ============================================================
   MOVEMENT DETAIL
   ============================================================ */
.back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color 0.15s;
}

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

.video-player {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 50vh;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius);
  background: #000;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.btn-edit {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-edit:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-section {
  margin-bottom: 1.25rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-tag {
  padding: 0.25rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.meta-none {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.detail-comments {
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.edit-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-cancel {
  flex: 1;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-cancel:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid #dc2626;
  border-radius: var(--radius);
  background: none;
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  flex: 2;
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem;
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
}

.admin-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  text-align: center;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.active {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-search {
  margin-bottom: 1rem;
}

.admin-search .search-input {
  width: 100%;
}

.admin-videos-toolbar {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.admin-videos-toolbar .search-input {
  flex: 1;
  min-width: 0;
}

.admin-videos-toolbar .btn-sm {
  flex-shrink: 0;
  white-space: nowrap;
}

.admin-videos-toolbar .btn-sm.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.admin-archive-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: #fff9f0;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.admin-archive-bar .btn-delete {
  margin-left: auto;
}

.admin-row-check {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: var(--accent);
}

.admin-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: 4px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 0.75rem;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s;
}

.admin-thumb:hover {
  border-color: var(--accent);
}

.admin-thumb img,
.admin-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-thumb .admin-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.admin-thumb:hover .admin-thumb-play {
  opacity: 1;
}

.admin-item-body {
  flex: 1;
  min-width: 0;
}

.admin-dup-header {
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}


.admin-section {
  margin-bottom: 2.5rem;
}

.admin-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.admin-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-invite-form {
  grid-template-columns: 2fr 2fr 1fr auto;
}

.admin-add-form input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.admin-add-form input:focus {
  border-color: var(--accent);
}

.admin-add-btn {
  width: 100%;
}

.admin-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.admin-list-item:last-child {
  border-bottom: none;
}

.admin-item-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.admin-item-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

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

.btn-delete {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-delete:hover {
  border-color: #dc2626;
  color: #dc2626;
}

.btn-sm {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-invite-form {
  flex-wrap: wrap;
  gap: 8px;
}

.admin-invite-form input,
.admin-invite-form select {
  flex: 1;
  min-width: 160px;
}

.admin-invite-form select {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}

.admin-invite-form select:focus {
  border-color: var(--accent);
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-weight: 600;
}

.tag-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.role-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-top: 0.125rem;
  align-self: flex-start;
  text-align: center;
}

.role-badge.admin {
  background: #ccf2ed;
  border-color: #99e6dc;
  color: #1a6b62;
}

.edit-inline {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  margin-bottom: 0.25rem;
  min-width: 12ch;
  max-width: 100%;
}

.edit-inline:focus {
  border-color: var(--accent);
}

select.edit-inline {
  width: fit-content;
}

/* ============================================================
   BULK UPLOAD
   ============================================================ */
.page-wide {
  max-width: 900px;
}

.bulk-drop {
  margin-bottom: 1.5rem;
}

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bulk-action-buttons {
  flex-shrink: 0;
}

.bulk-upload-btn {
  width: auto;
  min-width: 160px;
}

.bulk-summary {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  flex: 1;
}

.bulk-summary.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.bulk-summary.warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.bulk-queue {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.bulk-queue .bulk-row:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.bulk-queue .bulk-row:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
  border-bottom: none;
}

.bulk-row {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0.875rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.bulk-row:last-child {
  border-bottom: none;
}

.bulk-thumb {
  width: 72px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}

.bulk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bulk-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e5e7eb 25%, #d1d5db 100%);
  animation: bulk-pulse 1.5s ease-in-out infinite;
}

@keyframes bulk-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.bulk-row-body {
  min-width: 0;
}

.bulk-name {
  width: 100%;
  padding: 0.45rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}

.bulk-name:focus {
  border-color: var(--accent);
}

.bulk-name.bulk-name-empty {
  border-color: #dc2626;
}

.bulk-name.bulk-name-empty:focus {
  border-color: #dc2626;
}

.bulk-row.bulk-row-needs-name {
  background: #fff5f5;
  border-left: 3px solid #dc2626;
}

.bulk-status {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.bulk-status-detecting { color: var(--text-muted); }
.bulk-status-ready     { color: var(--text-muted); }
.bulk-status-uploading { color: var(--accent); }
.bulk-status-done      { color: #166534; }
.bulk-status-error     { color: #dc2626; }

.bulk-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bulk-name-row .bulk-name {
  flex: 1;
}

.bulk-tags-toggle {
  flex-shrink: 0;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}

.bulk-tags-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bulk-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.bulk-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.bulk-pill input[type="checkbox"] {
  display: none;
}

.bulk-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bulk-pill:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.bulk-tag-add-wrap {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0.25rem;
}

.bulk-tag-input {
  width: 90px;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.bulk-tag-input:focus {
  border-color: var(--accent);
}

.pill-group .bulk-tag-add-wrap {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.pill-group .bulk-tag-input {
  width: 120px;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.pill-group .bulk-tag-input:focus {
  border-color: var(--accent);
}

.pill-group .bulk-tag-add-btn {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 1rem;
}

.bulk-tag-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}

.bulk-tag-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bulk-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.bulk-remove:hover:not(:disabled) {
  color: #dc2626;
  background: #fef2f2;
}

.bulk-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============================================================
   MOBILE  (max 600px)
   ============================================================ */
@media (max-width: 600px) {
  /* Hide brand text on small screens — keep logo */
  .nav .brand-name {
    display: none;
  }

  .nav {
    justify-content: space-between;
    padding: 0 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links > a,
  .nav-user-btn {
    font-size: 1rem;
    color: var(--white);
  }

  /* Reduce page padding */
  .page {
    padding: 1.25rem 1rem;
  }

  /* Reduce auth card padding */
  .auth-card {
    padding: 1.75rem 1.25rem;
  }

  /* Larger touch targets for pills and filter buttons */
  .pill,
  .filter-pill {
    padding: 0.5rem 0.875rem;
    min-height: 44px;
  }

  /* Stack admin add form */
  .admin-add-form {
    grid-template-columns: 1fr;
  }

  /* User and video list items stack on mobile; tag lists stay as a row */
  #user-list .admin-list-item,
  #movement-list .admin-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  #user-list .admin-user-actions,
  #movement-list .admin-user-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}
