/* Five-step navigation and the model-assignment board. */
.flow-steps { width: min(100%, 960px); }
.model-selection-hint { color: var(--color-muted); font-size: 11px; }
.model-choice.is-selected .model-choice-number { color: var(--color-primary); font-size: 15px; }
.model-choice .model-choice-number { display: block; }
.assignment-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 24px; align-items: start; margin-top: 24px; }
.assignment-content { min-width: 0; border: var(--border-subtle); border-radius: var(--radius-card); background: var(--color-surface); overflow: clip; }
.assignment-selection { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin-bottom: 0; border: 0; border-top: var(--border-subtle); border-radius: 0; background: var(--color-surface-soft); }
.assignment-selection select:disabled, .assignment-selection .text-button:disabled { opacity: .45; cursor: default; }
.assignment-selection-summary, .assignment-selection-actions { display: flex; align-items: center; gap: 14px; }
.assignment-selection-summary strong { font-size: 12px; color: var(--color-navy); }
.assignment-selection-summary button { font-size: 11px; }
.assignment-selection-actions select { width: 220px; min-width: 220px; flex: 0 0 220px; height: 38px; padding: 0 12px; border: var(--border-subtle); border-radius: var(--radius-control); background: var(--color-surface-soft); color: var(--color-navy); font: inherit; font-size: 12px; white-space: nowrap; }
.assignment-selection-actions .flow-button { min-height: 38px; padding: 8px 18px; font-size: 12px; }
.assignment-library { padding: 20px; border: var(--border-subtle); border-radius: var(--radius-card); background: var(--color-surface); }
.assignment-library h2 { font-size: 16px; }
.assignment-library > p { font-size: 11px; line-height: 1.6; color: var(--color-muted); margin: 8px 0 16px; white-space: nowrap; }
.assignment-models { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; }
.assignment-model { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 8px; align-items: center; min-width: 0; padding: 8px; border: var(--border-subtle); border-radius: var(--radius-control); background: var(--color-surface); color: var(--color-navy); font: inherit; text-align: left; cursor: pointer; transition: background var(--duration-fast),border-color var(--duration-fast); }
.assignment-model strong { grid-column: 2; grid-row: 1; font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.assignment-model .model-sample { width: 28px; height: 28px; font-size: 15px; }
.assignment-model .group-count { grid-column: 3; grid-row: 1; min-width: 20px; height: 20px; font-size: 10px; padding: 0 4px; }
.assignment-model[data-group="all"] { grid-column: 1/-1; }
.assignment-model[data-group="all"] strong { grid-column: 1 / 3; grid-row: 1; }
.assignment-models.is-dense { grid-template-columns: repeat(2,minmax(0,1fr)); }
.assignment-models.is-dense .assignment-model { grid-template-columns: minmax(0,1fr) auto; gap: 5px; }
.assignment-models.is-dense .model-sample { display: none; }
.assignment-models.is-dense .assignment-model strong { grid-column: 1; font-size: 11px; }
.assignment-models.is-dense .group-count { grid-column: 2; }
.assignment-model:hover { background: #fafbfe; }
.assignment-model[aria-pressed="true"] { border-color: var(--color-primary); background: #f8faff; }
.assignment-model.is-drop-target { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 9%, var(--color-surface)); }
.assignment-library .assignment-tip { margin-bottom: 0; font-size: 10px; }
.model-groups { min-width: 0; }
.model-group { min-width: 0; border: 0; border-radius: 0; background: var(--color-surface); transition: border-color var(--duration-fast), background var(--duration-fast); }
.model-group[hidden] { display: none; }
.group-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 24px; align-content: center; align-items: center; padding: 20px; border-bottom: var(--border-subtle); }
.group-heading > :not(.group-preview) { grid-column: 1; }
.group-heading > .text-button { justify-self: start; }
.group-preview { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 12px; width: 190px; padding: 8px; border: var(--border-subtle); border-radius: var(--radius-control); background: var(--color-surface-soft); color: var(--color-navy); text-align: left; cursor: pointer; transition: border-color var(--duration-fast); }
.group-preview:hover { border-color: var(--color-primary); }
.group-preview-poster { position: relative; display: block; flex: none; width: 44px; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 6px; background: var(--color-navy); }
.group-preview-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.group-preview-poster .edit-caption { left: 2px; right: 2px; bottom: 8px; line-height: 5px; }
.group-preview-poster .edit-caption strong { font-size: 7px; padding: 2px; border-radius: 2px; line-height: 1.4; }
.group-preview-copy { display: grid; gap: 5px; }
.group-preview-copy strong { font-size: 11px; font-weight: 600; }
.group-preview-copy small { color: var(--color-muted); font-size: 9px; line-height: 1.4; }
.group-preview { position: relative; }
.group-preview-play { position: absolute; left: 17px; top: calc(50% - 13px); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #ffffffdf; color: var(--color-navy); font-size: 10px; }
.group-heading .group-preview-tip { display: flex; align-items: center; min-height: 80px; margin: 14px 0 0; max-width: 210px; font-size: 11px; }
.group-model-media { position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--radius-card); background: var(--color-navy); }
.group-model-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Template preview has its own composition, independent of the original moment dialog. */
html:has(#group-model-dialog[open]) { overflow: hidden; }
.group-model-dialog { --model-preview-width: clamp(220px, calc((100dvh - 160px) * .5625), 300px); width: min(900px, calc(100% - 40px)); padding: 32px; }
.group-model-dialog > .detail-close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 36px; font: inherit; font-size: 22px; }
.group-model-dialog > .detail-close:hover { background: var(--color-surface-soft); color: var(--color-navy); }
.group-model-layout { display: grid; grid-template-columns: var(--model-preview-width) minmax(0, 1fr); gap: 36px; align-items: stretch; }
.group-model-figure { margin: 0; min-width: 0; }
.group-model-media { border-radius: 16px; }
.group-model-figure figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--color-muted); font-size: var(--type-label); line-height: 16px; }
.group-model-info { display: flex; flex-direction: column; min-width: 0; padding-top: 16px; padding-bottom: 28px; }
.group-model-intro { padding-right: 24px; }
.group-model-intro .flow-eyebrow { color: var(--color-primary); font-size: var(--type-label); }
.group-model-intro h2 { margin: 12px 0; font-size: var(--type-30); font-weight: 650; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
#group-model-title:focus { outline: none; }
#group-model-description { margin: 0; color: var(--color-muted); font-size: var(--type-14); line-height: 1.6; }
.group-model-style { margin-block: 28px; padding-block: 24px; border-block: var(--border-subtle); }
.group-model-style h3 { margin: 0 0 20px; font-size: var(--type-13); font-weight: 600; }
.group-model-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; margin: 0; }
.group-model-facts dt { margin-bottom: 6px; color: var(--color-muted); font-size: var(--type-12); }
.group-model-facts dd { margin: 0; font-size: var(--type-14); font-weight: 500; line-height: 1.4; }
.group-model-palette { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.group-model-palette > span { display: inline-flex; align-items: center; gap: 7px; color: var(--color-muted); font-size: var(--type-label); }
.group-model-palette > [hidden] { display: none; }
.group-model-palette i { display: block; width: 18px; height: 18px; border: var(--border-subtle); border-radius: 50%; }
.group-model-actions { margin-top: auto; }
.group-model-actions > p { margin: 0 0 16px; color: var(--color-muted); font-size: var(--type-12); line-height: 1.6; max-width: 40ch; }
.group-model-actions .flow-button { display: flex; width: 100%; justify-content: space-between; min-height: 46px; padding-inline: 20px; }
.group-model-actions #group-model-error { margin: 12px 0 0; color: var(--color-error); }
@media (max-width: 700px) {
  .group-model-dialog { width: min(480px, calc(100% - 24px)); padding: 48px 24px 24px; max-height: calc(100dvh - 24px); }
  .group-model-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .group-model-figure { width: min(230px, 100%); margin-inline: auto; }
  .group-model-info { padding: 0; }
  .group-model-intro { padding: 0; }
  .group-model-intro h2 { font-size: var(--type-24); }
  .group-model-style { margin-block: 20px; padding-block: 20px; }
}
.group-heading h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.group-heading .group-count { background: var(--color-surface-soft); }
.group-count { display: grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-muted); font-size: 11px; }
.group-heading p { margin: 0; font-size: 11px; line-height: 1.6; color: var(--color-muted); }
.group-clips { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 16px; }
.group-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: var(--border-subtle); font-size: 11px; color: var(--color-muted); }
.group-pagination button:disabled { opacity: .4; cursor: default; }
.group-clip { position: relative; display: flex; flex: none; gap: 12px; align-items: center; padding: 12px; border: var(--border-subtle); border-radius: var(--radius-control); background: var(--color-surface); cursor: pointer; transition: border-color var(--duration-fast), background var(--duration-fast); }
.group-clip:hover { background: var(--color-surface-soft); }
.group-clip.is-marked { border-color: var(--color-primary); background: var(--color-surface-soft); }
.group-clip.is-dragging { border-color: var(--color-primary); background: #f0f5ff; opacity: 1; transition: none; cursor: grabbing; }
.group-check { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: none; cursor: pointer; }
.group-check input { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); }
.group-check img { width: 44px; height: 78px; object-fit: cover; border-radius: 5px; }
.group-clip-copy { display: grid; gap: 6px; min-width: 0; flex: 1; }
.group-clip-copy small { padding-right: 22px; color: var(--color-muted); font-size: 9px; letter-spacing: .04em; }
.group-clip-copy strong { font-size: 11px; line-height: 1.4; font-weight: 550; overflow-wrap: anywhere; }
.group-assigned-model { justify-self: start; max-width: 100%; padding: 3px 7px; border-radius: var(--radius-sm); background: var(--color-surface-soft); color: var(--color-muted); font-size: var(--type-label); line-height: 1.4; overflow-wrap: anywhere; }
.assignment-feedback { margin: 0; padding: 10px 16px; color: var(--color-muted); font-size: var(--type-label); line-height: 1.6; }
.group-empty { grid-column: 1/-1; padding: 36px 24px; text-align: center; color: var(--color-muted); font-size: 12px; line-height: 1.7; }
#aplicar-modelos .flow-actionbar div > span { display: block; }
#assignment-status { max-width: 430px; line-height: 1.5; }
.group-heading button:disabled { opacity: .45; cursor: default; }
@media(max-width:1250px){.assignment-layout{grid-template-columns:220px minmax(0,1fr);gap:16px}.assignment-library{padding:14px}.group-clips{grid-template-columns:repeat(2,minmax(0,1fr))}.group-heading{grid-template-columns:minmax(0,1fr) 180px}}
@media(max-width:800px){.assignment-layout{grid-template-columns:1fr}.assignment-models{grid-template-columns:repeat(4,minmax(0,1fr))}.assignment-model[data-group="all"]{grid-column:span 2}.assignment-library{padding:16px}}
@media (max-width: 900px) {
  .flow-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
  .flow-steps button { flex-direction: column; gap: 8px; min-width: 0; }
  .flow-steps strong { font-size: 10px; line-height: 1.4; }
  .step-connector { display: none; }
}
@media (max-width: 600px) {
  .assignment-selection { flex-direction: column; align-items: stretch; padding: 12px; gap: 12px; }
  .assignment-selection-summary { justify-content: space-between; }
  .assignment-selection-actions select { flex: 1; width: 0; }
  .assignment-models{grid-template-columns:repeat(2,minmax(0,1fr))}
  .assignment-model[data-group="all"]{grid-column:1/-1}
  .group-clips{grid-template-columns:1fr}
  .group-heading{grid-template-columns:1fr;padding:16px}
  .group-preview{grid-column:1;grid-row:auto}
  #aplicar-modelos .flow-actionbar { flex-wrap: wrap; }
  #aplicar-modelos .flow-actionbar .flow-button { width: 100%; }
  .model-selection-hint { font-size: 10px; }
}
@media (max-width: 440px) { .flow-steps { gap: 5px; } .flow-steps strong { font-size: 9px; } }

