:root {
  --canvas: #ffffff;
  --ink: #10233f;
  --muted: #708099;
  --blue: #3468f5;
  --blue-dark: #2958dc;
  --blue-soft: #eaf0ff;
  --line: #e4e9f2;
  --soft: #f7f9fc;
  --danger: #9f2633;
  --star: #efab23;
  --shadow: 0 12px 32px rgba(17, 35, 62, .09);
}

* { box-sizing: border-box; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", "Avenir Next", Arial, sans-serif;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.03em; }
h2 { font-size: 1.02rem; font-weight: 650; }
h3 { font-size: .98rem; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 62px;
  justify-content: space-between;
  padding: 0 30px;
}
.brand {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -.03em;
}
.topbar-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}
.topnav {
  background: var(--soft);
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-size: .92rem;
  gap: 4px;
  padding: 4px;
}
.nav-link {
  border-radius: 999px;
  padding: 8px 14px;
}
.nav-link.active {
  background: white;
  box-shadow: 0 1px 6px rgba(18, 34, 60, .08);
  color: var(--ink);
  font-weight: 650;
}
.account-chip {
  align-items: center;
  display: flex;
  gap: 10px;
}
.account-name {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}
.account-chip form {
  margin: 0;
}
.topnav a:hover, .text-link:hover, .back-link:hover { color: var(--blue); }

.page {
  margin: 0 auto;
  max-width: 1470px;
  padding: 30px 28px 64px;
  width: 100%;
}
.messages { margin: 0 0 22px; }
.message {
  background: var(--blue-soft);
  border-radius: 7px;
  color: var(--blue-dark);
  padding: 13px 16px;
}
.message.error { background: #fff1f2; color: var(--danger); }
.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-size: .9rem;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 10px 17px;
}
.button.primary {
  background: var(--blue);
  color: white;
}
.button.primary:hover { background: var(--blue-dark); }
.button.secondary {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}
.button.secondary:hover { background: var(--soft); }
.button.selected {
  background: var(--blue-soft);
  border-color: #bfd0ff;
  color: var(--blue);
}
.button.quiet {
  background: transparent;
  color: var(--muted);
}
.button.danger:hover { color: var(--danger); }
.button:disabled { cursor: default; opacity: .5; }
.button.compact {
  font-size: .78rem;
  min-height: 40px;
  padding: 8px 11px;
}

