/* Export workbench — isolated Recorder/Viewer modal layout and states. */
@font-face {
    font-family: 'Seocho Batang';
    src: url('/static/fonts/SeochoBatang-Regular.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

.export-modal__dialog--workbench {
    --export-accent: var(--color-primary, var(--color-accent, #4a90d9));
    width: min(1080px, calc(100vw - 40px));
    max-width: none;
    height: min(860px, calc(100dvh - 40px));
    max-height: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--color-border) 82%, transparent);
    border-radius: 22px;
    background: color-mix(in srgb, var(--color-bg) 96%, #eef2f6);
    box-shadow: 0 26px 80px rgba(15, 23, 42, 0.22), 0 4px 18px rgba(15, 23, 42, 0.08);
}

.export-modal__dialog--workbench .export-modal__header {
    min-height: 68px;
    padding: 16px 22px;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-bg) 98%, transparent);
    z-index: 3;
}

.export-modal__dialog--workbench .export-modal__header h3 {
    font-size: 19px;
    letter-spacing: -0.025em;
}

.export-modal__dialog--workbench .export-modal__close {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.export-workbench {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.export-workbench__scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 18px 22px 24px;
    scrollbar-gutter: stable;
}

.export-workbench__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.36fr) minmax(300px, 0.84fr);
    gap: 16px;
    align-items: start;
}

.export-workbench__main,
.export-workbench__side {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.export-workbench__main > *,
.export-workbench__side > *,
.export-workbench-section {
    min-width: 0;
    max-width: 100%;
}

.export-workbench-section,
.export-layout-disclosure,
.export-workbench__main > #exportWorkbenchTitleSlot {
    border: 1px solid color-mix(in srgb, var(--color-border) 86%, transparent);
    border-radius: 16px;
    background: var(--color-bg);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

.export-workbench__main > #exportWorkbenchTitleSlot {
    padding: 14px 16px;
}

.export-modal__dialog--workbench .export-title-field {
    margin: 0;
}

.export-modal__dialog--workbench .export-title-field__input {
    min-height: 44px;
}

.export-workbench-section {
    padding: 16px;
}

.export-workbench-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.export-workbench-section__head > div:first-child {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.export-workbench-section__step {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--export-accent) 12%, transparent);
    color: var(--export-accent);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.export-workbench-section__head h4 {
    margin: 0;
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.export-workbench-section__head p {
    margin: 3px 0 0;
    color: var(--color-text-dim);
    font-size: 12px;
    line-height: 1.45;
}

.export-template-selector {
    margin: 0;
    padding: 0;
    gap: 0;
    border: 0;
    background: transparent;
}

.export-template-selector__label,
.export-template-select {
    display: none;
}

.export-template-edit-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
}

.export-template-library {
    display: grid;
    gap: 13px;
}

.export-template-group {
    min-width: 0;
}

.export-template-group__head {
    min-height: 24px;
    margin: 0 2px 6px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.export-template-group__head strong {
    color: var(--color-text);
    font-size: 11px;
    letter-spacing: -0.01em;
}

.export-template-group__head span {
    overflow: hidden;
    color: var(--color-text-dim);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.export-template-group--saved {
    padding-top: 11px;
    border-top: 1px solid color-mix(in srgb, var(--color-border) 82%, transparent);
}

.export-template-group__empty {
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    border: 1px dashed color-mix(in srgb, var(--color-border) 88%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-bg-hover) 55%, transparent);
    color: var(--color-text-dim);
    font-size: 10.5px;
    line-height: 1.45;
}

.export-template-group__empty[hidden],
.export-template-cards[hidden] {
    display: none !important;
}

.export-template-cards {
    min-width: 0;
    max-width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(158px, 1fr);
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.export-template-cards::-webkit-scrollbar { display: none; }

.export-template-cards--saved {
    grid-auto-columns: minmax(158px, 180px);
}

.export-template-card-shell {
    min-width: 0;
    min-height: 176px;
    position: relative;
    scroll-snap-align: start;
}

.export-template-cards__loading {
    grid-column: 1 / -1;
    padding: 28px 16px;
    color: var(--color-text-dim);
    text-align: center;
    font-size: 13px;
}

.export-template-card {
    width: 100%;
    height: 100%;
    min-height: 176px;
    min-width: 0;
    padding: 10px;
    display: grid;
    grid-template-rows: 92px auto;
    gap: 9px;
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-bg);
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

.export-template-card:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--template-accent) 48%, var(--color-border));
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.export-template-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--template-accent) 30%, transparent);
    outline-offset: 2px;
}