.assignment-feedback:empty { display: none; }

.assignment-clone-panel:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-top: var(--border-subtle); animation: clone-panel-enter .2s ease-out; }
.assignment-clone-panel strong { font-size: 12px; color: var(--color-navy); }
.assignment-clone-panel p { margin: 6px 0 0; font-size: 11px; color: var(--color-muted); }
.assignment-clone-panel .assignment-selection-actions { flex-wrap: wrap; }
.assignment-clone-panel #assignment-clone-cancel,
.assignment-clone-panel #assignment-move-cancel,
.assignment-drop-dialog #assignment-drop-cancel { margin-left: 8px; }
.assignment-drop-dialog { width: min(480px, calc(100vw - 32px)); max-width: none; padding: 24px; border: var(--border-subtle); border-radius: var(--radius-card); background: var(--color-surface); color: var(--color-navy); box-shadow: 0 24px 80px #14274733; }
.assignment-drop-dialog::backdrop { background: #14274766; backdrop-filter: blur(2px); }
.assignment-drop-dialog h2 { margin: 0; font-size: 18px; }
.assignment-drop-dialog p { margin: 10px 0 22px; color: var(--color-muted); font-size: 12px; line-height: 1.6; }
.assignment-drop-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.assignment-drag-preview { position: fixed; top: 0; left: -10000px; z-index: 2147483647; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px; border: 1px solid var(--color-primary); border-radius: 12px; background: var(--color-navy); box-shadow: 0 14px 34px #14274766; opacity: 1; pointer-events: none; }
.assignment-drag-preview-thumbnails { display: flex; flex: none; align-items: center; gap: 4px; }
.assignment-drag-preview-thumbnails img { width: 34px; height: 52px; border: 1px solid #ffffffaa; border-radius: 6px; object-fit: cover; box-shadow: 0 2px 6px #0005; }
.assignment-drag-preview-copy { display: grid; min-width: 0; gap: 4px; }
.assignment-drag-preview-copy strong { color: #fff; font-size: 13px; white-space: nowrap; }
.assignment-drag-preview-copy small { color: #cbd7ec; font-size: 10px; white-space: nowrap; }
.assignment-drag-preview-more { display: grid; width: 34px; height: 52px; flex: none; place-items: center; border: 1px solid #ffffffaa; border-radius: 6px; background: var(--color-primary); color: #fff; font-size: 11px; font-weight: 700; }

#aplicar-modelos .assignment-checkout { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 24px; }
#clip-workflow #aplicar-modelos .assignment-checkout { position: sticky; bottom: 16px; z-index: 20; background: var(--color-surface); }
.assignment-checkout-progress { min-width: 0; }
#aplicar-modelos .assignment-checkout-cost { padding-left: 24px; border-left: var(--border-subtle); gap: 4px; }
#aplicar-modelos .assignment-checkout-cost > span { font-size: 11px; }
#aplicar-modelos .assignment-checkout-cost > strong { color: var(--color-navy); font-size: 22px; font-weight: 650; letter-spacing: -.035em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.assignment-checkout-cost > small { color: var(--color-muted); font-size: 11px; white-space: nowrap; }
@media(max-width:640px) {
  #aplicar-modelos .assignment-checkout { grid-template-columns: minmax(0,1fr) auto; gap: 16px; }
  .assignment-checkout-progress { grid-column: 1/-1; padding-bottom: 12px; border-bottom: var(--border-subtle); }
  #aplicar-modelos .assignment-checkout-cost { padding-left: 0; border-left: 0; }
  #aplicar-modelos .assignment-checkout .flow-button { width: auto; }
}
@media(max-width:440px) {
  .assignment-models, .assignment-models.is-dense { grid-template-columns: minmax(0,1fr); }
  #aplicar-modelos .assignment-checkout { grid-template-columns: minmax(0,1fr); gap: 12px; }
  #aplicar-modelos .assignment-checkout-cost { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .assignment-checkout-cost > strong { grid-column: 2; grid-row: 1/3; }
  .assignment-checkout-cost > small { grid-column: 1; }
  #aplicar-modelos .assignment-checkout .flow-button { width: 100%; }
}
@keyframes clone-panel-enter { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .assignment-clone-panel:not([hidden]) { animation: none; } }
