.prototype-flow {
  width: min(48rem, calc(100vw - 2rem));
  max-width: none;
  max-height: min(88vh, 52rem);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.45rem;
  background: rgba(43, 45, 49, 0.9);
  color: var(--color-text);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.prototype-flow--wide {
  width: min(70rem, calc(100vw - 2rem));
}

.prototype-flow::backdrop {
  background: rgba(7, 8, 10, 0.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.prototype-flow--nested[open] {
  position: fixed;
  inset: 0;
  z-index: 200;
  margin: auto;
  box-shadow: 0 0 0 100vmax rgba(7, 8, 10, 0.68), 0 2rem 6rem rgba(0, 0, 0, 0.7);
}

.prototype-flow__panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(88vh, 52rem);
  margin: 0;
}

.prototype-flow__header,
.prototype-flow__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.035);
}

.prototype-flow__header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.prototype-flow__footer {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.prototype-flow__footer[hidden] {
  display: none;
}

.prototype-flow__header h2,
.prototype-flow__header p {
  margin: 0;
}

.prototype-flow__header h2 {
  margin-top: 0.15rem;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 500;
}

.prototype-flow__header #prototype-flow-lede {
  margin-top: 0.3rem;
  color: #c5c9ce;
  font-family: var(--font-copy);
  font-size: 0.82rem;
  line-height: 1.45;
}

.prototype-flow__eyebrow {
  color: #9fc1e8;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prototype-flow__close {
  flex: 0 0 auto;
  color: white;
  font-size: 1.45rem;
  line-height: 1;
}

.prototype-flow__body {
  min-height: 0;
  overflow: auto;
  padding: 1.15rem;
  overscroll-behavior: contain;
}

.prototype-flow__body > :first-child {
  margin-top: 0;
}

.prototype-flow__body > :last-child {
  margin-bottom: 0;
}

.flow-grid {
  display: grid;
  gap: 0.75rem;
}

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

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

.flow-field {
  display: grid;
  gap: 0.28rem;
  margin-bottom: 0.75rem;
}

.flow-field > span,
.flow-choice legend {
  color: #d7d9dc;
  font-size: 0.7rem;
}

.flow-field .input,
.flow-field .select {
  width: 100%;
  min-height: 2.5rem;
}

.flow-field textarea.input {
  resize: vertical;
  line-height: 1.4;
}

.flow-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.7rem 0;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.flow-check input {
  margin-top: 0.15rem;
  accent-color: var(--color-accent);
}

.flow-check span,
.flow-check small {
  display: block;
}

.flow-check small {
  margin-top: 0.2rem;
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
  line-height: 1.4;
}

.flow-callout {
  margin: 0.8rem 0;
  padding: 0.7rem 0.8rem;
  border-left: 3px solid #759dcc;
  background: rgba(86, 120, 160, 0.12);
}

.flow-callout--warning {
  border-left-color: #d49a50;
  background: rgba(166, 107, 43, 0.13);
}

.flow-callout--success {
  border-left-color: #69a97d;
  background: rgba(53, 121, 78, 0.13);
}

.flow-callout p {
  margin: 0.22rem 0 0;
  color: #d1d4d8;
  font-family: var(--font-copy);
  font-size: 0.8rem;
  line-height: 1.45;
}

.flow-proposal {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(159, 193, 232, 0.24);
  color: #a9c8eb;
  font-size: 0.7rem;
}

.flow-proposal strong {
  padding: 0.16rem 0.35rem;
  border: 1px solid rgba(159, 193, 232, 0.46);
  color: #d8e9fb;
  font-weight: 500;
  text-transform: uppercase;
}

.flow-proposal span {
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
}

.flow-subheading {
  margin: 1.15rem 0 0.5rem;
  color: #f0f2f4;
  font-size: 0.82rem;
  font-weight: 500;
}

.flow-value--absent {
  color: #aeb4bc;
  font-style: italic;
}

.flow-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.66rem;
  line-height: 1;
  white-space: nowrap;
}

.flow-status--matched {
  color: #8fd3a6;
  background: rgba(67, 137, 90, 0.15);
}

.flow-status--review {
  color: #f0b668;
  background: rgba(184, 118, 36, 0.14);
}

.flow-status--absent {
  color: #b7bec7;
  background: rgba(126, 134, 145, 0.13);
}

.flow-status--invalid {
  color: #ec9b9b;
  background: rgba(165, 67, 67, 0.15);
}

.flow-summary {
  display: grid;
  gap: 0;
  margin: 0.8rem 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.flow-summary div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.42fr) 1fr;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.flow-summary div:last-child {
  border-bottom: 0;
}

.flow-summary dt {
  color: var(--color-text-secondary);
}

.flow-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.flow-summary--compact div {
  grid-template-columns: minmax(6rem, 0.42fr) 1fr;
}

