/* EXPORT-2 — Shared Export Flow State Machine.
 * This file owns shared export panel presentation for the state machine.
 * Tool-specific exporters still supply handlers, output blobs, and summaries.
 */
.ept-shared-export-flow,
.ept-shared-export-flow * {
  box-sizing: border-box;
}

.ept-shared-export-flow {
  --ept-export-surface: rgba(255, 255, 255, .96);
  --ept-export-border: rgba(148, 163, 184, .24);
  --ept-export-text: var(--ept-text, #0f172a);
  --ept-export-muted: var(--ept-muted, #64748b);
  --ept-export-primary: var(--ept-primary, #2563eb);
  --ept-export-success: var(--ept-success-text, #047857);
  --ept-export-error: var(--ept-error-text, #b91c1c);
  --ept-export-radius: 24px;
  color: var(--ept-export-text);
}

.ept-shared-export-area {
  padding: 14px;
}

.ept-shared-export-panel {
  background: var(--ept-export-surface);
  border: 1px solid var(--ept-export-border);
  border-radius: var(--ept-export-radius);
  box-shadow: 0 20px 70px rgba(15, 23, 42, .08);
  padding: clamp(18px, 3vw, 28px);
}

.ept-shared-export-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.ept-shared-export-icon {
  align-items: center;
  background: linear-gradient(135deg, #2f6df6 0%, #1f4ed8 100%);
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(37, 99, 235, .18);
  color: #fff !important;
  display: inline-flex;
  flex: 0 0 52px;
  font-size: .9rem;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  width: 52px;
}

.ept-shared-export-label {
  color: var(--ept-export-primary) !important;
  display: inline-block;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ept-shared-export-head h3 {
  color: var(--ept-export-text) !important;
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
  letter-spacing: -.04em;
  line-height: 1.06;
  margin: 0 0 8px;
}

.ept-shared-export-status-copy {
  color: var(--ept-export-muted) !important;
  font-size: .88rem;
  line-height: 1.55;
  margin: 0;
  max-width: 720px;
}

.ept-shared-export-progress-wrap {
  background: linear-gradient(180deg, #f8fbff, #fff);
  border: 1px solid rgba(191, 219, 254, .72);
  border-radius: 18px;
  margin: 0 0 18px;
  padding: 14px;
}

.ept-shared-export-progress-top {
  align-items: center;
  color: var(--ept-export-muted) !important;
  display: flex;
  font-size: .82rem;
  font-weight: 800;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ept-shared-export-progress-top strong {
  color: var(--ept-export-primary) !important;
  font-size: .86rem;
  font-weight: 900;
}

.ept-shared-export-progress-track {
  background: rgba(148, 163, 184, .22);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  width: 100%;
}

.ept-shared-export-progress-bar {
  background: linear-gradient(90deg, var(--ept-export-primary), #67e8f9);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 260ms ease;
  width: 0%;
}

.ept-shared-export-heading {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: 16px 0 10px;
}

.ept-shared-export-heading strong,
.ept-shared-export-heading span {
  display: block;
}

.ept-shared-export-heading strong {
  color: var(--ept-export-text) !important;
  font-size: .9rem;
  font-weight: 900;
}

.ept-shared-export-heading span {
  color: var(--ept-export-muted) !important;
  font-size: .76rem;
  text-align: right;
}

.ept-shared-export-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ept-shared-export-summary span[role="listitem"] {
  background: #fff;
  border: 1px solid #d7e3f2;
  border-radius: 14px;
  min-height: 74px;
  padding: 12px;
}

.ept-shared-export-summary strong,
.ept-shared-export-summary em {
  display: block;
  font-style: normal;
}

.ept-shared-export-summary strong {
  color: var(--ept-export-text) !important;
  font-size: .9rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ept-shared-export-summary em {
  color: var(--ept-export-muted) !important;
  font-size: .72rem;
  font-weight: 800;
  margin-top: 4px;
}

.ept-shared-export-card--wide {
  grid-column: span 1;
}

.ept-shared-export-changed-file {
  align-items: flex-start;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #d7e3f2;
  border-radius: 16px;
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 13px 14px;
}

.ept-shared-export-changed-file__label {
  color: var(--ept-export-success) !important;
  display: block;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.ept-shared-export-changed-file strong,
.ept-shared-export-changed-file em,
.ept-shared-export-changed-file small {
  display: block;
  font-style: normal;
}

.ept-shared-export-changed-file strong {
  color: var(--ept-export-text) !important;
  font-size: .95rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ept-shared-export-changed-file em,
.ept-shared-export-changed-file small {
  color: var(--ept-export-muted) !important;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.4;
}

.ept-shared-export-changed-file.is-stale {
  border-color: #fed7aa;
  background: #fff7ed;
}

.ept-shared-export-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ept-shared-export-actions .ept-button {
  min-height: 42px;
}

.ept-shared-export-stale {
  background: #fff7ed !important;
  border-color: #fed7aa !important;
  color: #9a3412 !important;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.45;
  margin-top: 12px;
}

.ept-shared-export-flow.is-stale .ept-shared-export-progress-wrap {
  border-color: #fed7aa;
}

.ept-shared-export-flow.is-stale .ept-shared-export-label,
.ept-shared-export-flow.is-stale .ept-shared-export-progress-top strong {
  color: #c2410c !important;
}

.ept-shared-export-flow.is-stale [data-ept-shared-export-download] {
  display: none !important;
}

.ept-shared-export-flow[data-ept-export-state="idle"] .ept-shared-export-ready-only,
.ept-shared-export-flow[data-ept-export-state="input-ready"] .ept-shared-export-ready-only,
.ept-shared-export-flow[data-ept-export-state="exporting"] .ept-shared-export-ready-only,
.ept-shared-export-flow[data-ept-export-state="error"] .ept-shared-export-ready-only,
.ept-shared-export-flow[data-ept-export-state="reset"] .ept-shared-export-ready-only {
  display: none !important;
}

.ept-shared-export-flow[data-ept-export-state="error"] .ept-shared-export-progress-wrap {
  border-color: var(--ept-error-border, #fecaca);
}

.ept-shared-export-flow[data-ept-export-state="ready"] .ept-shared-export-label,
.ept-shared-export-flow[data-ept-export-state="download-preparing"] .ept-shared-export-label,
.ept-shared-export-flow[data-ept-export-state="download-started"] .ept-shared-export-label {
  color: var(--ept-export-success) !important;
}

.ept-shared-export-flow[data-ept-export-state="error"] .ept-shared-export-label {
  color: var(--ept-export-error) !important;
}

[data-ept-shared-export-state="exporting"] [data-ept-production-export],
[data-ept-shared-export-state="download-preparing"] [data-ept-production-export],
[data-ept-production-export].is-loading {
  cursor: progress;
  opacity: .72;
}

.ept-shared-export-flow[aria-busy="true"],
.ept-shared-export-flow [aria-busy="true"] {
  cursor: progress;
}

@media (max-width: 960px) {
  .ept-shared-export-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ept-shared-export-head,
  .ept-shared-export-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .ept-shared-export-heading span {
    text-align: left;
  }

  .ept-shared-export-summary {
    grid-template-columns: 1fr;
  }

  .ept-shared-export-actions,
  .ept-shared-export-actions > * {
    width: 100%;
  }
}

/* EXPORT-7 — Shared Export Error / Cancel / Recovery Guard. */
.ept-shared-export-cancel-only,
.ept-shared-export-error-only {
  display: none !important;
}

.ept-shared-export-flow[data-ept-export-state="exporting"] .ept-shared-export-cancel-only {
  display: inline-flex !important;
}

.ept-shared-export-flow[data-ept-export-state="error"] .ept-shared-export-error-only {
  display: flex !important;
}

.ept-shared-export-flow[data-ept-export-state="error"] .ept-shared-export-ready-only,
.ept-shared-export-flow[data-ept-export-state="exporting"] .ept-shared-export-ready-only {
  display: none !important;
}

.ept-shared-export-error-actions {
  align-items: center;
  background: #fff7f7;
  border: 1px solid var(--ept-error-border, #fecaca);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
}

.ept-shared-export-flow[data-ept-export-state="error"] .ept-shared-export-progress-bar {
  background: linear-gradient(90deg, var(--ept-export-error), #fb7185);
}

.ept-shared-export-flow[data-ept-export-state="error"] .ept-shared-export-progress-top strong,
.ept-shared-export-flow[data-ept-export-state="error"] .ept-shared-export-progress-top span {
  color: var(--ept-export-error) !important;
}

.ept-shared-export-flow[data-ept-export-state="exporting"] [data-ept-shared-export-cancel] {
  cursor: pointer;
}

[data-ept-shared-export-cancel][hidden],
[data-ept-shared-export-error-actions][hidden] {
  display: none !important;
}

/* EXPORT-7.2 — Shared Export Progress Smoothness + In-Panel Ready Transition. */
.ept-shared-export-flow.is-exporting .ept-shared-export-panel {
  transition: border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.ept-shared-export-flow.is-ready .ept-shared-export-panel {
  border-color: rgba(34, 197, 94, .28);
  box-shadow: 0 22px 76px rgba(15, 23, 42, .09), 0 0 0 1px rgba(34, 197, 94, .08) inset;
}

.ept-shared-export-flow.is-ready .ept-shared-export-icon,
.ept-shared-export-flow.is-ready .ept-shared-export-topbar__icon {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 16px 42px rgba(34, 197, 94, .20);
}

.ept-shared-export-flow.is-error .ept-shared-export-icon,
.ept-shared-export-flow.is-error .ept-shared-export-topbar__icon {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 16px 42px rgba(239, 68, 68, .18);
}

.ept-shared-export-flow.is-ready .ept-shared-export-ready-only {
  animation: eptSharedExportReadyIn 260ms ease both;
}

.ept-shared-export-flow .ept-shared-export-progress-bar {
  transition: width 360ms cubic-bezier(.22, .61, .36, 1);
}

@keyframes eptSharedExportReadyIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* EXPORT-7.4 — Shared Export Surface Flatten + Workspace Width Parity.
 * Shared export uses the same wide shell geometry as workspace and removes
 * nested card framing around the export panel. Tool adapters remain consumers.
 */
.ept-bench[data-ept-context-type="tool"][data-ept-production-state="export"] .ept-shell {
  width: min(1500px, calc(100vw - 48px)) !important;
  max-width: min(1500px, calc(100vw - 48px)) !important;
  margin-top: 24px !important;
  padding: 24px !important;
  border-radius: 28px !important;
}

.ept-bench[data-ept-context-type="tool"][data-ept-production-state="export"] .ept-production-flow {
  padding: 0 !important;
  border-radius: 28px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.ept-shared-export-flow {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-topbar {
  background: rgba(255, 255, 255, .82) !important;
  border: 1px solid rgba(191, 219, 254, .72) !important;
  border-radius: 24px !important;
  box-shadow: 0 16px 50px rgba(15, 23, 42, .055) !important;
  margin: 0 0 16px !important;
  min-height: 72px !important;
  padding: 12px 14px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-area {
  padding: 0 !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-panel {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: clamp(16px, 2.2vw, 24px) clamp(10px, 1.6vw, 18px) 10px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-head {
  margin-bottom: 22px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-progress-wrap {
  background: rgba(248, 251, 255, .90) !important;
  border-color: rgba(191, 219, 254, .82) !important;
  box-shadow: none !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-summary span[role="listitem"],
.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-changed-file {
  background: rgba(255, 255, 255, .88) !important;
  box-shadow: none !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-actions {
  margin-top: 16px !important;
}

@media (max-width: 760px) {
  .ept-bench[data-ept-context-type="tool"][data-ept-production-state="export"] .ept-shell {
    width: min(100%, calc(100vw - 20px)) !important;
    max-width: min(100%, calc(100vw - 20px)) !important;
    padding: 12px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-topbar {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__actions,
  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__actions .ept-button {
    width: 100% !important;
  }
}

/* EXPORT-7.5 — Shared Export Premium Compact Ready Layout.
 * This remains a shared export-system polish. Tool adapters only provide
 * result data; Add Page Numbers is just the first consumer.
 */
.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-topbar {
  margin-bottom: 10px !important;
  min-height: 62px !important;
  padding: 10px 12px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-panel {
  align-items: stretch !important;
  display: grid !important;
  gap: 14px 16px !important;
  grid-template-columns: minmax(280px, .92fr) minmax(360px, 1.08fr) !important;
  margin: 0 auto !important;
  max-width: 1080px !important;
  padding: clamp(18px, 2.4vw, 30px) !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-head {
  align-items: center !important;
  flex-direction: column !important;
  gap: 12px !important;
  grid-column: 1 / -1 !important;
  justify-content: center !important;
  margin: 0 auto 2px !important;
  max-width: 760px !important;
  text-align: center !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-icon {
  border-radius: 18px !important;
  flex-basis: 48px !important;
  height: 48px !important;
  width: 48px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-label {
  margin-bottom: 7px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-head h3 {
  font-size: clamp(1.72rem, 3.1vw, 2.45rem) !important;
  line-height: 1.02 !important;
  margin-bottom: 8px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-status-copy {
  font-size: .93rem !important;
  line-height: 1.55 !important;
  margin: 0 auto !important;
  max-width: 720px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-progress-wrap {
  grid-column: 1 / -1 !important;
  margin: 4px auto 8px !important;
  max-width: 760px !important;
  padding: 13px 16px !important;
  width: 100% !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-progress-track {
  height: 9px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-heading {
  align-items: center !important;
  grid-column: 1 / -1 !important;
  justify-content: center !important;
  margin: 2px 0 0 !important;
  text-align: center !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-heading span {
  display: none !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-heading strong {
  font-size: .82rem !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-changed-file {
  align-content: center !important;
  align-self: stretch !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 197, 94, .10), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 251, 255, .92)) !important;
  border-color: rgba(187, 247, 208, .92) !important;
  border-radius: 22px !important;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .055) !important;
  display: grid !important;
  gap: 7px !important;
  grid-column: 1 !important;
  grid-row: 4 !important;
  margin: 0 !important;
  min-height: 148px !important;
  padding: 18px 20px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-changed-file__label {
  font-size: .72rem !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-changed-file strong {
  font-size: 1.05rem !important;
  line-height: 1.22 !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-summary {
  align-self: stretch !important;
  display: grid !important;
  gap: 10px !important;
  grid-column: 2 !important;
  grid-row: 4 !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  margin: 0 !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-summary span[role="listitem"] {
  align-content: center !important;
  background: rgba(255, 255, 255, .94) !important;
  border-color: rgba(191, 219, 254, .82) !important;
  border-radius: 18px !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .045) !important;
  min-height: 68px !important;
  padding: 14px 15px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-summary strong {
  font-size: .98rem !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-stale {
  grid-column: 1 / -1 !important;
  margin: 2px 0 0 !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-actions {
  grid-column: 1 / -1 !important;
  justify-content: center !important;
  margin-top: 8px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-actions [data-ept-production-edit],
.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-actions [data-ept-production-start-over] {
  display: none !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-actions [data-ept-shared-export-download] {
  min-height: 48px !important;
  min-width: 238px !important;
  padding-left: 22px !important;
  padding-right: 22px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-actions [data-ept-production-start-over] {
  display: none !important;
}

@media (max-width: 980px) {
  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-panel {
    grid-template-columns: 1fr !important;
    max-width: 780px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-changed-file,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-summary {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

@media (max-width: 640px) {
  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-panel {
    padding: 16px 12px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-summary {
    grid-template-columns: 1fr !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-actions [data-ept-shared-export-download] {
    width: 100% !important;
  }
}


/* EXPORT-7.6 — Shared Export Unified Loading Ready Layout + Back Workspace Fix.
 * Exporting and ready states now share the same compact premium geometry so
 * the shared export surface feels like one stateful panel, not two pages.
 */
.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-topbar {
  margin-bottom: 10px !important;
  min-height: 62px !important;
  padding: 10px 12px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-panel {
  align-items: stretch !important;
  display: grid !important;
  gap: 14px 16px !important;
  grid-template-columns: minmax(280px, .92fr) minmax(360px, 1.08fr) !important;
  margin: 0 auto !important;
  max-width: 1080px !important;
  min-height: 332px !important;
  padding: clamp(18px, 2.4vw, 30px) !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-head {
  align-items: center !important;
  flex-direction: column !important;
  gap: 12px !important;
  grid-column: 1 / -1 !important;
  justify-content: center !important;
  margin: 0 auto 2px !important;
  max-width: 760px !important;
  text-align: center !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-icon {
  border-radius: 18px !important;
  flex-basis: 48px !important;
  height: 48px !important;
  width: 48px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-label {
  margin-bottom: 7px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-head h3 {
  font-size: clamp(1.72rem, 3.1vw, 2.45rem) !important;
  line-height: 1.02 !important;
  margin-bottom: 8px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-status-copy {
  font-size: .93rem !important;
  line-height: 1.55 !important;
  margin: 0 auto !important;
  max-width: 720px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-progress-wrap {
  grid-column: 1 / -1 !important;
  margin: 4px auto 8px !important;
  max-width: 760px !important;
  padding: 13px 16px !important;
  width: 100% !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-progress-track {
  height: 9px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-actions {
  grid-column: 1 / -1 !important;
  justify-content: center !important;
  margin-top: 8px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-actions [data-ept-production-start-over] {
  display: none !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-cancel-only {
  min-height: 44px !important;
  min-width: 148px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-ready-only {
  display: none !important;
}

@media (max-width: 980px) {
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-panel {
    grid-template-columns: 1fr !important;
    max-width: 780px !important;
  }
}

@media (max-width: 640px) {
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-panel {
    padding: 16px 12px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-cancel-only {
    width: 100% !important;
  }
}

/* EXPORT-8 — Shared Export Responsive QA + Final Polish.
 * Final shared-export polish only: responsive geometry, action-row safety,
 * changed-file readability, error recovery layout, and compact mobile rhythm.
 * Add Page Numbers remains only the first consumer of this shared surface.
 */
.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-topbar,
.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-panel,
.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-progress-wrap,
.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-summary span[role="listitem"],
.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-changed-file {
  min-width: 0 !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-topbar {
  align-items: center !important;
  gap: 14px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__brand,
.ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__name {
  min-width: 0 !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__name strong,
.ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__name span,
.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-summary strong,
.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-summary em {
  overflow-wrap: anywhere !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__actions {
  align-items: center !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  justify-content: flex-end !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-flow-template__actions [data-ept-production-edit],
.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-flow-template__actions [data-ept-production-start-over] {
  min-width: 132px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-panel,
.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-panel {
  transition: max-width 220ms ease, min-height 220ms ease, padding 220ms ease !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-progress-top,
.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-progress-top {
  gap: 16px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-progress-top span,
.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-progress-top span {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-progress-top strong,
.ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-progress-top strong {
  flex: 0 0 auto !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-changed-file strong,
.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-changed-file em,
.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-changed-file small {
  overflow-wrap: anywhere !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-summary span[role="listitem"] {
  min-width: 0 !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-error .ept-shared-export-panel {
  margin: 0 auto !important;
  max-width: 820px !important;
  padding: clamp(18px, 2.4vw, 30px) !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export.is-error .ept-shared-export-error-actions {
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 620px !important;
}

.ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-stale,
.ept-bench.ept-mode-production .ept-flow-template--export [data-ept-shared-export-error] {
  border-radius: 16px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 760px !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 1180px) {
  .ept-bench[data-ept-context-type="tool"][data-ept-production-state="export"] .ept-shell {
    width: min(100%, calc(100vw - 32px)) !important;
    max-width: min(100%, calc(100vw - 32px)) !important;
    padding: 18px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-panel,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-panel {
    max-width: 920px !important;
  }
}

@media (max-width: 820px) {
  .ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-topbar {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__actions {
    justify-content: flex-start !important;
    width: 100% !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__actions .ept-button {
    flex: 1 1 160px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-panel,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-panel,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-error .ept-shared-export-panel {
    max-width: 720px !important;
    min-height: 0 !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-head h3,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-head h3 {
    font-size: clamp(1.55rem, 7vw, 2.05rem) !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-status-copy,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-status-copy {
    font-size: .88rem !important;
  }
}

@media (max-width: 560px) {
  .ept-bench[data-ept-context-type="tool"][data-ept-production-state="export"] .ept-shell {
    border-radius: 20px !important;
    padding: 10px !important;
    width: min(100%, calc(100vw - 12px)) !important;
    max-width: min(100%, calc(100vw - 12px)) !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-topbar {
    border-radius: 18px !important;
    min-height: 0 !important;
    padding: 10px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__brand {
    gap: 9px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-topbar__icon {
    flex: 0 0 32px !important;
    height: 32px !important;
    width: 32px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__name strong {
    font-size: .92rem !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__name span {
    font-size: .72rem !important;
    line-height: 1.3 !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__actions {
    gap: 8px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__actions .ept-button,
  .ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-actions .ept-button,
  .ept-bench.ept-mode-production .ept-flow-template--export .ept-shared-export-error-actions .ept-button {
    flex: 1 1 100% !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-panel,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-panel,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-error .ept-shared-export-panel {
    gap: 12px !important;
    padding: 14px 8px 10px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-icon,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-icon,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-error .ept-shared-export-icon {
    border-radius: 15px !important;
    flex-basis: 42px !important;
    height: 42px !important;
    width: 42px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-head,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-head {
    gap: 10px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-head h3,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-head h3 {
    font-size: clamp(1.38rem, 9vw, 1.8rem) !important;
    letter-spacing: -.035em !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-progress-wrap,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-progress-wrap {
    border-radius: 15px !important;
    padding: 11px 12px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-progress-top,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-progress-top {
    font-size: .76rem !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-changed-file {
    border-radius: 18px !important;
    min-height: 0 !important;
    padding: 15px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-summary {
    gap: 8px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-summary span[role="listitem"] {
    border-radius: 15px !important;
    min-height: 62px !important;
    padding: 12px !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-actions [data-ept-shared-export-download] {
    min-width: 0 !important;
  }
}

@media (max-width: 380px) {
  .ept-bench.ept-mode-production .ept-flow-template--export .ept-flow-template__name span {
    display: none !important;
  }

  .ept-bench.ept-mode-production .ept-flow-template--export.is-ready .ept-shared-export-status-copy,
  .ept-bench.ept-mode-production .ept-flow-template--export.is-exporting .ept-shared-export-status-copy {
    font-size: .82rem !important;
  }
}


/* EXPORT-4 — Shared Export Error / Recovery Guard. */
.ept-shared-export-error-detail,
.ept-shared-export-error-code {
  color: var(--ept-text-muted, #64748b);
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 0 0;
}

.ept-shared-export-error-code {
  background: #fff7f7;
  border: 1px dashed var(--ept-error-border, #fecaca);
  border-radius: 10px;
  color: var(--ept-export-error, #dc2626);
  display: inline-flex;
  max-width: 100%;
  padding: 6px 8px;
}

.ept-shared-export-error-detail[hidden],
.ept-shared-export-error-code[hidden] {
  display: none !important;
}


/* EXPORT-5 — Shared Result Page / Download Guard. */
.ept-shared-export-actions [data-ept-shared-export-download][aria-disabled="true"],
[data-ept-production-result-download][aria-disabled="true"],
[data-ept-result-download][aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.58;
}
.ept-shared-export-actions [data-ept-shared-export-download].is-ready {
  white-space: nowrap;
}
.ept-shared-export-flow.is-stale [data-ept-shared-export-download],
.ept-flow-template--result.is-stale [data-ept-production-result-download] {
  pointer-events: none;
}