/* Video library */
.catalog-head {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  margin: -30px -28px 32px;
  padding: 24px 28px;
}
.catalog-head-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.catalog-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}
.storage-tracker {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 560px;
  padding: 13px 14px 12px;
}
.storage-tracker.over-limit {
  background: #fff7f8;
  border-color: #f4c4cb;
}
.storage-tracker-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.storage-tracker-kicker {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.storage-tracker-usage {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 650;
  margin-top: 4px;
}
.storage-tracker-status {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: right;
}
.storage-tracker.over-limit .storage-tracker-status {
  color: var(--danger);
}
.storage-tracker-bar {
  background: #dde5f2;
  border-radius: 999px;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
}
.storage-tracker-bar span {
  background: linear-gradient(90deg, var(--blue), #6d8cf9);
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 0;
}
.storage-tracker.over-limit .storage-tracker-bar span {
  background: linear-gradient(90deg, var(--danger), #d35b66);
}
.upload-menu { position: relative; }
.upload-menu summary {
  list-style: none;
}
.upload-menu summary::-webkit-details-marker { display: none; }
.upload-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 22px;
  position: absolute;
  right: 0;
  top: 54px;
  width: 350px;
  z-index: 20;
}
.upload-card h2 { margin-bottom: 18px; }
label {
  color: var(--muted);
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin: 15px 0 7px;
}
input[type="text"], input[type="file"], input[type="search"], select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  padding: 12px 13px;
  width: 100%;
}
input[type="file"] { color: var(--muted); font-size: .88rem; padding: 10px; }
.upload-card .button { margin-top: 22px; width: 100%; }
.field-error { color: var(--danger); font-size: .83rem; margin-top: 7px; }
.field-help { color: var(--muted); font-size: .78rem; line-height: 1.4; margin-top: 7px; }
.drive-import-panel {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}
.drive-import-panel strong {
  display: block;
  font-size: .9rem;
}
.drive-import-panel p {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
  margin-top: 6px;
}
.drive-import-panel .button {
  margin-top: 13px;
}
.selected-upload-file {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
}
.selected-upload-file[hidden] { display: none; }
.selected-upload-file span {
  background: var(--blue);
  border-radius: 5px;
  color: white;
  font-size: .62rem;
  font-weight: 700;
  padding: 5px 6px;
  text-transform: uppercase;
}
.selected-upload-file strong {
  font-size: .88rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-upload-file small {
  color: var(--muted);
  font-size: .74rem;
  margin-left: auto;
  white-space: nowrap;
}
.upload-status {
  background: var(--blue-soft);
  border-radius: 7px;
  color: var(--blue-dark);
  font-size: .82rem;
  line-height: 1.4;
  margin-top: 14px;
  padding: 10px 12px;
}
.upload-status p { margin: 0; }
.upload-status progress {
  height: 8px;
  margin-top: 10px;
  width: 100%;
}
.upload-status .text-action {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
}
.upload-status.error {
  background: #fff1f2;
  color: var(--danger);
}
.upload-card ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.upload-card ul label {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: .87rem;
  font-weight: 500;
  gap: 8px;
  margin: 0;
}

.upload-progress-screen {
  margin: 0 auto;
  max-width: 760px;
  padding: 18px 0 42px;
}
.upload-progress-screen[hidden] { display: none; }
.upload-progress-screen .back-link {
  display: inline-block;
  margin-bottom: 28px;
}
.upload-progress-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(18, 34, 60, .06);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  margin-top: 28px;
  padding: 18px;
}
.upload-preview-frame {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: var(--soft);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: 100%;
}
.upload-preview-frame video {
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.upload-preview-fallback {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
}
.upload-progress-copy {
  align-self: center;
  min-width: 0;
}
.upload-progress-copy h2 {
  overflow-wrap: anywhere;
}
.upload-progress-copy p {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 7px;
}
.upload-progress-copy strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 18px;
}
.upload-progress-copy progress {
  height: 10px;
  margin-top: 10px;
  width: 100%;
}

.catalog-tools { margin-bottom: 34px; }
.library-filter-form {
  align-items: end;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.search-control { min-width: min(380px, 100%); }
.library-filter-form label {
  margin: 0;
  min-width: 155px;
}
.library-filter-form label span {
  color: var(--muted);
  display: block;
  font-size: .76rem;
  font-weight: 650;
  margin-bottom: 6px;
}
.library-filter-form input,
.library-filter-form select {
  background: var(--canvas);
  min-height: 50px;
}
.library-filter-form input[type="search"] { padding-left: 18px; }
.checkbox-filter {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 9px;
  min-height: 50px;
  padding: 0 13px;
}
.checkbox-filter input[type="checkbox"] { width: auto; }
.checkbox-filter span { margin: 0; }
.catalog-results h2 { margin-bottom: 21px; }
.video-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.video-tile {
  border: 1px solid var(--line);
  border-radius: 11px;
  min-width: 0;
  min-height: 330px;
  overflow: hidden;
  padding: 14px;
  transition: border-color .13s ease, box-shadow .13s ease;
}
.video-tile:hover {
  border-color: #cbd6ea;
  box-shadow: 0 8px 24px rgba(18, 34, 60, .06);
}
.video-tile-preview {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: var(--soft);
  border-radius: 9px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.video-tile-preview video, .video-tile-preview img { height: 100%; object-fit: cover; width: 100%; }
.tile-date {
  background: rgba(18, 34, 60, .65);
  border-radius: 7px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 7px 9px;
  position: absolute;
  right: 9px;
  top: 9px;
}
.status-pill {
  background: #ecf0f6;
  border-radius: 99px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  padding: 7px 12px;
  text-transform: uppercase;
}
.status-pill.uploading { background: var(--blue-soft); color: var(--blue-dark); }
.status-pill.ready { background: #e8f4ef; color: #0c7657; }
.status-pill.failed { background: #faeaed; color: var(--danger); }
.status-pill.needs-assist { background: #fff6df; color: #8a5b00; }
.tile-status {
  bottom: 9px;
  left: 9px;
  position: absolute;
}
.video-tile-meta { padding: 17px 2px 0; }
.video-tile-meta h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-tile-meta p {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: .82rem;
  gap: 8px 17px;
  margin-top: 28px;
}
.video-tile-meta .video-status-copy {
  display: grid;
  gap: 5px;
}
.video-status-copy strong {
  color: var(--ink);
  font-size: .85rem;
}
.video-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
  position: relative;
}
.card-actions-checkbox {
  display: none;
}
.video-card-actions > .card-actions-list { display: contents; }
.card-actions-toggle {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: none;
  height: 36px;
  justify-content: center;
  width: 36px;
}
.card-actions-toggle span { font-size: 1.2rem; line-height: 1; }
.card-action-menu { position: relative; }
.card-action-menu summary { list-style: none; }
.card-action-menu summary::-webkit-details-marker { display: none; }
.card-action-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  left: 0;
  min-width: 250px;
  padding: 16px;
  position: absolute;
  top: 42px;
  z-index: 20;
}
.card-action-card .button { margin-top: 12px; width: 100%; }
.empty-state {
  background: var(--soft);
  border-radius: 10px;
  color: var(--muted);
  padding: 34px;
}

/* Video review workspace */
.player-page {
  max-width: none;
  padding: 0 0 50px;
}
.player-page .messages { margin: 18px 24px; }
.detail-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 68px;
  justify-content: space-between;
  padding: 0 24px;
}
.detail-title {
  align-items: center;
  display: flex;
  gap: 18px;
}
.detail-title h1 { font-size: 1rem; font-weight: 600; }
.back-link {
  color: var(--muted);
  font-size: .9rem;
}
.detail-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  position: relative;
}
.detail-actions-checkbox {
  display: none;
}
.detail-actions > .detail-actions-list { display: contents; }
.detail-actions-toggle {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: none;
  font-size: .85rem;
  font-weight: 600;
  gap: 6px;
  padding: 10px 14px;
}
.detail-actions-toggle span:first-child { font-size: 1.2rem; line-height: 1; }
.rename-menu { position: relative; }
.rename-menu summary { list-style: none; }
.rename-menu summary::-webkit-details-marker { display: none; }
.rename-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 280px;
  padding: 18px;
  position: absolute;
  right: 0;
  top: 52px;
  z-index: 20;
}
.rename-card .button { margin-top: 14px; width: 100%; }
.video-content { min-height: 170px; }
.review-workspace {
  display: grid;
  grid-template-columns: minmax(550px, 1fr) 390px;
  min-height: calc(100vh - 131px);
}
.main-player {
  background: #fafbfe;
  padding: 16px 14px;
}
.main-player video {
  background: #0e1420;
  display: block;
  height: min(calc(100vh - 180px), 760px);
  object-fit: contain;
  width: 100%;
}
.rally-panel {
  border-left: 1px solid var(--line);
  min-height: calc(100vh - 131px);
}
.rally-panel-head {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  height: 57px;
  padding: 19px 17px 0;
  row-gap: 8px;
}
.rally-panel-head h2 {
  border-bottom: 2px solid var(--ink);
  height: 38px;
}
.rally-panel-head span { color: var(--muted); font-size: .82rem; }
.rally-sort-control {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0 0 0 auto;
}
.rally-sort-control select {
  font-size: .78rem;
  padding: 6px 10px;
  width: auto;
}
.time-saved-summary {
  align-items: flex-start;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 14px 17px;
}
.time-saved-summary p {
  color: var(--muted);
  flex: 1;
  font-size: .85rem;
  line-height: 1.5;
  margin: 0;
}
.time-saved-summary strong { color: var(--ink); }
.time-saved-dismiss {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.15rem;
  height: 28px;
  justify-content: center;
  line-height: 1;
  margin: -4px -6px 0 0;
  padding: 0;
  width: 28px;
}
.time-saved-dismiss:hover,
.time-saved-dismiss:focus-visible {
  color: var(--ink);
}
.rally-list {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}
.rally-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  min-height: 58px;
  padding: 0 10px 0 16px;
}
.rally-row.active {
  background: var(--blue);
  color: white;
}
.rally-row.highlighted:not(.active) { background: #fbfcff; }
.rally-jump {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex: 1;
  gap: 12px;
  min-height: 57px;
  padding: 8px 0;
  text-align: left;
}
.rally-time {
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: .79rem;
  min-width: 110px;
  padding-right: 10px;
}
.rally-row.active .rally-time { border-color: rgba(255,255,255,.4); color: white; }
.rally-jump strong { font-size: .84rem; }
.rally-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rally-flag {
  background: #fff4dc;
  border-radius: 999px;
  color: #936301;
  font-size: .68rem;
  font-weight: 650;
  padding: 2px 8px;
  width: fit-content;
}
.rally-row.active .rally-flag { background: rgba(255,255,255,.25); color: white; }
.rally-row.likely-junk:not(.active) { opacity: .72; }
.row-actions {
  align-items: center;
  display: flex;
  gap: 2px;
}
.icon-action {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 1.28rem;
  height: 38px;
  justify-content: center;
  width: 37px;
}
.icon-action.chosen { color: var(--star); }
.icon-action.delete { font-size: 1.42rem; }
.rally-row.active .icon-action { color: white; }
.icon-action.delete:hover { color: var(--danger); }
.highlight-action {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 650;
  gap: 5px;
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}
.highlight-action.chosen {
  background: #fff4dc;
  border-color: #f4d596;
  color: #936301;
}
.rally-row.active .highlight-action {
  border-color: rgba(255,255,255,.4);
  color: white;
}
.panel-empty { color: var(--muted); padding: 30px 17px; }
.deleted-list {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .84rem;
  padding: 16px;
}
.deleted-list summary { cursor: pointer; margin-bottom: 12px; }
.deleted-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}
.text-action {
  background: transparent;
  border: 0;
  color: var(--blue);
  cursor: pointer;
  font-weight: 600;
}