.flow-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.flow-metrics article {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.flow-metrics strong {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 400;
}

.flow-metrics span {
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
  font-size: 0.7rem;
}

.flow-table-wrap {
  width: 100%;
  margin: 0.75rem 0;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.flow-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  color: #eef0f2;
  font-family: var(--font-copy);
  font-size: 0.72rem;
}

.flow-table th,
.flow-table td {
  padding: 0.58rem 0.65rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.flow-table th {
  position: sticky;
  top: 0;
  background: #35383d;
  color: #d9dde1;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 500;
}

.flow-table tr:last-child td {
  border-bottom: 0;
}

.flow-table th:last-child,
.flow-table td:last-child {
  border-right: 0;
}

.flow-table--export {
  min-width: 60rem;
}

.flow-file small {
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
  font-size: 0.7rem;
}

.flow-file input[type="file"] {
  height: auto;
  padding: 0.55rem;
}

.flow-separated-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(212, 154, 80, 0.38);
  background: rgba(166, 107, 43, 0.09);
}

.flow-separated-action p {
  margin: 0.18rem 0 0;
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
  font-size: 0.75rem;
}

.flow-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0;
}

.flow-actions--wrap {
  flex-wrap: wrap;
}

.flow-action-list {
  display: grid;
  gap: 0.4rem;
}

.flow-action-list .button {
  justify-content: flex-start;
  width: 100%;
}

.flow-button--danger {
  min-height: 2.35rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(207, 105, 105, 0.68);
  border-radius: 0.25rem;
  background: rgba(121, 49, 49, 0.4);
  color: #fff;
  font: inherit;
}

.flow-details {
  margin: 0.8rem 0;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.flow-details summary {
  width: max-content;
  cursor: pointer;
  color: #d8e5f5;
  font-size: 0.78rem;
}

.flow-member-list,
.flow-download-list,
.flow-notification-list,
.flow-thread {
  display: grid;
  gap: 0.55rem;
}

.flow-member-list article,
.flow-download-list article,
.flow-notification-list article,
.flow-thread article {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.flow-member-list article > span,
.flow-download-list article > div,
.flow-notification-list article > div {
  min-width: 0;
  flex: 1 1 auto;
}

.flow-member-list article > span,
.flow-download-list span,
.flow-notification-list p,
.flow-thread p {
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
  font-size: 0.78rem;
  line-height: 1.4;
}

.flow-download-list strong,
.flow-download-list span {
  display: block;
}

.flow-download-list progress {
  width: 100%;
  margin-top: 0.4rem;
  accent-color: var(--color-accent);
}

.flow-notification-list p,
.flow-thread p {
  margin: 0.2rem 0 0;
}

.flow-thread article {
  display: block;
}

.flow-thread header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.72rem;
}

.flow-thread article > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.flow-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #727981;
}

.flow-dot--new {
  background: #78a9de;
  box-shadow: 0 0 0 3px rgba(120, 169, 222, 0.18);
}

.flow-choice {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0;
  padding: 0;
  border: 0;
}

.flow-choice label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.flow-choice input {
  margin-top: 0.15rem;
  accent-color: var(--color-accent);
}

.flow-choice span,
.flow-choice small {
  display: block;
}

.flow-choice small {
  margin-top: 0.2rem;
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
}

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

.flow-choice--candidates legend {
  grid-column: 1 / -1;
}

.flow-candidate em {
  display: block;
  margin-top: 0.35rem;
  color: #c7d8ea;
  font-family: var(--font-copy);
  font-size: 0.7rem;
  font-style: normal;
}

.flow-compatibility {
  margin: 0.9rem 0;
  padding: 0.8rem;
  border: 1px solid rgba(113, 160, 211, 0.48);
  background: rgba(66, 104, 148, 0.12);
}

.flow-compatibility > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.flow-compatibility > header > div {
  display: grid;
  gap: 0.2rem;
}

.flow-compatibility > header span {
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
  font-size: 0.73rem;
}

.flow-compatibility details {
  position: relative;
}

.flow-compatibility summary {
  display: grid;
  width: 1.65rem;
  min-height: 1.65rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  list-style: none;
}

.flow-compatibility summary::-webkit-details-marker {
  display: none;
}

.flow-help {
  width: min(36rem, calc(100vw - 4rem));
  margin-top: 0.55rem;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #2a2d31;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.34);
}

.flow-help p {
  margin: 0 0 0.55rem;
  color: #d5d9de;
  font-family: var(--font-copy);
  font-size: 0.75rem;
  line-height: 1.45;
}

.flow-help article {
  display: grid;
  gap: 0.2rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.flow-help article span {
  font-size: 0.68rem;
}

.flow-help code {
  overflow-wrap: anywhere;
  color: #ebeff4;
  font-size: 0.7rem;
}

.flow-dot--warning {
  background: #d9a052;
  box-shadow: 0 0 0 3px rgba(217, 160, 82, 0.18);
}

.flow-notification--ale {
  border-color: rgba(217, 160, 82, 0.35) !important;
  background: rgba(156, 100, 37, 0.09) !important;
}

.flow-notification--ale .flow-actions {
  margin-bottom: 0;
}

.flow-consequences {
  color: #d1d4d8;
  font-family: var(--font-copy);
  font-size: 0.82rem;
  line-height: 1.5;
}

.flow-account-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.flow-account-avatar {
  display: grid;
  width: 5.5rem;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(117, 157, 204, 0.48), rgba(42, 47, 54, 0.88));
  color: #fff;
  font-size: 1.4rem;
}

