:root {
  --paper: #f6f5f0;
  color-scheme: light;
  --surface: #fff;
  --ink: #282c27;
  --muted: #777a70;
  --line: #e2e3da;
  --orange: #e8673e;
  --orange-dark: #bf4925;
  --green: #dce7c6;
  --sidebar: #242d28;
  --surface-soft: #eeeee5;
  --surface-tint: #edf0e4;
  --surface-hover: #e0e9cf;
  --subtle: #8a8c83;
  --placeholder: #95978f;
  --line-soft: #eeeeea;
  --line-strong: #abb79d;
  --line-tint: #cdd6bb;
  --focus: #bb743d;
  --on-accent: #fff;
  --selected-background: #282c27;
  --selected-text: #fff;
  --badge-background: #f7f4e8e8;
  --badge-text: #4c513f;
  --neutral-background: #f2f3ed;
  --neutral-text: #747b6d;
  --practicing-background: #fff0df;
  --practicing-text: #a06a29;
  --learned-background: #e8f0df;
  --learned-text: #657b4d;
  --symbol-background: #e2e8d6;
  --symbol-text: #73845e;
  --error-background: #fbe8e1;
  --error-text: #a43825;
  --danger: #b35039;
  --card-shadow: #27322410;
  --dialog-shadow: #0004;
  --backdrop: #16201cd1;
  --radius: 13px;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151b18;
  --surface: #202823;
  --ink: #edf1e9;
  --muted: #b0b9af;
  --line: #3e4b41;
  --orange: #f39a73;
  --orange-dark: #f4a583;
  --green: #c3d5a7;
  --sidebar: #101612;
  --surface-soft: #222c25;
  --surface-tint: #252f28;
  --surface-hover: #324235;
  --subtle: #a1aba2;
  --placeholder: #a1aba2;
  --line-soft: #354138;
  --line-strong: #627366;
  --line-tint: #4d6149;
  --focus: #f3b28a;
  --on-accent: #241a15;
  --selected-background: #c5d6b5;
  --selected-text: #182118;
  --badge-background: #26372fed;
  --badge-text: #dce7cb;
  --neutral-background: #2b352e;
  --neutral-text: #becab8;
  --practicing-background: #423121;
  --practicing-text: #f4c48c;
  --learned-background: #283c2b;
  --learned-text: #c5dca5;
  --symbol-background: #2f402f;
  --symbol-text: #bfd2a4;
  --error-background: #402720;
  --error-text: #ffc1ae;
  --danger: #ffa990;
  --card-shadow: #0005;
  --dialog-shadow: #0008;
  --backdrop: #060a08d9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--focus);
  border-radius: 8px;
  transform: translateY(-180%);
}
.skip-link:focus {
  transform: none;
}
.sidebar-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.navigation-panel {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}
.connection-notice {
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-tint);
  line-height: 1.6;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}
