/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f0f7f1;
  --surface: #ffffff;
  --surface-hover: #e3f2e5;
  --border: #b9dbbe;
  --text: #1b3a1f;
  --text-dim: #5f8a64;
  --accent: #4db251;
  --accent-hover: #3da041;
  --danger: #e74c3c;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ---- Header ---- */
header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Instructions block ---- */
.instructions {
  text-align: left;
  margin-bottom: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 24px;
}

#auth-section .instructions {
  padding-top: 0;
  padding-bottom: 0;
}

.instructions__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.instructions__header:hover .instructions__title {
  color: var(--accent);
}

.instructions__toggle-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.instructions--collapsed .instructions__toggle-icon {
  transform: rotate(-90deg);
}

.instructions__body {
  overflow: hidden;
  transition: opacity 0.2s ease;
  margin-top: 14px;
}

.instructions--collapsed .instructions__body {
  display: none;
}

.instructions__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  padding-top: 0;
  padding-bottom: 14px;
  transition: color 0.15s ease;
}

.instructions--collapsed .instructions__title {
  padding-bottom: 0;
}

.instructions__list {
  list-style: none;
  counter-reset: steps;
  margin: 0;
  padding: 0;
}

.instructions__list li {
  counter-increment: steps;
  position: relative;
  padding-left: 24px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}

.instructions__list li + li {
  margin-top: 12px;
}

.instructions__list li::before {
  content: counter(steps) ".";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--accent);
}

.instructions__video-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  white-space: nowrap;
}

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

.instructions__img {
  width: 100%;
  max-width: 300px;
  display: block;
  margin: 10px 0 0;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ---- Drop Zone ---- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(77, 178, 81, 0.08);
}

.drop-zone__content svg {
  color: var(--text-dim);
  margin-bottom: 16px;
}

.drop-zone__content p {
  font-size: 1rem;
}

.drop-zone .link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.drop-zone .hint {
  display: block;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ---- Progress ---- */
.progress-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 32px;
}

.progress-filename {
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 0.95rem;
  word-break: break-all;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.progress-status {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.progress-cancel-btn {
  margin-top: 20px;
}

/* ---- Results ---- */
.results-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
  min-width: 0;
}

.results-task-link {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

a.results-task-link[href] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.results-task-link[href]:hover {
  color: var(--accent-hover);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ---- Create Asana tasks ---- */
.create-tasks-wrap {
  margin-top: 28px;
}

.mute-all-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}

.mute-all-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.create-tasks-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.create-tasks-btn {
  min-width: 260px;
}

.create-tasks-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.create-tasks-status {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.create-tasks-status--ok {
  color: var(--accent);
  font-weight: 500;
}

.create-tasks-status--error {
  color: var(--danger);
}

.btn--danger-outline {
  background: rgba(231, 76, 60, 0.06);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn--danger-outline:hover {
  background: rgba(231, 76, 60, 0.08);
  border-color: var(--danger);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--outline:hover {
  background: var(--surface-hover);
}

.btn--sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.btn--accent {
  background: var(--accent);
  color: #fff;
}

.btn--accent:hover {
  background: var(--accent-hover);
}

/* ---- Table ---- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s, opacity 0.15s;
}

tbody tr[data-seg-id] {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--surface-hover);
}

tbody td {
  padding: 12px;
  vertical-align: middle;
}

.th-check,
.td-check {
  width: 40px;
  text-align: center;
}

#segments-table td:nth-child(2) {
  width: 48px;
  color: var(--text-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.td-actions {
  width: 48px;
  text-align: center;
}

/* ---- Dimmed rows (unchecked) ---- */
tbody tr.row-dimmed {
  opacity: 0.45;
}

tbody tr.row-dimmed:hover {
  opacity: 0.8;
}

/* ---- Details button ---- */
.btn-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, transform 0.2s;
}

.btn-details:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-details svg {
  transition: transform 0.2s;
}

.btn-details.open svg {
  transform: rotate(180deg);
}

/* ---- Detail row ---- */
.detail-row {
  background: var(--surface);
}

.detail-row:hover {
  background: var(--surface) !important;
}

.detail-row td {
  padding: 0 12px 16px;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
}

.detail-content p {
  margin: 0;
}

.detail-screenshot {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  background: #000;
  cursor: pointer;
  transition: opacity 0.15s;
}

.detail-screenshot:hover {
  opacity: 0.85;
}

.detail-content video {
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  background: #000;
}

/* ---- Detail editable fields ---- */
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-field__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-field__input,
.detail-field__textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.5;
}

.detail-field__input:focus,
.detail-field__textarea:focus {
  border-color: var(--accent);
}

.detail-field__textarea {
  resize: vertical;
  min-height: 60px;
}

/* ---- Task link in detail ---- */
.detail-task-link {
  margin: 0;
}

.detail-task-link a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  font-size: 0.85rem;
}

.detail-task-link a:hover {
  color: var(--accent-hover);
}

/* ---- Media block (screenshot / video) ---- */
.media-block {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: opacity 0.2s;
}

.media-block + .media-block {
  margin-top: 8px;
}

.media-block__header {
  margin-bottom: 8px;
}

.media-block__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.media-block__toggle input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.media-block--disabled .media-block__header {
  pointer-events: auto;
}

.media-block--disabled > :not(.media-block__header) {
  opacity: 0.3;
  pointer-events: none;
}

/* ---- Range Slider ---- */
.range-slider {
  margin-top: 8px;
  user-select: none;
  touch-action: none;
}

.range-slider__track-wrap {
  position: relative;
  height: 28px;
}

.range-slider__track {
  position: absolute;
  top: 11px;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  pointer-events: none;
}

.range-slider__fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  pointer-events: none;
}

.range-slider__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  z-index: 2;
}

