:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #64717f;
  --line: #d9e0e3;
  --surface: #ffffff;
  --surface-muted: #fbfcfc;
  --surface-soft: #f9fbfb;
  --control: #ffffff;
  --chip: #eef2f3;
  --status-surface: #f0f6f5;
  --progress-track: #dbe7e5;
  --page: #f4f7f8;
  --admin-page: #f3f6f7;
  --teal: #0f766e;
  --teal-dark: #0b5d57;
  --primary: #0f766e;
  --primary-hover: #0b5d57;
  --brand-secondary: #2d5f8b;
  --coral: #d75c48;
  --blue: #2d5f8b;
  --on-accent: #ffffff;
  --danger: #a43a2b;
  --danger-strong: #9b3427;
  --warning: #765413;
  --warning-surface: #fff1c7;
  --cancelled: #5f6670;
  --cancelled-surface: #e9edef;
  --drop-line: #a9b7bd;
  --empty-line: #bdc8cc;
  --ghost-line: #c9d4d8;
  --video-surface: #121820;
  --header-glass: rgba(255, 255, 255, 0.75);
  --stat-surface: rgba(255, 255, 255, 0.86);
  --row-hover: rgba(244, 247, 248, 0.72);
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4f5;
  --muted: #a2b0b7;
  --line: #34444b;
  --surface: #182328;
  --surface-muted: #1c292f;
  --surface-soft: #152126;
  --control: #202d33;
  --chip: #25343b;
  --status-surface: #172c2c;
  --progress-track: #33474c;
  --page: #0e171b;
  --admin-page: #0d161a;
  --teal: #53cec1;
  --teal-dark: #7be0d6;
  --primary: #137a72;
  --primary-hover: #0f645e;
  --brand-secondary: #386f9e;
  --coral: #ff806b;
  --blue: #8fc1ec;
  --danger: #ff9a87;
  --danger-strong: #ff9a87;
  --warning: #f1d18d;
  --warning-surface: #40361e;
  --cancelled: #b9c4ca;
  --cancelled-surface: #303c42;
  --drop-line: #53666e;
  --empty-line: #455860;
  --ghost-line: #465960;
  --header-glass: rgba(24, 35, 40, 0.9);
  --stat-surface: rgba(24, 35, 40, 0.9);
  --row-hover: rgba(83, 206, 193, 0.06);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 280px),
    var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.theme-menu {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  color: var(--ink);
}

.theme-menu summary {
  list-style: none;
}

.theme-menu summary::-webkit-details-marker {
  display: none;
}

.theme-menu-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--header-glass);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.theme-menu-toggle:hover,
.theme-menu[open] .theme-menu-toggle {
  border-color: var(--teal);
}

.theme-menu-toggle:focus-visible {
  outline: 3px solid rgba(45, 95, 139, 0.25);
  outline-offset: 2px;
}

.theme-menu-toggle > strong {
  color: var(--teal-dark);
  font-size: 0.76rem;
}

.theme-menu-icon {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid var(--teal);
  border-radius: 50%;
}

.theme-menu-icon::after {
  position: absolute;
  inset: -5px;
  border: 1px dashed var(--teal);
  border-radius: 50%;
  content: "";
}

html[data-theme="dark"] .theme-menu-icon {
  border-color: var(--blue);
  box-shadow: inset 5px -2px 0 var(--surface);
}

html[data-theme="dark"] .theme-menu-icon::after {
  display: none;
}

.theme-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(260px, calc(100vw - 24px));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.theme-menu-title {
  margin: 2px 4px 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.theme-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option > span {
  display: grid;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 10px;
}

.theme-option > span:hover {
  background: var(--surface-muted);
}

.theme-option input:checked + span {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.1);
  box-shadow: inset 3px 0 var(--teal);
}

.theme-option input:focus-visible + span {
  outline: 3px solid rgba(45, 95, 139, 0.25);
  outline-offset: 1px;
}

