:root {
    --studio-ink: #20271d;
    --studio-muted: #70786b;
    --studio-line: #dfe4d7;
    --studio-soft: #f4f7ed;
    --studio-paper: #fcfdf9;
    --studio-accent: #b8d72e;
    --studio-accent-dark: #536b13;
    --studio-yellow: #f7df37;
    --studio-danger: #b5473d;
    --studio-shadow: 0 18px 50px rgba(48, 60, 36, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.studio-page {
    margin: 0;
    min-width: 320px;
    color: var(--studio-ink);
    background:
        radial-gradient(circle at 2% 0%, rgba(230, 241, 183, .45), transparent 25rem),
        #f6f7f2;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.studio-header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 76px;
    padding: 0 28px;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(360px, 1fr);
    align-items: center;
    gap: 24px;
    background: rgba(252, 253, 249, .94);
    border-bottom: 1px solid var(--studio-line);
    backdrop-filter: blur(18px);
}
.studio-brand {
    width: max-content;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--studio-ink);
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
}
.studio-brand img { width: 36px; height: 36px; object-fit: contain; }
.header-center { display: flex; align-items: baseline; justify-content: center; gap: 10px; white-space: nowrap; }
.header-center strong { font-size: 15px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { color: var(--studio-accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.save-state { color: var(--studio-muted); font-size: 12px; }
.header-actions { display: flex; justify-content: flex-end; gap: 9px; }
.button {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 750;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { background: var(--studio-ink); color: #fff; }
.button.primary:hover { background: #34452b; }
.button.secondary { border-color: var(--studio-line); background: #fff; }
.button.ghost { background: transparent; border-color: transparent; }
.button.danger { color: var(--studio-danger); background: #fff; border-color: #edc8c4; }
#previewMobileButton { display: none; }

.studio-shell {
    width: min(1780px, 100%);
    min-height: calc(100vh - 76px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 250px minmax(570px, 820px) minmax(300px, 370px);
    justify-content: center;
    gap: 30px;
    padding: 30px;
}
.studio-sidebar, .preview-panel { position: sticky; top: 106px; height: fit-content; max-height: calc(100vh - 132px); overflow-y: auto; scrollbar-width: thin; }
.guide-card, .my-characters, .preview-panel {
    background: rgba(252, 253, 249, .88);
    border: 1px solid var(--studio-line);
    border-radius: 22px;
}
.guide-card { padding: 19px; }
.guide-heading { display: flex; align-items: flex-end; justify-content: space-between; }
.guide-heading > div { display: flex; flex-direction: column; gap: 4px; }
.guide-heading strong { font-size: 25px; line-height: 1; }
.guide-count { color: var(--studio-muted); font-size: 12px; }
.progress-track { height: 6px; margin-top: 16px; overflow: hidden; background: #e5e9dc; border-radius: 99px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--studio-accent); border-radius: inherit; transition: width .25s ease; }
.guide-card p { min-height: 38px; margin: 12px 0 0; color: var(--studio-muted); font-size: 12px; line-height: 1.6; }
.section-nav { display: grid; gap: 4px; margin: 18px 0; }
.section-nav button {
    display: grid;
    grid-template-columns: 28px 1fr 20px;
    align-items: center;
    min-height: 46px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-weight: 650;
}
.section-nav button > span { color: #9ba294; font-size: 11px; font-variant-numeric: tabular-nums; }
.section-nav button i { opacity: 0; color: var(--studio-accent-dark); font-size: 11px; }
.section-nav button.complete i { opacity: 1; }
.section-nav button.active { color: var(--studio-accent-dark); background: #edf3d8; }
.my-characters { padding: 16px; }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; }
.sidebar-title > div { display: flex; flex-direction: column; gap: 4px; }
.sidebar-title strong { font-size: 14px; }
.sidebar-title button, .preview-header button {
    width: 35px; height: 35px; border: 1px solid var(--studio-line); border-radius: 10px; background: #fff; cursor: pointer;
}
.my-character-list { display: grid; gap: 7px; margin-top: 14px; }
.my-character-item {
    width: 100%; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 9px;
    padding: 7px; border: 1px solid transparent; border-radius: 12px; background: transparent; text-align: left; cursor: pointer;
}
.my-character-item.active { border-color: #cfdd95; background: #f1f6df; }
.my-character-item img { width: 40px; height: 45px; border-radius: 9px; object-fit: cover; background: var(--studio-soft); }
.my-character-item span { min-width: 0; }
.my-character-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.my-character-item small { display: block; margin-top: 3px; color: var(--studio-muted); font-size: 10px; }
.my-character-item > small { padding: 3px 6px; color: var(--studio-accent-dark); background: #eaf1ce; border-radius: 99px; }
.my-character-item > small[data-status="pending"] { color: #85621d; background: #fff1c7; }
.my-character-item > small[data-status="approved"] { color: #356c43; background: #dff2e2; }
.my-character-item > small[data-status="rejected"] { color: #93463c; background: #f8dfdc; }
.my-character-empty { color: var(--studio-muted); font-size: 12px; line-height: 1.6; }

.studio-form { min-width: 0; display: grid; gap: 24px; }
.form-section {
    scroll-margin-top: 100px;
    padding: 34px;
    background: var(--studio-paper);
    border: 1px solid var(--studio-line);
    border-radius: 24px;
    box-shadow: 0 1px 0 rgba(255,255,255,.8);
}
.section-heading { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--studio-line); }
.section-heading > div { display: flex; align-items: center; gap: 13px; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.025em; }
.section-heading p { margin: 9px 0 0 49px; color: var(--studio-muted); font-size: 13px; line-height: 1.7; }
.section-number { display: grid; place-items: center; width: 36px; height: 36px; color: var(--studio-accent-dark); background: #eaf2cb; border-radius: 10px; font-size: 12px; font-weight: 850; }
.portrait-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 26px; }
.portrait-field { min-width: 0; }
.field-label, .field label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.field.required > label::after { content: "必填"; margin-left: 7px; color: var(--studio-accent-dark); font-size: 10px; font-weight: 700; }
.portrait-upload {
    position: relative; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; border: 1px dashed #bcc7ab; border-radius: 18px;
    background: linear-gradient(145deg, #f6f9ed, #eef3e4); cursor: pointer;
}
.portrait-upload img { width: 100%; height: 100%; object-fit: cover; }
.portrait-upload > span { display: flex; height: 100%; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 20px; color: var(--studio-muted); }
.portrait-upload i { font-size: 28px; color: #9daa7f; }
.portrait-upload strong { color: var(--studio-ink); font-size: 13px; }
.portrait-upload small { font-size: 11px; }
.portrait-help { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--studio-muted); font-size: 10px; line-height: 1.5; }
.portrait-help i { color: var(--studio-accent-dark); }
.identity-fields, .field { min-width: 0; }
.identity-fields { display: grid; gap: 18px; }
.field { margin-top: 20px; }
.identity-fields > .field, .two-columns .field, .release-grid .field, details .field { margin-top: 0; }
.field input, .field textarea {
    display: block; width: 100%; padding: 13px 14px; color: var(--studio-ink); background: #fff;
    border: 1px solid #d7ddcf; border-radius: 12px; outline: 0; resize: vertical; line-height: 1.65;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.field input { min-height: 46px; }
.field textarea { min-height: 110px; }
.field input:focus, .field textarea:focus { border-color: #a9bd57; box-shadow: 0 0 0 3px rgba(184, 215, 46, .14); }
.field input::placeholder, .field textarea::placeholder { color: #a3a99f; }
.field > small { display: flex; justify-content: flex-end; margin-top: 6px; color: var(--studio-muted); font-size: 10px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two-columns.wide-gap { gap: 20px; margin-top: 20px; }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.subsection-heading > div { display: flex; flex-direction: column; gap: 4px; }
.subsection-heading strong { font-size: 14px; }
.subsection-heading span { color: var(--studio-muted); font-size: 11px; }
.text-button { padding: 8px 10px; color: var(--studio-accent-dark); border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.text-button i { margin-right: 5px; }
.greeting-list { display: grid; gap: 10px; }
.greeting-item { display: grid; grid-template-columns: 28px 1fr 36px; align-items: start; gap: 8px; }
.greeting-number { display: grid; place-items: center; width: 28px; height: 28px; margin-top: 8px; color: var(--studio-accent-dark); background: #eef3dc; border-radius: 8px; font-size: 10px; font-weight: 800; }
.greeting-item textarea { width: 100%; min-height: 88px; padding: 11px 12px; border: 1px solid #d7ddcf; border-radius: 11px; resize: vertical; line-height: 1.6; }
.greeting-item button { width: 34px; height: 34px; margin-top: 5px; color: var(--studio-muted); border: 0; background: transparent; cursor: pointer; }
.advanced-block { margin-top: 12px; overflow: hidden; background: #f8faf4; border: 1px solid var(--studio-line); border-radius: 14px; }
.advanced-block summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px; cursor: pointer; list-style: none; }
.advanced-block summary::-webkit-details-marker { display: none; }
.advanced-block summary span { display: flex; flex-direction: column; gap: 4px; }
.advanced-block summary strong { font-size: 14px; }
.advanced-block summary small { color: var(--studio-muted); font-size: 11px; font-weight: 400; }
.advanced-block summary i { color: var(--studio-muted); transition: transform .18s ease; }
.advanced-block[open] summary i { transform: rotate(180deg); }
.advanced-block .field { padding: 0 18px 18px; }
.release-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(230px, .75fr); gap: 22px; }
.release-card { padding: 20px; background: #f3f7e8; border: 1px solid #dfe7c8; border-radius: 16px; }
.release-card ul { display: grid; gap: 11px; padding: 0; margin: 16px 0; list-style: none; font-size: 12px; }
.release-card li { color: var(--studio-muted); }
.release-card li i { margin-right: 8px; font-size: 7px; }
.release-card li.complete { color: var(--studio-ink); }
.release-card li.complete i { color: var(--studio-accent-dark); }
.author-note { display: flex; gap: 9px; padding-top: 15px; color: var(--studio-muted); border-top: 1px solid #dfe7c8; font-size: 11px; line-height: 1.6; }
.author-note i { margin-top: 3px; color: var(--studio-accent-dark); }
.review-status-card { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 15px; padding: 12px; color: #56604c; background: #f2f4eb; border: 1px solid #e1e6d7; border-radius: 12px; }
.review-status-card > i { margin-top: 2px; color: var(--studio-accent-dark); }
.review-status-card > div { display: grid; gap: 3px; }
.review-status-card strong { font-size: 12px; }
.review-status-card span { color: var(--studio-muted); font-size: 10px; line-height: 1.55; }
.review-status-card[data-status="pending"] { background: #fff8df; border-color: #eedca4; }
.review-status-card[data-status="pending"] > i { color: #a37920; }
.review-status-card[data-status="approved"] { background: #eaf6ec; border-color: #cde5d2; }
.review-status-card[data-status="approved"] > i { color: #3d8050; }
.review-status-card[data-status="rejected"] { background: #fceedb; border-color: #edc9c4; }
.review-status-card[data-status="rejected"] > i { color: #a54e43; }
.unpublish-button { width: 100%; margin-top: 13px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 30px; padding-top: 22px; border-top: 1px solid #edd6d3; }
.danger-zone > div { display: flex; flex-direction: column; gap: 4px; }
.danger-zone strong { color: var(--studio-danger); font-size: 13px; }
.danger-zone span { color: var(--studio-muted); font-size: 11px; }

.preview-panel { padding: 20px; overflow: visible; background: rgba(252, 253, 249, .92); box-shadow: var(--studio-shadow); }
.preview-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.preview-header > div { display: flex; flex-direction: column; gap: 3px; }
.preview-header strong { font-size: 15px; }
#closePreviewButton { display: none; }
.preview-card { overflow: hidden; background: #fff; border: 1px solid var(--studio-line); border-radius: 18px; }
.preview-image-wrap { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--studio-soft); }
.preview-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.community-badge { position: absolute; top: 11px; left: 11px; padding: 6px 9px; color: #fff; background: rgba(35, 47, 29, .78); border-radius: 8px; backdrop-filter: blur(8px); font-size: 10px; font-weight: 750; }
.community-badge i { margin-right: 4px; color: #cfe85b; }
.preview-content { padding: 17px; }
.preview-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preview-title-row h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; }
.preview-title-row > span { flex: none; color: #8b6823; font-size: 11px; }
.preview-title-row i { margin-right: 4px; color: #e2a528; }
.preview-content > p { min-height: 55px; margin: 10px 0 13px; color: var(--studio-muted); font-size: 12px; line-height: 1.6; }
.preview-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.preview-tags span { padding: 4px 7px; color: var(--studio-accent-dark); background: #eef4db; border-radius: 7px; font-size: 9px; }
.preview-author { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid #edf0e8; }
.preview-avatar { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; background: var(--studio-accent-dark); border-radius: 50%; font-size: 10px; font-weight: 800; }
.preview-author div { display: flex; flex-direction: column; gap: 1px; }
.preview-author small { color: var(--studio-muted); font-size: 8px; }
.preview-author strong { font-size: 10px; }
.opening-preview { margin-top: 18px; }
.opening-bubble { max-height: 150px; margin-top: 9px; padding: 14px; overflow-y: auto; color: #454c40; background: #f1f4eb; border-radius: 6px 14px 14px 14px; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.preview-tips { display: flex; gap: 10px; margin-top: 15px; padding: 13px; color: #635d31; background: #fff9d9; border: 1px solid #eee3a7; border-radius: 13px; }
.preview-tips > i { margin-top: 2px; color: #b78f14; }
.preview-tips p { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: 10px; line-height: 1.55; }
.preview-tips p span { color: #77704b; }
.mobile-section-bar { display: none; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 30px; max-width: min(420px, calc(100vw - 32px)); padding: 11px 16px; color: #fff; background: #253120; border-radius: 11px; box-shadow: var(--studio-shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .18s ease, transform .18s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #883a32; }

body.portrait-crop-open { overflow: hidden; }
.portrait-crop-modal {
    position: fixed; inset: 0; z-index: 120; padding: 24px; display: grid; place-items: center;
    background: rgba(26, 31, 22, .72); backdrop-filter: blur(8px);
}
.portrait-crop-dialog {
    width: min(570px, 100%); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; overflow: hidden;
    color: var(--studio-ink); background: var(--studio-paper); border: 1px solid rgba(255,255,255,.64); border-radius: 20px;
    box-shadow: 0 28px 80px rgba(24, 31, 19, .28);
}
.portrait-crop-header {
    min-height: 76px; padding: 16px 18px 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
    border-bottom: 1px solid var(--studio-line); background: rgba(252,253,249,.96);
}
.portrait-crop-header h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.portrait-crop-header p { margin: 5px 0 0; color: var(--studio-muted); font-size: 12px; line-height: 1.5; }
.portrait-crop-header button {
    width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--studio-line); border-radius: 11px;
    background: var(--studio-soft); cursor: pointer; font-size: 17px;
}
.portrait-crop-body { min-height: 0; padding: 22px; overflow-y: auto; }
.portrait-crop-stage {
    position: relative; width: min(100%, 390px); aspect-ratio: 3 / 4; margin: 0 auto; overflow: hidden; border-radius: 14px;
    background: #252b21; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); cursor: grab; touch-action: none;
}
.portrait-crop-stage.dragging { cursor: grabbing; }
.portrait-crop-stage canvas { width: 100%; height: 100%; display: block; }
.portrait-crop-stage::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; border: 1px solid rgba(245,248,235,.88); border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(31,39,24,.2);
}
.portrait-crop-corner { position: absolute; z-index: 2; width: 22px; height: 22px; pointer-events: none; border-color: #e4ed75; border-style: solid; }
.corner-top-left { top: 9px; left: 9px; border-width: 3px 0 0 3px; }
.corner-top-right { top: 9px; right: 9px; border-width: 3px 3px 0 0; }
.corner-bottom-left { bottom: 9px; left: 9px; border-width: 0 0 3px 3px; }
.corner-bottom-right { right: 9px; bottom: 9px; border-width: 0 3px 3px 0; }
.portrait-crop-controls {
    margin-top: 16px; display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 14px;
}
.portrait-crop-controls label { display: inline-flex; align-items: center; gap: 7px; color: var(--studio-muted); font-size: 12px; font-weight: 700; }
.portrait-crop-controls label i { color: var(--studio-accent-dark); }
.portrait-crop-controls input { width: 100%; accent-color: var(--studio-accent-dark); }
.portrait-crop-controls button { min-height: 38px; padding: 0 12px; border: 1px solid var(--studio-line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 700; }
.portrait-crop-controls button i { margin-right: 6px; color: var(--studio-accent-dark); }
.portrait-crop-footer { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--studio-line); }
.portrait-crop-footer .button { min-width: 116px; }
.portrait-crop-footer .button i { margin-right: 7px; }

@media (max-width: 1260px) {
    .studio-shell { grid-template-columns: 220px minmax(540px, 760px); }
    .preview-panel { position: fixed; z-index: 50; top: 76px; right: 0; width: min(390px, 100vw); height: calc(100vh - 76px); max-height: none; overflow-y: auto; border-radius: 22px 0 0 0; transform: translateX(105%); transition: transform .2s ease; }
    .preview-panel.open { transform: translateX(0); }
    #previewMobileButton, #closePreviewButton { display: inline-grid; place-items: center; }
}

@media (max-width: 820px) {
    body.studio-page { padding-bottom: 70px; }
    .studio-header { height: 64px; grid-template-columns: auto 1fr auto; gap: 10px; padding: 0 14px; }
    .studio-brand span, .header-center .eyebrow, .save-state, .header-actions .primary span { display: none; }
    .studio-brand img { width: 32px; height: 32px; }
    .header-center { justify-content: flex-start; min-width: 0; }
    .header-center strong { max-width: 38vw; font-size: 13px; }
    .header-actions { gap: 2px; }
    .button { min-height: 38px; padding: 0 11px; border-radius: 10px; font-size: 12px; }
    #previewMobileButton { display: inline-flex; gap: 6px; }
    #publishButton { display: block; }
    .studio-shell { display: block; min-height: auto; padding: 14px; }
    .studio-sidebar { position: static; max-height: none; overflow: visible; }
    .guide-card { padding: 15px; border-radius: 16px; }
    .guide-card p { min-height: 0; }
    .section-nav { grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 10px 0 14px; }
    .section-nav button { display: flex; justify-content: center; min-height: 38px; padding: 0; font-size: 0; }
    .section-nav button > span { font-size: 10px; }
    .section-nav button i { display: none; }
    .my-characters { display: block; margin-bottom: 14px; padding: 12px; border-radius: 16px; }
    .my-character-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
    .my-character-item { min-width: 190px; }
    .my-character-empty { margin: 4px 0 0; }
    .studio-form { gap: 14px; }
    .form-section { display: none; padding: 21px 17px; border-radius: 18px; }
    .form-section.mobile-active { display: block; }
    .section-heading { margin-bottom: 22px; padding-bottom: 17px; }
    .section-heading h1, .section-heading h2 { font-size: 21px; }
    .section-heading p { margin-left: 0; font-size: 12px; }
    .section-number { width: 32px; height: 32px; }
    .portrait-layout { grid-template-columns: 116px minmax(0, 1fr); gap: 13px; align-items: start; }
    .portrait-upload { border-radius: 14px; }
    .portrait-upload strong, .portrait-upload small { display: none; }
    .portrait-upload i { font-size: 21px; }
    .identity-fields { gap: 13px; }
    .two-columns { grid-template-columns: 1fr; gap: 13px; }
    .field { margin-top: 16px; }
    .field input, .field textarea { padding: 12px; font-size: 14px; }
    .field label, .field-label { font-size: 12px; }
    .wide-gap { margin-top: 16px; }
    .release-grid { grid-template-columns: 1fr; }
    .danger-zone { align-items: flex-start; flex-direction: column; }
    .preview-panel { top: 64px; height: calc(100vh - 64px); padding-bottom: 30px; }
    .mobile-section-bar { position: fixed; z-index: 25; right: 0; bottom: 0; left: 0; height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 14px env(safe-area-inset-bottom); background: rgba(252, 253, 249, .96); border-top: 1px solid var(--studio-line); backdrop-filter: blur(16px); }
    .mobile-section-bar button { height: 40px; color: var(--studio-accent-dark); border: 0; background: transparent; font-size: 11px; font-weight: 750; }
    .mobile-section-bar button:first-child { text-align: left; }
    .mobile-section-bar button:last-child { text-align: right; }
    .mobile-section-bar button i { margin: 0 5px; }
    .mobile-section-bar > span { font-size: 11px; font-weight: 800; }
}

@media (max-width: 480px) {
    .header-center { display: none; }
    .portrait-layout { display: block; }
    .portrait-field { width: 100%; margin-bottom: 20px; }
    .header-actions .button span { display: none; }
    .subsection-heading { align-items: flex-start; gap: 8px; }
}

@media (max-width: 620px) {
    .portrait-crop-modal { padding: 0; place-items: stretch; }
    .portrait-crop-dialog { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
    .portrait-crop-header { min-height: calc(66px + env(safe-area-inset-top)); padding: max(12px, env(safe-area-inset-top)) 12px 12px 16px; }
    .portrait-crop-header h2 { font-size: 18px; }
    .portrait-crop-header p { max-width: 32ch; font-size: 10px; }
    .portrait-crop-body { padding: 16px 12px; display: flex; flex-direction: column; justify-content: flex-start; }
    .portrait-crop-stage { width: min(100%, calc((100dvh - 230px) * .75), 330px); }
    .portrait-crop-stage { border-radius: 12px; }
    .portrait-crop-controls { grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; }
    .portrait-crop-controls label span { display: none; }
    .portrait-crop-footer { justify-content: stretch; padding-inline: 12px; }
    .portrait-crop-footer .button { flex: 1; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