.job-status {
  align-items: center;
  background: var(--soft);
  border-radius: 9px;
  display: flex;
  gap: 22px;
  margin: 42px auto;
  max-width: 760px;
  padding: 32px;
}
.job-status h2 { margin-bottom: 7px; }
.job-status p { color: var(--muted); line-height: 1.45; }
.job-status form { margin-top: 18px; }
.job-status progress {
  height: 8px;
  margin-top: 16px;
  width: min(360px, 100%);
}
.job-status.failed { background: #fff2f3; }
.spinner {
  border: 3px solid #dbe2ef;
  border-radius: 50%;
  border-top-color: var(--blue);
  display: block;
  height: 34px;
  width: 34px;
}
.spinner.moving { animation: rotate .8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

.manual-net-labeler {
  margin: 30px auto 56px;
  max-width: 1100px;
  padding: 0 24px;
}
.manual-net-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.manual-net-head p {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 6px;
}
.manual-net-head .eyebrow {
  color: var(--blue);
  margin-bottom: 6px;
  margin-top: 0;
}
.manual-net-error {
  background: #fff2f3;
  border-radius: 9px;
  color: var(--danger);
  padding: 18px;
}
.manual-net-guide {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 16px;
  grid-template-columns: 168px minmax(0, 1fr);
  margin-bottom: 18px;
  padding: 14px;
}
.manual-net-guide strong {
  color: var(--ink);
  display: block;
  font-size: .93rem;
}
.manual-net-guide p {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
  margin-top: 5px;
}
.manual-net-example {
  aspect-ratio: 16 / 9;
  background: #c9e8fb;
  border: 1px solid #bdd4e1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.manual-net-example-sky,
.manual-net-example-sand {
  left: 0;
  position: absolute;
  right: 0;
}
.manual-net-example-sky {
  background: linear-gradient(#cae9fb, #f4fbff);
  bottom: 32%;
  top: 0;
}
.manual-net-example-sand {
  background: #ead89b;
  bottom: 0;
  top: 68%;
}
.manual-net-example-post {
  background: #2b4b62;
  bottom: 22%;
  position: absolute;
  top: 29%;
  width: 4px;
}
.manual-net-example-post.left { left: 18%; }
.manual-net-example-post.right { right: 18%; }
.manual-net-example-line {
  background: #00a9d6;
  height: 4px;
  left: 18%;
  position: absolute;
  right: 18%;
  top: 38%;
  transform: rotate(-2deg);
  transform-origin: left center;
}
.manual-net-example-dot {
  background: white;
  border: 3px solid #00a9d6;
  border-radius: 50%;
  height: 16px;
  position: absolute;
  top: calc(38% - 6px);
  width: 16px;
}
.manual-net-example-dot.first { left: calc(18% - 7px); }
.manual-net-example-dot.second { right: calc(18% - 7px); }
.manual-net-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}
.manual-net-frame {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
}
.manual-net-frame.complete {
  border-color: #78a486;
}
.manual-net-frame-media {
  aspect-ratio: 16 / 9;
  background: #0e1420;
  border: 0;
  cursor: crosshair;
  display: block;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100%;
}
.manual-net-frame-media img {
  display: block;
  height: 100%;
  object-fit: contain;
  user-select: none;
  width: 100%;
}
.manual-net-frame-media svg {
  bottom: 0;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}
.manual-net-frame-media line {
  display: none;
  stroke: #00d4ff;
  stroke-linecap: round;
  stroke-width: 6;
}
.manual-net-frame-media circle {
  display: none;
  fill: #ffffff;
  stroke: #00d4ff;
  stroke-width: 4;
}
.manual-net-frame figcaption {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 11px;
}
.manual-net-frame figcaption span {
  color: var(--muted);
  font-size: .78rem;
}
.manual-net-frame figcaption strong {
  color: var(--danger);
  font-size: .78rem;
  grid-column: 1 / -1;
}
.manual-net-frame.complete figcaption strong {
  color: #17704a;
}
.manual-net-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 18px;
}
.manual-net-actions span {
  color: var(--muted);
  font-size: .83rem;
}

/* Highlights view and its clip cards */
.eyebrow {
  color: var(--blue);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.lede {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 14px;
  max-width: 530px;
}
.highlights-head h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.highlights-head { margin-bottom: 34px; }
.compile-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 45px;
  max-width: 620px;
  padding: 22px;
}
.compile-panel .button { margin-top: 21px; width: 100%; }
.aspect-options {
  border: 0;
  margin: 18px 0 0;
  padding: 0;
}
.aspect-options legend {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
  margin-bottom: 8px;
}
.aspect-options div {
  display: grid;
  gap: 8px;
}
.aspect-options label {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  display: flex;
  font-size: .9rem;
  gap: 9px;
  margin: 0;
  padding: 12px 13px;
}
.aspect-options input {
  width: auto;
}
.tracking-option {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-top: 14px;
  padding: 14px;
}
.tracking-option strong {
  display: block;
  font-size: .9rem;
  margin-top: 8px;
}
.tracking-option p,
.vertical-preview-card p {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
  margin-top: 5px;
}
.vertical-preview-card {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 150px;
  margin-top: 14px;
  padding: 14px;
}
.vertical-preview-frame {
  aspect-ratio: 9 / 16;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}
.vertical-preview-frame video {
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.collection + .collection { margin-top: 44px; }
.collection > h2 { margin-bottom: 20px; }
.rally-grid {
  display: grid;
  gap: 17px;
  grid-template-columns: repeat(3, 1fr);
}
.rally-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.rally-card video {
  aspect-ratio: 16 / 9;
  background: #111827;
  display: block;
  object-fit: cover;
  width: 100%;
}
.rally-meta {
  align-items: start;
  display: flex;
  justify-content: space-between;
  padding: 14px 14px 11px;
}
.rally-meta p { color: var(--muted); font-size: .82rem; margin-top: 5px; }
.highlight-tag {
  background: #fff4dc;
  border-radius: 99px;
  color: #a16d00;
  font-size: .67rem;
  font-weight: bold;
  padding: 5px 8px;
  text-transform: uppercase;
}
.rally-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 6px;
  padding: 10px;
}
.rally-actions form:first-child { flex: 1; }
.rally-actions form:first-child .button { width: 100%; }
.removed-rally {
  align-items: center;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  min-height: 80px;
  padding: 16px;
}
.reel-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.reel-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 17px 19px;
}
.reel-row:last-child { border-bottom: 0; }
.highlight-player { max-width: 760px; }
.highlight-player.vertical { max-width: 390px; }
.highlight-player video {
  background: #111827;
  border-radius: 9px;
  display: block;
  margin-bottom: 20px;
  width: 100%;
}

/* Auth */
.auth-page {
  display: flex;
  min-height: calc(100vh - 63px);
}
.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  width: 100%;
}
.auth-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-width: 460px;
  padding: 30px;
  width: 100%;
}
.auth-form {
  margin-top: 24px;
}
.auth-form .button {
  margin-top: 24px;
  width: 100%;
}
.auth-link-row {
  margin: 18px 0 0;
  text-align: center;
}
.auth-link-row a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}
.auth-link-row a:hover { color: var(--blue-dark); }