.theme-option strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.theme-option small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.auth-theme-control {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.limit-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--teal-dark);
  font-size: 0.88rem;
  font-weight: 800;
  background: var(--header-glass);
}

.header-link,
.back-link {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.header-link {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--header-glass);
}

.header-link:hover,
.back-link:hover {
  color: var(--teal-dark);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 20px;
  padding: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.codec-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.codec-field legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.codec-options {
  display: grid;
  gap: 7px;
}

.codec-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.codec-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.codec-option span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  transition: border-color 150ms ease, background 150ms ease;
}

.codec-option strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.codec-option small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.codec-option input:checked + span {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.08);
  box-shadow: inset 3px 0 var(--teal);
}

.codec-option input:focus-visible + span {
  outline: 3px solid rgba(45, 95, 139, 0.25);
  outline-offset: 2px;
}

.output-options {
  display: grid;
  gap: 7px;
}

.audio-option,
.metadata-option {
  min-width: 0;
}

.option-toggle {
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.option-toggle:hover {
  border-color: var(--teal);
}

.option-toggle:focus-visible {
  outline: 3px solid rgba(45, 95, 139, 0.25);
  outline-offset: 2px;
}

.option-toggle[aria-pressed="true"] {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.08);
  box-shadow: inset 3px 0 var(--teal);
}

.option-toggle-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: var(--teal-dark);
  background: rgba(15, 118, 110, 0.1);
}

.option-toggle-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.option-toggle-copy strong {
  font-size: 0.92rem;
}

.option-toggle-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.option-toggle-state {
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--chip);
  font-size: 0.73rem;
  font-weight: 850;
  white-space: nowrap;
}

.option-toggle[aria-pressed="true"] .option-toggle-state {
  color: var(--teal-dark);
  background: rgba(15, 118, 110, 0.12);
}

label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.drop-zone {
  display: grid;
  min-height: 190px;
  place-items: center;
  gap: 8px;
  padding: 20px;
  border: 1px dashed var(--drop-line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.07);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: rgba(15, 118, 110, 0.1);
}

#fileLabel {
  width: 100%;
  font-size: 1rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.target-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.number-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--control);
}

.number-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 12px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 900;
  outline: 0;
}

.number-control span {
  padding: 0 12px;
  color: var(--muted);
  font-weight: 900;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.primary-button,
.primary-link,
.ghost-button,
.icon-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  gap: 8px;
  border: 0;
  padding: 0 16px;
  color: var(--on-accent);
  background: var(--primary);
}

.primary-button:hover,
.primary-link:hover {
  background: var(--primary-hover);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.inline-error {
  margin: 0;
  border: 1px solid rgba(215, 92, 72, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--danger-strong);
  background: rgba(215, 92, 72, 0.08);
  font-size: 0.88rem;
  font-weight: 750;
}

.status-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--status-surface);
}

.status-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--teal-dark);
  font-size: 0.9rem;
}

.status-copy span {
  text-align: right;
  overflow-wrap: anywhere;
}

progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--progress-track);
}

progress::-webkit-progress-bar {
  background: var(--progress-track);
}

progress::-webkit-progress-value {
  background: var(--coral);
}

progress::-moz-progress-bar {
  background: var(--coral);
}

.cancel-job-button {
  width: max-content;
  border: 0;
  padding: 2px 0;
  color: var(--danger);
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 850;
  cursor: pointer;
}

.cancel-job-button:disabled {
  color: var(--muted);
  cursor: wait;
}

.history-panel {
  min-height: 360px;
  padding: 16px;
}

.result-panel {
  min-height: 420px;
  padding: 16px;
}

.privacy-pill,
.codec-badge,
.audio-badge,
.metadata-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 850;
}

.privacy-pill {
  border: 1px solid rgba(45, 95, 139, 0.25);
  padding: 6px 9px;
  color: var(--blue);
  background: rgba(45, 95, 139, 0.06);
  font-size: 0.76rem;
}

