/* Liliana's Wonderland large-file R2 uploader */
.upload-title-row { align-items: center; }
.upload-capability-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #cad8ff;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255,255,255,.88);
  font-size: .78rem;
  font-weight: 1000;
  white-space: nowrap;
}
.upload-capability-pill.is-ready { color: #076b4a; border-color: #9be5c6; background: #e9fff6; }
.upload-capability-pill.is-error { color: #9b1d43; border-color: #ffc0cf; background: #fff0f4; }

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
  gap: 20px;
  align-items: start;
}
.upload-form-card { min-width: 0; }
.upload-help-card { position: sticky; top: 170px; }
.upload-help-card ol { margin: 14px 0 22px; padding-left: 22px; line-height: 1.65; }
.upload-help-note {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #dfe8ff;
  border-radius: 16px;
  background: linear-gradient(145deg, #f8fbff, #eef6ff);
}
.upload-help-note strong { color: var(--blue-dark); }
.upload-help-note span { color: var(--muted); font-size: .86rem; line-height: 1.45; }

.upload-drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 238px;
  padding: 28px;
  overflow: hidden;
  text-align: center;
  border: 3px dashed #9bb8ff;
  border-radius: 27px;
  color: var(--blue-dark);
  background:
    radial-gradient(circle at 16% 14%, rgba(255,255,255,.92), transparent 20%),
    radial-gradient(circle at 82% 80%, rgba(255,188,224,.22), transparent 28%),
    linear-gradient(145deg, #f8fdff, #eaf3ff 58%, #f7edff);
  outline: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.upload-drop-zone::before,
.upload-drop-zone::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  filter: blur(4px);
  opacity: .34;
  pointer-events: none;
}
.upload-drop-zone::before { top: -45px; right: 8%; background: radial-gradient(circle, #fff, #93e9ff 48%, transparent 70%); }
.upload-drop-zone::after { bottom: -55px; left: 9%; background: radial-gradient(circle, #fff8c7, #ff99d0 45%, transparent 72%); }
.upload-drop-zone:hover,
.upload-drop-zone:focus-visible,
.upload-drop-zone.is-dragover {
  transform: translateY(-2px);
  border-color: var(--pink);
  box-shadow: 0 16px 34px rgba(18,56,182,.14), 0 0 0 5px rgba(255,92,172,.09);
}
.upload-cloud {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 78px;
  height: 58px;
  margin-bottom: 4px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--aqua), var(--blue), #7651e7);
  box-shadow: 0 12px 24px rgba(18,56,182,.23);
  font-size: 2.2rem;
  line-height: 1;
}
.upload-drop-zone strong { position: relative; z-index: 1; font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
.upload-drop-zone > span:not(.upload-cloud) { position: relative; z-index: 1; color: var(--blue); font-weight: 900; }
.upload-drop-zone small { position: relative; z-index: 1; max-width: 620px; color: var(--muted); line-height: 1.45; }

.selected-upload-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #cddcff;
  border-radius: 18px;
  background: #f7faff;
}
.selected-file-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), #7a4de5);
  box-shadow: 0 8px 18px rgba(120,63,197,.2);
}
.selected-upload-file strong,
.selected-upload-file span,
.selected-upload-file small { display: block; overflow-wrap: anywhere; }
.selected-upload-file span { margin-top: 3px; color: var(--muted); font-size: .84rem; }
.selected-upload-file small { margin-top: 4px; color: #9b5d00; }
.small-icon-action {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  background: #fff;
  font-size: 1.25rem;
}

.upload-form-grid { margin-top: 18px; }
.upload-form-grid label > small { display: block; margin-top: 7px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.poster-picker input { padding: 9px; }
.upload-switch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 17px; }
.upload-switch-grid label:last-child { grid-column: 1 / -1; border-color: #ffd4df; background: #fff9fb; }
.upload-submit-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.upload-primary-action { min-width: 220px; }
#upload-size-guidance { color: var(--muted); font-size: .82rem; }

.current-upload-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(86,122,232,.3);
  background:
    radial-gradient(circle at 92% 8%, rgba(255,255,255,.8), transparent 20%),
    linear-gradient(145deg, #fff, #eef6ff 60%, #fbf2ff);
}
.current-upload-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72,216,238,.2), rgba(123,84,222,.08) 50%, transparent 70%);
  pointer-events: none;
}
.current-upload-heading { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.current-upload-heading h2 { margin: 3px 0 5px; }
.current-upload-heading p { margin: 0; color: var(--muted); }
.upload-percent { color: var(--blue-dark); font-size: clamp(2rem, 5vw, 3.5rem); }
.upload-progress-track {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 20px;
  margin-top: 22px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #dfe8fa;
  box-shadow: inset 0 2px 7px rgba(24,53,130,.15), 0 5px 16px rgba(18,56,182,.09);
}
.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), #2b78ee 38%, #8555e7 68%, var(--pink));
  background-size: 200% 100%;
  transition: width .16s linear;
  animation: upload-shimmer 2.2s linear infinite;
}
@keyframes upload-shimmer { to { background-position: -200% 0; } }
.upload-progress-stats { position: relative; z-index: 1; display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: .84rem; }
.upload-progress-stats span:first-child { color: var(--blue-dark); font-weight: 900; }
.upload-control-row { position: relative; z-index: 1; display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }

.upload-history-list { display: grid; gap: 11px; margin-top: 16px; }
.upload-history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid #e0e8fb;
  border-radius: 17px;
  background: #fbfdff;
}
.upload-history-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--blue);
  background: #eaf2ff;
  font-weight: 1000;
}
.upload-history-copy { min-width: 0; }
.upload-history-copy strong,
.upload-history-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-history-copy small { margin-top: 4px; color: var(--muted); }
.upload-history-mini-progress { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #e5ebf8; }
.upload-history-mini-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--aqua), var(--blue), var(--pink)); }
.upload-history-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.upload-history-actions button { min-height: 38px; padding: 7px 12px; }
.upload-status-badge { display: inline-flex; width: fit-content; margin-top: 5px; padding: 4px 8px; border-radius: 999px; color: var(--blue); background: #eaf2ff; font-size: .7rem; font-weight: 1000; text-transform: uppercase; letter-spacing: .04em; }
.upload-status-badge.completed { color: #076b4a; background: #e1fff2; }
.upload-status-badge.failed,
.upload-status-badge.aborted { color: #9b1d43; background: #ffedf2; }
.upload-resume-file-input { display: none; }

@media (prefers-reduced-motion: reduce) {
  .upload-progress-track span { animation: none; }
  .upload-drop-zone { transition: none; }
}

@media (max-width: 1040px) {
  .upload-layout { grid-template-columns: 1fr; }
  .upload-help-card { position: static; }
}

@media (max-width: 760px) {
  .upload-title-row { align-items: stretch; }
  .upload-capability-pill { width: fit-content; max-width: 100%; white-space: normal; }
  .upload-drop-zone { min-height: 210px; padding: 22px 16px; }
  .upload-switch-grid { grid-template-columns: 1fr; }
  .upload-switch-grid label:last-child { grid-column: auto; }
  .upload-submit-row,
  .current-upload-heading { align-items: stretch; flex-direction: column; }
  .upload-primary-action { width: 100%; }
  .upload-percent { align-self: flex-start; }
  .upload-progress-stats { display: grid; gap: 4px; }
  .upload-control-row > button { flex: 1 1 180px; }
  .upload-history-item { grid-template-columns: auto minmax(0, 1fr); }
  .upload-history-actions { grid-column: 1 / -1; justify-content: stretch; }
  .upload-history-actions button { flex: 1 1 130px; }
}

/* Mobile rendition inputs — 1.9.9 */
.mobile-rendition-picker {
  padding: 0.9rem;
  border: 1px solid rgba(56, 132, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(230, 246, 255, 0.72), rgba(247, 252, 255, 0.92));
}

.mobile-rendition-picker > span small {
  color: #345db5;
  font-weight: 800;
}

.mobile-rendition-picker code {
  white-space: nowrap;
}