button {
  transition:
    background 0.15s,
    transform 0.15s;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button:hover:not(:disabled) {
  filter: brightness(0.96);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.sidebar {
  width: 254px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--sidebar);
  color: #f3f3e8;
  display: flex;
  flex-direction: column;
  padding: 34px 22px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  font-size: 21px;
  letter-spacing: -0.8px;
  font-weight: 650;
  margin: 0 0 56px 6px;
}
.brand-mark {
  font-size: 29px;
  background: #dce7c6;
  color: #253327;
  width: 47px;
  height: 47px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -3px;
}
.brand-mark > span {
  font-size: 17px;
  align-self: flex-start;
  margin-top: 4px;
  letter-spacing: 0;
}
.brand-caption {
  display: block;
  font-size: 6.6px;
  letter-spacing: 0.9px;
  color: #a4b1a7;
  margin-top: 7px;
}
.nav-label,
.tiny {
  font-size: 9px;
  letter-spacing: 1.6px;
  line-height: 1.8;
  color: #a3afa4;
}
.nav-label {
  padding: 0 15px;
  margin-bottom: 15px;
}
.nav-item {
  width: 100%;
  border: 0;
  background: none;
  color: #b7c0b7;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 14px 15px;
  gap: 13px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 7px;
}
.nav-item > span:first-child {
  font-size: 21px;
  width: 23px;
  line-height: 1;
}
.nav-item.active {
  background: #3a453b;
  color: #ecf3db;
}
.nav-count {
  margin-left: auto;
  font-size: 10px;
  background: #485347;
  padding: 3px 6px;
  border-radius: 5px;
}
.sidebar-note {
  margin: auto 6px 42px;
  background: #303b32;
  border: 1px solid #445040;
  border-radius: 12px;
  padding: 22px 18px;
}
.little-star {
  color: #dae7b5;
  font-size: 35px;
}
.sidebar-note h3 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  margin: 14px 0 9px;
}
.sidebar-note p {
  font-size: 12px;
  line-height: 1.9;
  color: #b0baac;
  margin: 0;
}
.note-line {
  display: block;
  width: 26px;
  border-top: 1px solid #64705c;
  margin: 19px 0 14px;
}
.tiny {
  font-size: 7px;
  letter-spacing: 1.1px;
}
.profile {
  border-top: 1px solid #414a42;
  padding-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #cfb9a1;
  color: #313c30;
  font-size: 12px;
}
.profile small {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  color: #98a797;
}
.online-dot {
  width: 6px;
  height: 6px;
  background: #aac184;
  border-radius: 50%;
  margin-left: auto;
}
main {
  margin-left: 254px;
  padding: 0 46px;
  max-width: 1900px;
}
.topbar {
  min-height: 83px;
  padding: 14px 0;
  gap: 12px;
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.topbar-slash {
  margin: 0 16px;
  color: var(--subtle);
}
#breadcrumb {
  letter-spacing: 0;
  color: var(--ink);
  font-size: 11px;
}
.topbar-right {
  letter-spacing: 0;
  font-size: 11px;
}
.topbar-right > span {
  font-size: 19px;
  color: var(--orange);
  margin-left: 15px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 42px 0 30px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.8px;
  color: var(--orange-dark);
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.15vw, 48px);
  font-weight: 400;
  letter-spacing: -1.7px;
  margin: 12px 0;
}
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 400;
  letter-spacing: -0.65px;
  margin: 10px 0 12px;
}
.page-heading p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
}
.primary,
.secondary {
  padding: 12px 18px;
  border-radius: 7px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.primary {
  background: var(--orange);
  color: var(--on-accent);
}
.primary > span {
  font-size: 20px;
  line-height: 1;
}
.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  margin-bottom: 35px;
  overflow: hidden;
}
.stats > div {
  padding: 22px 26px;
  position: relative;
}
.stats > div + div {
  border-left: 1px solid var(--line);
}
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 12px;
}
.stats strong {
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -1px;
}
.stats small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 6px;
}
.stat-spark {
  position: absolute;
  right: 24px;
  top: 28px;
  color: var(--symbol-text);
  font-size: 40px;
}
.library-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.dance-tabs {
  display: flex;
  gap: 24px;
}
.dance-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 0 15px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.dance-tabs button.selected {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}
.style-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.salsa-dot {
  background: var(--orange);
}
.bachata-dot {
  background: #909f78;
}
.result-count {
  font-size: 10px;
  color: var(--muted);
  padding-bottom: 14px;
}
.filters {
  display: flex;
  gap: 10px;
  padding: 21px 0;
}
.search {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  position: relative;
}
.search > span {
  position: absolute;
  left: 12px;
  font-size: 24px;
  color: var(--muted);
}
.search input {
  padding-left: 38px !important;
  margin: 0;
  width: 100%;
  height: 40px;
}
.filters select {
  height: 40px;
  font-size: 11px;
  width: auto;
  margin: 0;
  padding: 0 28px 0 12px;
  background-color: var(--paper);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  width: 100%;
  font-size: 12px;
  line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}