.export-template-card.is-selected {
    border-color: var(--template-accent);
    background: color-mix(in srgb, var(--template-soft) 42%, var(--color-bg));
    box-shadow: 0 0 0 1px var(--template-accent), 0 8px 22px rgba(15, 23, 42, 0.08);
}

.export-template-card__paper {
    width: 72px;
    height: 92px;
    margin: 0 auto;
    padding: 12px 9px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    border: 1px solid var(--template-rule);
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
}

.export-template-card__paper i {
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: var(--template-accent);
}

.export-template-card__paper b {
    width: 70%;
    height: 7px;
    border-radius: 2px;
    background: var(--template-ink);
}

.export-template-card__paper span {
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--template-rule);
}

.export-template-card__paper span:last-child { width: 68%; }
.export-template-card__paper--card i { width: 100%; height: 16px; border-radius: 3px; }
.export-template-card__paper--notebook { border-left: 4px solid color-mix(in srgb, var(--template-accent) 45%, #fff); }
.export-template-card__paper--minimal i { width: 18px; background: var(--template-ink); }
.export-template-card__paper--columns span { width: 46%; align-self: flex-end; }
.export-template-card__paper--tablet { border-radius: 8px; }

.export-template-card__copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.export-template-card__copy strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.export-template-card__copy small {
    display: -webkit-box;
    overflow: hidden;
    color: color-mix(in srgb, var(--color-text) 66%, transparent);
    font-size: 10.5px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.export-template-card__check {
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 8px;
    right: 8px;
    border: 2px solid var(--color-bg);
    border-radius: 50%;
    background: var(--template-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.export-template-card.is-selected .export-template-card__check { display: flex; }

.export-template-card__delete {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    position: absolute;
    right: 5px;
    bottom: 5px;
    border: 0;
    border-radius: 11px;
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    color: var(--color-text-dim);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.export-template-card__delete:hover {
    background: color-mix(in srgb, #e5484d 10%, var(--color-bg));
    color: #c83238;
}

.export-template-card__delete:active { transform: scale(0.96); }
.export-template-card__delete:focus-visible { outline: 3px solid color-mix(in srgb, #e5484d 24%, transparent); }
.export-template-card__delete span { transform: translateY(-1px); font-size: 21px; line-height: 1; }

.export-switch {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    cursor: pointer;
}

.export-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.export-switch > span {
    width: 40px;
    height: 24px;
    padding: 3px;
    border-radius: 999px;
    background: var(--color-border);
    transition: background 150ms ease;
}

.export-switch > span::after {
    content: '';
    width: 18px;
    height: 18px;
    display: block;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
    transition: transform 150ms ease;
}

.export-switch input:checked + span { background: var(--export-accent); }
.export-switch input:checked + span::after { transform: translateX(16px); }
.export-switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--export-accent) 30%, transparent); outline-offset: 2px; }
.export-switch strong { font-size: 12px; white-space: nowrap; }

.export-mark-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    transition: opacity 150ms ease;
}

.export-mark-options.is-disabled { opacity: 0.48; }

.export-mark-option {
    min-width: 0;
    min-height: 68px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-bg) 96%, var(--color-bg-hover));
}

.export-mark-option__choice {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.export-mark-option__choice input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: var(--export-accent);
}

.export-mark-option__choice > span:last-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.export-mark-option__choice strong { font-size: 12px; line-height: 1.2; }
.export-mark-option__choice small { color: var(--color-text-dim); font-size: 10px; line-height: 1.25; }

.export-mark-option__sample {
    width: 28px;
    height: 12px;
    flex: 0 0 28px;
    border-radius: 3px;
    transform: rotate(-1deg);
}

.export-mark-option__sample--important { background: var(--export-important-color, #FFE08A); }
.export-mark-option__sample--review { background: var(--export-review-color, #BDE3FF); }

.export-mark-option__memo-icon {
    width: 28px;
    height: 24px;
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--color-bg-hover);
    color: var(--color-text-dim);
    font-family: Georgia, serif;
    font-size: 11px;
    font-weight: 700;
}

.export-color-control {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--color-text-dim);
    font-size: 10px;
    cursor: pointer;
}

.export-color-control input {
    width: 34px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-bg);
    cursor: pointer;
}

.export-preview__expand {
    min-height: 40px;
    padding: 0 12px;
    flex: 0 0 auto;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.export-preview__paper {
    min-height: 190px;
    padding: 18px;
    display: grid;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--color-border) 80%, #cbd5e1);
    border-radius: 12px;
    background: #eef1f4;
}

.export-preview__content {
    width: min(100%, 520px);
    min-height: 154px;
    margin: 0 auto;
    padding: 18px 20px;
    display: grid;
    align-content: start;
    gap: 10px;
    border-radius: 3px;
    background: #fff;
    color: var(--preview-ink, #18212B);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    transition: width 180ms ease, padding 180ms ease;
}

.export-preview__content[data-orientation="landscape"] { width: min(100%, 620px); }
.export-preview__content[data-margin="narrow"] { padding: 14px 16px; }
.export-preview__content[data-margin="wide"] { padding: 22px 26px; }

.export-preview-document__head {
    padding-bottom: 10px;
    display: grid;
    gap: 4px;
    border-bottom: 1px solid color-mix(in srgb, var(--preview-accent, #315A72) 20%, #e5e7eb);
}

.export-preview-document__head span {
    color: var(--preview-accent, #315A72);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.export-preview-document__head strong { font-size: 16px; letter-spacing: -0.025em; }

.export-preview-document__body {
    min-width: 0;
    column-count: var(--preview-columns, 1);
    column-gap: 14px;
    column-rule: 1px solid color-mix(in srgb, var(--preview-accent, #315A72) 12%, #e5e7eb);
}

.export-preview-sentence {
    display: grid;
    gap: 5px;
    break-inside: avoid;
    font-size: var(--preview-font-size, 10.5px);
    line-height: 1.58;
}

.export-preview-sentence__heading {
    margin-top: 2px;
    padding-left: 7px;
    border-left: 3px solid var(--preview-accent, #315A72);
    color: var(--preview-ink, #18212B);
    font-size: 10.5px;
    font-weight: 800;
}

.export-preview-sentence__text {
    width: fit-content;
    max-width: 100%;
    padding: 0 2px;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.export-preview-sentence__memo {
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--preview-soft, #f4f7f9);
    color: var(--preview-muted, #667085);
    font-size: 9.5px;
}

.export-preview__loading {
    width: min(100%, 520px);
    min-height: 154px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    align-content: center;
    gap: 12px;
    border-radius: 3px;
    background: #fff;
}

.export-preview__loading span {
    height: 9px;
    border-radius: 4px;
    background: linear-gradient(90deg, #edf0f3 20%, #f8f9fa 50%, #edf0f3 80%);
    background-size: 220% 100%;
    animation: export-preview-shimmer 1.2s linear infinite;
}

.export-preview__loading span:nth-child(1) { width: 42%; height: 15px; }
.export-preview__loading span:nth-child(3) { width: 76%; }

.export-preview__loading[hidden],
.export-preview__content[hidden],
.export-preview__empty[hidden],
.export-preview__error[hidden] {
    display: none !important;
}

@keyframes export-preview-shimmer { to { background-position: -220% 0; } }

.export-preview__empty,
.export-preview__error {
    min-height: 154px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text-dim);
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
}

.export-preview__error strong { color: var(--color-text); font-size: 13px; }
.export-preview__error button {
    min-height: 40px;
    margin-top: 6px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg);
    color: var(--color-text);
    font-weight: 700;
    cursor: pointer;
}

.export-preview__format-note {
    min-height: 18px;
    margin: 9px 1px 0;
    color: var(--color-text-dim);
    font-size: 10.5px;
    line-height: 1.45;
}

.export-layout-disclosure { overflow: hidden; }

.export-layout-disclosure--inline {
    margin-top: 14px;
    box-shadow: none;
}

.export-layout-disclosure > summary {
    min-height: 58px;
    padding: 0 15px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    color: var(--color-text);
    cursor: pointer;
    list-style: none;
}

.export-layout-disclosure > summary::-webkit-details-marker { display: none; }
.export-layout-disclosure > summary > span:first-child { font-size: 13px; font-weight: 800; }
.export-layout-disclosure > summary strong { color: var(--color-text-dim); font-size: 10.5px; font-weight: 600; text-align: right; }
.export-layout-disclosure > summary > span:last-child { transition: transform 150ms ease; }
.export-layout-disclosure[open] > summary > span:last-child { transform: rotate(180deg); }

.export-modal__dialog--workbench .export-page-layout {
    margin: 0;
    padding: 14px;
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    background: color-mix(in srgb, var(--color-bg) 96%, var(--color-bg-hover));
}

.export-modal__dialog--workbench .export-page-layout__head { display: none; }
.export-modal__dialog--workbench .export-page-layout__scope { margin-top: 0; }
.export-modal__dialog--workbench .export-page-layout button { min-height: 40px; }
.export-modal__dialog--workbench .export-page-layout__custom input { min-height: 40px; }

.export-layout-save {
    padding: 12px 14px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.export-layout-save__current {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.export-layout-save__current > span {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--export-accent) 10%, transparent);
    color: var(--export-accent);
    font-size: 9px;
    font-weight: 800;
}

.export-layout-save__current strong {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.export-layout-save__current small {
    flex: 0 0 auto;
    color: #b46a08;
    font-size: 9px;
    font-weight: 700;
}

.export-layout-save__open {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--export-accent) 32%, var(--color-border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--export-accent) 7%, var(--color-bg));
    color: var(--export-accent);
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 140ms ease, transform 140ms ease;
}

.export-layout-save__open:hover { background: color-mix(in srgb, var(--export-accent) 11%, var(--color-bg)); }
.export-layout-save__open:active { transform: scale(0.96); }
.export-layout-save__open:focus-visible { outline: 3px solid color-mix(in srgb, var(--export-accent) 25%, transparent); outline-offset: 2px; }

.export-layout-save__form {
    grid-column: 1 / -1;
    display: grid;
    gap: 7px;
}

.export-layout-save__form[hidden] { display: none !important; }

.export-layout-save__form > label {
    color: var(--color-text-dim);
    font-size: 10px;
    font-weight: 700;
}

.export-layout-save__form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
}

.export-layout-save__form input,
.export-layout-save__form button {
    min-width: 0;
    min-height: 42px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}

.export-layout-save__form input {
    padding: 0 11px;
    font-size: 12px;
}

.export-layout-save__form button {
    padding: 0 11px;
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
}

.export-layout-save__form button[type="submit"] {
    border-color: var(--export-accent);
    background: var(--export-accent);
    color: #fff;
}

.export-layout-save__form button:disabled { opacity: 0.6; cursor: wait; }
.export-layout-save__form input:focus-visible,
.export-layout-save__form button:focus-visible { outline: 3px solid color-mix(in srgb, var(--export-accent) 24%, transparent); outline-offset: 1px; }

.export-layout-save__status {
    min-height: 14px;
    margin: -3px 0 0;
    grid-column: 1 / -1;
    color: var(--color-text-dim);
    font-size: 9.5px;
    line-height: 1.35;
}

.export-layout-save__status:empty { display: none; }
.export-layout-save__status[data-state="success"] { color: #237a4b; }
.export-layout-save__status[data-state="error"] { color: #c83238; }

.export-output-workbench .export-destination {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.export-output-workbench .export-destination__label { margin-bottom: 8px; font-size: 11px; }
.export-output-workbench .export-destination__segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.export-output-workbench .export-destination__option { min-height: 42px; border-radius: 10px; }

.export-format-workbench { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-border); }
.export-format-workbench::before {
    content: '파일 형식';
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-dim);
    font-size: 11px;
    font-weight: 700;
}

.export-modal__dialog--workbench .export-modal__formats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.export-modal__dialog--workbench .export-format-btn {
    min-width: 0;
    min-height: 72px;
    padding: 9px 5px;
    gap: 5px;
    border-radius: 11px;
}

.export-modal__dialog--workbench .export-format-btn:hover,
.export-modal__dialog--workbench .export-format-btn.is-selected {
    border-color: var(--export-accent);
    background: color-mix(in srgb, var(--export-accent) 8%, var(--color-bg));
}

.export-modal__dialog--workbench .export-format-btn.is-selected {
    box-shadow: inset 0 0 0 1px var(--export-accent);
}

.export-modal__dialog--workbench .export-format-btn__icon { width: 28px; height: 30px; }
.export-modal__dialog--workbench .export-format-btn__label { font-size: 11px; }

.export-workbench__footer {
    min-height: 76px;
    padding: 12px 22px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-bg) 97%, transparent);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.035);
    z-index: 3;
}

.export-workbench__utilities .export-modal__actions {
    margin: 0;
    display: flex;
    gap: 6px;
}

.export-workbench__submit {
    min-width: 260px;
    min-height: 50px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 14px;
    background: var(--export-accent);
    color: #fff;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--export-accent) 24%, transparent);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.015em;
    cursor: pointer;
    transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.export-workbench__submit:hover { transform: translateY(-1px); filter: brightness(1.03); }
.export-workbench__submit:active { transform: translateY(0); }
.export-workbench__submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--export-accent) 30%, transparent); outline-offset: 3px; }
.export-workbench__submit:disabled { opacity: 0.68; cursor: wait; transform: none; }
.export-workbench__submit.is-loading span:last-child { animation: export-submit-pulse 900ms ease-in-out infinite alternate; }
@keyframes export-submit-pulse { to { opacity: 0.35; } }

.export-modal__dialog--workbench.is-preview-expanded .export-workbench__side,
.export-modal__dialog--workbench.is-preview-expanded .export-workbench__main > :not(.export-preview) {
    display: none;
}

.export-modal__dialog--workbench.is-preview-expanded .export-workbench__grid { display: block; }
.export-modal__dialog--workbench.is-preview-expanded .export-preview { min-height: calc(100dvh - 185px); }
.export-modal__dialog--workbench.is-preview-expanded .export-preview__paper { min-height: calc(100dvh - 310px); }
.export-modal__dialog--workbench.is-preview-expanded .export-preview__content { width: min(100%, 720px); min-height: calc(100dvh - 350px); }
.export-modal__dialog--workbench.is-preview-expanded .export-workbench__footer { display: none; }

@media (min-width: 761px) {
    .export-workbench__main > #exportWorkbenchTitleSlot { padding: 10px 14px; }
    .export-workbench__main > #exportWorkbenchTitleSlot .export-title-field__hint { margin-top: 3px; }
    .export-workbench-section { padding: 14px; }
    .export-workbench-section__head { margin-bottom: 10px; }
    .export-template-card-shell,
    .export-template-card {
        min-height: 148px;
    }
    .export-template-card {
        grid-template-rows: 72px auto;
        padding: 8px;
        gap: 7px;
    }
    .export-template-card__paper {
        width: 56px;
        height: 72px;
        padding: 9px 7px;
        gap: 4px;
    }
    .export-template-card__paper b { height: 6px; }
    .export-template-card__copy strong { font-size: 12px; }
    .export-template-card__copy small { font-size: 9.5px; }
    .export-mark-option { min-height: 60px; padding: 8px; }
    .export-preview__paper { min-height: 176px; padding: 14px; }
    .export-preview__content,
    .export-preview__loading { min-height: 148px; }
}

@media (max-width: 760px) {
    .export-modal {
        padding: max(24px, env(safe-area-inset-top)) 0 0;
        align-items: flex-end;
    }

    .export-modal__dialog--workbench {
        width: 100%;
        height: min(94dvh, 920px);
        max-height: 94dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 24px 24px 0 0;
    }

    .export-modal__dialog--workbench .export-modal__header {
        min-height: 62px;
        padding: 10px 15px 10px 18px;
    }

    .export-workbench__scroll {
        padding: 12px 12px 20px;
        scrollbar-gutter: auto;
    }

    .export-workbench__grid { grid-template-columns: 1fr; gap: 12px; }
    .export-workbench__main,
    .export-workbench__side { gap: 12px; }
    .export-workbench-section { padding: 14px; border-radius: 15px; }
    .export-workbench__main > #exportWorkbenchTitleSlot { padding: 12px 14px; border-radius: 15px; }
    .export-workbench-section__head { align-items: flex-start; margin-bottom: 12px; }
    .export-workbench-section__head p { font-size: 11px; }

    .export-template-cards {
        width: calc(100vw - 54px);
        grid-auto-columns: minmax(142px, 44%);
    }

    .export-template-card-shell,
    .export-template-card { min-height: 168px; }
    .export-template-group__head { align-items: flex-start; flex-direction: column; gap: 2px; }
    .export-template-group__head span { max-width: 100%; }
    .export-layout-save { grid-template-columns: 1fr; }
    .export-layout-save__open { width: 100%; }
    .export-layout-save__form > div { grid-template-columns: minmax(0, 1fr) auto; }
    .export-layout-save__form button[data-layout-save-cancel] { grid-column: 1 / -1; }
    .export-mark-options { grid-template-columns: 1fr; }
    .export-mark-option { min-height: 62px; }
    .export-preview__paper { min-height: 210px; padding: 12px; }
    .export-preview__content { min-height: 184px; padding: 16px; }

    .export-workbench__footer {
        min-height: 78px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        gap: 8px;
    }

    .export-workbench__utilities { display: none; }
    .export-workbench__submit { width: 100%; min-width: 0; min-height: 52px; }

    .export-modal__dialog--workbench.is-preview-expanded .export-preview {
        min-height: calc(94dvh - 92px);
    }

    .export-modal__dialog--workbench.is-preview-expanded .export-preview__paper {
        min-height: calc(94dvh - 230px);
    }

    .export-modal__dialog--workbench.is-preview-expanded .export-preview__content {
        min-height: calc(94dvh - 260px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .export-template-card,
    .export-template-card__delete,
    .export-switch > span,
    .export-switch > span::after,
    .export-workbench__submit,
    .export-layout-disclosure > summary > span:last-child {
        transition: none;
    }

    .export-preview__loading span,
    .export-workbench__submit.is-loading span:last-child { animation: none; }
}