.codec-badge {
  padding: 5px 8px;
  color: var(--teal-dark);
  background: rgba(15, 118, 110, 0.1);
  font-size: 0.76rem;
}

.audio-badge,
.metadata-badge {
  padding: 5px 8px;
  color: var(--blue);
  background: rgba(45, 95, 139, 0.1);
  font-size: 0.76rem;
}

.result-container {
  min-height: 330px;
}

.empty-result {
  display: grid;
  min-height: 310px;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed var(--empty-line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-result p {
  max-width: 300px;
  margin-bottom: 0;
  font-weight: 750;
}

.empty-result-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: rgba(15, 118, 110, 0.1);
}

.result-item {
  display: grid;
  gap: 14px;
}

.result-item video {
  width: 100%;
  max-height: 420px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--video-surface);
  object-fit: contain;
}

.result-body {
  display: grid;
  gap: 11px;
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.playback-note {
  margin: 0;
  color: var(--coral);
  font-size: 0.85rem;
  font-weight: 750;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.icon-button {
  width: 42px;
  border: 1px solid var(--line);
  color: var(--blue);
  background: var(--control);
}

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

.history-item {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.history-item video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: var(--video-surface);
  object-fit: contain;
}

.history-body {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.meta-grid span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--chip);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-link,
.ghost-button {
  padding: 0 12px;
  font-size: 0.9rem;
}

.primary-link {
  color: var(--on-accent);
  background: var(--primary);
}

.ghost-button {
  border: 1px solid var(--ghost-line);
  color: var(--blue);
  background: var(--control);
}

.empty-state {
  margin: 56px 0;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(100%, 430px);
  padding: 24px;
}

.auth-panel .back-link {
  display: inline-block;
  margin-bottom: 42px;
  font-size: 0.88rem;
}

.auth-panel h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 8vw, 3rem);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.auth-form input[type="password"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--control);
  font: inherit;
  outline: 0;
}

.auth-form input[type="password"]:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.admin-page {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 118, 110, 0.13), transparent 32rem),
    radial-gradient(circle at 95% 5%, rgba(45, 95, 139, 0.1), transparent 28rem),
    var(--admin-page);
}

.admin-layout {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

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

.admin-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.admin-brand h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1;
}

.admin-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: var(--on-accent);
  background: linear-gradient(145deg, var(--primary), var(--brand-secondary));
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.24);
  font-size: 1.25rem;
  font-weight: 950;
}

.admin-header-status {
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-header-status form {
  margin: 0;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 5px;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 850;
}

.live-indicator i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a36a;
  box-shadow: 0 0 0 4px rgba(22, 163, 106, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 18px;
}

.stat-card {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--stat-surface);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.04);
}

.stat-card-active {
  border-color: rgba(15, 118, 110, 0.32);
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.11), var(--surface));
}

.stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-card > strong {
  overflow: hidden;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-control-panel {
  margin-bottom: 26px;
  padding: 18px;
  border-radius: 12px;
}

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

.task-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.task-summary span {
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background: var(--chip);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.task-summary strong {
  color: var(--ink);
}

.task-list {
  max-height: 620px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.task-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.1fr) minmax(250px, 1.45fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 15px 8px;
  border-bottom: 1px solid var(--line);
}

.task-row:hover {
  background: var(--row-hover);
}

.task-identity {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.task-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.task-status-queued {
  color: var(--warning);
  background: var(--warning-surface);
}

.task-status-processing {
  color: var(--blue);
  background: rgba(45, 95, 139, 0.1);
}

.task-status-complete {
  color: var(--teal-dark);
  background: rgba(15, 118, 110, 0.1);
}

.task-status-error {
  color: var(--danger-strong);
  background: rgba(215, 92, 72, 0.1);
}

.task-status-cancelled {
  color: var(--cancelled);
  background: var(--cancelled-surface);
}

.task-progress {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.task-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
}

.task-progress-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-progress-copy span {
  color: var(--teal-dark);
  font-weight: 900;
}

.task-progress small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-time {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.task-result-link {
  width: max-content;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.task-result-link:hover {
  color: var(--teal-dark);
}

.task-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 116px;
}

.task-control-button,
.task-control-icon,
.task-cancel-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--blue);
  background: var(--control);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 850;
  cursor: pointer;
}

.task-control-icon {
  width: 32px;
  padding: 0;
  font-size: 0.9rem;
}

.task-cancel-button {
  border-color: rgba(215, 92, 72, 0.28);
  color: var(--danger);
}

.task-control-button:hover,
.task-control-icon:hover {
  border-color: rgba(45, 95, 139, 0.4);
  background: rgba(45, 95, 139, 0.06);
}

.task-cancel-button:hover {
  background: rgba(215, 92, 72, 0.07);
}

.task-cancel-button:disabled {
  color: var(--muted);
  cursor: wait;
  opacity: 0.7;
}

.empty-task-state {
  padding: 42px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
  font-weight: 750;
}

.task-retention-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-action-notice {
  margin: 11px 0 0;
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--teal-dark);
  background: rgba(15, 118, 110, 0.08);
  font-size: 0.8rem;
  font-weight: 750;
}

.admin-action-notice.is-error {
  color: var(--danger-strong);
  background: rgba(215, 92, 72, 0.09);
}

.header-actions form {
  margin: 0;
}

.admin-section {
  margin-bottom: 26px;
}

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

.admin-preview-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
}

.admin-preview-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--video-surface);
  object-fit: contain;
}

.admin-preview-body {
  display: grid;
  gap: 11px;
  padding: 13px;
}

.empty-admin-state {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.storage-panel {
  padding: 18px;
  border-radius: 12px;
}

.admin-auth-panel {
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(23, 32, 42, 0.14);
}

.admin-auth-panel .admin-mark {
  margin-bottom: 34px;
}

.auth-back-link {
  display: block;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.storage-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.storage-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
}

.storage-table th,
.storage-table td {
  border-top: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: middle;
}

.storage-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.storage-table td {
  font-size: 0.88rem;
}

.storage-table td:first-child {
  max-width: 360px;
}

.storage-table td:first-child strong,
.storage-table td:first-child small {
  display: block;
  overflow-wrap: anywhere;
}

.storage-table td:first-child small {
  margin-top: 3px;
  color: var(--muted);
}

.storage-table form {
  margin: 0;
}

.danger-button {
  border: 1px solid rgba(215, 92, 72, 0.35);
  padding: 0 12px;
  color: var(--danger);
  background: var(--control);
}

.danger-button:hover {
  background: rgba(215, 92, 72, 0.08);
}

.danger-link {
  border: 0;
  padding: 5px;
  color: var(--danger);
  background: transparent;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.empty-storage {
  margin: 36px 0;
  color: var(--muted);
  text-align: center;
  font-weight: 750;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .task-row {
    grid-template-columns: minmax(200px, 1fr) minmax(250px, 1.35fr) auto;
  }

  .task-time {
    display: none;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding: 22px 0;
  }

  .topbar {
    align-items: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    position: static;
  }

  .admin-preview-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    width: min(100% - 22px, 680px);
    padding: 22px 0 36px;
  }

  .admin-header {
    align-items: flex-start;
  }

  .admin-header-status {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .task-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .task-time {
    display: block;
    order: -1;
  }

  .task-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar,
  .target-row,
  .history-item {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .limit-pill {
    width: max-content;
  }

  .primary-button {
    width: 100%;
  }

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

  .option-toggle-state {
    grid-column: 2;
    justify-self: start;
  }

  .history-item {
    display: grid;
  }

  .header-actions,
  .admin-header {
    width: 100%;
    justify-content: space-between;
  }

  .admin-header {
    display: grid;
  }

  .admin-header-status {
    justify-content: flex-start;
  }

  .live-indicator {
    width: 100%;
    margin-bottom: 3px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-summary {
    justify-content: flex-start;
  }

  .result-heading {
    align-items: flex-start;
  }
}