textarea {
  resize: vertical;
}
label {
  display: block;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.6;
}
label > input,
label > select,
label > textarea {
  margin-top: 7px;
  font-weight: 400;
}
.move-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 23px 20px;
}
.move-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  overflow: hidden;
  position: relative;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.move-card:hover {
  box-shadow: 0 5px 22px var(--card-shadow);
  transform: translateY(-2px);
}
.card-preview {
  display: block;
  padding: 0;
  border: 0;
  width: 100%;
  aspect-ratio: 16/10;
  background: #29312b;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.card-preview .play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #ffffff77;
  background: #24302766;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 14px;
  padding-left: 3px;
}
.card-preview .dance-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 9px;
  background: var(--badge-background);
  color: var(--badge-text);
  padding: 5px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #15211fbb;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 9px;
}
.card-info {
  position: relative;
  padding: 15px 15px 13px;
}
.card-info h3 {
  font-size: 14px;
  font-weight: 550;
  line-height: 1.5;
  margin: 0 44px 8px 0;
  overflow-wrap: anywhere;
}
.card-title {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
  line-height: inherit;
}
.card-meta {
  color: var(--muted);
  font-size: 10px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.level-dot {
  width: 5px;
  height: 5px;
  background: #98ad77;
  border-radius: 50%;
}
.level-dot.intermediate {
  background: #d6a351;
}
.level-dot.advanced {
  background: #cf796a;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 9px;
  color: var(--subtle);
}
.progress-tag {
  color: var(--neutral-text);
  background: var(--neutral-background);
  padding: 5px 7px;
  border-radius: 4px;
}
.progress-tag.practicing {
  background: var(--practicing-background);
  color: var(--practicing-text);
}
.progress-tag.learned {
  background: var(--learned-background);
  color: var(--learned-text);
}
.favorite-button {
  position: absolute;
  right: 12px;
  top: 15px;
  border: 0;
  background: none;
  font-size: 23px;
  color: var(--subtle);
  padding: 2px;
  line-height: 1;
}
.favorite-button.is-favorite {
  color: var(--orange);
}
.empty-state {
  text-align: center;
  padding: 42px 16px 50px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  margin: 3px 0 20px;
}
.empty-symbol {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  background: var(--symbol-background);
  color: var(--symbol-text);
  display: grid;
  place-items: center;
  font-size: 39px;
  margin: 0 auto 22px;
}
.empty-state h2 {
  font-size: 32px;
  margin: 12px 0;
}
.empty-state p {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  margin: 0 0 23px;
}
.format-hint {
  display: block;
  margin-top: 14px;
  font-size: 9px;
  color: var(--subtle);
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 28px 0;
  color: var(--subtle);
  font-size: 10px;
  gap: 20px;
}
footer > span:last-child {
  font-size: 8px;
  letter-spacing: 1.2px;
  display: flex;
  gap: 10px;
  align-items: center;
}
dialog {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 27px;
  width: min(540px, calc(100% - 28px));
  max-height: 92dvh;
  box-shadow: 0 24px 90px var(--dialog-shadow);
}
dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(5px);
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.dialog-heading h2 {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}
.dialog-heading > div {
  min-width: 0;
}
.icon-button {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
}
.drop-zone {
  position: relative;
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  padding: 25px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-tint);
  cursor: pointer;
  overflow: hidden;
}
.upload-sources {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.account-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.theme-toggle {
  min-height: 34px;
  letter-spacing: 0;
}
.theme-toggle svg {
  flex-shrink: 0;
}
.theme-toggle[aria-pressed="true"] {
  color: var(--orange-dark);
  border-color: var(--orange);
  background: var(--surface-tint);
}
.welcome-panel {
  margin: 24px 0 0;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-tint);
}
.welcome-panel p {
  margin: 10px 0 0;
  line-height: 1.6;
}
.shared-video-notice {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--surface-tint);
  line-height: 1.6;
}
.visibility-label {
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0 0;
}
.profile > div {
  min-width: 0;
}
#profile-name {
  overflow-wrap: anywhere;
}
#auth-dialog,
#password-dialog {
  max-width: 500px;
}
@media (max-width: 600px) {
  .account-actions {
    gap: 8px;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
}
.upload-sources button {
  flex: 1;
}
.upload-sources [aria-pressed="true"] {
  background: var(--selected-background);
  color: var(--selected-text);
  border-color: var(--selected-background);
}
#instagram-upload-fields {
  margin-bottom: 24px;
}
#instagram-hint {
  line-height: 1.6;
  margin-top: 10px;
}
.source-credit {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.source-credit a {
  color: inherit;
  text-underline-offset: 3px;
}
.drop-zone.dragging {
  background: var(--surface-hover);
  border-color: var(--symbol-text);
}
.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  width: 100%;
  height: 100%;
}
.drop-zone:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.upload-symbol {
  font-size: 29px;
  color: var(--symbol-text);
}
.drop-zone strong {
  font-size: 12px;
  word-break: break-word;
}
.drop-zone > span:last-child {
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
}
form > label,
form > .form-row {
  margin-bottom: 15px;
}
.muted {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}
.compact {
  font-size: 10px;
  line-height: 1.6;
  margin: 10px 0 20px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
  align-items: center;
}
.form-error {
  background: var(--error-background);
  color: var(--error-text);
  border-radius: 7px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--orange);
}
.player-dialog {
  width: min(880px, calc(100% - 28px));
}
.collection-playback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 14px 0;
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.collection-playback-context {
  display: grid;
  gap: 4px;
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.collection-playback-context strong {
  font-size: 13px;
}
.collection-playback-context span {
  font-size: 11px;
}
.collection-playback-buttons {
  display: flex;
  gap: 8px;
}
.video-stage {
  background: #151b17;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-stage video {
  width: 100%;
  max-height: 46dvh;
  display: block;
}
.video-stage video.mirrored {
  transform: scaleX(-1);
}
.playback-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 15px 0;
}
.playback-tools label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.playback-tools select {
  width: auto;
  padding: 5px 8px;
  margin: 0;
}
.checkbox-label input {
  width: auto;
  margin: 0;
  accent-color: var(--orange);
}
.small {
  font-size: 10px;
  padding: 7px 10px;
}
.segment-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  padding: 0 0 20px;
  margin-bottom: 19px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.segment-tools > span:first-child {
  color: var(--muted);
}
#segment-label {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.text-button {
  background: none;
  border: 0;
  padding: 7px 0;
  color: var(--muted);
  font-size: 11px;
}
.clip-transport {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}
.clip-transport input {
  flex: 1;
  min-width: 35px;
  padding: 0;
  accent-color: var(--orange);
}
#clip-time {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.clip-context {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 0 0;
  overflow-wrap: anywhere;
}
.clip-context button {
  margin-left: 10px;
  color: var(--orange-dark);
}
.clip-editor {
  padding: 20px;
  border: 1px solid var(--line-tint);
  border-radius: 12px;
  background: var(--surface-tint);
  margin-bottom: 24px;
}
.clip-editor-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.clip-editor h3,
.related-clips h3 {
  font-size: 15px;
  font-weight: 550;
  margin: 8px 0;
}
.clip-editor > p {
  line-height: 1.7;
  margin-bottom: 18px;
}
.clip-editor .dialog-actions {
  flex-wrap: wrap;
}
#clip-selection {
  margin-right: auto;
}
.related-clips {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 18px;
}
#related-clips-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 14px;
  margin-top: 12px;
}
.related-clips-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.related-clips-hint {
  margin: 2px 0 0;
  font-size: 10px;
}
.related-clip-card {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 9px;
  overflow: hidden;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}