.flow-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flow-account-avatar img[hidden],
.flow-account-avatar span[hidden] {
  display: none;
}

.flow-account-photo {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

.flow-account-photo > span,
.flow-account-password > p,
.flow-empty-state {
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
  font-size: 0.76rem;
  line-height: 1.45;
}

.flow-account-photo .flow-actions {
  margin-block: 0.4rem 0;
}

.flow-file-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.flow-file-button input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.flow-file-button:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.flow-account-password > p {
  margin: 0.55rem 0 0.8rem;
}

.flow-thread--day {
  margin-bottom: 1rem;
}

.flow-empty-state {
  margin: 0;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.pending-invitation {
  display: flex;
  width: min(calc(100% - 4.25rem), 48rem);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 4.25rem 1rem 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(121, 157, 202, 0.4);
  border-radius: 0.25rem;
  background: rgba(71, 101, 138, 0.12);
  color: white;
  font: inherit;
  text-align: left;
}

.pending-invitation > span,
.pending-invitation > span > span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pending-invitation > span:first-child {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
}

.pending-invitation > span:first-child > span {
  color: var(--color-text-secondary);
  font-family: var(--font-copy);
  font-size: 0.76rem;
}

.compare-compatibility {
  flex: 1 1 100%;
  margin: 0;
  padding: 0.3rem 0.45rem;
  color: #ffd6a0;
  font-family: var(--font-copy);
  font-size: 0.72rem;
  text-align: center;
}

#upload-dialog .dialog__body {
  color: #202226;
}

#upload-dialog .message--warning {
  border-color: rgba(164, 112, 38, 0.5);
  border-left-color: #a96e24;
  background: rgba(255, 242, 209, 0.84);
  color: #49391f;
}

#upload-dialog .upload-dropzone {
  border-color: rgba(32, 34, 38, 0.34);
}

#upload-dialog .upload-dropzone p,
#upload-dialog .upload-review-cases,
#upload-dialog .field__hint {
  color: #575d65;
}

#upload-dialog .upload-row {
  border-color: rgba(255, 255, 255, 0.17);
  background: rgba(31, 33, 37, 0.96);
  color: #f3f5f7;
}

#upload-dialog .upload-row__name {
  color: #f8f9fa;
}

#upload-dialog .upload-row__meta,
#upload-dialog .upload-row__details {
  color: #c5cbd2;
}

#upload-dialog .upload-row .button--secondary,
#upload-dialog .upload-row .button--quiet {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
  color: #f3f5f7;
}

#upload-dialog .upload-row__fields .input,
#upload-dialog .upload-row__fields .select {
  border-color: rgba(255, 255, 255, 0.25);
  background: #f5f6f7;
  color: #202226;
}

#upload-dialog .upload-review-cases {
  border-color: rgba(32, 34, 38, 0.16);
}

#upload-dialog .upload-review-cases summary {
  color: #202226;
}

.compare-split.is-horizontal .compare-split__overlay {
  inset: 0 0 auto;
  width: 100%;
  height: var(--split);
  clip-path: none;
}

.compare-split.is-horizontal .compare-split__divider {
  inset: var(--split) 0 auto;
  width: 100%;
  height: 2px;
  transform: translateY(-1px);
}

.compare-split.is-horizontal .compare-split__range {
  width: min(70vh, 36rem);
  transform: translate(-50%, -50%) rotate(90deg);
}

@media (max-width: 46rem) {
  .prototype-flow {
    width: 100vw;
    max-height: 100dvh;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .prototype-flow__panel {
    max-height: 100dvh;
  }

  .prototype-flow__header,
  .prototype-flow__footer,
  .prototype-flow__body {
    padding-inline: 0.8rem;
  }

  .flow-grid--2,
  .flow-grid--3 {
    grid-template-columns: 1fr;
  }

  .flow-summary--compact,
  .flow-metrics,
  .flow-choice--candidates {
    grid-template-columns: 1fr;
  }

  .flow-proposal,
  .flow-separated-action,
  .flow-compatibility > header {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-separated-action .button {
    width: 100%;
  }

  .flow-help {
    width: calc(100vw - 3.2rem);
  }

  .flow-member-list article,
  .flow-download-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-account-profile {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .flow-account-photo {
    justify-items: center;
  }

  .flow-summary div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .pending-invitation {
    width: calc(100% - 3.6rem);
    align-items: flex-start;
    flex-direction: column;
    margin-right: 3.6rem;
  }

  /* Le timecode source reste une information fonctionnelle au format mobile. */
  .player-controls__row .timecode {
    display: block;
    flex: 1 1 100%;
    order: 12;
    margin-left: 0;
    font-size: 0.72rem;
    text-align: center;
  }
}

@media (pointer: coarse) {
  .prototype-flow .button,
  .prototype-flow button,
  .prototype-flow summary {
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prototype-flow,
  .prototype-flow::backdrop {
    scroll-behavior: auto;
  }
}