@media (max-width: 1100px) {
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-workspace { grid-template-columns: 1fr; }
  .main-player video { height: auto; max-height: 65vh; }
  .rally-panel { border-left: 0; border-top: 1px solid var(--line); min-height: unset; }
  .rally-list { max-height: 460px; }
}
@media (max-width: 810px) {
  .video-grid, .rally-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    height: auto;
    padding: 14px 18px;
  }
  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }
  .topnav { font-size: .86rem; }
  .nav-link { padding: 7px 10px; }
  .account-chip {
    justify-content: space-between;
    width: 100%;
  }
  .page { padding: 22px 16px 50px; }
  .catalog-head {
    grid-template-columns: minmax(0, 1fr);
    margin: -22px -16px 25px;
    padding: 19px 16px;
  }
  .storage-tracker { max-width: none; }
  .storage-tracker-head {
    flex-direction: column;
    gap: 6px;
  }
  .storage-tracker-status { text-align: left; }
  .library-filter-form,
  .library-filter-form label,
  .search-control {
    min-width: 0;
    width: 100%;
  }
  .library-filter-form .button { width: 100%; }
  .catalog-actions {
    display: block;
    width: 100%;
  }
  .upload-menu {
    width: 100%;
  }
  .upload-menu summary {
    display: flex;
    width: 100%;
  }
  .upload-card {
    margin-top: 12px;
    position: static;
    right: auto;
    top: auto;
    width: 100%;
    z-index: auto;
  }
  .upload-progress-screen {
    padding-top: 4px;
  }
  .upload-progress-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }
  .video-grid, .rally-grid {
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
  }
  .vertical-preview-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .vertical-preview-frame {
    max-width: 180px;
  }
  .video-tile {
    align-items: flex-start;
    column-gap: 12px;
    display: grid;
    grid-template-areas: "preview meta actions";
    grid-template-columns: 110px 1fr auto;
    min-height: unset;
    overflow: visible;
    padding: 10px;
    width: 100%;
  }
  .video-tile-link {
    grid-area: preview;
  }
  .video-tile-preview {
    aspect-ratio: 16 / 9;
    max-height: none;
    width: 110px;
  }
  .video-tile-preview video, .video-tile-preview img {
    height: 100%;
    object-fit: cover;
    width: 100%;
  }
  .tile-date {
    font-size: .65rem;
    padding: 4px 6px;
  }
  .status-pill {
    font-size: .65rem;
    padding: 5px 8px;
  }
  .video-tile-meta {
    grid-area: meta;
    min-width: 0;
    padding-top: 0;
  }
  .video-tile-meta p {
    flex-wrap: wrap;
    margin-top: 6px;
  }
  .video-card-actions {
    grid-area: actions;
    margin-top: 0;
  }
  .card-actions-checkbox {
    display: block;
    height: 1px;
    margin: -1px;
    opacity: 0;
    position: absolute;
    width: 1px;
  }
  .card-actions-checkbox:focus-visible ~ .card-actions-toggle {
    outline: 2px solid var(--blue-dark);
    outline-offset: 2px;
  }
  .card-actions-toggle {
    display: inline-flex;
  }
  .video-card-actions > .card-actions-list {
    display: none;
  }
  .card-actions-checkbox:checked ~ .card-actions-list {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
  }
  .video-card-actions .button { width: 100%; }
  .card-actions-list .card-action-card {
    box-shadow: none;
    border: 0;
    left: auto;
    min-width: 0;
    padding: 8px 0 0;
    position: static;
    width: 100%;
  }
  .detail-head {
    align-items: flex-start;
    flex-direction: row;
    gap: 12px;
    height: auto;
    justify-content: space-between;
    padding: 16px;
  }
  .detail-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }
  .detail-title h1 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .detail-actions { flex-shrink: 0; }
  .detail-actions-checkbox {
    display: block;
    height: 1px;
    margin: -1px;
    opacity: 0;
    position: absolute;
    width: 1px;
  }
  .detail-actions-checkbox:focus-visible ~ .detail-actions-toggle {
    outline: 2px solid var(--blue-dark);
    outline-offset: 2px;
  }
  .detail-actions-toggle { display: inline-flex; }
  .detail-actions > .detail-actions-list { display: none; }
  .detail-actions-checkbox:checked ~ .detail-actions-list {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
  }
  .detail-actions-list .button, .detail-actions-list form, .detail-actions-list details { width: 100%; }
  .detail-actions-list .rename-card {
    border: 0;
    box-shadow: none;
    left: auto;
    min-width: 0;
    padding: 8px 0 0;
    position: static;
    width: 100%;
  }
  .manual-net-labeler { margin-top: 22px; padding: 0 16px; }
  .manual-net-head { align-items: stretch; flex-direction: column; }
  .manual-net-head .button, .manual-net-head form, .manual-net-actions .button {
    width: 100%;
  }
  .manual-net-guide {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }
  .manual-net-example { max-width: 260px; }
  .manual-net-grid { grid-template-columns: minmax(0, 1fr); }
  .manual-net-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .rally-panel-head { height: auto; padding: 14px 12px; }
  .time-saved-summary { padding: 12px; }
  .time-saved-dismiss {
    height: 36px;
    width: 36px;
  }
  .rally-sort-control { flex-basis: 100%; margin-left: 0; }
  .rally-sort-control select { flex: 1; }
  .rally-row { align-items: stretch; flex-direction: column; gap: 8px; padding: 10px 12px; }
  .rally-jump { width: 100%; }
  .row-actions { justify-content: flex-end; }
  .review-workspace { display: block; }
  .auth-card { padding: 24px 18px; }
  .debug-panel { margin: 28px 16px; padding: 18px; }
  .debug-panel-head { align-items: stretch; flex-direction: column; }
  .debug-panel-head form, .debug-panel-head .button { width: 100%; }
}

.debug-panel {
  background: var(--soft);
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin: 36px auto;
  max-width: 1100px;
  padding: 22px 24px;
}
.debug-panel-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}
.debug-panel-head h2 { margin-bottom: 6px; }
.debug-panel-head p { color: var(--muted); font-size: .85rem; line-height: 1.45; max-width: 640px; }
.debug-status { color: var(--muted); font-size: .88rem; margin-top: 14px; }
.debug-error {
  background: #fff2f3;
  border-radius: 8px;
  color: var(--danger);
  font-size: .82rem;
  margin-top: 12px;
  overflow-x: auto;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.debug-video-player {
  border-radius: 9px;
  display: block;
  margin: 16px 0 14px;
  max-height: 70vh;
  width: 100%;
}