.related-clip-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 11px 12px;
  gap: 10px;
  font-size: 11px;
  line-height: 1.5;
}
.related-clip-duration {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.original-video-label {
  display: block;
  color: var(--orange-dark);
  font-size: 9px;
  font-weight: 600;
  margin-bottom: 3px;
}
.related-clip-preview {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  max-height: 230px;
  background: #151b17;
}
.related-clip-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}
.related-clip-open {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 7px;
  border-radius: 4px;
  background: #15211fbb;
  color: white;
  font-size: 9px;
}
.clip-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 7px;
  border-radius: 4px;
  color: #fff;
  background: #243327d9;
  font-size: 9px;
}
.danger {
  color: var(--danger);
}
.details-actions > .danger {
  margin-right: auto;
}
.confirmation {
  max-width: 440px;
}
.confirmation p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 22px;
  border: 1px solid #627151;
  border-radius: 9px;
  background: #303d2c;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 4px 20px #0002;
  z-index: 100;
  max-width: 90vw;
}
.error-panel {
  padding: 25px;
  text-align: center;
  background: var(--error-background);
  color: var(--error-text);
  border-radius: 10px;
  font-size: 13px;
}
@media (min-width: 1550px) {
  main {
    padding: 0 65px;
  }
  .move-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 215px;
    padding: 28px 15px;
  }
  .brand {
    font-size: 18px;
    gap: 9px;
  }
  .brand-caption {
    font-size: 5.7px;
  }
  .brand-mark {
    width: 39px;
    height: 42px;
  }
  main {
    margin-left: 215px;
    padding: 0 28px;
  }
  .move-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    flex-wrap: wrap;
  }
  .search {
    flex-basis: 100%;
  }
  .filters select {
    flex: 1;
  }
  .stat-spark {
    display: none;
  }
  .stats > div {
    padding: 20px;
  }
  .topbar-right {
    display: none;
  }
}
@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: auto;
    padding: calc(12px + env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right)) 12px
      max(16px, env(safe-area-inset-left));
    display: block;
  }
  .brand {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.5px;
  }
  .brand-mark {
    flex-shrink: 0;
    width: 40px;
    height: 44px;
  }
  .brand-caption {
    display: none;
  }
  #navigation-toggle {
    flex-shrink: 0;
    padding: 10px 12px;
    font-size: 14px;
  }
  .navigation-panel {
    margin-top: 16px;
    display: block;
  }
  .nav-label,
  .sidebar-note {
    display: none;
  }
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .nav-item {
    width: 100%;
    min-width: 0;
    white-space: normal;
    justify-content: flex-start;
    font-size: 14px;
    padding: 12px 10px;
    gap: 8px;
    border-radius: 8px;
    margin: 0;
  }
  .nav-item > span:first-child {
    font-size: 20px;
    width: auto;
  }
  .nav-count {
    display: none;
  }
  main {
    margin: 0;
    min-width: 0;
    padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom)
      max(16px, env(safe-area-inset-left));
  }
  .topbar {
    min-height: 60px;
    font-size: 12px;
    letter-spacing: 0;
    gap: 8px;
    padding: 10px 0;
  }
  .topbar > span,
  #breadcrumb {
    overflow-wrap: anywhere;
    font-size: 13px;
  }
  .topbar-slash {
    margin: 0 8px;
  }
  .account-actions {
    gap: 8px;
  }
  .profile {
    margin-top: 16px;
    padding-top: 16px;
    font-size: 14px;
  }
  .profile small {
    font-size: 12px;
  }
  .page-heading {
    padding: 24px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .page-heading > .primary {
    width: 100%;
  }
  .page-heading p,
  .empty-state p,
  .confirmation p {
    font-size: 16px;
  }
  h1 {
    font-size: clamp(28px, 7vw, 36px);
    overflow-wrap: anywhere;
  }
  h2,
  h3,
  .dialog-heading > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .eyebrow {
    font-size: 12px;
    letter-spacing: 1px;
  }
  .stats {
    margin-bottom: 25px;
  }
  .stats > div {
    padding: 14px 10px;
    min-width: 0;
  }
  .stat-label {
    font-size: 12px;
    min-height: 36px;
    margin-bottom: 8px;
  }
  .stats strong {
    font-size: 24px;
  }
  .stats small {
    display: block;
    margin: 3px 0 0;
    font-size: 12px;
  }
  .library-top {
    flex-wrap: wrap;
  }
  .dance-tabs {
    gap: 12px;
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .dance-tabs button {
    font-size: 14px;
    padding: 12px 4px;
    gap: 6px;
  }
  .result-count {
    font-size: 14px;
    padding-bottom: 10px;
  }
  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px 0;
  }
  .search {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .filters select {
    min-width: 0;
    width: 100%;
    padding: 10px 8px;
  }
  input,
  select,
  textarea,
  .filters select,
  .form-row.three select,
  .upload-queue-item input {
    font-size: 16px;
    min-height: 44px;
    max-width: 100%;
  }
  label,
  .small,
  .primary,
  .secondary,
  .text-button,
  .muted,
  .compact,
  .collection-choices label,
  .upload-queue-item label {
    font-size: 14px;
  }
  .primary,
  .secondary,
  .text-button {
    white-space: normal;
    padding: 10px 12px;
  }
  .checkbox-label,
  .card-selection,
  .collection-choices label {
    min-height: 44px;
    padding-block: 8px;
  }
  input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    flex-shrink: 0;
  }
  .move-grid {
    gap: 14px;
  }
  .card-info {
    padding: 14px;
  }
  .card-info h3 {
    font-size: 16px;
    margin-right: 44px;
  }
  .card-meta {
    font-size: 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .card-bottom {
    font-size: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .favorite-button {
    right: 6px;
    top: 12px;
  }
  .card-preview .dance-badge {
    font-size: 11px;
    top: 8px;
    left: 8px;
  }
  .empty-state {
    padding: 32px 15px;
  }
  .empty-state h2 {
    font-size: 29px;
  }
  .empty-state p br {
    display: none;
  }
  footer {
    font-size: 12px;
    flex-wrap: wrap;
  }
  footer > span:last-child {
    font-size: 12px;
    gap: 6px;
  }
  dialog,
  .player-dialog,
  #auth-dialog,
  #password-dialog {
    padding: 16px;
    width: calc(100% - 16px);
    max-width: none;
    max-height: calc(
      100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
    border-radius: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 96px 24px;
  }
  dialog .dialog-heading {
    position: sticky;
    top: -16px;
    margin: -16px -16px 16px;
    padding: 16px;
    z-index: 3;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .dialog-heading h2 {
    font-size: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .icon-button {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }
  .video-stage video {
    max-height: 45dvh;
  }
  .playback-tools {
    gap: 8px 12px;
  }
  .form-row.three {
    grid-template-columns: 1fr;
  }
  .segment-tools,
  .clip-context,
  #clip-time {
    font-size: 14px;
  }
  .segment-tools > span:first-child {
    flex-basis: 100%;
  }
  .collection-playback-buttons {
    width: 100%;
  }
  .collection-playback-buttons button {
    flex: 1;
  }
  .clip-transport {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }
  #clip-seek {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .clip-editor {
    padding: 12px;
  }
  .dialog-actions,
  .related-clips-heading {
    flex-wrap: wrap;
  }
  .dialog-actions > button {
    flex: 1 1 120px;
  }
  .dialog-actions > .muted {
    flex-basis: 100%;
  }
  .details-actions > .danger {
    flex-basis: 100%;
    text-align: left;
  }
  .upload-queue {
    max-height: none;
  }
  .drop-zone strong,
  .clip-editor h3,
  .related-clips h3 {
    font-size: 16px;
  }
  #toast {
    bottom: calc(12px + env(safe-area-inset-bottom));
    font-size: 14px;
    width: max-content;
    max-width: calc(100vw - 32px);
    overflow-wrap: anywhere;
  }
}
@media (max-width: 480px) {
  .move-grid,
  .form-row,
  .filters,
  #related-clips-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .card-preview video {
    object-fit: contain;
  }
}
@media (max-height: 500px) and (max-width: 960px) {
  dialog .dialog-heading {
    position: static;
  }
  .video-stage video {
    max-height: 60dvh;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Collections, multi-select tags, and the upload queue share theme tokens. */
.sidebar {
  overflow-y: auto;
}
.collections-nav {
  margin-top: 26px;
}
.collections-heading,
.collection-actions,
.selection-toolbar,
.queue-file,
.collection-order {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.collections-heading {
  justify-content: space-between;
  margin-bottom: 10px;
}
.collections-heading .nav-label {
  margin: 0;
  padding: 0;
}
.collections-heading .text-button {
  color: #dce7c6;
  padding: 5px;
}
.collections-nav .muted {
  color: #b7c0b7;
}
.collection-name {
  flex: 1;
  overflow-wrap: anywhere;
}
.collections-nav .nav-item {
  padding: 10px;
}
.tag-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.tag-options,
.card-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.tag-options {
  margin: 8px 0 18px;
}
.tag-filter-bar .tag-options {
  margin: 0;
}
.tag-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
button.tag-chip[aria-pressed="true"] {
  background: var(--selected-background);
  color: var(--selected-text);
  border-color: var(--selected-background);
}
.card-tags {
  margin-top: 10px;
}
.card-tags .tag-chip {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--surface-soft);
}
.selection-toolbar {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.collection-actions {
  margin-bottom: 16px;
}
.card-selection,
.collection-choices label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
}
.card-selection {
  font-size: 12px;
  margin-top: 14px;
  width: fit-content;
}
.card-selection input,
.collection-choices input {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--orange);
}
.collection-order {
  margin-top: 12px;
  gap: 7px;
}
.collection-order .small {
  font-size: 11px;
  padding: 6px 9px;
}
.collection-picker {
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.collection-picker legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 5px;
}
.collection-choices {
  display: grid;
  gap: 10px;
  max-height: 170px;
  overflow-y: auto;
}
.collection-choices label {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.collection-picker .text-button {
  margin-top: 10px;
}
.upload-queue {
  max-height: 330px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  margin: 15px 0;
}
.upload-queue-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}
.queue-file {
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
}
.queue-file strong {
  overflow-wrap: anywhere;
}
.queue-file span {
  color: var(--muted);
  white-space: nowrap;
}
.upload-queue-item label {
  font-size: 11px;
  margin: 10px 0;
}
.upload-queue-item input {
  padding: 8px 10px;
}
.queue-status {
  display: block;
  font-size: 12px;
  margin-top: 8px;
  color: var(--muted);
}
.upload-queue-item[data-status="failed"],
.upload-queue-item[data-status="invalid"] {
  border-color: var(--danger);
}
.upload-queue-item[data-status="failed"] .queue-status,
.upload-queue-item[data-status="invalid"] .queue-status {
  color: var(--error-text);
}
.upload-queue-item[data-status="saved"] .queue-status {
  color: var(--learned-text);
}
@media (max-width: 720px) {
  .collections-nav {
    width: 100%;
    margin-top: 18px;
  }
  #collections-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .collections-nav .nav-item {
    width: 100%;
    max-width: none;
    font-size: 14px;
    white-space: normal;
  }
  .collections-nav .nav-item .collection-name {
    font-size: 14px;
  }
  .card-tags .tag-chip,
  .collection-playback-context span,
  .related-clips-hint,
  .format-hint,
  .drop-zone > span:last-child {
    font-size: 12px;
  }
  .tiny {
    font-size: 11px;
  }
  .collections-heading .nav-label {
    display: block;
  }
  .selection-toolbar {
    gap: 8px;
  }
  .collection-order .small,
  .collections-heading .text-button,
  .collection-choices label,
  .card-selection,
  .queue-file,
  .queue-status,
  .upload-queue-item label,
  .collection-playback-context strong {
    font-size: 14px;
  }
  .upload-queue {
    max-height: none;
  }
  .collection-choices input,
  .card-selection input {
    width: 22px;
    height: 22px;
  }
}
