/* Authoring UI only. Public manuscript presentation and document typography
   deliberately keep their existing styles. Prodromos tokens take precedence. */
/* Prodromos currently supplies dark semantic tokens even for light-mode
   users. Keep the light palette explicit; only dark mode inherits those tokens. */
.homer-ui {
    --homer-bg: #fafbfc;
    --homer-panel: #dce1e7;
    --homer-input: #fff;
    --homer-text: #20252b;
    --homer-muted: #48515c;
    --homer-placeholder: #515e6b;
    --homer-border: #929daa;
    --homer-accent: #125078;
    --homer-selected: #c4dded;
    font-family: Lato, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--homer-text);
    background: var(--homer-bg);
    color-scheme: light;
}
.homer-ui[data-homer-theme="dark"] {
    --homer-bg: var(--wa-colors-background-strongest, #222324);
    --homer-panel: var(--wa-colors-background-strong, #2c2d2e);
    --homer-input: var(--wa-colors-accent-background, #1b1b1c);
    --homer-text: var(--wa-colors-foreground-strongest, #ebeef5);
    --homer-muted: var(--wa-colors-foreground-average, #a6a9ad);
    --homer-placeholder: #b9c2cd;
    --homer-border: var(--wa-colors-background-weak, #47484a);
    --homer-accent: var(--wa-colors-default-main-primary-accent, #54bbfa);
    --homer-selected: var(--wa-colors-default-toolbar-button-background, #213745);
    color-scheme: dark;
}
/* Preserve the legacy editor's full-page treatment without hiding every
   Bootstrap .border-bottom or restyling the global navigation. */
body.homer-editor-page .pre-footer,
body.homer-editor-page .footer,
body.homer-editor-page .navbar-static-top,
body.homer-editor-page .super-buttons-container { display: none; }
body.homer-editor-page #page-wrapper > .wrapper { padding: 0; margin: 0; }
body.prodromos-installed.homer-editor-page .homer-manuscript-wrapper {
    margin-top: 0;
}
.homer-ui a { color: var(--homer-accent); }
.homer-ui h1, .homer-ui h2, .homer-ui h3, .homer-ui h4,
.homer-ui .header-title { font-family: Lato, Arial, sans-serif; color: var(--homer-text); }
.homer-ui h1 { font-size: 24px; }
.homer-ui h2 { font-size: 21px; }
.homer-ui h3 { font-size: 18px; }
.homer-ui .header-title { font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.homer-ui .form-control-description, .homer-ui .text-muted { color: var(--homer-muted) !important; }
.homer-ui hr { border-color: var(--homer-border); }
.homer-ui .form-control, .homer-ui .homer-input {
    background: var(--homer-input) !important;
    border: 1px solid var(--homer-border) !important;
    border-radius: 3px;
    color: var(--homer-text) !important;
    font: inherit;
    padding: 7px 9px;
    opacity: 1;
    max-width: 100%;
    box-shadow: none;
}
.homer-ui input::placeholder,
.homer-ui textarea::placeholder {
    color: var(--homer-placeholder) !important;
    opacity: 1 !important;
    -webkit-text-fill-color: var(--homer-placeholder) !important;
}
.homer-ui textarea.form-control { min-height: 80px; resize: vertical; }
.homer-ui .form-control:focus, .homer-ui .homer-input:focus {
    border-color: var(--homer-accent) !important;
    outline: 2px solid var(--homer-accent);
    outline-offset: 1px;
}
.homer-ui a:focus-visible, .homer-ui button:focus-visible {
    outline: 2px solid var(--homer-accent);
    outline-offset: 2px;
}
.homer-ui .btn {
    border-radius: 3px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    padding: 6px 10px;
    box-shadow: none;
    white-space: normal;
}
.homer-ui .btn-primary, .homer-ui .btn-secondary, .homer-ui .btn-default {
    background: var(--homer-panel);
    border: 1px solid var(--homer-border);
    color: var(--homer-text);
}
.homer-ui .btn-primary:hover, .homer-ui .btn-secondary:hover,
.homer-ui .btn-default:hover, .homer-ui .mode-change.active {
    color: var(--homer-accent);
    background: var(--homer-selected);
    border-color: var(--homer-accent);
}
.homer-ui .btn-success { background: #07612f; border-color: #07612f; color: #fff; }
.homer-ui .btn-success:hover { background: #0b4b26; border-color: #0b4b26; }
.homer-ui .btn-danger { background: #9f0e11; border-color: #9f0e11; color: #fff; }
.homer-ui .btn-danger:hover { background: #7e0508; border-color: #7e0508; }
.homer-ui .dropdown-menu { background: var(--homer-panel); border-color: var(--homer-border); border-radius: 3px; }
.homer-ui .dropdown-item { color: var(--homer-text); padding: 7px 14px; }
.homer-ui .dropdown-item:hover, .homer-ui .dropdown-item:focus { color: var(--homer-accent); background: var(--homer-selected); }
.homer-manuscript-wrapper .row.homer-manuscript-top-container {
    margin: 0;
    padding: 10px 16px;
    background: var(--homer-panel);
    border-bottom: 1px solid var(--homer-border);
}
.homer-workspace-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0; }
.homer-toolbar-actions, .homer-display-navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.homer-display-navigation { margin-left: auto; }
.homer-version-search-input.form-control { width: 190px; height: auto; margin: 0; }
.homer-ui .save-indicator { color: var(--homer-muted); font-size: 12px; }
.homer-ui .save-indicator .label { background: transparent; color: inherit; }
.homer-manuscript-wrapper .row.homer-manuscript-bottom-container { margin: 0; }
.homer-manuscript-wrapper #homer-left-container,
.homer-manuscript-wrapper #homer-right-container { padding: 0; background: var(--homer-panel); }
.homer-manuscript-wrapper #homer-left-container { border-right: 1px solid var(--homer-border); }
.homer-manuscript-wrapper #homer-right-container { border-left: 1px solid var(--homer-border); }
.homer-manuscript-wrapper #homer-center-container { padding: 0; min-width: 0; }
.homer-panel-heading { margin: 0; padding: 14px 14px 8px; font-size: 11px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.homer-manuscript-wrapper #homer-center-content,
.homer-manuscript-wrapper #homer-right-content { overflow: auto; background: var(--homer-bg); }
.homer-manuscript-wrapper #homer-right-content { background: var(--homer-panel); }
.homer-manuscript-wrapper #homer-center-top-content { max-height: 30vh; overflow: auto; }
/* Override legacy theme !important fills so the selected tab and its pane
   share one surface in both light and dark mode. */
.homer-ui .tab-content,
.homer-ui .homer-tab-content { background-color: var(--homer-bg) !important; }
.homer-ui .homer-tab-content { padding: 18px; margin: 0; border: 0; }
.homer-ui .homer-tab-content .homer-tab-content { padding: 16px 0; }
.homer-ui .homer-tab-content-item { margin-bottom: 20px; }
.homer-ui .homer-tab-content-item-container { margin-left: 0; }
.homer-ui .nav-tabs { background: var(--homer-panel); border-color: var(--homer-border); display: flex; flex-wrap: wrap; gap: 2px; padding: 16px 10px 0; }
.homer-ui .nav-tabs .nav-link { color: var(--homer-muted); padding: 12px 12px; font-size: 12px; border-radius: 3px 3px 0 0; }
.homer-ui .nav-tabs .nav-link:not(.active):hover {
    color: var(--homer-accent); background: var(--homer-selected); border-color: var(--homer-border);
}
.homer-ui .nav-tabs .nav-item { margin: 0 0 -1px; }
.homer-ui .nav-tabs .nav-link.active,
.homer-ui .nav-tabs .nav-item.show .nav-link {
    position: relative;
    background-color: var(--homer-bg) !important;
    color: var(--homer-text) !important;
    border: 1px solid var(--homer-border);
    border-bottom-color: var(--homer-bg);
    box-shadow: inset 0 2px var(--homer-accent);
    font-weight: 700;
}
.homer-ui .nav-tabs .nav-link.active i { color: inherit !important; }
.homer-ui .nav-tabs .nav-link i { color: inherit; }
.homer-ui .homer-tab-label { margin-left: 4px; }
.homer-ui ol#parts-tree { list-style: none; padding: 8px; margin: 0; overflow: auto; }
/* Each level is inset 36px horizontally; the guide belongs to the child list so it
   follows the actual hierarchy, including collapsed and reordered folders. */
.homer-ui #parts-tree ol {
    list-style: none;
    margin: 2px 0 3px 20px;
    padding: 0 0 0 15px;
    border-left: 1px solid var(--homer-border);
}
.homer-ui #parts-tree li { padding: 2px 0; border-radius: 3px; }
.homer-ui .homer-tree-list-item-data { display: flex; align-items: baseline; gap: 5px; padding: 2px; }
.homer-ui .homer-tree-part { display: inline-flex; align-items: baseline; gap: 6px; flex: 1; min-width: 0; padding: 6px; border-radius: 2px; }
.homer-ui #parts-tree .homer-tree-part-title { display: inline; max-width: none; overflow-wrap: anywhere; }
.homer-ui .homer-tree-part:hover { background: var(--homer-selected); color: var(--homer-accent); }
.homer-ui .homer-tree-active { background: var(--homer-selected); color: var(--homer-accent); box-shadow: inset 2px 0 var(--homer-accent); }
.homer-ui .homer-tree-active .homer-tree-part-title { font-weight: 700; }
.homer-ui span.homer-genre, .homer-ui span.homer-part-tag {
    display: inline-block; padding: 3px 7px; margin: 4px 3px;
    border: 1px solid var(--homer-border); border-radius: 3px; background: var(--homer-panel); cursor: pointer;
}
.homer-ui .homer-part-label-selection-wrapper { padding: 10px; margin: 5px 0; background: var(--homer-panel); }
.homer-ui .homer-part-label { display: inline-block; padding: 3px 6px; border-radius: 3px; font-size: 13px; }
.homer-ui .homer-part-synopsis { padding: 12px; border: 1px solid var(--homer-border); margin-bottom: 8px; }
.homer-ui .homer-part-reading { border-bottom: 1px solid var(--homer-border); margin-bottom: 12px; }
.homer-ui .homer-part-clean { background: transparent !important; border-color: transparent !important; }
.homer-ui textarea.homer-part-clean { min-height: auto !important; }
.homer-ui .table { color: var(--homer-text); }
.homer-ui .table td, .homer-ui .table th { border-color: var(--homer-border); }
.homer-ui .ibox, .homer-ui .ibox-content { background: var(--homer-panel); border-color: var(--homer-border); color: var(--homer-text); }
/* Only TinyMCE chrome is themed. Its iframe still uses homer_settings,
   including the author's custom CSS, font, page colour and paragraph rules. */
.homer-ui .tox-tinymce { border: 0; border-radius: 0; }
.homer-ui .tox .tox-menubar, .homer-ui .tox .tox-toolbar,
.homer-ui .tox .tox-toolbar__primary, .homer-ui .tox .tox-toolbar__overflow,
.homer-ui .tox .tox-toolbar-overlord, .homer-ui .tox .tox-statusbar {
    background: var(--homer-panel); color: var(--homer-text); border-color: var(--homer-border);
}
.homer-ui .tox .tox-mbtn, .homer-ui .tox .tox-tbtn,
.homer-ui .tox .tox-statusbar a, .homer-ui .tox .tox-statusbar__path-item,
.homer-ui .tox .tox-statusbar__wordcount { color: var(--homer-text); font-family: Lato, Arial, sans-serif; }
.homer-ui .tox .tox-tbtn svg { fill: var(--homer-text); }
.homer-ui .tox .tox-mbtn:hover, .homer-ui .tox .tox-tbtn:hover,
.homer-ui .tox .tox-tbtn--enabled { background: var(--homer-selected); color: var(--homer-accent); }
/* Library: all original edit/view/export/delete links remain visible on touch
   and keyboard, rather than being available only when hovering a cover. */
.homer-library { padding: 24px; }
.homer-library #homer-manuscripts-list { max-width: none; padding: 0; }
.homer-library .homer-manuscript-tile { width: 100%; height: auto; min-height: 340px; padding-top: 190px; background-position: center top; border: 1px solid var(--homer-border); border-radius: 3px; overflow: hidden; }
.homer-library .homer-manuscript-tile-container,
.homer-library .homer-manuscript-tile:hover .homer-manuscript-tile-container {
    display: block; position: static; width: 100%; max-width: none; padding: 12px 14px 4px; background: var(--homer-panel);
}
.homer-library .homer-manuscript-tile-container h4 { color: var(--homer-text) !important; margin: 0; overflow-wrap: anywhere; }
.homer-library .homer-manuscript-action-container,
.homer-library .homer-manuscript-tile:hover .homer-manuscript-action-container {
    display: flex; flex-wrap: wrap; gap: 6px; position: static; padding: 10px 14px 14px; width: 100%; background: var(--homer-panel);
}
.homer-library .homer-manuscript-action-container .btn { width: auto; flex: 1 1 auto; margin: 0 !important; }
.homer-library .homer-manuscript-add-icon { position: static; padding: 20px; }
.homer-library .homer-manuscript-create-tile { padding-top: 0; display: flex; align-items: center; justify-content: center; background: var(--homer-panel); }
@media (min-width: 992px) {
    .homer-manuscript-wrapper #homer-left-container { flex: 0 0 var(--homer-left-width, 20%); max-width: var(--homer-left-width, 20%); }
    .homer-manuscript-wrapper #homer-right-container { flex: 0 0 var(--homer-right-width, 27%); max-width: var(--homer-right-width, 27%); }
    .homer-manuscript-wrapper #homer-center-container { flex: 1 1 0; max-width: 100%; }
}
@media (max-width: 991px) {
    .homer-manuscript-wrapper #homer-left-container,
    .homer-manuscript-wrapper #homer-right-container,
    .homer-manuscript-wrapper #homer-center-container { width: 100%; flex: 0 0 100%; max-width: 100%; border: 0; }
    .homer-display-navigation { margin-left: 0; }
    .homer-manuscript-wrapper #homer-right-content,
    .homer-manuscript-wrapper #homer-center-content { height: auto !important; }
    .homer-ui ol#parts-tree { max-height: 280px; }
    .homer-ui .form-control { font-size: 16px; }
    .homer-library { padding: 16px; }
}

/* Column splitters sit on the existing panel edges, leaving the original
   sidebar show/hide controls and mobile stacking intact. */
.homer-column-resizer { display: none; }
@media (min-width: 992px) {
    .homer-manuscript-wrapper #homer-left-container,
    .homer-manuscript-wrapper #homer-right-container { position: relative; }
    .homer-column-resizer {
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        width: 12px;
        z-index: 20;
        cursor: col-resize;
        touch-action: none;
    }
    .homer-column-resizer[data-side="left"] { right: -6px; }
    .homer-column-resizer[data-side="right"] { left: -6px; }
    .homer-column-resizer::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 5px;
        width: 2px;
        background: transparent;
    }
    .homer-column-resizer::after {
        content: "";
        position: absolute;
        top: 100px;
        left: 4px;
        width: 4px;
        height: 36px;
        border-radius: 3px;
        background: var(--homer-border);
    }
    .homer-column-resizer:hover::before,
    .homer-column-resizer:focus::before,
    .homer-column-resizer:hover::after,
    .homer-column-resizer:focus::after { background: var(--homer-accent); }
    .homer-column-resizer:focus-visible { outline: 2px solid var(--homer-accent); outline-offset: -2px; }
}
body.homer-resizing-columns, body.homer-resizing-columns * { cursor: col-resize !important; user-select: none !important; }
body.homer-resizing-columns iframe { pointer-events: none; }

/* Review cards need a separate surface and visible editable fields in light
   mode; the legacy "clean" fields otherwise disappear into the page. */
.homer-ui[data-homer-theme="light"] .homer-part-synopsis {
    background-color: #e1e7ee !important;
    border: 1px solid #8290a0 !important;
    border-left: 3px solid #65788d !important;
    border-radius: 3px;
    color: #20252b;
    padding: 16px;
    margin-bottom: 14px;
}
.homer-ui[data-homer-theme="light"] .homer-part-synopsis .form-control.homer-part-clean {
    background: #fff !important;
    border: 1px solid #748091 !important;
    color: #20252b !important;
    padding: 8px 10px;
}
.homer-ui[data-homer-theme="light"] .homer-part-synopsis .form-control.homer-part-clean:focus {
    border-color: #125078 !important;
    outline: 2px solid #125078;
}
.homer-ui[data-homer-theme="light"] .homer-part-publication .text-warning {
    color: #804400 !important;
    background: #fff0d6;
    border: 1px solid #b8792f;
    border-radius: 3px;
    padding: 3px 7px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
}
.homer-ui[data-homer-theme="light"] .homer-part-publication .text-success { color: #185c31 !important; font-weight: 700; }
.homer-ui[data-homer-theme="light"] .homer-part-label-empty {
    color: #334252 !important;
    background: #d4dce6 !important;
    border: 1px solid #8290a0;
}
.homer-ui[data-homer-theme="light"] .homer-part-synopsis .homer-tree-part,
.homer-ui[data-homer-theme="light"] .homer-part-synopsis .homer-part-archive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    margin-bottom: 4px;
    padding: 5px;
    color: #125078;
    background: #fff;
    border: 1px solid #748091;
    border-radius: 3px;
}
.homer-ui[data-homer-theme="light"] .homer-part-synopsis .homer-part-archive { color: #8b2025; }

/* Labels remain distinct from the blue navigation selection, with their
   names visible rather than relying on colour or a hover tooltip alone. */
.homer-ui #parts-tree .homer-tree-part-title { flex: 1 1 auto; min-width: 0; }
.homer-ui .homer-tree-label-badge {
    display: inline-block;
    flex: 0 1 auto;
    max-width: 46%;
    margin-left: auto;
    padding: 3px 7px;
    border: 1px solid var(--homer-border);
    border-left: 5px solid var(--homer-label-color, var(--homer-border));
    border-radius: 4px;
    background: var(--homer-panel);
    background: var(--homer-label-color, var(--homer-panel));
    color: var(--homer-text);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    overflow-wrap: anywhere;
    align-self: center;
}

/* Review card: put the synopsis across the entire card, not in a quarter-width
   Bootstrap column. Metadata and actions wrap independently of the text. */
.homer-ui .homer-synopsis-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.homer-ui .homer-synopsis-title-field { flex: 1 1 240px; min-width: 0; margin: 0; }
.homer-ui .homer-synopsis-field-label { display: block; margin-bottom: 6px; color: var(--homer-text); font-size: 12px; font-weight: 700; }
.homer-ui .homer-synopsis-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.homer-ui .homer-synopsis-metadata { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 14px 0; color: var(--homer-muted); font-size: 13px; }
.homer-ui .homer-synopsis-body-field { display: block; width: 100%; margin: 0; }
.homer-ui .homer-synopsis-body-field textarea.homer-part-clean { width: 100%; min-height: 120px !important; }
.homer-ui .homer-synopsis-card .form-control.homer-part-clean { background: var(--homer-input) !important; border: 1px solid var(--homer-border) !important; }
.homer-ui .homer-synopsis-tags { margin-top: 10px; }
.homer-ui .homer-part-synopsis .homer-synopsis-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    gap: 7px;
    min-height: 36px;
    padding: 7px 12px;
    margin: 0;
    color: #fff !important;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
}
.homer-ui .homer-part-synopsis .homer-synopsis-actions .homer-synopsis-edit { background: #185880; border-color: #185880; }
.homer-ui .homer-part-synopsis .homer-synopsis-actions .homer-synopsis-edit:hover { background: #124363; border-color: #124363; }
.homer-ui .homer-part-synopsis .homer-synopsis-actions .homer-synopsis-trash { background: #9f0e11; border-color: #9f0e11; }
.homer-ui .homer-part-synopsis .homer-synopsis-actions .homer-synopsis-trash:hover { background: #7e0508; border-color: #7e0508; }

/* The contrast helper supplies readable text for each saved label colour. */
.homer-ui .homer-tree-label-badge,
.homer-ui .homer-part-label { color: var(--homer-label-text, var(--homer-text)); }
.homer-ui .homer-tree-label-badge i,
.homer-ui .homer-part-label i { color: var(--homer-label-text, inherit) !important; }

.homer-ui .homer-label-color-control { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--homer-text); cursor: pointer; }
.homer-ui input.homer-label-color-picker {
    display: inline-block;
    width: 64px;
    min-width: 64px;
    height: 38px;
    padding: 4px;
    background: var(--homer-input);
    border: 1px solid var(--homer-border);
    border-radius: 4px;
    cursor: pointer;
}
.homer-ui .homer-label-color-picker:focus-visible { outline: 2px solid var(--homer-accent); outline-offset: 2px; }
.homer-ui .homer-label-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.homer-ui .homer-label-color-picker::-webkit-color-swatch { border: 0; border-radius: 2px; }
.homer-ui .homer-label-color-picker::-moz-color-swatch { border: 0; border-radius: 2px; }

.homer-ui .homer-label-management-table { width: 100%; table-layout: fixed; }
.homer-ui .homer-label-management-table .homer-label-color-column { width: 86px; }
.homer-ui .homer-label-management-table td { vertical-align: middle; padding: 10px 8px; }
.homer-ui .homer-label-management-table input.homer-label-color-picker { display: block; margin: 0; }

/* Match the Prodromos toolkit Tag: blue body, light text, darker remove area. */
.homer-ui .homer-part-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.homer-ui span.homer-part-tag {
    display: inline-flex;
    align-items: stretch;
    padding: 0;
    background: var(--wa-colors-default-main-primary-medium, #1e6d9e) !important;
    color: #ebeef5 !important;
    border: 0 !important;
    border-radius: 2px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.5;
}
.homer-ui .homer-part-tags-container > .homer-part-tag { margin: 0; }
.homer-ui .homer-part-tag-load { padding: 4px 8px; color: inherit !important; overflow-wrap: anywhere; }
.homer-ui .homer-part-tag-delete {
    display: inline-flex;
    align-items: center;
    padding: 4px 6px;
    background: var(--wa-colors-default-main-primary-dark, #185880);
    color: #ebeef5 !important;
}
.homer-ui .homer-part-tag-delete i { color: inherit !important; }
.homer-ui .homer-part-tag-load:hover { background: var(--wa-colors-default-main-primary-dark, #185880); }
.homer-ui .homer-part-tag-delete:hover { background: #124363; }

.homer-manuscript-wrapper { position: relative; }
.homer-ui .homer-label-popover {
    position: absolute;
    z-index: 1100;
    overflow-y: auto;
    padding: 10px;
    background: var(--homer-panel);
    color: var(--homer-text);
    border: 1px solid var(--homer-border);
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.homer-ui .homer-label-menu-heading { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.homer-ui .homer-label-popover .homer-part-label-select {
    display: block;
    width: 100%;
    padding: 8px 10px;
    text-align: left;
    font-family: inherit;
    border: 1px solid var(--homer-border);
    background: var(--homer-input);
    cursor: pointer;
    white-space: normal;
    overflow-wrap: anywhere;
}
.homer-ui .homer-label-popover .homer-part-label-select:hover { outline: 2px solid var(--homer-accent); outline-offset: -2px; }
.homer-ui .homer-label-popover .homer-manuscript-configuration { background: transparent; color: var(--homer-accent); border: 0; padding: 8px 0 0; cursor: pointer; }

/* Keep the title and actions on the same baseline without legacy input margins. */
.homer-ui .homer-synopsis-header input.homer-part-synopsis-title {
    height: 44px; min-height: 44px; margin: 0 !important;
    padding: 10px 12px; font-size: 17px; line-height: 22px;
}
.homer-ui .homer-part-synopsis .homer-synopsis-actions .btn { min-height: 44px; }
.homer-ui .btn-success { background: #07612f !important; border-color: #07612f !important; color: #fff !important; }
.homer-ui .btn-success:hover, .homer-ui .btn-success:focus,
.homer-ui .btn-success:active, .homer-ui .open > .dropdown-toggle.btn-success {
    background: #0b4b26 !important; border-color: #0b4b26 !important; color: #fff !important;
}
.homer-ui .btn-success i { color: inherit !important; }

/* TinyMCE appends its dropdowns to body, outside the workspace theme scope. */
body.homer-editor-page {
    --homer-menu-bg: #fff;
    --homer-menu-text: #20252b;
    --homer-menu-muted: #596472;
    --homer-menu-border: #a2adba;
    --homer-menu-hover: #d9eaf5;
    --homer-menu-shadow: 0 8px 24px rgba(26, 39, 52, .24), 0 2px 6px rgba(26, 39, 52, .14);
}
body.homer-editor-page[data-homer-theme="dark"] {
    --homer-menu-bg: #353739;
    --homer-menu-text: #ebeef5;
    --homer-menu-muted: #bac0c8;
    --homer-menu-border: #62676d;
    --homer-menu-hover: #244a60;
    --homer-menu-shadow: 0 10px 28px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
}
body.homer-editor-page .tox .tox-menu,
body.homer-editor-page .homer-ui .dropdown-menu,
body.homer-editor-page .homer-label-popover {
    background: var(--homer-menu-bg);
    color: var(--homer-menu-text);
    border: 1px solid var(--homer-menu-border);
    border-radius: 5px;
    box-shadow: var(--homer-menu-shadow);
}
body.homer-editor-page .tox .tox-collection--list .tox-collection__item {
    background: transparent; color: var(--homer-menu-text);
}
body.homer-editor-page .tox .tox-collection--list .tox-collection__item--enabled {
    background: var(--homer-menu-hover);
}
body.homer-editor-page .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) {
    background: var(--homer-menu-hover); color: var(--homer-menu-text);
}
body.homer-editor-page .tox .tox-collection--list .tox-collection__group { border-color: var(--homer-menu-border); }
body.homer-editor-page .tox .tox-collection__item-accessory { color: var(--homer-menu-muted); }
body.homer-editor-page .tox .tox-collection__item--state-disabled { opacity: .5; }

/* Clear the action float so every metadata row has the same available width. */
.homer-ui .homer-folder-metadata {
    clear: both;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 2.6fr);
    align-items: center;
    gap: 12px;
    width: 100%;
}
.homer-ui .homer-folder-metadata > div { min-width: 0; overflow-wrap: anywhere; }
.homer-ui .homer-folder-metadata-cell:first-child { font-variant-numeric: tabular-nums; }
.homer-ui .homer-folder-metadata .homer-part-label { max-width: 100%; white-space: normal; }
.homer-ui .homer-folder-metadata-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Compact actions use the same neutral surfaces and accents as the workspace. */
.homer-ui .homer-part-synopsis .homer-synopsis-actions .btn {
    flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px;
    padding: 0; margin: 0; font-size: 16px;
    background: var(--homer-panel); border: 1px solid var(--homer-border);
    color: var(--homer-accent) !important; border-radius: 4px;
}
.homer-ui .homer-part-synopsis .homer-synopsis-actions .homer-synopsis-trash { color: #a32c35 !important; }
.homer-ui[data-homer-theme="dark"] .homer-part-synopsis .homer-synopsis-actions .homer-synopsis-trash { color: #f28b91 !important; }
.homer-ui .homer-part-synopsis .homer-synopsis-actions .btn:hover {
    background: var(--homer-selected); border-color: var(--homer-accent);
}
.homer-ui .homer-part-synopsis .homer-synopsis-actions .btn:focus-visible {
    outline: 2px solid var(--homer-accent); outline-offset: 2px;
}
.homer-ui #parts-tree { font-size: 15px; }
.homer-ui #parts-tree .homer-tree-manuscript {
    padding: 10px 6px 12px; color: var(--homer-text);
}
.homer-ui #parts-tree .homer-tree-manuscript .homer-tree-part-title {
    font-size: 17px; font-weight: 800; line-height: 1.4;
    letter-spacing: .045em; text-transform: uppercase;
}

.homer-ui[data-homer-theme="dark"] .nav-tabs .nav-link:not(.active) { color: #c8cdd4; }
.homer-ui[data-homer-theme="dark"] .nav-tabs .nav-link:not(.active):hover { color: var(--homer-accent); }
.homer-ui .nav-tabs .nav-link i { color: inherit !important; }

/* Solid item icons stand out without changing the separate expand controls. */
.homer-ui #parts-tree .homer-tree-part > i {
    color: #344d63; opacity: 1;
}
.homer-ui[data-homer-theme="dark"] #parts-tree .homer-tree-part > i {
    color: #ebeef5;
}
.homer-ui #parts-tree .homer-tree-part:hover > i,
.homer-ui #parts-tree .homer-tree-active > i {
    color: var(--homer-accent);
}

.homer-ui #parts-tree .homer-tree-manuscript > .homer-tree-settings-icon {
    margin-left: auto; padding-left: 8px; margin-right: 10px; flex: 0 0 auto;
    align-self: center; font-size: 16px;
}

/* One continuous settings header, from title through the tab strip. */
.homer-ui .homer-settings-header {
    background: var(--homer-panel);
    margin: -18px -18px 18px;
    padding: 18px 18px 0;
}
.homer-ui .homer-settings-header h1 { margin: 0 0 10px; }
.homer-ui .homer-settings-world { margin: 0; }
.homer-ui .homer-settings-header .nav-tabs {
    margin: 0 -18px; padding: 16px 18px 0;
}

/* A subdued drop target for the dark outline instead of the legacy pale fill. */
.homer-ui[data-homer-theme="dark"] #parts-tree .ui-sortable-placeholder {
    background: #263b47 !important;
    border: 1px dashed #53788d !important;
    box-shadow: none !important;
}

/* Shared surface for chapter/scene cards in both write and review lists. */
.homer-ui[data-homer-theme="dark"] .homer-part-synopsis {
    background-color: #303438 !important;
    border: 1px solid #555e67 !important;
    border-left: 3px solid #657b8b !important;
    border-radius: 3px;
    color: var(--homer-text);
    padding: 16px;
    margin-bottom: 14px;
}

body.homer-editor-page .tox-tinymce-aux input::placeholder,
body.homer-editor-page .tox-tinymce-aux textarea::placeholder {
    color: var(--homer-menu-muted) !important;
    -webkit-text-fill-color: var(--homer-menu-muted) !important;
    opacity: 1 !important;
}

/* Keep tree icons clear of the selection stripe at every nesting level. */
.homer-ui #parts-tree .homer-tree-part { padding-left: 12px; }

.homer-ui .homer-replace-controls { display: flex; align-items: stretch; gap: 8px; margin-top: 6px; }
.homer-ui .homer-replace-controls .homer-replace-replacement {
    flex: 1 1 0; min-width: 0; width: 100%; height: 38px; margin: 0;
}
.homer-ui .homer-replace-controls .homer-replace-trigger {
    flex: 0 0 auto; min-height: 38px; margin: 0; padding: 7px 12px;
}

/* Mode controls override legacy Bootstrap hover and active colours. */
.homer-ui .homer-display-navigation .mode-change,
.homer-ui .homer-display-navigation > a {
    background: var(--homer-panel) !important; color: var(--homer-text) !important;
    border-color: var(--homer-border) !important; box-shadow: none;
}
.homer-ui .homer-display-navigation .mode-change:hover,
.homer-ui .homer-display-navigation > a:hover {
    background: var(--homer-selected) !important; color: var(--homer-accent) !important;
}
.homer-ui .homer-display-navigation .mode-change.active {
    background: var(--homer-selected) !important; color: var(--homer-accent) !important;
    border-color: var(--homer-accent) !important; box-shadow: inset 0 -3px var(--homer-accent); font-weight: 700;
}
.homer-ui .homer-display-navigation a:focus-visible { outline: 2px solid var(--homer-accent); outline-offset: 2px; }
.homer-ui .homer-corkboard { --cork-note: #fff0b9; --cork-ink: #3e3421; --cork-edge: #cfb66e; }
.homer-ui[data-homer-theme="dark"] .homer-corkboard { --cork-note: #d8c985; --cork-ink: #332d1b; --cork-edge: #a99651; }
.homer-ui .homer-corkboard-context { font-size: 16px; color: var(--homer-muted); }
.homer-ui .homer-corkboard-chapters { list-style: none; padding: 0; margin: 0; }
.homer-ui .homer-corkboard-chapter { background: var(--homer-panel); border: 1px solid var(--homer-border); border-radius: 6px; margin-bottom: 18px; padding: 16px; }
.homer-ui .homer-corkboard-chapter-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.homer-ui .homer-corkboard-chapter-item > .homer-corkboard-chapter > .homer-corkboard-chapter-heading { cursor: grab; }
.homer-ui .homer-corkboard-chapter-heading h2 { font-size: 18px; font-weight: 700; margin: 0 0 6px; overflow-wrap: anywhere; }
.homer-ui .homer-corkboard-chapter-synopsis { color: var(--homer-muted); margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.homer-ui .homer-corkboard-scenes { display: flex; flex-wrap: wrap; align-items: stretch; gap: 14px; min-height: 100px; list-style: none; margin: 0; padding: 8px; border: 1px dashed var(--homer-border); border-radius: 4px; }
.homer-ui .homer-corkboard-scene { flex: 0 0 230px; width: 230px; max-width: 100%; min-height: 150px; padding: 12px; background: var(--cork-note); color: var(--cork-ink); border: 1px solid var(--cork-edge); border-top: 5px solid var(--cork-edge); border-radius: 2px 2px 10px 2px; box-shadow: 0 3px 6px rgba(0,0,0,.18); }
.homer-ui .homer-corkboard-scene-heading { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.homer-ui .homer-corkboard-scene p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.homer-ui .homer-corkboard-open { color: inherit; font: inherit; font-weight: 700; font-size: 16px; padding: 0; background: transparent; border: 0; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.homer-ui .homer-corkboard-scene-grip,
.homer-ui .homer-corkboard-chapter-grip { color: inherit; background: transparent; border: 0; padding: 3px 6px; cursor: grab; flex: 0 0 auto; }
.homer-ui .homer-corkboard button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.homer-ui .homer-corkboard-order-slot { display: none !important; }
.homer-ui .homer-corkboard-empty { margin: 8px 0 0; color: var(--homer-muted); }
.homer-ui .homer-corkboard-scene-placeholder { flex: 0 0 230px; max-width: 100%; border: 2px dashed var(--homer-accent); background: var(--homer-selected); border-radius: 4px; visibility: visible !important; }
.homer-ui .homer-corkboard-chapter-placeholder { border: 2px dashed var(--homer-accent); background: var(--homer-selected); border-radius: 6px; margin-bottom: 18px; visibility: visible !important; }
.homer-ui .homer-corkboard .ui-sortable-helper { opacity: .9; }
.homer-ui .homer-corkboard-status { color: var(--homer-accent); min-height: 21px; }

.homer-ui .homer-corkboard-edit {
    margin-left: auto; flex: 0 0 auto; padding: 4px 6px; color: inherit;
    border: 1px solid currentColor; border-radius: 3px; background: transparent; cursor: pointer;
}
.homer-ui .homer-corkboard-edit-form { margin: 12px 0; }
.homer-ui .homer-corkboard-edit-form[hidden] { display: none; }
.homer-ui .homer-corkboard-edit-form label { display: block; margin-bottom: 10px; font-size: 13px; }
.homer-ui .homer-corkboard-edit-form .form-control { margin-top: 4px; width: 100%; }
.homer-ui .homer-corkboard-edit-actions { display: flex; gap: 8px; }
.homer-ui .homer-corkboard-edit-status { margin: 8px 0 0; }
.homer-ui .homer-corkboard-editing > .homer-corkboard-scene-synopsis { display: none; }
.homer-ui .homer-corkboard-editing > .homer-corkboard-scene-heading .homer-corkboard-edit,
.homer-ui .homer-corkboard-editing > .homer-corkboard-chapter-heading .homer-corkboard-edit { visibility: hidden; }

/* Fixed note dimensions keep every row uniform, regardless of synopsis length. */
.homer-ui .homer-corkboard-scene {
    --cork-label-color: var(--cork-edge);
    height: 220px; min-height: 220px; box-sizing: border-box; overflow: hidden;
    border-top-color: var(--cork-label-color);
}
.homer-ui .homer-corkboard-chapter { border-top: 5px solid var(--cork-label-color, var(--homer-border)); }
.homer-ui .homer-corkboard-scene-heading { gap: 4px; align-items: flex-start; }
.homer-ui .homer-corkboard-chapter-heading { gap: 4px; }
.homer-ui .homer-corkboard-scene-grip,
.homer-ui .homer-corkboard-chapter-grip { padding: 3px 2px; }
.homer-ui .homer-corkboard-open {
    min-width: 0; line-height: 1.35; max-height: 2.7em;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.homer-ui .homer-corkboard-scene > .homer-corkboard-scene-synopsis {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5;
    max-height: 7.5em; overflow: hidden;
}
.homer-ui .homer-corkboard-scene.homer-corkboard-editing { overflow-y: auto; }
.homer-ui .homer-corkboard-scene.homer-corkboard-editing > .homer-corkboard-scene-synopsis { display: none; }

.homer-ui .homer-corkboard-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.homer-ui .homer-corkboard-toolbar h1 { margin: 0; }
.homer-ui .homer-corkboard-collapse-all { margin-left: auto; }
.homer-ui .homer-corkboard-chapter-heading { align-items: flex-start; column-gap: 6px; }
.homer-ui .homer-corkboard-chapter-summary { flex: 1; min-width: 0; }
.homer-ui .homer-corkboard-chapter-heading h2 { margin: 0 0 2px !important; line-height: 28px; }
.homer-ui .homer-corkboard-chapter-heading .homer-corkboard-chapter-synopsis { margin: 0 !important; line-height: 1.4; }
.homer-ui .homer-corkboard-chapter-grip { display: inline-flex; align-items: center; justify-content: center; height: 28px; margin: 0; padding: 0 2px; }
.homer-ui .homer-corkboard-collapse { display: inline-flex; align-items: center; justify-content: center; height: 28px; width: 28px; flex: 0 0 auto; color: var(--homer-text); background: transparent; border: 1px solid var(--homer-border); border-radius: 3px; cursor: pointer; }
.homer-ui .homer-corkboard-collapse:hover { background: var(--homer-selected); color: var(--homer-accent); }
.homer-ui .homer-corkboard-chapter-heading > .homer-corkboard-edit { margin-left: 4px; }
.homer-ui .homer-corkboard-collapsed > .homer-corkboard-scenes,
.homer-ui .homer-corkboard-collapsed > .homer-corkboard-empty { display: none !important; }
.homer-ui .homer-corkboard-collapsed > .homer-corkboard-chapter-heading { margin-bottom: 0; }

/* Matching chapter-header actions in both themes. */
.homer-ui .homer-corkboard-chapter-heading > .homer-corkboard-edit,
.homer-ui .homer-corkboard-chapter-heading > .homer-corkboard-collapse {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 30px; width: 30px; height: 30px; box-sizing: border-box;
    padding: 0; margin: 0; font-size: 14px; line-height: 1;
    color: var(--homer-text); background: transparent;
    border: 1px solid var(--homer-border); border-radius: 3px;
}
.homer-ui .homer-corkboard-chapter-heading > .homer-corkboard-edit:hover,
.homer-ui .homer-corkboard-chapter-heading > .homer-corkboard-collapse:hover {
    background: var(--homer-selected); color: var(--homer-accent); border-color: var(--homer-accent);
}

/* A stable two-line header keeps note handles, titles and actions aligned. */
.homer-ui .homer-corkboard-scene-heading {
    align-items: center; min-height: 44px; gap: 4px;
}
.homer-ui .homer-corkboard-scene-heading > .homer-corkboard-scene-grip {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 20px; width: 20px; height: 30px; padding: 0; margin: 0;
    line-height: 1; align-self: center;
}
.homer-ui .homer-corkboard-scene-heading > .homer-corkboard-open {
    flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; align-self: center;
}
.homer-ui .homer-corkboard-scene-heading > .homer-corkboard-edit {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 30px; width: 30px; height: 30px; box-sizing: border-box;
    padding: 0; margin: 0; line-height: 1; align-self: center;
}

/* Wider notes with space reserved for the word count. */
.homer-ui .homer-corkboard-scene {
    position: relative; flex-basis: 270px; width: 270px; padding-bottom: 48px;
}
.homer-ui .homer-corkboard-scene-placeholder { flex-basis: 270px; width: 270px; }
.homer-ui .homer-corkboard-scene-heading > .homer-corkboard-edit {
    position: static; right: auto; bottom: auto;
}

/* Workspace modes sit centrally as primary tabs; search anchors the right edge. */
.homer-manuscript-wrapper .row.homer-manuscript-top-container { padding: 10px 16px 0; }
.homer-ui .homer-workspace-toolbar {
    display: grid; grid-template-columns: minmax(240px, 1fr) auto minmax(180px, 1fr);
    grid-template-areas: "actions modes search"; gap: 10px 16px;
}
.homer-ui .homer-toolbar-search { grid-area: search; justify-self: end; position: relative; width: 100%; max-width: 320px; margin-bottom: 10px; }
.homer-ui .homer-toolbar-search > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--homer-muted); pointer-events: none; }
.homer-ui .homer-toolbar-search .homer-version-search-input {
    width: 100%; height: 40px; padding: 8px 10px 8px 34px;
    font-size: 15px; background: var(--homer-input) !important;
    border: 1px solid transparent !important; border-bottom-color: var(--homer-border) !important;
    border-radius: 0; box-shadow: none;
}
.homer-ui .homer-toolbar-search .homer-version-search-input:hover { border-bottom-color: var(--homer-muted) !important; }
.homer-ui .homer-toolbar-search .homer-version-search-input:focus { outline: none; border-bottom: 2px solid var(--homer-accent) !important; }
.homer-ui .homer-toolbar-actions { grid-area: actions; justify-content: flex-start; margin-bottom: 10px; }
.homer-ui .homer-display-navigation { grid-area: modes; justify-content: center; align-self: end; flex-wrap: nowrap; margin: 0 0 -1px; gap: 4px; }
.homer-ui .homer-display-navigation > .btn-group { gap: 3px; }
.homer-ui .homer-display-navigation .mode-change,
.homer-ui .homer-display-navigation > a {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 52px; padding: 12px 18px; margin: 0 !important;
    font-size: 16px; border: 1px solid transparent !important;
    border-radius: 5px 5px 0 0 !important; background: transparent !important;
}
.homer-ui .homer-display-navigation .mode-change.active {
    background: var(--homer-bg) !important; color: var(--homer-accent) !important;
    border-color: var(--homer-border) !important; border-bottom-color: var(--homer-bg) !important;
    box-shadow: inset 0 3px var(--homer-accent);
}
.homer-ui .homer-display-navigation > a i { font-size: 11px; }
.homer-ui .homer-workspace-toolbar > .save-indicator { position: absolute; right: 0; top: 100%; z-index: 2; }
@media (max-width: 1250px) {
    .homer-ui .homer-workspace-toolbar { grid-template-columns: auto minmax(160px, 1fr); grid-template-areas: "actions search" "modes modes"; }
    .homer-ui .homer-display-navigation { overflow-x: auto; max-width: 100%; justify-content: flex-start; }
}
@media (max-width: 575px) {
    .homer-ui .homer-workspace-toolbar { grid-template-columns: minmax(0, 1fr); grid-template-areas: "actions" "search" "modes"; }
    .homer-ui .homer-toolbar-search { max-width: none; }
    .homer-ui .homer-toolbar-actions { justify-content: flex-start; }
    .homer-ui .homer-display-navigation .mode-change, .homer-ui .homer-display-navigation > a { padding: 12px; }
}

.homer-ui .homer-toolbar-actions .dropdown-item > i {
    color: inherit !important; width: 20px; margin-right: 6px; text-align: center;
}

/* Recess the primary toolbar behind the active tab and its workspace. */
.homer-ui[data-homer-theme="dark"] .row.homer-manuscript-top-container {
    background: #161819;
}
.homer-ui[data-homer-theme="light"] .row.homer-manuscript-top-container {
    background: #cbd2db;
}

/* Explicit primary-tab surfaces override legacy theme fills. */
.homer-ui[data-homer-theme="dark"] .row.homer-manuscript-top-container,
.homer-ui[data-homer-theme="dark"] .homer-workspace-toolbar {
    background: #141617 !important;
}
.homer-ui[data-homer-theme="dark"] .homer-display-navigation .mode-change,
.homer-ui[data-homer-theme="dark"] .homer-display-navigation > a {
    color: #fff !important; font-weight: 700;
}
.homer-ui[data-homer-theme="dark"] .homer-display-navigation .mode-change.active {
    background: var(--homer-bg) !important; border-bottom-color: var(--homer-bg) !important;
    color: #fff !important;
}
.homer-ui[data-homer-theme="dark"] .homer-display-navigation .mode-change:not(.active):hover,
.homer-ui[data-homer-theme="dark"] .homer-display-navigation > a:hover {
    background: #252a2e !important;
}
.homer-ui[data-homer-theme="light"] .row.homer-manuscript-top-container,
.homer-ui[data-homer-theme="light"] .homer-workspace-toolbar {
    background: #cbd2db !important;
}
.homer-ui[data-homer-theme="light"] .homer-display-navigation .mode-change,
.homer-ui[data-homer-theme="light"] .homer-display-navigation > a { font-weight: 700; }

/* One continuous surface connects every selected mode to the centre workspace. */
.homer-ui .homer-display-navigation .mode-change.active {
    position: relative; z-index: 1;
    background: var(--homer-bg) !important;
    background-image: none !important;
    border-bottom-color: var(--homer-bg) !important;
    box-shadow: inset 0 3px var(--homer-accent) !important;
}
.homer-ui #homer-center-container,
.homer-ui #homer-center-top-content,
.homer-ui #homer-center-content,
.homer-ui #homer-center-content .homer-tab-content,
.homer-ui #homer-center-content .homer-settings-header,
.homer-ui #homer-center-content .homer-settings-header > .nav-tabs,
.homer-ui #homer-center-content .tox-menubar,
.homer-ui #homer-center-content .tox-toolbar-overlord,
.homer-ui #homer-center-content .tox-toolbar,
.homer-ui #homer-center-content .tox-toolbar__primary {
    background: var(--homer-bg) !important;
    background-image: none !important;
}

.homer-ui #homer-right-content .form-control.homer-info-field {
    padding: 11px 13px; font-size: 16px; line-height: 1.5;
}
.homer-ui #homer-right-content input.homer-info-field { min-height: 46px; }
.homer-ui #homer-right-content textarea.homer-info-field { min-height: 130px; }

/* Label strips reveal their names over the card without shifting its contents. */
.homer-ui .homer-corkboard-chapter { position: relative; }
.homer-ui .homer-corkboard-label-strip {
    position: absolute; left: 0; right: 0; top: -5px; z-index: 2;
    display: flex; align-items: center; justify-content: flex-start;
    width: 100%; height: 9px; margin: 0; padding: 0 12px;
    border: 0; border-radius: 4px 4px 0 0;
    background: var(--cork-label-color, var(--homer-border)); color: var(--homer-label-text, #fff);
    font: inherit; font-size: 13px; font-weight: 700; text-align: left;
    overflow: hidden; cursor: default; transition: height 160ms ease;
}
.homer-ui .homer-corkboard-label-strip[hidden] { display: none; }
.homer-ui .homer-corkboard-label-strip span { opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 120ms ease; }
.homer-ui .homer-corkboard-label-strip:hover,
.homer-ui .homer-corkboard-label-strip:focus { height: 32px; }
.homer-ui .homer-corkboard-label-strip:hover span,
.homer-ui .homer-corkboard-label-strip:focus span { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .homer-ui .homer-corkboard-label-strip, .homer-ui .homer-corkboard-label-strip span { transition: none; }
}

.homer-ui .homer-corkboard-label-strip { cursor: pointer; }
.homer-ui .homer-corkboard-label-strip[aria-expanded="true"] { height: 32px; }
.homer-ui .homer-corkboard-label-strip[aria-expanded="true"] span { opacity: 1; }

/* Warm paper with a small turned-up corner; keep the edit action clear of it. */
.homer-ui .homer-corkboard-scene:not(.homer-corkboard-editing) {
    border-bottom-right-radius: 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
.homer-ui .homer-corkboard-scene:not(.homer-corkboard-editing)::after {
    content: ''; position: absolute; right: 0; bottom: 0; width: 20px; height: 20px;
    pointer-events: none;
    background: linear-gradient(135deg, var(--cork-edge) 0%, var(--cork-note) 48%, transparent 50%);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, .2);
    border-top-left-radius: 3px;
}
.homer-ui .homer-corkboard-scene-heading > .homer-corkboard-edit { position:static; inset:auto; margin-left:auto; border-radius:0; }

/* Reveal note editing on hover or keyboard focus; touch keeps it available. */
@media (hover: hover) and (pointer: fine) {
    .homer-ui .homer-corkboard-scene-heading > .homer-corkboard-edit {
        opacity: 0; pointer-events: none; transition: opacity 140ms ease;
    }
    .homer-ui .homer-corkboard-scene:hover > .homer-corkboard-scene-heading > .homer-corkboard-edit,
    .homer-ui .homer-corkboard-scene:focus-within > .homer-corkboard-scene-heading > .homer-corkboard-edit {
        opacity: 1; pointer-events: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    .homer-ui .homer-corkboard-scene-heading > .homer-corkboard-edit { transition: none; }
}

/* Keep scrolling visually quiet and separate from the column resize rails. */
.homer-ui #parts-tree,
.homer-ui #homer-center-content,
.homer-ui #homer-right-content {
    scrollbar-width: thin;
    scrollbar-color: var(--homer-border) transparent;
}
.homer-ui #parts-tree::-webkit-scrollbar,
.homer-ui #homer-center-content::-webkit-scrollbar,
.homer-ui #homer-right-content::-webkit-scrollbar { width: 6px; height: 6px; }
.homer-ui #parts-tree::-webkit-scrollbar-track,
.homer-ui #homer-center-content::-webkit-scrollbar-track,
.homer-ui #homer-right-content::-webkit-scrollbar-track { background: transparent; margin-block: 12px; }
.homer-ui #parts-tree::-webkit-scrollbar-thumb,
.homer-ui #homer-center-content::-webkit-scrollbar-thumb,
.homer-ui #homer-right-content::-webkit-scrollbar-thumb { background: var(--homer-border); border-radius: 6px; }
@media (min-width: 992px) {
    .homer-ui ol#parts-tree { margin-right: 10px; }
    .homer-ui #homer-center-content { margin-right: 10px; }
    .homer-ui #homer-right-content { margin-left: 10px; }
    .homer-ui .homer-column-resizer { width: 16px; z-index: 30; }
    .homer-ui .homer-column-resizer[data-side="left"] { right: -8px; }
    .homer-ui .homer-column-resizer[data-side="right"] { left: -8px; }
    .homer-ui .homer-column-resizer::before {
        left: 6px; width: 4px; background: var(--homer-border);
    }
    .homer-ui .homer-column-resizer::after {
        left: 4px; width: 8px; height: 52px; top: 96px;
        background: var(--homer-accent); border-radius: 5px;
        box-shadow: 0 0 0 3px var(--homer-panel);
    }
    .homer-ui .homer-column-resizer:hover::before,
    .homer-ui .homer-column-resizer:focus::before { background: var(--homer-accent); }
}

.homer-ui #parts-tree button.homer-tree-label-badge { cursor: pointer; font-family: inherit; }
.homer-ui #parts-tree button.homer-tree-label-badge:hover,
.homer-ui #parts-tree button.homer-tree-label-badge:focus-visible { outline: 2px solid var(--homer-accent); outline-offset: 2px; }

@media (min-width: 992px) {
    .homer-ui .homer-column-resizer::after { background: #626970; }
    .homer-ui .homer-column-resizer:hover::before,
    .homer-ui .homer-column-resizer:focus::before,
    .homer-ui .homer-column-resizer:hover::after,
    .homer-ui .homer-column-resizer:focus::after { background: #7b838b; }
}

.homer-ui[data-homer-theme="dark"] #parts-tree .homer-tree-manuscript.homer-tree-active {
    background: #2c4b5c;
}

.homer-ui .homer-stats-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.homer-ui .homer-stats-goal { display: flex; align-items: center; gap: 8px; }
.homer-ui .homer-stats-goal #wordcountGoal { width: 110px; margin: 0; }
.homer-ui .homer-stats-table-wrap { overflow-x: auto; border: 1px solid var(--homer-border); border-radius: 5px; }
.homer-ui .homer-stats-table { width: 100%; margin: 0; font-size: 14px; }
.homer-ui .homer-stats-table th { background: var(--homer-panel); color: var(--homer-text); font-weight: 700; border-top: 0; }
.homer-ui .homer-stats-table th, .homer-ui .homer-stats-table td { padding: 12px 14px; vertical-align: middle; white-space: nowrap; }
.homer-ui .homer-stats-table th:not(:first-child), .homer-ui .homer-stats-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.homer-ui .homer-stats-table tbody tr:nth-child(even) { background: var(--homer-panel); }
.homer-ui .homer-stats-table tbody tr:hover { background: var(--homer-selected); }
.homer-ui .homer-stats-table .wordcount-goal-display { color: var(--homer-muted); font-size: 12px; margin-left: 3px; }
.homer-ui .homer-stats-table .homer-stats-empty { text-align: center; padding: 24px 14px; color: var(--homer-muted); white-space: normal; }
.homer-ui #export-tab { min-width: 42px; text-align: center; }

.homer-ui #parts-tree .homer-tree-label-empty {
    background: transparent; border: 1px dashed var(--homer-border);
    border-left-width: 1px; font-size: 11px; font-weight: 400; white-space: nowrap;
}
.homer-ui #parts-tree .homer-tree-label-empty:hover { background: var(--homer-selected); }

@media (hover: hover) and (pointer: fine) {
    .homer-ui #parts-tree .homer-tree-label-empty {
        opacity: 0; pointer-events: none; transition: opacity 120ms ease;
    }
    .homer-ui #parts-tree .homer-tree-part:hover > .homer-tree-label-empty,
    .homer-ui #parts-tree .homer-tree-part:focus-within > .homer-tree-label-empty,
    .homer-ui #parts-tree .homer-tree-label-empty[aria-expanded="true"] {
        opacity: 1; pointer-events: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    .homer-ui #parts-tree .homer-tree-label-empty { transition: none; }
}

/* Non-draggable creation card stays last in each chapter's scene list. */
.homer-ui .homer-corkboard-add-slot { flex: 0 0 270px; width: 270px; max-width: 100%; height: 220px; list-style: none; }
.homer-ui .homer-corkboard-add-scene {
    width: 100%; height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    background: transparent; border: 2px dashed var(--homer-border); border-radius: 4px;
    color: var(--homer-muted); font: inherit; cursor: pointer;
}
.homer-ui .homer-corkboard-add-scene > i { font-size: 28px; }
.homer-ui .homer-corkboard-add-scene:hover,
.homer-ui .homer-corkboard-add-scene:focus-visible { color: var(--homer-accent); border-color: var(--homer-accent); background: var(--homer-selected); }
.homer-ui .homer-corkboard-add-scene:disabled { opacity: .5; cursor: wait; }

/* Native colour wells for the manuscript's live document settings. */
.homer-ui input.homer-design-color-picker {
    width: 96px;
    height: 44px;
    padding: 5px;
    cursor: pointer;
}
.homer-ui .homer-design-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.homer-ui .homer-design-color-picker::-webkit-color-swatch { border: 0; border-radius: 3px; }
.homer-ui .homer-design-color-picker::-moz-color-swatch { border: 0; border-radius: 3px; }
.homer-ui .homer-design-color-picker:focus-visible { outline: 2px solid var(--homer-accent); outline-offset: 2px; }

/* Insert chapters at any gap without leaving the board. */
.homer-ui .homer-corkboard-add-chapter {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 10px; margin: 12px 0; border: 1px dashed var(--homer-border);
    border-radius: 6px; background: transparent; color: var(--homer-muted); cursor: pointer;
}
.homer-ui .homer-corkboard-add-chapter:hover,
.homer-ui .homer-corkboard-add-chapter:focus-visible { background: var(--homer-selected); color: var(--homer-text); border-color: var(--homer-accent); }
.homer-ui .homer-corkboard-add-chapter:disabled { opacity: .5; cursor: wait; }
.homer-ui .homer-corkboard-chapter-add-slot { width: 100%; height: auto; }
@media (hover: hover) and (pointer: fine) {
    .homer-ui .homer-corkboard-add-chapter {
        height: 20px; min-height: 0; padding: 0 10px; margin: 6px 0;
        overflow: hidden; border-radius: 4px;
        transition: height 160ms ease, padding 160ms ease, background-color 160ms ease;
    }
    .homer-ui .homer-corkboard-add-chapter { position: relative; }
    .homer-ui .homer-corkboard-add-chapter > i {
        position: absolute; left: 50%; transform: translateX(-50%);
        opacity: 1; font-size: 12px;
    }
    .homer-ui .homer-corkboard-add-chapter > span {
        opacity: 0; transition: opacity 120ms ease;
    }
    .homer-ui .homer-corkboard-add-chapter:hover > i,
    .homer-ui .homer-corkboard-add-chapter:focus-visible > i {
        position: static; transform: none;
    }
    .homer-ui .homer-corkboard-add-chapter:hover,
    .homer-ui .homer-corkboard-add-chapter:focus-visible {
        height: 40px; padding: 8px 10px;
    }
    .homer-ui .homer-corkboard-add-chapter:hover > *,
    .homer-ui .homer-corkboard-add-chapter:focus-visible > * { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .homer-ui .homer-corkboard-add-chapter,
    .homer-ui .homer-corkboard-add-chapter > * { transition: none; }
}

/* The editor replaces the note contents, with actions outside the text area. */
.homer-ui .homer-corkboard-scene.homer-corkboard-editing {
    height: 340px; padding: 14px; overflow: visible;
}
.homer-ui .homer-corkboard-scene.homer-corkboard-editing > .homer-corkboard-scene-heading { display: none; }
.homer-ui .homer-corkboard-scene.homer-corkboard-editing > .homer-corkboard-edit-form {
    display: flex; flex-direction: column; height: 100%; margin: 0; gap: 8px;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form label { margin: 0; flex-shrink: 0; }
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form .homer-corkboard-synopsis-field {
    display: flex; flex-direction: column; flex: 1; min-height: 70px;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form textarea {
    flex: 1; min-height: 0; height: auto; resize: none;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-actions { flex-shrink: 0; }
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-status { margin: 0; font-size: 12px; }
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-status:empty { display: none; }

/* Respond to the resized outline column, independently of the window width. */
.homer-ui ol#parts-tree { container-type: inline-size; container-name: manuscript-outline; }
@container manuscript-outline (max-width: 420px) {
    .homer-ui #parts-tree button.homer-tree-label-badge {
        flex: 0 0 20px; width: 20px; min-width: 20px; max-width: 20px;
        height: 20px; min-height: 20px; padding: 0; border-radius: 50%;
        font-size: 0; line-height: 18px; overflow: hidden;
    }
    .homer-ui #parts-tree .homer-tree-label-empty > i { display: none; }
    .homer-ui #parts-tree .homer-tree-label-empty::after { content: '+'; font-size: 15px; }
}

/* Equal breathing room between each chapter and its insertion control. */
.homer-ui .homer-corkboard-chapter-item > .homer-corkboard-chapter { margin-bottom: 0; }
.homer-ui .homer-corkboard-add-chapter > i { opacity: .5; }
.homer-ui .homer-corkboard-add-chapter:hover > i,
.homer-ui .homer-corkboard-add-chapter:focus-visible > i { opacity: 1; }

/* Clear actions and a label picker inside scene/chapter editing forms. */
.homer-ui .homer-corkboard-edit-actions .btn {
    min-height: 36px; padding: 7px 16px; font-weight: 700;
}
.homer-ui .homer-corkboard-edit-actions .homer-corkboard-edit-cancel {
    background: var(--homer-input); color: var(--homer-text); border: 1px solid var(--homer-muted);
}
.homer-ui .homer-corkboard-edit-actions .homer-corkboard-edit-cancel:hover { background: var(--homer-selected); }
.homer-ui .homer-corkboard-form-label {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    flex-shrink: 0; margin: 0 0 8px; padding: 5px 10px; min-height: 32px;
    border: 1px solid var(--homer-muted); font-weight: 600;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-form-label { margin-bottom: 0; }

/* Paper-coloured controls keep the inline editor part of the sticky note. */
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form .form-control {
    background: rgba(255, 255, 255, .2) !important;
    color: var(--cork-ink) !important;
    border: 1px solid var(--cork-edge) !important;
    box-shadow: none !important;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form .form-control:focus {
    background: rgba(255, 255, 255, .35) !important;
    border-color: var(--cork-ink) !important;
    outline: 2px solid var(--cork-edge); outline-offset: 1px;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form .form-control::placeholder {
    color: #67582e !important; opacity: 1;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-form-label {
    background: rgba(255, 255, 255, .15) !important;
    color: var(--cork-ink) !important; border-color: var(--cork-edge);
}
.homer-ui .homer-corkboard-edit-actions .homer-corkboard-edit-cancel {
    background: transparent !important; border-color: transparent !important;
    color: var(--homer-muted) !important; font-weight: 400; box-shadow: none;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-cancel { color: var(--cork-ink) !important; opacity: .65; }
.homer-ui .homer-corkboard-edit-actions .homer-corkboard-edit-cancel:hover,
.homer-ui .homer-corkboard-edit-actions .homer-corkboard-edit-cancel:focus-visible { opacity: 1; text-decoration: underline; }

.homer-ui .homer-corkboard-edit-actions { justify-content: space-between; width: 100%; }
.homer-ui .homer-corkboard-edit-actions > [type="submit"] { margin-left: auto; }

/* Prodromos Create and Delete variants for scene settings actions. */
.homer-ui .homer-settings-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 0; padding: 8px 12px; min-height: 36px;
    font: inherit; font-size: 14px; color: #ebeef5 !important;
}
.homer-ui .homer-settings-action i { color: inherit !important; }
.homer-ui .homer-settings-action-create { background: #0b4b26 !important; font-weight: 700; }
.homer-ui .homer-settings-action-create:hover,
.homer-ui .homer-settings-action-create:focus-visible { background: #07612f !important; }
.homer-ui .homer-settings-action-create:active { background: #002e16 !important; }
.homer-ui .homer-settings-action-delete { background: #47484a !important; }
.homer-ui .homer-settings-action-delete:hover { background: #9f0e11 !important; }
.homer-ui .homer-settings-action-delete:active,
.homer-ui .homer-settings-action-delete:focus-visible { background: #560608 !important; }
.homer-ui .homer-settings-action:focus-visible { outline: 2px solid var(--homer-accent); outline-offset: 2px; }

/* A miniature workspace makes sidebar visibility directly selectable. */
.homer-ui .dropdown-menu.homer-layout-picker { width: 340px; max-width: calc(100vw - 32px); padding: 16px; text-transform: none; }
.homer-ui .homer-layout-picker-title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--homer-text); }
.homer-ui .homer-layout-picker-help { margin: 0 0 14px; font-size: 12px; color: var(--homer-muted); }
.homer-ui .homer-layout-preview { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 5px; padding: 7px; background: var(--homer-bg); border: 1px solid var(--homer-border); border-radius: 6px; }
.homer-ui .homer-layout-preview-toolbar { grid-column: 1 / -1; display: flex; gap: 4px; padding: 3px 2px 7px; border-bottom: 1px solid var(--homer-border); }
.homer-ui .homer-layout-preview-toolbar i { width: 5px; height: 5px; border-radius: 50%; background: var(--homer-muted); }
.homer-ui .homer-layout-panel,
.homer-ui .homer-layout-preview-editor { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; height: 115px; padding: 8px 4px; border-radius: 3px; font: inherit; font-size: 12px; text-transform: none; }
.homer-ui .homer-layout-panel { border: 1px solid var(--homer-accent); background: var(--homer-selected); color: var(--homer-text); cursor: pointer; }
.homer-ui .homer-layout-panel[aria-pressed="false"] { border: 1px dashed var(--homer-border); background: transparent; color: var(--homer-muted); }
.homer-ui .homer-layout-panel:hover { border-color: var(--homer-accent); color: var(--homer-accent); }
.homer-ui .homer-layout-panel > i { font-size: 20px; color: inherit; }
.homer-ui .homer-layout-panel-state { font-size: 11px; }
.homer-ui .homer-layout-preview-editor { background: var(--homer-panel); color: var(--homer-muted); border: 1px solid var(--homer-border); }
.homer-ui .homer-layout-preview-editor > span { font-size: 10px; }
.homer-ui .homer-layout-picker-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.homer-ui .homer-layout-picker-actions > button { padding: 6px 10px; border: 1px solid var(--homer-border); border-radius: 3px; background: transparent; color: var(--homer-text); font-size: 12px; cursor: pointer; }
.homer-ui .homer-layout-picker-actions > button:hover { background: var(--homer-selected); }
.homer-ui .homer-layout-picker button:focus-visible { outline: 2px solid var(--homer-accent); outline-offset: 2px; }

/* Chapter-local creation controls appear when interacting with the row. */
.homer-ui .homer-tree-create-actions { display: inline-flex; flex-shrink: 0; gap: 4px; }
.homer-ui .homer-tree-create-actions button {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0; border: 1px solid var(--homer-border);
    border-radius: 3px; background: var(--homer-panel); color: var(--homer-text); cursor: pointer;
}
.homer-ui .homer-tree-create-actions button:hover { color: var(--homer-accent); border-color: var(--homer-accent); }
.homer-ui .homer-tree-create-actions button:focus-visible { outline: 2px solid var(--homer-accent); outline-offset: 2px; }
.homer-ui .homer-tree-create-actions .homer-tree-create-plus { position: absolute; right: 2px; bottom: 2px; font-size: 8px; }
@media (hover: hover) and (pointer: fine) {
    .homer-ui .homer-tree-create-actions { visibility: hidden; }
    .homer-ui .homer-tree-folder:hover > .homer-tree-create-actions,
    .homer-ui .homer-tree-folder:focus-within > .homer-tree-create-actions,
    .homer-ui .homer-tree-folder:has(> [aria-expanded="true"]) > .homer-tree-create-actions { visibility: visible; }
}

/* Echo World Anvil's application header rather than window chrome. */
.homer-ui .homer-layout-preview-toolbar {
    align-items: center; gap: 10px; padding: 6px 8px; min-height: 25px;
    background: var(--homer-panel); border: 0; border-bottom: 1px solid var(--homer-border);
}
.homer-ui .homer-layout-preview-logo { width: 11px; height: 11px; flex-shrink: 0; border-radius: 50%; background: #b41420; }
.homer-ui .homer-layout-preview-nav { width: 65%; height: 4px; border-radius: 1px; background: var(--homer-muted); opacity: .4; }

.homer-ui .homer-layout-preview-search { margin-left: auto; width: 22%; height: 6px; border-radius: 2px; background: var(--homer-muted); opacity: .6; }
.homer-ui .homer-layout-preview-nav { width: 38%; }

/* The outer navigation rails frame the manuscript's three working columns. */
.homer-ui .homer-layout-preview { grid-template-columns: 16px 1fr 1.2fr 1fr 16px; gap: 4px; }
.homer-ui .homer-layout-preview-rail {
    grid-row: 1; display: flex; align-items: center; padding: 5px 2px;
    background: var(--homer-panel); border: 1px solid var(--homer-border); min-height: 125px;
}
.homer-ui .homer-layout-preview-rail-left { grid-column: 1; flex-direction: column; }
.homer-ui .homer-layout-preview-rail-right { grid-column: 5; flex-direction: column; justify-content: flex-end; }
.homer-ui .homer-layout-preview > .homer-layout-alter-left { grid-column: 2; grid-row: 1; }
.homer-ui .homer-layout-preview > .homer-layout-preview-editor { grid-column: 3; grid-row: 1; }
.homer-ui .homer-layout-preview > .homer-layout-alter-right { grid-column: 4; grid-row: 1; }
.homer-ui .homer-layout-preview-logo,
.homer-ui .homer-layout-preview-create { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.homer-ui .homer-layout-preview-create { background: #159447; }
.homer-ui .homer-layout-preview > .homer-layout-panel,
.homer-ui .homer-layout-preview > .homer-layout-preview-editor { height: 125px; }

/* Give the miniature workspace columns more breathing room. */
.homer-ui .dropdown-menu.homer-layout-picker { width: 380px; }
.homer-ui .homer-layout-preview { padding: 10px; gap: 7px; }
.homer-ui .homer-layout-preview > .homer-layout-panel,
.homer-ui .homer-layout-preview > .homer-layout-preview-editor { padding: 12px 8px; height: 135px; }
.homer-ui .homer-layout-preview-rail { min-height: 135px; }

.homer-ui .homer-layout-picker-actions > .homer-layout-hide-both { margin-left: auto; }
.homer-ui .homer-layout-hide-both > i { margin-right: 5px; color: inherit; }

/* A roomier layout chooser, still bounded by the viewport on small screens. */
.homer-ui .dropdown-menu.homer-layout-picker { width: 460px; padding: 20px; }
.homer-ui .homer-layout-preview { padding: 12px; gap: 9px; grid-template-columns: 20px 1fr 1.2fr 1fr 20px; }
.homer-ui .homer-layout-preview > .homer-layout-panel,
.homer-ui .homer-layout-preview > .homer-layout-preview-editor { height: 160px; padding: 16px 10px; gap: 12px; font-size: 14px; }
.homer-ui .homer-layout-preview-rail { min-height: 160px; }
.homer-ui .homer-layout-panel > i,
.homer-ui .homer-layout-preview-editor > i { font-size: 24px; }
.homer-ui .homer-layout-panel-state,
.homer-ui .homer-layout-preview-editor > span { font-size: 12px; }
.homer-ui .homer-layout-picker-actions { margin-top: 16px; }
.homer-ui .homer-layout-picker-actions > button { font-size: 14px; padding: 8px 12px; }
@media (max-width: 480px) {
    .homer-ui .dropdown-menu.homer-layout-picker { padding: 12px; }
    .homer-ui .homer-layout-preview { padding: 7px; gap: 4px; grid-template-columns: 14px 1fr 1.2fr 1fr 14px; }
    .homer-ui .homer-layout-preview > .homer-layout-panel,
    .homer-ui .homer-layout-preview > .homer-layout-preview-editor { padding: 12px 3px; font-size: 12px; }
}

/* One stable action position; eye icons match the adjacent text. */
.homer-ui .homer-layout-picker-actions { justify-content: flex-end; }
.homer-ui .homer-layout-picker-actions > button { margin-left: auto; line-height: 20px; }
.homer-ui .homer-layout-picker-actions > button > i {
    display: inline-block; position: static; width: 16px; height: 16px;
    margin: 0 6px 0 0; padding: 0; font-size: 14px !important;
    line-height: 16px; vertical-align: middle; color: inherit;
}

.homer-ui .dropdown-menu.homer-layout-picker { margin-top: 8px; }

/* Roomier manuscript settings fields, matching the scene editor controls. */
.homer-ui .homer-manuscript-settings-form .form-control {
    font-size: 16px; line-height: 1.5; padding: 12px 14px; min-height: 48px;
    border-radius: 5px;
}
.homer-ui .homer-manuscript-settings-form textarea.form-control { min-height: 180px; }
.homer-ui .homer-manuscript-settings-form .homer-tab-content-item { margin-bottom: 26px; }
.homer-ui .homer-manuscript-settings-form .header-title { margin-bottom: 10px; font-size: 15px; font-weight: 700; }
.homer-ui .homer-manuscript-settings-form .form-control-description { margin-top: 10px; font-size: 13px; line-height: 1.6; }
.homer-ui .homer-manuscript-settings-form .languages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.homer-ui .homer-manuscript-settings-form .languages .homer-genre {
    margin: 0; padding: 7px 12px; background: var(--homer-panel); color: var(--homer-text);
    border: 1px solid var(--homer-border); border-radius: 4px; cursor: pointer;
}
.homer-ui .homer-manuscript-settings-form .languages .homer-genre:hover { background: var(--homer-selected); border-color: var(--homer-accent); }

/* Prodromos-style genre and language tags. */
.homer-ui .homer-manuscript-genres-list { display: flex; flex-wrap: wrap; gap: 8px; }
.homer-ui .homer-manuscript-genres-list:not(:empty) { margin-bottom: 14px; }
.homer-ui .homer-manuscript-settings-form span.homer-genre {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 26px; margin: 0; padding: 4px 10px;
    background: #1e6d9e !important; color: #ebeef5 !important;
    border: 0 !important; border-radius: 0; font-size: 12px; line-height: 18px; cursor: pointer;
}
.homer-ui .homer-manuscript-settings-form span.homer-genre:hover { background: #185880 !important; }

.homer-ui .homer-corkboard-scene .homer-corkboard-edit-actions {
    flex: 0 0 auto; margin-top: 0; padding-top: 2px; box-sizing: border-box;
}
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form input::placeholder,
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form textarea::placeholder {
    color: #67582e !important; -webkit-text-fill-color: #67582e !important; opacity: 1 !important;
}

/* New cards remain local drafts until Create is submitted. */
.homer-ui .homer-corkboard-draft { position: relative; list-style: none; border-top-color: var(--cork-label-color, var(--cork-edge)); }
.homer-ui .homer-corkboard-draft > form { margin-top: 0; }
.homer-ui .homer-corkboard-draft-label {
    position: absolute; top: -5px; left: 0; width: 100%; height: 9px;
    padding: 0; border: 0; border-radius: 3px 3px 0 0; cursor: pointer;
    background: var(--cork-label-color, var(--cork-edge)); color: transparent;
    transition: height 150ms ease;
}
.homer-ui .homer-corkboard-draft-label:hover,
.homer-ui .homer-corkboard-draft-label:focus { height: 32px; color: var(--homer-text); background: var(--homer-panel); }
.homer-ui .homer-corkboard-draft-label option { background: var(--homer-panel); color: var(--homer-text); }

/* Live writing progress module and goals. */
.homer-ui #homer-wordcount-module { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.homer-ui #homer-wordcount-modal .modal-content { background: var(--homer-panel); color: var(--homer-text); border: 1px solid var(--homer-border); }
.homer-ui #homer-wordcount-modal .modal-header { display: flex; justify-content: space-between; border-color: var(--homer-border); }
.homer-ui #homer-wordcount-modal h2 { font-size: 22px; margin: 0; }
.homer-ui #homer-wordcount-modal .close { color: var(--homer-text); opacity: 1; text-shadow: none; }
.homer-ui .homer-word-goal { padding: 16px; margin: 12px 0 22px; background: var(--homer-panel); border: 1px solid var(--homer-border); border-radius: 5px; }
.homer-ui .homer-word-goal-summary { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.homer-ui .homer-word-total { font-size: 20px; }
.homer-ui .homer-word-percent { color: var(--homer-muted); }
.homer-ui .homer-word-progress { height: 10px; background: var(--homer-input); border-radius: 5px; overflow: hidden; margin-bottom: 16px; }
.homer-ui .homer-word-progress > span { display: block; height: 100%; background: var(--homer-accent); transition: width 150ms ease; }
.homer-ui .homer-word-goal-fields { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.homer-ui .homer-word-goal-fields label { flex: 1; min-width: 140px; margin: 0; }
.homer-ui .homer-word-goal-fields input { width: 100%; margin-top: 6px; min-height: 40px; }
.homer-ui .homer-word-goal-fields button { min-height: 40px; }
.homer-ui .homer-word-pace { margin: 12px 0 0; }
.homer-ui .homer-word-goal-status:empty { display: none; }
.homer-ui .homer-word-sync { color: var(--homer-muted); font-size: 12px; }

/* High-contrast writing milestones, shared by the modal and chapter panels. */
.homer-ui .homer-word-goal { padding: 22px; background: var(--homer-bg); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.homer-ui .homer-word-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; font-weight:700; }
.homer-ui .homer-word-heading > span { text-transform:uppercase; letter-spacing: .07em; font-size:12px; }
.homer-ui .homer-word-heading i { margin-right:6px; }
.homer-ui .homer-word-heroes { display:grid; grid-template-columns:1.2fr 1fr; gap:12px; }
.homer-ui .homer-word-tile { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:6px; padding:20px; border-radius:7px; color:#fff; border:1px solid rgba(255,255,255,.18); }
.homer-ui .homer-word-tile > span { font-size:13px; font-weight:700; }
.homer-ui .homer-word-tile > strong { font-size:clamp(28px,3vw,44px); line-height:1.1; font-weight:800; font-variant-numeric:tabular-nums; color:inherit; }
.homer-ui .homer-word-tile > small { color:inherit; font-size:12px; }
.homer-ui .homer-word-written { background:linear-gradient(130deg,#145078,#216d9c); }
.homer-ui .homer-word-completion { background:linear-gradient(130deg,#4c3282,#7550aa); }
.homer-ui .homer-word-progress { position:relative; height:24px; margin:18px 0; border:1px solid var(--homer-border); border-radius:6px; background:var(--homer-panel); box-shadow:inset 0 2px 5px rgba(0,0,0,.2); }
.homer-ui .homer-word-progress > span { background:linear-gradient(90deg,#168bca,#5dc9fa); box-shadow:0 0 12px rgba(84,187,250,.3); border-radius:4px; }
.homer-ui .homer-word-progress > div { position:absolute; inset:0; background:repeating-linear-gradient(90deg,transparent 0,transparent calc(25% - 1px),rgba(255,255,255,.2) calc(25% - 1px),rgba(255,255,255,.2) 25%); pointer-events:none; }
.homer-ui .homer-word-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.homer-ui .homer-word-metrics .homer-word-tile { padding:16px; }
.homer-ui .homer-word-metrics .homer-word-tile > strong { font-size:clamp(24px,2.5vw,34px); }
.homer-ui .homer-word-tile > i { color:inherit; font-size:18px; margin-bottom:3px; }
.homer-ui .homer-word-daily { background:#16645e; }
.homer-ui .homer-word-remaining { background:#865117; }
.homer-ui .homer-word-days { background:#8b3d59; }
.homer-ui .homer-word-goal-fields { padding-top:18px; margin-top:18px; border-top:1px solid var(--homer-border); }
.homer-ui .homer-word-goal-fields[hidden] { display:none !important; }
.homer-ui .homer-word-pace { font-size:13px; color:var(--homer-text); margin-top:16px; }
.homer-ui .homer-word-goal-complete .homer-word-completion { background:linear-gradient(120deg,#0b643f,#278258); }
.homer-ui .homer-word-goal-complete .homer-word-progress > span { background:linear-gradient(90deg,#1c9c65,#70d69c); }
.homer-ui #homer-wordcount-modal .modal-header { padding:24px; background:var(--homer-bg); border-bottom:3px solid var(--homer-accent); }
.homer-ui #homer-wordcount-modal .modal-body { padding:24px; }
.homer-ui #homer-wordcount-modal .modal-content { border-radius:10px; overflow:hidden; }
@media(max-width:600px) {
    .homer-ui .homer-word-goal { padding:14px; }
    .homer-ui .homer-word-heroes { grid-template-columns:1fr; }
    .homer-ui .homer-word-metrics { gap:6px; }
    .homer-ui .homer-word-metrics .homer-word-tile { padding:10px; }
    .homer-ui .homer-word-tile > span { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) { .homer-ui .homer-word-progress > span { transition:none; } }

.homer-ui .homer-word-live {
    display:inline-flex; align-items:center; gap:5px; margin-left:10px; padding:4px 7px;
    background:#a7192d; color:#fff; border:1px solid #e36576; border-radius:4px;
    font-size:10px; font-weight:800; letter-spacing:.08em; line-height:1.2; vertical-align:middle;
}
.homer-ui .homer-word-live > i { color:inherit; font-size:11px; }

/* Keep goal controls aligned despite legacy label/button margins. */
.homer-ui .homer-word-goal-fields {
    display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;
    align-items:end; gap:12px;
}
.homer-ui .homer-word-goal-fields > label { display:flex; flex-direction:column; gap:6px; min-width:0; margin:0; }
.homer-ui .homer-word-goal-fields input.form-control {
    box-sizing:border-box; height:44px; min-height:44px; margin:0 !important; padding:10px 12px; line-height:22px;
}
.homer-ui .homer-word-goal-fields > button {
    box-sizing:border-box; height:44px; min-height:44px; margin:0 !important;
    padding:10px 16px; line-height:22px; align-self:end;
}
@media(max-width:600px) {
    .homer-ui .homer-word-goal-fields { grid-template-columns:minmax(0,1fr); }
    .homer-ui .homer-word-goal-fields > button { justify-self:end; }
}

/* Flush modal header and a clearer daily writing ledger. */
.homer-ui #homer-wordcount-modal .modal-content { padding:0 !important; }
.homer-ui #homer-wordcount-modal .modal-header { margin:0 !important; border-radius:0; width:100%; box-sizing:border-box; align-items:center; }
.homer-ui #homer-wordcount-modal .modal-body { margin:0; }
.homer-ui .homer-word-history-heading { margin:24px 0 12px; font-size:16px; font-weight:700; }
.homer-ui #homer-wordcount-modal .homer-stats-table-wrap { border-radius:8px; background:var(--homer-bg); }
.homer-ui #homer-wordcount-modal .homer-stats-table { border-collapse:collapse; }
.homer-ui #homer-wordcount-modal .homer-stats-table thead th {
    padding:12px 18px; background:var(--homer-input); color:var(--homer-muted);
    font-size:11px; text-transform:uppercase; letter-spacing:.08em; border-bottom:1px solid var(--homer-border);
}
.homer-ui #homer-wordcount-modal .homer-stats-table tbody td {
    padding:16px 18px; color:var(--homer-text); border-top:1px solid var(--homer-border);
}
.homer-ui #homer-wordcount-modal .homer-stats-table tbody tr { background:var(--homer-bg); }
.homer-ui #homer-wordcount-modal .homer-stats-table tbody tr:nth-child(even) { background:var(--homer-panel); }
.homer-ui #homer-wordcount-modal .homer-stats-table tbody .homer-word-history-live { background:var(--homer-selected); }
.homer-ui #homer-wordcount-modal .homer-word-history-live > td:first-child { box-shadow:inset 3px 0 var(--homer-accent); font-weight:700; }
.homer-ui #homer-wordcount-modal .homer-stats-table .homer-word-history-count { font-size:20px; font-weight:800; font-variant-numeric:tabular-nums; }
.homer-ui #homer-wordcount-modal .homer-word-history-live .homer-word-history-count { color:var(--homer-accent); }

/* Square writing UI and an invitation to set the first goal. */
.homer-ui #homer-wordcount-modal .modal-content { background:#17191b; }
.homer-ui #homer-wordcount-modal .modal-header { background:#111315; }
.homer-ui #homer-wordcount-modal .modal-body { background:transparent; }
.homer-ui #homer-wordcount-modal .modal-content,
.homer-ui #homer-wordcount-modal .modal-content *,
.homer-ui .homer-word-goal,
.homer-ui .homer-word-goal *,
.homer-ui #homer-wordcount-module { border-radius:0 !important; }
.homer-ui .homer-word-goal { position:relative; }
.homer-ui .homer-word-dashboard { position:static; }
.homer-ui .homer-word-empty-overlay {
    position:absolute; inset:0; z-index:1; display:flex;
    align-items:center; justify-content:center; background:rgba(8,10,12,.76);
}
.homer-ui .homer-word-empty-overlay[hidden],
.homer-ui .homer-word-edit-toggle[hidden] { display:none !important; }
.homer-ui .homer-word-empty-overlay .homer-word-set-goal {
    padding:8px 12px; font-size:14px; font-weight:400; line-height:1.4; margin:0;
    background:#1e6d9e !important; border:0; color:#ebeef5 !important;
    box-shadow:none;
}
.homer-ui .homer-word-set-goal i { margin-right:8px; }
.homer-ui .homer-word-empty-overlay .homer-word-set-goal:hover,
.homer-ui .homer-word-empty-overlay .homer-word-set-goal:focus-visible { background:#2483bd !important; color:#ebeef5 !important; box-shadow:none; }
.homer-ui .homer-word-empty-overlay .homer-word-set-goal:active { background:#185880 !important; }
.homer-ui .homer-word-set-goal:focus-visible { outline:2px solid #ebeef5; outline-offset:3px; }

.homer-ui .homer-word-daily-chart { padding:16px 8px; background:var(--homer-bg); border:1px solid var(--homer-border); }
.homer-ui .homer-word-daily-chart svg { display:block; width:100%; height:auto; overflow:visible; }
.homer-ui .homer-word-chart-description { color:var(--homer-muted); font-size:12px; margin:0 0 14px; }
.homer-ui .homer-word-chart-grid { stroke:var(--homer-border); stroke-width:1; }
.homer-ui .homer-word-chart-label { fill:var(--homer-muted); font-size:11px; }
.homer-ui .homer-word-chart-bar { fill:#2687b4; }
.homer-ui .homer-word-chart-bar.is-live { fill:var(--homer-accent); }
.homer-ui .homer-word-chart-bar.is-negative { fill:#de6474; }
.homer-ui .homer-word-chart-bar:hover { filter:brightness(1.25); }
.homer-ui .homer-word-chart-empty { padding:32px 20px; margin:0; text-align:center; color:var(--homer-muted); }

.homer-ui .homer-word-chart-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin:24px 0 12px; }
.homer-ui .homer-word-chart-heading .homer-word-history-heading { margin:0; }
.homer-ui .homer-word-chart-filter { display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:var(--homer-muted); }
.homer-ui .homer-word-chart-filter .form-control { width:150px; height:38px; margin:0; padding:6px 10px; background:var(--homer-input); color:var(--homer-text); border:1px solid var(--homer-border); }

/* Shared Manuscripts modal headers follow the Prodromos title tab. */
.homer-ui .modal .modal-content { padding:0 !important; border-radius:0 !important; }
.homer-ui .modal .modal-header,
.homer-ui #homer-wordcount-modal .modal-header {
    display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
    padding:0; margin:0 !important; border:0; background:transparent; border-radius:0;
}
.homer-ui .modal .modal-header > :is(h2,h3,h4,.modal-title),
.homer-ui #homer-wordcount-modal .modal-header > h2 {
    display:flex; align-items:center; gap:8px; box-sizing:border-box;
    height:35px; min-height:35px; flex:0 1 auto; width:max-content; max-width:calc(100% - 47px);
    margin:0 !important; padding:8px 30px 8px 12px;
    background:#0a0a0a !important; color:#ebeef5 !important; font-family:Lato,sans-serif;
    font-size:16px; line-height:19px; font-weight:700; text-transform:uppercase;
    /* 35px * tan(15deg) = 9.38px: fixed Prodromos angled edge. */
    clip-path:polygon(0 0,100% 0,calc(100% - 9.38px) 100%,0 100%) !important;
}
.homer-ui .modal .modal-header > :is(h2,h3,h4,.modal-title) i { color:inherit; font-size:16px; }
.homer-ui .modal .modal-header .close,
.homer-ui #homer-wordcount-modal .modal-header .close {
    float:none; flex:0 0 35px; width:35px; height:35px; padding:0; margin:0;
    font-size:24px; line-height:35px; color:#ebeef5; opacity:1; text-shadow:none;
    background:transparent; border:0;
}
.homer-ui .modal .modal-header .close:hover,
.homer-ui .modal .modal-header .close:focus-visible { background:#333; }

/* Prominent live word total in the workspace toolbar. */
.homer-ui #homer-wordcount-module {
    font-size:13px; font-weight:800; line-height:1.5; color:#fff !important;
    padding:6px 10px; background:#1e6d9e !important; border:1px solid #2483bd;
}
.homer-ui #homer-wordcount-module > span,
.homer-ui #homer-wordcount-module > i { color:#fff !important; }
.homer-ui #homer-wordcount-module:hover,
.homer-ui #homer-wordcount-module:focus-visible { background:#2483bd !important; border-color:#2483bd; color:#fff !important; }

/* Keep the progress panel visibly darker than the surrounding workspace. */
.homer-manuscript-wrapper.homer-ui .homer-word-goal {
    background:#121416 !important;
    color:#ebeef5;
    --homer-text:#ebeef5;
    --homer-muted:#aeb5bf;
    --homer-input:#1b1e21;
    --homer-border:#41464c;
    --homer-panel:#272b30;
}

.homer-ui .modal .homer-modal-title-tab {
    overflow:hidden; white-space:nowrap; border:0 !important; border-radius:0 !important;
}
.homer-ui #homer-wordcount-modal .modal-header { background:transparent !important; border-bottom:0 !important; padding:0 !important; }

.homer-ui .homer-word-daily-chart { overflow-x:auto; }
.homer-ui .homer-word-daily-chart svg { width:auto; min-width:100%; height:250px; }
.homer-ui .homer-word-chart-zero { fill:var(--homer-text); font-size:12px; font-weight:700; }
.homer-ui .homer-word-sync[hidden] { display:none !important; }

/* Quiet, sourced encouragement with a deliberately slow crossfade. */
.homer-ui .homer-word-pace:empty { display:none; }
.homer-ui .homer-writing-inspiration { display:flex; align-items:center; gap:16px; margin-top:20px; min-height:82px; }
.homer-ui .homer-writing-quote { flex:1; margin:0; padding:0 0 0 14px; border:0; border-left:2px solid var(--homer-accent); opacity:1; transition:opacity 1200ms ease; }
.homer-ui .homer-writing-inspiration.is-fading .homer-writing-quote { opacity:0; }
.homer-ui .homer-writing-quote-text { margin:0 0 8px; color:var(--homer-text); font-size:15px; line-height:1.6; font-style:italic; }
.homer-ui .homer-writing-quote footer { color:var(--homer-muted); font-size:12px; }
.homer-ui .homer-writing-quote footer::before { content:none; }
.homer-ui .homer-writing-quote-author { color:var(--homer-muted); text-decoration:none; }
.homer-ui .homer-writing-quote-author:hover { color:#fff; text-decoration:underline; }
@media(prefers-reduced-motion:reduce) { .homer-ui .homer-writing-quote { transition:none; } }

/* Isolate inspiration quotes from the site's article blockquote styles. */
.homer-manuscript-wrapper.homer-ui .homer-word-goal blockquote.homer-writing-quote {
    background:transparent !important; background-image:none !important;
    color:#ebeef5 !important; font-family:inherit !important;
    box-shadow:none !important; padding:8px 0 8px 14px;
}
.homer-manuscript-wrapper.homer-ui .homer-writing-quote .homer-writing-quote-text {
    color:#ebeef5 !important; background:transparent !important;
    font-family:inherit !important; font-size:15px; line-height:1.6;
}
.homer-manuscript-wrapper.homer-ui .homer-writing-quote footer,
.homer-manuscript-wrapper.homer-ui .homer-writing-quote .homer-writing-quote-author {
    color:#c8cfd8 !important; background:transparent !important;
    font-family:inherit !important; font-style:normal;
}
.homer-manuscript-wrapper.homer-ui .homer-writing-quote .homer-writing-quote-author:hover { color:#fff !important; }

.homer-ui .homer-corkboard-wordcount { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; white-space:nowrap; font-variant-numeric:tabular-nums; }
.homer-ui .homer-corkboard-chapter-heading > .homer-corkboard-wordcount { color:var(--homer-text); margin:0 10px; }
.homer-ui .homer-corkboard-scene > .homer-corkboard-wordcount { position:absolute; left:14px; bottom:12px; color:var(--cork-ink); }
.homer-ui .homer-corkboard-scene:not(.homer-corkboard-editing) { padding-bottom:38px; }
.homer-ui .homer-corkboard-scene.homer-corkboard-editing > .homer-corkboard-wordcount { display:none; }

/* Prodromos tabs: neutral hover, inherited icon color, no outlined hover tile. */
.homer-manuscript-wrapper.homer-ui .nav-tabs .nav-link {
    border:0 !important; border-radius:0 !important; box-shadow:none;
}
.homer-manuscript-wrapper.homer-ui .nav-tabs .nav-link:not(.active):hover,
.homer-manuscript-wrapper.homer-ui .nav-tabs .nav-link:not(.active):focus-visible {
    background:#2c2d2e !important; color:#a6a9ad !important;
    border:0 !important; box-shadow:none !important;
}
.homer-manuscript-wrapper.homer-ui .nav-tabs .nav-link.active,
.homer-manuscript-wrapper.homer-ui .nav-tabs .nav-link.active:hover,
.homer-manuscript-wrapper.homer-ui .nav-tabs .nav-link.active:focus-visible {
    background:#222324 !important; color:#ebeef5 !important;
    border:0 !important; box-shadow:none !important;
}
.homer-manuscript-wrapper.homer-ui .nav-tabs .nav-link:hover :is(i,span,svg) { color:inherit !important; }

/* Compact scene rows for the chapter Write view. */
.homer-ui .homer-folder-list > ul { margin:16px 0; display:grid; gap:6px; }
.homer-ui .homer-folder-item { display:grid; grid-template-columns:minmax(0,1fr) 100px 145px 68px; align-items:center; gap:16px; padding:16px; background:var(--homer-input); border:1px solid var(--homer-border); border-radius:0; }
.homer-ui .homer-folder-item:hover, .homer-ui .homer-folder-item:focus-within { background:var(--homer-panel); }
.homer-ui .homer-folder-item-main { display:flex; gap:12px; align-items:flex-start; min-width:0; }
.homer-ui .homer-folder-item-icon { color:var(--homer-muted); margin-top:4px; font-size:16px; }
.homer-ui .homer-folder-item-copy { min-width:0; }
.homer-ui button.homer-folder-item-title { display:block; max-width:100%; background:none; border:0; padding:0; margin:0; text-align:left; color:var(--homer-text); font:inherit; font-weight:700; font-size:16px; overflow-wrap:anywhere; }
.homer-ui button.homer-folder-item-title:hover { color:var(--homer-accent); }
.homer-ui .homer-folder-item-synopsis { margin:6px 0 0; font-size:13px; line-height:1.5; color:var(--homer-muted); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.homer-ui .homer-folder-item-details { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; font-size:12px; }
.homer-ui .homer-folder-item-words { color:var(--homer-muted); font-size:12px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.homer-ui .homer-folder-item-words i { margin-right:4px; }
.homer-ui .homer-folder-item-label .homer-part-label { display:inline-block; max-width:100%; padding:4px 8px; border-radius:0 !important; font-size:12px; }
.homer-ui .homer-folder-item-label .homer-part-label-empty { background:transparent !important; color:var(--homer-muted) !important; border:1px dashed var(--homer-border); }
.homer-ui .homer-folder-item-actions { display:flex; gap:4px; }
.homer-ui .homer-folder-item-actions button { width:32px; height:32px; padding:6px; border:0; background:transparent; color:var(--homer-muted); border-radius:0; }
.homer-ui .homer-folder-item-actions button:hover { background:#47484a; color:#ebeef5; }
.homer-ui .homer-folder-item-actions .homer-part-archive:hover { background:#9f0e11; color:#fff; }
@media(max-width:1100px) {
    .homer-ui .homer-folder-item { grid-template-columns:minmax(0,1fr) auto; gap:12px; }
    .homer-ui .homer-folder-item-main { grid-column:1; grid-row:1; }
    .homer-ui .homer-folder-item-actions { grid-column:2; grid-row:1; }
    .homer-ui .homer-folder-item-words { grid-column:1; grid-row:2; }
    .homer-ui .homer-folder-item-label { grid-column:2; grid-row:2; }
}

.homer-ui .homer-corkboard-chapter-heading > .homer-corkboard-wordcount { height:30px; box-sizing:border-box; align-items:center; line-height:1; margin-top:0; margin-bottom:0; }

/* Keep the note actions close to the synopsis field. */
.homer-ui .homer-corkboard-scene.homer-corkboard-editing > .homer-corkboard-edit-form { gap:6px; }
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form .homer-corkboard-synopsis-field,
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-form textarea { margin-bottom:0 !important; }
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-actions { margin-top:0 !important; padding-top:0; }
.homer-ui .homer-corkboard-scene .homer-corkboard-edit-actions > .btn { margin-top:0 !important; margin-bottom:0 !important; }

.homer-ui .homer-corkboard-scene .homer-corkboard-edit-actions > .homer-corkboard-edit-cancel {
    margin-left:0 !important; padding-left:0 !important; text-align:left;
}

.homer-ui .tox .tox-statusbar {
    min-height:36px; height:auto; padding:7px 12px; box-sizing:border-box;
}
.homer-ui .tox .tox-statusbar__text-container { padding:0; }

.homer-ui #homer-public-view-modal .modal-content { background:#17191b; color:#ebeef5; border:1px solid #41464c; }
.homer-ui #homer-public-view-modal .modal-body { padding:24px; font-size:16px; line-height:1.6; }
.homer-ui #homer-public-view-modal .modal-footer { padding:12px 24px 20px; border:0; }
.homer-ui #homer-public-view-modal .modal-footer .btn { background:#1e6d9e; color:#ebeef5; border:0; border-radius:0; }

/* Reader preferences are independent of the manuscript's saved design. */
.homer-ui .homer-reader { --reader-size:16px; --reader-bg:#fff; --reader-ink:#171717; background:var(--reader-bg); color:var(--reader-ink); }
.homer-ui .homer-reader[data-reader-theme="dark"] { --reader-bg:#111315; --reader-ink:#ebeef5; }
.homer-ui .homer-reader-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:12px 16px; background:#1b1b1c; color:#ebeef5; }
.homer-ui .homer-reader-controls { display:flex; align-items:center; gap:6px; }
.homer-ui .homer-reader-toolbar-label { font-size:13px; font-weight:700; }
.homer-ui .homer-reader-toolbar button { padding:6px 10px; background:#2c2d2e; color:#ebeef5; border:0; border-radius:0; }
.homer-ui .homer-reader-toolbar button[aria-pressed="true"] { background:#1e6d9e; }
.homer-ui .homer-reader-toolbar button:disabled { opacity:.4; cursor:default; }
.homer-ui .homer-reader-size { color:#ebeef5; font-size:12px; min-width:36px; text-align:center; }
.homer-ui .homer-reader-control-divider { height:20px; border-left:1px solid #515254; margin:0 6px; }
.homer-ui .homer-reader-page { max-width:76ch; margin:0 auto; padding:32px 28px; font-size:var(--reader-size); }
.homer-ui .homer-reader-prose { font-size:var(--reader-size); line-height:1.8; }
.homer-ui .homer-reader-prose :is(p,li,div,span) { font-size:inherit !important; line-height:inherit; color:var(--reader-ink) !important; background-color:transparent !important; }
.homer-ui .homer-reader-prose p { margin:0 0 1em; }
.homer-ui .homer-reader :is(h1,h2,h3,h4,h5,h6) { color:var(--reader-ink) !important; line-height:1.3; font-weight:700; margin:1.3em 0 .6em; }
.homer-ui .homer-reader h1 { font-size:2em !important; }
.homer-ui .homer-reader h2 { font-size:1.65em !important; }
.homer-ui .homer-reader h3 { font-size:1.35em !important; }
.homer-ui .homer-reader :is(h4,h5,h6) { font-size:1.15em !important; }
.homer-ui .homer-reader .homer-reader-title { margin-top:0; }
.homer-ui .homer-reader .homer-part-reading { border:0; margin:0 0 1.5em; }
.homer-ui .homer-reader img { max-width:100%; height:auto; }
.homer-ui .homer-reader-navigation { display:flex; justify-content:space-between; gap:16px; padding:20px; border-top:1px solid #515254; }
.homer-ui .homer-reader-chapter { max-width:48%; background:transparent; border:0; padding:8px; text-align:left; color:var(--reader-ink); }
.homer-ui .homer-reader-chapter span { display:block; font-size:12px; margin-bottom:5px; }
.homer-ui .homer-reader-chapter strong { font-size:15px; }
.homer-ui .homer-reader-next { text-align:right; margin-left:auto; }
.homer-ui .homer-reader-chapter:hover { text-decoration:underline; }
@media(max-width:600px) { .homer-ui .homer-reader-page { padding:24px 16px; } }

.homer-ui .homer-reader-controls { flex-wrap:wrap; }
.homer-ui .homer-reader-select-label { display:flex; align-items:center; gap:6px; margin:0 4px; color:#ebeef5; font-size:12px; }
.homer-ui .homer-reader-select-label select { background:#2c2d2e; color:#ebeef5; border:1px solid #515254; padding:6px 8px; border-radius:0; }
.homer-ui .homer-reader-page { font-family:var(--reader-font,Lato,Arial,sans-serif); }
.homer-ui .homer-reader-prose { line-height:var(--reader-leading,1.8); }
.homer-ui .homer-reader-page :is(p,li,div,span,h1,h2,h3,h4,h5,h6) { font-family:inherit !important; }
.homer-reader-focus-host { position:fixed; inset:0; z-index:2147483647; overflow:auto; background:#111315; width:100%; height:100%; }
.homer-reader-focus-host .homer-reader { min-height:100%; }
.homer-reader-focus-host .homer-reader-toolbar { display:none; }
.homer-reader-focus-host .homer-reader-page { padding-top:64px; }
.homer-ui .homer-reader-focus-exit { position:fixed; right:20px; top:16px; z-index:2; background:#1e6d9e; color:#fff; border:0; border-radius:0; padding:8px 12px; }
.homer-ui .homer-reader-focus-exit[hidden] { display:none !important; }

/* Reading quotes follow reader preferences instead of article decoration. */
.homer-ui .homer-reader .homer-reader-prose blockquote {
    background:transparent !important; background-image:none !important;
    color:var(--reader-ink) !important; font-family:var(--reader-font,Lato,Arial,sans-serif) !important;
    font-size:var(--reader-size) !important; line-height:var(--reader-leading,1.8) !important;
    font-weight:400 !important; font-style:normal !important;
    margin:1.5em 0 !important; padding:.5em 0 .5em 1.25em !important;
    border:0 !important; border-left:3px solid #717275 !important;
    border-radius:0 !important; box-shadow:none !important;
    height:auto !important; min-height:0 !important;
}
.homer-ui .homer-reader .homer-reader-prose blockquote :is(p,div,span) {
    font-size:inherit !important; line-height:inherit !important; font-family:inherit !important;
    color:inherit !important; font-style:inherit; letter-spacing:normal;
}
.homer-ui .homer-reader .homer-reader-prose blockquote > :last-child { margin-bottom:0 !important; }
.homer-ui .homer-reader .homer-reader-prose blockquote::before,
.homer-ui .homer-reader .homer-reader-prose blockquote::after { content:none !important; }
.homer-ui .homer-reader .homer-reader-prose blockquote :is(cite,footer) { color:var(--reader-ink) !important; font-size:.875em; line-height:1.5; margin-top:.75em; }

@font-face { font-family:"OpenDyslexic"; src:url("../../fonts/reader/OpenDyslexic-Regular.woff2") format("woff2"); font-weight:400; font-style:normal; font-display:swap; }

@font-face { font-family:"OpenDyslexic"; src:url("../../fonts/reader/OpenDyslexic-Bold.woff2") format("woff2"); font-weight:700; font-style:normal; font-display:swap; }

@font-face { font-family:"OpenDyslexic"; src:url("../../fonts/reader/OpenDyslexic-Italic.woff2") format("woff2"); font-weight:400; font-style:italic; font-display:swap; }

@font-face { font-family:"OpenDyslexic"; src:url("../../fonts/reader/OpenDyslexic-BoldItalic.woff2") format("woff2"); font-weight:700; font-style:italic; font-display:swap; }

@font-face { font-family:"Atkinson Hyperlegible"; src:url("../../fonts/reader/AtkinsonHyperlegible-Regular.woff2") format("woff2"); font-weight:400; font-style:normal; font-display:swap; }

@font-face { font-family:"Atkinson Hyperlegible"; src:url("../../fonts/reader/AtkinsonHyperlegible-Bold.woff2") format("woff2"); font-weight:700; font-style:normal; font-display:swap; }

@font-face { font-family:"Atkinson Hyperlegible"; src:url("../../fonts/reader/AtkinsonHyperlegible-Italic.woff2") format("woff2"); font-weight:400; font-style:italic; font-display:swap; }

@font-face { font-family:"Atkinson Hyperlegible"; src:url("../../fonts/reader/AtkinsonHyperlegible-BoldItalic.woff2") format("woff2"); font-weight:700; font-style:italic; font-display:swap; }

.homer-ui .homer-reader-toolbar [data-reader-theme-choice="light"] { background:#fff !important; color:#111 !important; }
.homer-ui .homer-reader-toolbar [data-reader-theme-choice="dark"] { background:#08090a !important; color:#fff !important; }
.homer-ui .homer-reader-toolbar [data-reader-theme-choice] { border:1px solid #717275; }
.homer-ui .homer-reader-toolbar [data-reader-theme-choice][aria-pressed="true"] { box-shadow:inset 0 -3px #54bbfa; }
.homer-ui .homer-reader-focus-toggle { margin-left:8px; }

/* Consistent dimensions for every reading-toolbar control. */
.homer-ui .homer-reader-controls { align-items:center; }
.homer-ui .homer-reader-controls > button,
.homer-ui .homer-reader-controls .homer-reader-select-label select {
    box-sizing:border-box; height:36px; min-height:36px; max-height:36px;
    margin-top:0 !important; margin-bottom:0 !important;
    padding:0 12px; font-size:14px; line-height:normal; vertical-align:middle;
}
.homer-ui .homer-reader-controls > button { display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.homer-ui .homer-reader-select-label { display:flex; align-items:center; height:36px; }
.homer-ui .homer-reader-size { display:none; }

/* One inset controls every single-choice dropdown across Manuscripts. */
.homer-ui { --homer-dropdown-chevron-inset: 12px; }
.homer-ui select:not([multiple]):not([size]),
.homer-ui select[size="1"]:not([multiple]) {
    appearance:none !important;
    -webkit-appearance:none !important;
    padding-right:calc(var(--homer-dropdown-chevron-inset) + 24px) !important;
    border-radius:0 !important;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E") !important;
    background-repeat:no-repeat !important;
    background-position:right var(--homer-dropdown-chevron-inset) center !important;
    background-size:12px 8px !important;
}

.homer-ui #homer-center-content:has(.homer-reader-container) { padding:0 !important; margin:0 !important; }
.homer-ui #homer-center-content .homer-tab-content.homer-reader-container { padding:0 !important; margin:0 !important; border:0; }
.homer-ui .homer-reader-container > .homer-reader { margin:0; width:100%; }

/* Connect the reading toolbar visually to its selected workspace tab. */
.homer-ui .homer-reader-toolbar { background:var(--homer-bg) !important; color:var(--homer-text); }

.homer-ui .homer-reader-cover { margin:24px auto; text-align:center; }
.homer-ui .homer-reader-cover img { display:block; margin:auto; width:auto; max-width:100%; max-height:480px; object-fit:contain; }
.homer-ui .homer-reader-backcover { margin:28px 0; }
.homer-ui .homer-reader-genres { display:flex; flex-wrap:wrap; gap:8px; list-style:none; padding:0; margin:24px 0; }
.homer-ui .homer-reader-prose .homer-reader-genres li { background:#1e6d9e !important; color:#ebeef5 !important; padding:4px 10px; font-size:13px !important; border-radius:0; }

/* Manuscript settings tabs connect directly to a distinct content surface. */
.homer-ui #homer-center-content .homer-manuscript-settings-form { --homer-settings-surface:#1b1b1c; }
.homer-ui[data-homer-theme="light"] #homer-center-content .homer-manuscript-settings-form { --homer-settings-surface:#e6e9ed; }
.homer-ui #homer-center-content .homer-manuscript-settings-form > .homer-settings-header { margin-bottom:0; }
.homer-ui #homer-center-content .homer-manuscript-settings-form > .tab-content {
    margin:0 -18px -18px; padding:24px 18px; background:var(--homer-settings-surface) !important;
}
.homer-ui #homer-center-content .homer-manuscript-settings-form > .tab-content .homer-tab-content { background:transparent !important; padding-top:0; }
.homer-ui #homer-center-content .homer-settings-header .nav-tabs { border:0; gap:0; }
.homer-ui #homer-center-content .homer-settings-header .nav-tabs .nav-item { margin:0; }
.homer-ui #homer-center-content .homer-settings-header .nav-tabs .nav-link {
    border:0 !important; border-radius:0 !important; padding:14px 20px;
    background:transparent; font-weight:400; box-shadow:none !important;
}
.homer-ui #homer-center-content .homer-settings-header .nav-tabs .nav-link.active,
.homer-ui #homer-center-content .homer-settings-header .nav-tabs .nav-link.active:hover {
    background:var(--homer-settings-surface) !important; color:var(--homer-text) !important;
}
.homer-ui #homer-center-content .homer-settings-header .nav-tabs .nav-link:focus:not(:focus-visible) { outline:none !important; }
.homer-ui #homer-center-content .homer-settings-header .nav-tabs .nav-link:focus-visible { outline:2px solid var(--homer-accent); outline-offset:-3px; }

.homer-ui #parts-tree button.homer-tree-label-badge:not(.homer-tree-label-empty) {
    border:0 !important; box-shadow:none !important;
}

/* Fill the remaining workspace below every manuscript settings tab. */
.homer-ui #homer-center-content:has(> .homer-manuscript-settings-form) {
    background:#1b1b1c !important;
}
.homer-ui[data-homer-theme="light"] #homer-center-content:has(> .homer-manuscript-settings-form) {
    background:#e6e9ed !important;
}
.homer-ui #homer-center-content > .homer-manuscript-settings-form {
    min-height:100%; box-sizing:border-box; display:flex; flex-direction:column;
    background:var(--homer-settings-surface) !important;
}
.homer-ui #homer-center-content > .homer-manuscript-settings-form > .homer-settings-header { flex:0 0 auto; }
.homer-ui #homer-center-content > .homer-manuscript-settings-form > .tab-content { flex:1 0 auto; }

.homer-ui .homer-label-create { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.homer-ui .homer-label-create .homer-label-new-title { flex:1; min-width:0; margin:0; }
.homer-ui .homer-label-create input[type="color"] { width:44px; height:36px; flex-shrink:0; padding:3px; background:var(--homer-input); border:1px solid var(--homer-border); }
.homer-ui .homer-label-create button { white-space:nowrap; }
.homer-ui .homer-label-manager input, .homer-ui .homer-label-manager button { border-radius:0 !important; }
.homer-ui .homer-label-management-table td:last-child { width:48px; vertical-align:middle; }

/* Keep scrolling inside the picker from scrolling the tree underneath. */
body.homer-editor-page .homer-label-popover { overscroll-behavior:contain; border-radius:0; }

/* Compact label editor: swatch, editable name, and a quiet removal action. */
.homer-ui .homer-label-manager { width:100%; max-width:880px; }
.homer-ui .homer-label-manager .homer-label-management-table { margin:0; background:transparent !important; }
.homer-ui .homer-label-manager .homer-label-management-table thead th { padding:0; height:0; border:0; }
.homer-ui .homer-label-manager .homer-label-management-table tbody,
.homer-ui .homer-label-manager .homer-label-management-table tr,
.homer-ui .homer-label-manager .homer-label-management-table td { background:transparent !important; }
.homer-ui .homer-label-manager .homer-label-management-table td { padding:8px 0; border:0; border-bottom:1px solid var(--homer-border); }
.homer-ui .homer-label-manager .homer-label-management-table td:nth-child(2) { padding-right:12px; }
.homer-ui .homer-label-manager .homer-label-management-table td:last-child { text-align:right; }
.homer-ui .homer-label-manager input.form-control { height:36px; min-height:36px; padding:6px 10px; margin:0; font-size:14px; box-shadow:none; }
.homer-ui .homer-label-manager .homer-label-edit[type="text"] { background:var(--homer-input) !important; border:1px solid var(--homer-border); color:var(--homer-text); }
.homer-ui .homer-label-manager .homer-label-edit[type="text"]:hover { border-color:var(--homer-border); }
.homer-ui .homer-label-manager .homer-label-edit[type="text"]:focus { background:var(--homer-input) !important; border-color:var(--homer-accent); }
.homer-ui .homer-label-manager input[type="color"] { width:36px; min-width:36px; height:36px; padding:4px; margin:0; background:transparent; border:1px solid var(--homer-border); cursor:pointer; }
.homer-ui .homer-label-manager input[type="color"]::-webkit-color-swatch-wrapper { padding:0; }
.homer-ui .homer-label-manager input[type="color"]::-webkit-color-swatch { border:0; border-radius:0; }
.homer-ui .homer-label-manager input[type="color"]::-moz-color-swatch { border:0; border-radius:0; }
.homer-ui .homer-label-manager .homer-label-remove { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border:1px solid transparent !important; background:transparent !important; color:var(--homer-muted) !important; box-shadow:none; }
.homer-ui .homer-label-manager .homer-label-remove:hover,
.homer-ui .homer-label-manager .homer-label-remove:focus-visible { color:#fff !important; background:#a51019 !important; }
.homer-ui .homer-label-manager .homer-label-create { display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:16px; margin:20px 0 0; }
.homer-ui .homer-label-manager .homer-label-add { height:36px; margin:0; padding:0 12px; background:#1e6d9e !important; border:1px solid #1e6d9e !important; color:#fff !important; font-size:14px; }
.homer-ui .homer-label-manager .homer-label-add:hover { background:#2483bd !important; }
.homer-ui .homer-label-manager button:focus-visible { outline:2px solid var(--homer-accent); outline-offset:2px; }
@media(max-width:600px) {
    .homer-ui .homer-label-manager .homer-label-create { gap:12px; grid-template-columns:36px minmax(0,1fr); }
    .homer-ui .homer-label-manager .homer-label-add { grid-column:2; justify-self:end; }
}

/* Prodromos Create/Delete variants, with a shared control height. */
.homer-ui .homer-label-manager input,
.homer-ui .homer-label-manager button { box-sizing:border-box; height:36px; min-height:36px; vertical-align:middle; }
.homer-ui .homer-label-manager .homer-label-add { display:inline-flex; align-items:center; justify-content:center; gap:6px; font-weight:700; line-height:normal; border:0 !important; background:var(--wa-colors-default-main-create-medium,#0B4B26) !important; color:var(--wa-colors-default-maingradient-light-1,#ebeef5) !important; }
.homer-ui .homer-label-manager .homer-label-add:hover,
.homer-ui .homer-label-manager .homer-label-add:focus-visible { background:var(--wa-colors-default-main-create-bright,#07612F) !important; }
.homer-ui .homer-label-manager .homer-label-add:active { background:var(--wa-colors-default-main-create-dark,#002E16) !important; }
.homer-ui .homer-label-manager .homer-label-remove { background:var(--wa-colors-default-maingradient-medium-4,#47484a) !important; color:var(--wa-colors-default-maingradient-light-1,#ebeef5) !important; }
.homer-ui .homer-label-manager .homer-label-remove:hover { background:var(--wa-colors-default-main-danger-bright,#9F0E11) !important; }
.homer-ui .homer-label-manager .homer-label-remove:active,
.homer-ui .homer-label-manager .homer-label-remove:focus-visible { background:var(--wa-colors-default-main-danger-dark,#560608) !important; }
.homer-ui .homer-label-manager button:disabled { opacity:.5; cursor:not-allowed; }

/* A single table grid aligns existing labels and the creation footer. */
.homer-ui .homer-label-manager { max-width:none; box-sizing:border-box; padding:12px 16px; border:1px solid var(--homer-border); background:var(--homer-input); }
.homer-ui .homer-label-manager .homer-label-swatch-col { width:76px; }
.homer-ui .homer-label-manager .homer-label-actions-col { width:124px; }
.homer-ui .homer-label-manager .homer-label-management-table thead th { height:auto; padding:10px 0 12px; border-bottom:1px solid var(--homer-border); color:var(--homer-muted); font-size:12px; font-weight:700; text-align:left; background:transparent !important; }
.homer-ui .homer-label-manager .homer-label-management-table thead th:last-child { text-align:right; }
.homer-ui .homer-label-manager .homer-label-management-table td { padding:10px 0; }
.homer-ui .homer-label-manager .homer-label-management-table td:nth-child(2) { padding-right:16px; }
.homer-ui .homer-label-manager .homer-label-management-table .homer-label-create { display:table-row; margin:0; }
.homer-ui .homer-label-manager .homer-label-management-table tfoot td { padding-top:16px; padding-bottom:4px; border-bottom:0; }
.homer-ui .homer-label-manager .homer-label-management-table input[type="text"] { width:100%; }
@media(max-width:600px) {
    .homer-ui .homer-label-manager { padding:8px; }
    .homer-ui .homer-label-manager .homer-label-swatch-col { width:52px; }
    .homer-ui .homer-label-manager .homer-label-actions-col { width:108px; }
    .homer-ui .homer-label-manager .homer-label-management-table td:nth-child(2) { padding-right:8px; }
}

/* Shared framing for Basic Details, Access, and Labels. */
.homer-ui .homer-manuscript-settings-form .homer-settings-container {
    width:100%; max-width:none; box-sizing:border-box; padding:12px 16px;
    border:1px solid var(--homer-border); border-radius:0; background:var(--homer-input);
}
.homer-ui .homer-settings-container > .homer-tab-content-item { margin:0; padding:12px 0 20px; }
.homer-ui .homer-settings-container > .homer-tab-content-item + .homer-tab-content-item { border-top:1px solid var(--homer-border); padding-top:20px; }
.homer-ui .homer-settings-container > .homer-tab-content-item:last-child { padding-bottom:4px; }
.homer-ui .homer-settings-container .header-title { margin:0 0 10px; }
.homer-ui .homer-settings-container .form-control { border-radius:0 !important; }
@media(max-width:600px) {
    .homer-ui .homer-manuscript-settings-form .homer-settings-container { padding:8px; }
}

/* Match the creation action to the row actions and make swatches easier to use. */
.homer-ui .homer-manuscript-settings-form .homer-settings-container { background:var(--homer-panel); }
.homer-ui .homer-label-manager .homer-label-swatch-col { width:96px; }
.homer-ui .homer-label-manager .homer-label-actions-col { width:52px; }
.homer-ui .homer-label-manager input[type="color"] { width:76px; min-width:76px; }
.homer-ui .homer-label-manager .homer-label-add { width:36px; min-width:36px; padding:0; }
@media(max-width:600px) {
    .homer-ui .homer-label-manager .homer-label-swatch-col { width:80px; }
    .homer-ui .homer-label-manager input[type="color"] { width:64px; min-width:64px; }
}

.homer-manuscript-wrapper #homer-center-top-content.homer-article-split { max-height: none; box-sizing: border-box; }
#homer-article-resizer { height: 10px; cursor: row-resize; touch-action: none; background: var(--homer-panel); position: relative; }
#homer-article-resizer[hidden] { display: none; }
#homer-article-resizer::after { content: ''; position: absolute; width: 40px; height: 3px; left: calc(50% - 20px); top: 3px; background: var(--homer-muted); }
#homer-article-resizer:hover::after, #homer-article-resizer:focus::after { background: var(--homer-accent, #54bbfa); }
#homer-article-resizer:focus-visible { outline: 2px solid #54bbfa; outline-offset: -2px; }
body.homer-resizing-article, body.homer-resizing-article * { cursor: row-resize !important; user-select: none !important; }
body.homer-resizing-article iframe { pointer-events: none !important; }
