.short-story-editor-actions {
    display: flex;
    align-items: stretch;
    gap: 6px;
}
.short-story-editor-actions > button { white-space: nowrap }
.short-story-editor-actions > .short-story-download {
    flex-shrink: 0;
    justify-content: center;
    min-width: 36px;
}
@media (max-width: 420px) {
    .short-story-editor-actions > button:not(.chapter-tools-trigger, .short-story-download) > svg { display: none }
}
.short-story-manual-action {
    background: white;
    color: #ba421b;
    border: 1px solid #f2d6c9;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.short-story-manual-action:hover { background: #fff6f1 }
.short-story-manual-editor:empty::before {
    content: attr(data-placeholder);
    color: #89817d;
    pointer-events: none;
}
.short-story-manual-entry {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}
.short-story-manual-form {
    display: grid;
    gap: 18px;
    padding: 6px 8px 20px;
}
.short-story-manual-form h3 {
    margin: 0;
    color: #24211f;
    font-size: 20px;
}
.short-story-manual-form label { display: grid; gap: 6px }
.short-story-manual-form label > span { font-size: 14px; font-weight: 600 }
.short-story-manual-form :is(input, select) {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #e4dedb;
    border-radius: 10px;
    background: white;
    color: #24211f;
    font-size: 16px;
}
.short-story-manual-form-actions { display: flex; gap: 12px }
.short-story-manual-form-actions .btn { flex: 1; min-height: 44px }
.short-story-manual-form .short-story-manual-error {
    margin: 0;
    color: #a92e17;
    font-size: 14px;
}

body:has(.chapter-editor-mobile) {
    --chapter-editor-toolbar-height: calc(73px + env(safe-area-inset-bottom, 0px));
    --chapter-editor-toolbar-reserve: 0px;
    padding-top: 0 !important;
}
body:has(.chapter-editor-mobile):has(.chapter-editor-toolbar) {
    --chapter-editor-toolbar-reserve: var(--chapter-editor-toolbar-height);
}
body:has(.chapter-editor-mobile) :is(.site-footer,.mobile-nav) { display: none !important }
body:has(.chapter-editor-mobile) #app > div:has(> div > .chapter-editor-mobile) {
    min-height: 100dvh !important;
}

.chapter-editor-mobile {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: calc(100vh - var(--chapter-editor-toolbar-reserve));
    height: calc(100dvh - var(--chapter-editor-toolbar-reserve));
    background: #fafaf9;
}
.chapter-editor-header {
    z-index: 1000;
    flex: none;
    padding-top: env(safe-area-inset-top, 0px);
    background: #fafaf9;
}
.chapter-editor-header > div {
    gap: 6px;
    padding: 10px clamp(12px,4vw,20px) !important;
}
.chapter-editor-header button { white-space: nowrap }
.chapter-editor-main {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
    max-width: 800px;
    margin: 0 auto;
    padding: 8px clamp(12px,4vw,20px) 0;
}
.chapter-editor-draft {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}
.chapter-editor-draft > :not(.chapter-editor-text) { flex-shrink: 0 }
.chapter-editor-text {
    flex: 1;
    min-height: 0;
    padding: 0 0 12px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-padding-block-end: 12px;
    outline: none;
    color: #333;
    font-size: 16px;
    line-height: 2;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chapter-editor-toolbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    box-sizing: border-box;
    height: var(--chapter-editor-toolbar-height);
    border-top: 1px solid #ede7e3;
    background: #fff;
    box-shadow: 0 -4px 16px #43241110;
}
.chapter-editor-toolbar-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px clamp(12px,4vw,20px);
}
.chapter-editor-toolbar-buttons { display: flex; gap: clamp(6px,2vw,12px) }
.chapter-editor-toolbar-buttons button {
    box-sizing: border-box;
    min-width: 0;
    height: 48px;
    gap: clamp(4px,1.5vw,8px) !important;
    padding: 0 !important;
    font-size: clamp(12px,3.6vw,15px) !important;
    white-space: nowrap;
}
.chapter-editor-toolbar-buttons button svg { flex: none; width: clamp(15px,4.2vw,18px) }
@media (max-width: 360px) {
    .chapter-editor-header > div > div:last-child { gap: 5px !important }
    .chapter-editor-header > div > div:last-child > button { padding-inline: 8px !important }
}