.range-slider__input--end {
  z-index: 3;
}

.range-slider__input::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border: none;
}

.range-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
  margin-top: -7px;
}

.range-slider__input::-moz-range-track {
  height: 6px;
  background: transparent;
  border: none;
}

.range-slider__input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
}

.range-slider__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

/* ---- Screenshot slider ---- */
.screenshot-slider {
  margin-top: 8px;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.screenshot-slider__track-wrap {
  position: relative;
  height: 28px;
  flex: 1;
  min-width: 0;
}

.screenshot-slider__track {
  position: absolute;
  top: 11px;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  pointer-events: none;
}

.screenshot-slider__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  pointer-events: none;
}

.screenshot-slider__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  z-index: 2;
}

.screenshot-slider__input::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border: none;
}

.screenshot-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  margin-top: -7px;
}

.screenshot-slider__input::-moz-range-track {
  height: 6px;
  background: transparent;
  border: none;
}

.screenshot-slider__input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.screenshot-slider__time {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.detail-screenshot-video {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  background: #000;
}

/* ---- Audio toggle ---- */
.audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.audio-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.audio-toggle input[type="checkbox"]:disabled {
  cursor: wait;
}

.audio-toggle__status {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ---- Other section ---- */
.other-section {
  margin-top: 32px;
}

.other-section .section-title {
  color: var(--text-dim);
}

/* ---- Auth Screen ---- */
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 56px 40px;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

@media (min-width: 769px) {
  .auth-card {
    max-width: none;
    width: 100%;
  }
}

.auth-btn-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.auth-text {
  color: var(--text-dim);
  margin-bottom: 28px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.btn--lg {
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

/* ---- Tasks Screen ---- */
.tasks-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.tasks-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.task-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.task-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.task-card__name {
  font-weight: 500;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card__project {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.task-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 16px;
}

.task-card__due {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.task-card__badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.task-card__badge--yellow {
  color: #b8860b;
  background: rgba(218, 165, 32, 0.14);
}

.task-card__badge--green {
  color: var(--accent);
  background: rgba(77, 178, 81, 0.12);
}

.tasks-empty,
.tasks-loading {
  text-align: center;
  color: var(--text-dim);
  padding: 32px 0;
  font-size: 0.95rem;
}

.tasks-refresh-btn {
  display: block;
  margin: 16px auto 0;
}

/* ---- Custom task input ---- */
.custom-task-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.custom-task-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.custom-task-input-row {
  display: flex;
  gap: 8px;
}

.custom-task-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}

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

.custom-task-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.custom-task-error {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--danger);
}

/* ---- Upload Toolbar ---- */
.upload-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
  min-width: 0;
}

#back-btn,
#results-back-btn {
  white-space: nowrap;
  flex-shrink: 0;
  min-width: min-content;
}

.selected-task-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  min-width: 0;
}

a.selected-task-name[href] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.selected-task-name[href]:hover {
  color: var(--accent-hover);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal__text {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 24px;
}

.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn--danger {
  background: var(--danger);
  color: #fff;
  border: none;
}

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

/* ---- Build links ---- */
.build-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.build-link-line {
  line-height: 1.5;
}

.build-link__label {
  font-weight: 500;
  color: var(--text);
}

.build-link__url {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.build-link__url:hover {
  color: var(--accent-hover);
}

.build-link__status {
  color: var(--text-dim);
  font-style: italic;
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

/* ---- Completion Screen ---- */
.completion-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  animation: completion-fade-in 0.4s ease;
}

.completion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 460px;
  width: calc(100% - 32px);
  padding: 48px 32px;
}

.completion-check {
  width: 80px;
  height: 80px;
  margin-bottom: 28px;
}

.completion-check__svg {
  width: 80px;
  height: 80px;
}

.completion-check__circle {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: completion-circle 0.6s ease forwards 0.1s;
}

.completion-check__tick {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: completion-tick 0.4s ease forwards 0.65s;
}

@keyframes completion-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes completion-tick {
  to { stroke-dashoffset: 0; }
}

@keyframes completion-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.completion-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  animation: completion-slide-up 0.5s ease forwards 0.3s;
  opacity: 0;
}

.completion-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 32px;
  font-size: 0.95rem;
  color: var(--text-dim);
  animation: completion-slide-up 0.5s ease forwards 0.45s;
  opacity: 0;
}

.completion-stats__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.completion-stats__value {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.completion-task-link,
.completion-back-btn {
  min-width: 260px;
  justify-content: center;
  padding: 14px 32px;
  font-size: 1rem;
  opacity: 0;
}

.completion-task-link {
  margin-bottom: 12px;
  animation: completion-slide-up 0.5s ease forwards 0.6s;
}

.completion-back-btn {
  animation: completion-slide-up 0.5s ease forwards 0.7s;
}

@keyframes completion-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Mobile (no extra vertical scroll on iOS) ---- */
@media (max-width: 768px) {
  .container {
    padding: max(16px, var(--safe-top)) max(16px, var(--safe-left)) max(16px, var(--safe-bottom)) max(16px, var(--safe-right));
  }

  header {
    margin-bottom: 24px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .instructions__img {
    max-width: 260px;
  }

  .drop-zone {
    padding: 32px 16px;
  }

  .auth-card {
    padding: 32px 20px;
  }

  .tasks-toolbar {
    margin-bottom: 16px;
  }

  .tasks-title {
    margin-bottom: 12px;
  }

  .upload-toolbar {
    margin-bottom: 16px;
  }

  .results-header {
    margin-bottom: 16px;
  }

  .detail-content video {
    max-height: 240px;
  }

  .create-tasks-actions {
    flex-direction: column;
  }

  .create-tasks-btn,
  .reset-task-btn {
    width: 100%;
    justify-content: center;
  }
}
