:root {
  --export-accent: #94492f;
  --export-accent-dark: #793922;
  --export-tone: #fbf4ee;
  --export-border: #eadbd0;
  --export-surface: #f6f2ed;
  --export-muted: #6e625a;
}

.export-modes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: var(--export-surface); border-radius: 11px; }
#export-dialog .export-modes { padding: 4px; }
.export-modes label { position: relative; display: grid; place-items: center; min-height: 34px; font-size: 13px; font-weight: 640; cursor: pointer; border-radius: 8px; }
.export-modes label:has(:checked) { background: #fff; color: var(--export-accent-dark); box-shadow: 0 1px 4px #45221917; }
#export-dialog .export-video-options { gap: 16px; grid-template-columns: minmax(0, 1fr); }
.export-video-options legend { font-size: 13px; font-weight: 660; padding: 0; margin-bottom: 7px; }
.export-motion { display: grid; gap: 7px; }
#export-dialog .export-motion label { grid-template-columns: auto minmax(0,1fr) auto; }
.export-motion-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #f2e7de; color: var(--export-accent-dark); }
.export-motion-icon svg, .export-toast svg, .export-playback button svg { width: 18px; height: 18px; }
.export-ratios { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export-ratios i { width: 17px; height: 17px; border: 1.5px solid var(--export-accent); border-radius: 3px; margin: 0 3px; }
.export-ratios label:has([value="portrait"]) i { width: 13px; height: 21px; margin-inline: 5px; }
.document-actions .export-tasks-link { padding: 6px 2px; font-size: 12px; font-weight: 620; white-space: nowrap; }
.export-tasks-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.export-toast {
  position: fixed; z-index: 12; inset: auto 16px 16px auto; width: min(355px, calc(100vw - 32px)); box-sizing: border-box;
  display: grid; align-items: center; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 12px 13px 12px 15px;
  border: 1px solid var(--export-border); border-radius: 13px; background: white; box-shadow: 0 12px 32px #38231526;
}
.export-toast p { grid-column: 1; margin: 0; font-weight: 660; font-size: 13px; overflow-wrap: anywhere; }
.export-toast button { grid-column: 2; grid-row: 1 / 3; }
.export-toast a { justify-self: start; font-size: 12px; font-weight: 630; color: var(--export-accent-dark); }
.export-toast[data-state="error"] p { color: #8b322c; }

.export-center { min-height: 100dvh; background: #faf8f4; }
.export-center-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px max(20px, calc((100vw - 1050px) / 2)); border-bottom: 1px solid var(--export-border); background: white; }
.export-center-bar > a:last-child { font-size: 13px; color: var(--export-accent-dark); font-weight: 650; }
.export-center-main { width: min(100% - 40px, 1000px); margin: 48px auto; }
.export-center h1 { font-size: clamp(30px, 5vw, 43px); font-weight: 690; letter-spacing: -.05em; margin: 0 0 6px; }
.export-center-description { color: var(--export-muted); font-size: 14px; margin: 0 0 24px; }
.export-center-panel { overflow: hidden; border: 1px solid var(--export-border); border-radius: 17px; background: white; box-shadow: 0 4px 15px #46241607; }
.export-center-tools { display: flex; gap: 8px; padding: 13px 17px; border-bottom: 1px solid var(--export-border); }
.export-center-tools button { border: 1px solid transparent; border-radius: 8px; font-size: 13px; min-height: 37px; padding: 6px 10px; white-space: nowrap; }
.export-center-tools button[aria-pressed="true"] { color: var(--export-accent-dark); background: var(--export-tone); border-color: var(--export-border); }
.export-center-feedback { margin: 0; padding: 34px 18px; color: var(--export-muted); text-align: center; }
.export-task-list { list-style: none; padding: 0; margin: 0; }
.export-task-row {
  display: grid; grid-template-columns: 51px minmax(0,1fr) minmax(96px,120px) 146px; align-items: center;
  gap: 15px; min-height: 85px; padding: 14px 17px; border-top: 1px solid #f1eae4;
}
.export-task-row:first-child { border-top: 0; }
.export-task-row.is-selected { background: #fffaf4; box-shadow: inset 3px 0 var(--export-accent); }
.export-task-format { display: grid; place-items: center; width: 46px; height: 45px; border-radius: 10px; background: #f3e6db; color: var(--export-accent-dark); font-size: 11px; letter-spacing: .035em; }
.export-task-info h2 { font-size: 14px; font-weight: 690; margin: 0; overflow-wrap: anywhere; }
.export-task-note, .export-task-error { margin: 3px 0 0; color: var(--export-muted); font-size: 12px; overflow-wrap: anywhere; }
.export-task-error { color: #8b322c; }
.export-task-status { display: grid; justify-items: start; grid-template-columns: minmax(0,1fr) auto; gap: 4px; align-items: center; font-size: 11px; }
.export-task-state { grid-column: 1 / -1; border-radius: 99px; padding: 4px 8px; font-weight: 650; white-space: nowrap; background: var(--export-surface); color: var(--export-muted); }
[data-state="running"] .export-task-state, [data-state="queued"] .export-task-state { color: #773d16; background: #fcf0de; }
[data-state="succeeded"] .export-task-state { color: #2b604a; background: #e8f3ec; }
[data-state="failed"] .export-task-state { color: #8b322c; background: #fbe9e7; }
.export-task-progress { width: 100%; min-width: 38px; height: 6px; accent-color: var(--export-accent); }
.export-task-percent { font-variant-numeric: tabular-nums; color: var(--export-muted); }
.export-task-actions { display: flex; gap: 6px; justify-content: end; }
.export-task-actions button, .export-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.export-playback { width: min(700px, calc(100vw - 28px)); max-height: calc(100dvh - 24px); padding: 15px; border: 1px solid var(--export-border); border-radius: 16px; }
.export-playback::backdrop { background: #261e1a99; }
.export-playback div { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.export-playback h2 { margin: 0; font-size: 18px; }
.export-playback video { display: block; width: 100%; max-height: 67dvh; background: #221c19; border-radius: 10px; margin-bottom: 10px; }

@media (max-width: 720px) {
  #export-dialog .export-heading { padding: 11px 14px; }
  #export-dialog .export-heading h2 { font-size: 20px; }
  #export-dialog .export-body { grid-template-columns: minmax(0,1fr); gap: 12px; padding: 11px 14px 13px; }
  #export-dialog .export-preview-surface { height: clamp(150px, 29dvh, 255px); padding: 8px; }
  #export-dialog[data-frame="square"] .export-preview-surface,
  #export-dialog[data-frame="portrait"] .export-preview-surface { height: clamp(140px, 22dvh, 190px); }
  #export-dialog .export-options { gap: 10px; }
  #export-dialog .export-video-options { gap: 10px; }
  #export-dialog .export-motion label { min-height: 46px; padding-block: 6px; }
  .export-motion-icon { width: 30px; height: 30px; }
  .export-action-bar { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  #export-dialog .export-footer { width: 100%; }
  #export-dialog .export-notice { font-size: 11px; }
  .export-center-main { width: calc(100% - 24px); margin: 28px auto; }
  .export-center-bar { padding-inline: 12px; }
  .export-task-row { grid-template-columns: 41px minmax(0,1fr) auto; gap: 7px 10px; padding: 12px 10px; }
  .export-task-format { width: 39px; height: 39px; grid-row: 1 / 3; align-self: start; }
  .export-task-info { grid-column: 2 / -1; }
  .export-task-status { grid-column: 2; max-width: 112px; }
  .export-task-actions { grid-column: 3; }
}
@media (max-width: 470px) {
  .document-actions .export-tasks-link { padding: 6px 3px; font-size: 11px; }
  #export-dialog .export-footer button { min-height: 40px; }
  .export-center-tools { padding-inline: 10px; gap: 5px; }
}

#export-dialog .export-options > [hidden], .export-toast[hidden], .export-tasks-link[hidden] { display: none; }
#export-dialog:has(#export-modes:not([hidden])) .export-options { align-content: start; }
#export-dialog .export-modes { border: 0; margin: 0 0 10px; }
#export-dialog .export-video-options:not([hidden]) { display: grid; }
#export-dialog .export-video-options fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.export-video-options label {
  display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr);
  gap: 8px; min-height: 46px; padding: 5px 8px; cursor: pointer; border-radius: 9px;
  border: 1px solid var(--line); background: white; font-size: 13px;
}
.export-video-options label:has(:checked) { border-color: #ba7959; background: var(--export-tone); }
.export-video-options label:has(:focus-visible), .export-modes label:has(:focus-visible) {
  outline: 2px solid var(--export-accent); outline-offset: 2px;
}
.export-motion small { display: block; color: var(--export-muted); margin-top: 2px; font-size: 11px; }
.export-motion b { color: var(--export-accent-dark); font-size: 11px; padding-right: 4px; }
#export-dialog[data-frame] .export-preview-surface { display: grid; place-items: center; }
#export-dialog[data-frame] .export-preview img { max-width: 100%; width: 100%; object-fit: contain; }
.export-primary { color: white; background: var(--export-accent); text-decoration: none; border: 1px solid var(--export-accent); }
.export-primary:hover { background: var(--export-accent-dark); }
