        @import url('/styles/fern-shared-chrome.css');

        a {
            text-decoration: none;
        }

        .material-icons {
            font-family: 'Material Icons';
            font-weight: normal;
            font-style: normal;
            font-size: 16px;
            line-height: 1;
            letter-spacing: normal;
            text-transform: none;
            display: inline-block;
            white-space: nowrap;
            word-wrap: normal;
            direction: ltr;
            -webkit-font-feature-settings: 'liga';
            -webkit-font-smoothing: antialiased;
        }

        :root {
            --bg-editor: var(--phrond-bg);
            --bg-panel: var(--phrond-surface-panel);
            --bg-panel-header: var(--phrond-chassis-bg);
            --border-editor: rgba(121, 113, 95, 0.45);
            --text-main: var(--phrond-text-primary);
            --text-muted: var(--phrond-text-muted);
            --accent-gold: #d97706;
            --accent-gold-light: #fef3c7;
            --accent-gold-dark: #b45309;
            --accent-danger: #ef4444;
            --accent-success: #10b981;
            --bg-paper: #ffffff;
            --color-ink: #111827;
            --color-ink-muted: #4b5563;
            --border-grid: rgba(17, 24, 39, 0.15);
            --sidebar-width: 340px;
            --radius-card: 12px;
            --radius-color: 9px;
            --radius-control: 6px;
            --radius-swatch: 5px;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-editor);
            color: var(--text-main);
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .workbench-header {
            display: flex;
            flex-direction: column;
            background-color: var(--bg-panel-header);
            border-bottom: 1px solid var(--phrond-tile-border);
            flex: 0 0 auto;
            position: sticky;
            top: 0;
            z-index: 220;
        }

        .workbench-header-main {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
        }

        /* Fern replaces this placeholder with the shared footer when mounted. */
        body > .site-footer,
        body > .fern-shared-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            height: 28px;
            min-height: 28px;
            margin: 0;
            padding: 4px 12px;
            color: var(--text-muted);
            border-top: 1px solid var(--phrond-tile-border);
            font-size: 10px;
            line-height: 1.2;
        }

        body > .site-footer nav,
        body > .fern-shared-footer nav {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
        }

        body > .site-footer a,
        body > .fern-shared-footer a {
            color: inherit;
            text-decoration: none;
        }

        body > .site-footer a:hover,
        body > .site-footer a:focus-visible,
        body > .fern-shared-footer a:hover,
        body > .fern-shared-footer a:focus-visible {
            text-decoration: underline;
        }

        .workspace {
            display: flex;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        .panel {
            width: var(--sidebar-width);
            background-color: var(--bg-panel-header);
            border-right: 1px solid var(--border-editor);
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow-y: auto;
            overflow-x: hidden;
        }

        .sidebar-collapse-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex: 0 0 auto;
            min-height: 2.75rem;
            margin: 0.55rem;
            padding: 0.55rem 0.65rem;
            border: 1px solid var(--border-editor);
            border-radius: 8px;
            color: var(--accent-gold-light);
            background: var(--bg-panel);
            cursor: pointer;
        }

        .sidebar-collapse-toggle:hover,
        .sidebar-collapse-toggle:focus-visible {
            border-color: var(--accent-gold);
        }

        .sidebar-collapse-toggle .material-icons {
            font-size: 1.35rem;
        }

        .sidebar-toggle-label {
            color: var(--text-muted);
            font-size: 0.68rem;
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        .sidebar-tool-icon {
            display: none;
        }

        .panel.is-sidebar-collapsed {
            width: 58px;
            flex: 0 0 58px;
            overflow: hidden;
        }

        .panel.is-sidebar-collapsed .content-list {
            display: none;
        }

        .panel.is-sidebar-collapsed .sidebar-collapse-toggle {
            flex-direction: column;
            justify-content: flex-start;
            gap: 0.65rem;
            height: calc(100% - 1.1rem);
            padding: 0.75rem 0.35rem;
        }

        .panel.is-sidebar-collapsed .sidebar-toggle-label {
            display: none;
        }

        .panel.is-sidebar-collapsed .sidebar-tool-icon {
            display: inline-block;
        }

        .panel-header {
            padding: 0.75rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex: 0 0 var(--sidebar-width);
            border-right: 1px solid var(--border-editor);
        }

        .panel-header h1 {
            font-size: 1.1rem;
            font-weight: 600;
            letter-spacing: 0.05em;
            color: var(--text-main);
            font-family: 'Uncial Antiqua', Georgia, serif;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .panel-header h1 .brand-word {
            color: inherit;
            text-decoration: none;
        }

        .panel-header h1 .brand-separator {
            color: var(--text-muted);
            font-family: Inter, sans-serif;
            font-weight: 300;
        }

        .panel-header h1 .product-name {
            color: var(--accent-gold);
            font-family: 'Cinzel', Georgia, serif;
            font-style: normal;
        }

        .site-menu {
            flex: 1;
            padding: 0 1.25rem;
            overflow: visible;
        }

        .publish-account-status {
            flex: 0 0 auto;
            padding: 0 0.75rem;
            font-size: 0.72rem;
            font-weight: 600;
            white-space: nowrap;
        }

        .publish-account-status a {
            color: var(--text-main);
            text-decoration: none;
        }

        .publish-account-status a:hover,
        .publish-account-status a:focus-visible {
            text-decoration: underline;
        }

        .publish-account-status [data-publish-temporary-message] {
            color: var(--accent-danger);
        }

        .site-toolbar-row {
            width: 100%;
            border-top: 1px solid var(--phrond-tile-border);
            padding: 0 5.5rem 0 1.25rem;
            background: var(--bg-panel);
            position: relative;
            z-index: 210;
            overflow: visible;
        }

        .site-toolbar-row[hidden] {
            display: none;
        }

        .site-toolbar-band {
            padding: 0.5rem 0;
        }

        .site-toolbar {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem 0.75rem;
        }

        .site-toolbar-band + .site-toolbar-band {
            border-top: 1px solid var(--border-editor);
        }

        .toolbar-dock-control {
            position: absolute;
            top: 0.5rem;
            right: 1rem;
            z-index: 5;
        }
        @media (max-width: 820px) {
            /* Fixed toolbar position on ipad and below */
            .toolbar-dock-control {
                display: none;
            }
            .site-toolbar-row {
                padding-right: 1.25rem;
            }
        }

        .site-menu-item.toolbar-dock-control {
            position: absolute;
        }

        .toolbar-dock-control.has-submenu::after {
            display: none;
        }

        .toolbar-dock-control > .site-submenu {
            position: absolute;
            left: auto;
            right: 0;
            top: 100%;
            min-width: 10rem;
        }

        .toolbar-dock-trigger {
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            white-space: nowrap;
        }

        .toolbar-dock-menu .site-submenu-option {
            padding: 0;
        }

        .toolbar-dock-option {
            width: 100%;
            border: 0;
            background: transparent;
            color: var(--text-main);
            font: inherit;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 0.7rem;
            padding: 0.55rem 0.65rem;
            border-radius: 6px;
            text-align: left;
            white-space: nowrap;
        }

        .toolbar-dock-option .material-icons {
            flex: 0 0 1.2rem;
            text-align: center;
        }

        .toolbar-dock-option-label {
            flex: 1 1 auto;
        }

        .toolbar-dock-option:hover,
        .toolbar-dock-option:focus-visible {
            background: rgba(255, 255, 255, 0.06);
            outline: none;
        }

        body[data-toolbar-dock="right"] .workbench-header {
            padding-right: 9rem;
        }

        body[data-toolbar-dock="right"] .site-toolbar-row {
            position: fixed;
            top: 3rem;
            bottom: 0;
            right: 0;
            width: 7.75rem;
            max-height: none;
            overflow-y: auto;
            overflow-x: hidden;
            border-left: 1px solid var(--border-editor);
            border-top: 0;
            box-shadow: -12px 0 28px rgba(0, 0, 0, 0.22);
            padding: 0.65rem 0.5rem;
        }

        body[data-toolbar-dock="right"] .site-toolbar-band {
            padding: 0;
        }

        body[data-toolbar-dock="right"] .site-toolbar-band + .site-toolbar-band {
            border-top: 1px solid var(--border-editor);
            margin-top: 0.85rem;
            padding-top: 0.85rem;
        }

        body[data-toolbar-dock="right"] .site-toolbar {
            align-items: stretch;
            flex-direction: column;
            gap: 0.85rem;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row + .chip-row,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row.toolbar-break-before {
            padding-left: 0;
            border-left: 0;
            width: 100%;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.35rem;
            align-items: stretch;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .chip-btn,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .site-menu-item,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .toolbar-popout {
            width: 100%;
            min-width: 0;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .site-menu-item > .site-menu-trigger,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .toolbar-popout > .site-menu-trigger,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .chip-btn {
            width: 100%;
            min-height: 2.2rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
            padding-left: 0.35rem;
            padding-right: 0.35rem;
        }

        .toolbar-label-right {
            display: none;
        }

        body[data-toolbar-dock="right"] .toolbar-label-default {
            display: none;
        }

        body[data-toolbar-dock="right"] .toolbar-label-right {
            display: inline;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .site-menu-item > .site-menu-trigger,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .toolbar-popout > .site-menu-trigger {
            justify-content: flex-start;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .site-menu-item > .site-submenu,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .toolbar-popout > .site-submenu {
            top: 100%;
            left: auto !important;
            right: 0;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .site-menu-item.has-submenu::after,
        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .toolbar-popout.has-submenu::after {
            right: 0.6rem;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .site-menu-item.has-submenu:not(.toolbar-compact-popout) {
            grid-column: span 2;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row > .chip-btn[id^="case-"] {
            font-size: 0.95rem;
            letter-spacing: 0.01em;
        }

        body[data-toolbar-dock="right"] .site-toolbar .field-label {
            display: block;
            width: 100%;
            margin: 0 0 0.15rem;
            color: var(--text-muted);
            font-size: 0.68rem;
            font-weight: 600;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row.toolbar-break-before {
            margin-top: 0.15rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border-editor);
        }

        body[data-toolbar-dock="right"] .site-toolbar > .chip-row + .chip-row {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border-editor);
        }

        body[data-toolbar-dock="right"] .site-toolbar-band {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        body[data-toolbar-dock="right"] .site-toolbar .field-label + .chip-row {
            margin-top: 0;
            padding-top: 0;
            border-top: 0;
        }

        body[data-toolbar-dock="right"] .site-toolbar .chip-row + .field-label {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border-editor);
        }

        body[data-toolbar-dock="right"] .site-toolbar .field-label + .chip-row {
            margin-top: 0;
        }

        body[data-toolbar-dock="right"] .toolbar-dock-control {
            position: relative;
            top: auto;
            right: auto;
            left: auto;
            margin-top: 0.85rem;
            padding-top: 0.85rem;
            border-top: 1px solid var(--border-editor);
        }

        body[data-toolbar-dock="right"] .toolbar-dock-control > .site-submenu {
            bottom: 100%;
            top: auto;
        }

        body[data-toolbar-dock="right"] .toolbar-dock-trigger {
            width: 100%;
        }

        body[data-toolbar-dock="floating"] .site-toolbar-row {
            position: fixed;
            top: 5.5rem;
            right: 1.25rem;
            width: min(42rem, calc(100vw - 2.5rem));
            max-height: calc(100vh - 7rem);
            overflow-y: auto;
            overflow-x: hidden;
            border: 1px solid var(--border-editor);
            box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
            border-radius: 10px;
            padding: 3rem 0.75rem 0.75rem;
        }

        body[data-toolbar-dock="floating"] .toolbar-dock-control {
            top: 0.75rem;
            right: 0.85rem;
        }

        body[data-toolbar-dock="floating"] .toolbar-dock-trigger {
            cursor: move;
        }

        body[data-toolbar-dock="floating"] .site-toolbar-band {
            padding: 0.75rem;
        }

        body[data-toolbar-dock="floating"] .site-toolbar .field-label {
            display: block;
            flex-basis: 100%;
            width: 100%;
            margin: 0;
            color: var(--text-muted);
            font-size: 0.68rem;
            font-weight: 600;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }

        body[data-toolbar-dock="floating"] .site-toolbar > .chip-row + .chip-row,
        body[data-toolbar-dock="floating"] .site-toolbar > .chip-row.toolbar-break-before {
            padding-left: 1rem;
            margin-left: 0.25rem;
        }

        body[data-toolbar-dock="floating"] .site-toolbar .field-label + .chip-row {
            padding-left: 0;
            margin-left: 0;
            border-left: 0;
        }

        body[data-toolbar-dock="floating"] .site-toolbar .chip-row-case {
            padding-left: 0 !important;
            margin-top: 0 !important;
            margin-left: 0 !important;
            border-left: 0 !important;
        }

        .site-toolbar .field-label {
            display: none;
        }

        .site-toolbar > .chip-row {
            margin-top: 0 !important;
        }

        .site-toolbar > .chip-row + .chip-row {
            padding-left: 0.75rem;
            border-left: 1px solid var(--border-editor);
        }

        .site-toolbar > .chip-row.toolbar-break-before {
            padding-left: 0.75rem;
            border-left: 1px solid var(--border-editor);
        }

        .site-toolbar-band > .site-toolbar > .field-label:first-child + .chip-row {
            padding-left: 0;
            border-left: 0;
        }

        .toolbar-popout.has-submenu::after {
            content: '▾';
            position: absolute;
            right: 0.6rem;
            top: 50%;
            transform: translateY(-48%);
            font-size: 0.7rem;
            color: var(--text-muted);
            pointer-events: none;
        }

        .toolbar-popout > .site-menu-trigger {
            padding-right: 1.6rem;
        }

        .toolbar-popout > .site-submenu {
            top: 100%;
            left: 0;
        }

        .site-menu-list {
            list-style: none;
            display: flex;
            align-items: center;
            gap: 0.35rem;
            overflow: visible;
        }

        .site-menu-list > li {
            padding: 0.45rem 0.75rem;
            border-radius: 999px;
            color: var(--text-muted);
            font-size: 0.82rem;
            font-weight: 500;
            cursor: default;
            user-select: none;
        }

        .site-menu-list > li > a {
            color: inherit;
        }

        .site-menu-list > li:hover {
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-main);
        }

        .site-menu-item {
            position: relative;
        }

        .site-menu-item.has-submenu {
            padding: 0;
        }

        .site-menu-item.has-submenu::after {
            content: '▾';
            position: absolute;
            right: 0.75rem;
            top: 50%;
            transform: translateY(-48%);
            font-size: 0.7rem;
            color: var(--text-muted);
            pointer-events: none;
        }

        .site-menu-trigger {
            border: 0;
            background: transparent;
            color: inherit;
            font: inherit;
            padding: 0.45rem 2rem 0.45rem 0.75rem;
            border-radius: 999px;
            cursor: default;
        }

        .site-menu-trigger:hover,
        .site-menu-trigger:focus-visible,
        .site-menu-item.is-open .site-menu-trigger {
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-main);
            outline: none;
        }

        .site-submenu {
            position: absolute;
            top: 100%;
            left: 0;
            width: max-content;
            min-width: 110px;
            box-sizing: border-box;
            padding: 0.45rem;
            list-style: none;
            border: 1px solid var(--border-editor);
            border-radius: 8px;
            background: var(--phrond-surface-panel);
            box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
            display: none;
            z-index: 300;
        }

        .site-menu-item.is-open > .site-submenu {
            display: block;
        }

        .site-menu-item.has-submenu:hover > .site-submenu {
            display: block;
        }

        .site-submenu-option {
            width: 100%;
            box-sizing: border-box;
            padding: 0.5rem 0.6rem;
            border-radius: 6px;
            color: var(--text-main);
            font-size: 0.8rem;
            cursor: default;
            white-space: nowrap;
        }

        .site-submenu-option:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        .site-submenu-option.file-project-option {
            padding: 0;
        }

        .file-project-option > a {
            display: block;
            padding: 0.5rem 0.6rem;
            color: inherit;
            text-decoration: none;
        }

        .site-submenu-option.is-current {
            position: relative;
            padding-right: 1.8rem;
        }

        .site-submenu-option.is-current::after {
            content: '✓';
            position: absolute;
            right: 0.65rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--accent-gold-light);
            font-size: 0.78rem;
            font-weight: 700;
        }

        .site-submenu-option.disabled-option,
        .site-submenu-option.disabled-option:hover,
        .site-submenu-option.has-submenu.disabled-option,
        .site-submenu-option.has-submenu.disabled-option:hover {
            color: var(--text-muted);
            opacity: 0.42;
            background: transparent;
            cursor: default;
        }

        .site-submenu-option.has-submenu.disabled-option > .site-submenu-nested {
            display: none !important;
        }

        .site-submenu-option.has-submenu.disabled-option::after {
            color: var(--text-muted);
        }

        .site-submenu-divider {
            height: 1px;
            margin: 0.3rem 0.35rem;
            background: var(--border-editor);
            list-style: none;
        }

        .site-submenu-option.danger-option {
            color: #fca5a5;
        }

        .site-submenu-option.swatch-option {
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }

        .toolbar-color-swatch.toolbar-no-background-swatch {
            background: linear-gradient(135deg, transparent 42%, #ef4444 45%, #ef4444 55%, transparent 58%);
            border-color: rgba(255, 255, 255, 0.25);
        }

        .site-submenu-option.border-style-option {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .toolbar-border-style {
            display: inline-block;
            width: 2rem;
            height: 0;
            flex: 0 0 auto;
        }

        .toolbar-border-style-solid {
            border-top: 2px solid var(--text-main);
        }

        .toolbar-border-style-solid-2px {
            border-top: 3.5px solid var(--text-main);
        }

        .toolbar-border-style-double {
            border-top: 4px double var(--text-main);
        }

        .toolbar-border-style-dotted {
            border-top: 3px dotted var(--text-main);
        }

        .section-padding-submenu {
            min-width: 145px;
            padding: 0.35rem 0.45rem;
        }

        .toolbar-color-swatch {
            width: 0.95rem;
            height: 0.95rem;
            border-radius: 3px;
            border: 1px solid rgba(255, 255, 255, 0.16);
            flex: 0 0 auto;
        }

        .site-submenu-option.has-submenu {
            position: relative;
            padding-right: 1.8rem;
        }

        .site-submenu-option.has-submenu::after {
            content: '›';
            position: absolute;
            right: 0.6rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
        }

        .site-submenu-nested {
            top: -0.45rem;
            left: calc(100% - 0.2rem);
            min-width: 180px;
            z-index: 310;
        }

        .site-submenu-option.has-submenu:hover > .site-submenu-nested {
            display: block;
        }

        .site-submenu-option.checkbox-option {
            padding: 0;
        }

        .site-submenu-option.checkbox-option label {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            width: 100%;
            padding: 0.5rem 0.6rem;
            border-radius: 6px;
        }

        .site-submenu-option.checkbox-option label:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        .site-submenu-option input {
            margin: 0;
            accent-color: var(--accent-gold);
        }

        .badge-quota {
            font-size: 0.7rem;
            background: rgba(217, 119, 6, 0.15);
            color: var(--accent-gold);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            border: 1px solid rgba(217, 119, 6, 0.3);
        }

        .content-list {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .bucket-group {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .bucket-group-label {
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            padding: 0 0.15rem;
        }

        #issue-settings-publication-name.required-field-missing {
            border-color: #dc2626;
            box-shadow: 0 0 0 1px #dc2626;
        }

        .required-field-message {
            margin: 0.35rem 0 0;
            color: #ef4444;
            font-size: 0.75rem;
            line-height: 1.35;
        }

        .accordion {
            border: 1px solid var(--border-editor);
            border-radius: 8px;
            overflow: hidden;
            background: rgba(255, 255, 255, 0.02);
        }

        .accordion-toggle {
            width: 100%;
            background: var(--phrond-surface-panel);
            border: none;
            color: var(--text-main);
            padding: 0.85rem 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 600;
            cursor: pointer;
            text-align: left;
        }

        .accordion-toggle:hover {
            background: var(--phrond-surface-control-hover);
        }

        .accordion-toggle small {
            color: var(--text-muted);
            font-size: 0.68rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .accordion-toggle::after {
            content: '−';
            color: var(--accent-gold);
            font-size: 1rem;
            line-height: 1;
        }

        .accordion.collapsed .accordion-toggle::after {
            content: '+';
        }

        .accordion-body {
            padding: 0.85rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            border-top: 1px solid var(--border-editor);
        }

        .accordion.collapsed .accordion-body {
            display: none;
        }

        .intake-dropzone {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr) auto;
            align-items: center;
            gap: 0.75rem;
            min-height: 72px;
            padding: 0.8rem;
            border: 1px dashed var(--border-editor);
            border-radius: 8px;
            background: var(--phrond-surface-panel);
            transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
        }

        .intake-dropzone.is-dragging {
            border-color: rgba(217, 119, 6, 0.9);
            background: color-mix(in srgb, var(--accent-gold) 14%, var(--phrond-surface-panel));
            box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.35);
        }

        .material-icons.intake-dropzone-icon {
            width: 34px;
            height: 34px;
            display: grid;
            place-items: center;
            border-radius: 8px;
            background: rgba(217, 119, 6, 0.14);
            color: var(--accent-gold);
            font-size: 1.15rem;
        }

        .intake-dropzone-copy {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 0.18rem;
        }

        .intake-dropzone-copy strong {
            color: var(--text-main);
            font-size: 0.8rem;
            line-height: 1.2;
        }

        .intake-dropzone-copy span {
            color: var(--text-muted);
            font-size: 0.72rem;
            line-height: 1.3;
        }

        .intake-dropzone-actions {
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .intake-icon-btn,
        .intake-remove-btn {
            width: 32px;
            height: 32px;
            border: 1px solid var(--border-editor);
            background: var(--phrond-surface-panel);
            color: var(--text-muted);
            display: grid;
            place-items: center;
            cursor: pointer;
            border-radius: 6px;
            padding: 0;
        }

        .intake-icon-btn:hover,
        .intake-remove-btn:hover {
            color: var(--text-main);
            border-color: rgba(217, 119, 6, 0.58);
            background: rgba(217, 119, 6, 0.12);
        }

        .intake-icon-btn .material-icons,
        .intake-remove-btn .material-icons {
            font-size: 1.05rem;
        }

        .intake-item-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .intake-item-tree {
            display: flex;
            flex-direction: column;
            gap: 0.38rem;
        }

        .intake-card-children {
            display: flex;
            flex-direction: column;
            gap: 0.38rem;
            margin-left: 1rem;
            padding-left: 0.75rem;
            border-left: 1px solid var(--border-editor);
        }

        .intake-empty-state {
            padding: 0.55rem 0.15rem 0.15rem;
            color: var(--text-muted);
            font-size: 0.72rem;
        }

        .vectors-library-panel-link {
            color: var(--text-muted);
            font-size: 0.72rem;
            line-height: 1.3;
            text-decoration: underline;
        }

        .vectors-library-panel-link:hover {
            color: var(--text-main);
        }

        .vectors-library-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .vectors-library-item {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            align-items: center;
            gap: 0.55rem;
            padding: 0.65rem;
            border: 1px solid var(--border-editor);
            border-radius: 7px;
            background: var(--phrond-surface-control);
            color: var(--text-main);
            font-size: 0.76rem;
            text-decoration: none;
            overflow-wrap: anywhere;
        }

        .vectors-library-item:hover {
            border-color: var(--phrond-border-strong);
            background: var(--phrond-surface-control-hover);
        }

        .intake-item-card {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 0.65rem;
            align-items: start;
            padding: 0.72rem;
            border: 1px solid var(--border-editor);
            border-radius: 7px;
            background: var(--phrond-surface-control);
            cursor: grab;
            min-width: 0;
        }

        .intake-item-card:hover {
            border-color: var(--phrond-border-strong);
            background: var(--phrond-surface-control-hover);
        }

        .intake-item-card:active {
            cursor: grabbing;
        }

        .intake-item-card.is-asset {
            border-color: rgba(34, 197, 94, 0.24);
        }

        .intake-item-card.is-child {
            padding: 0.58rem;
            background: var(--phrond-surface-panel);
        }

        .intake-item-meta {
            min-width: 0;
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            gap: 0.55rem;
            align-items: start;
        }

        .intake-item-icon {
            width: 28px;
            height: 28px;
            display: grid;
            place-items: center;
            border-radius: 6px;
            background: var(--phrond-surface-control-hover);
            color: var(--text-muted);
            font-size: 1rem;
        }

        .intake-item-body {
            min-width: 0;
        }

        .intake-item-title {
            color: var(--text-main);
            font-size: 0.78rem;
            font-weight: 650;
            line-height: 1.25;
            overflow-wrap: anywhere;
        }

        .intake-item-preview {
            margin-top: 0.22rem;
            color: var(--text-muted);
            font-size: 0.7rem;
            line-height: 1.35;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .intake-remove-btn {
            width: 26px;
            height: 26px;
            border-radius: 5px;
        }

        .card {
            background: var(--phrond-surface-control);
            border: 1px solid var(--border-editor);
            border-radius: 6px;
            padding: 0.85rem;
            cursor: grab;
            transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
            position: relative;
            min-width: 0;
            overflow: hidden;
        }

        .card.selected {
            border-color: rgba(245, 158, 11, 0.95);
            background: rgba(245, 158, 11, 0.08);
            box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4);
        }

        .card:hover {
            border-color: var(--phrond-border-strong);
            background: var(--phrond-surface-control-hover);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .card.selected:hover {
            border-color: rgba(245, 158, 11, 0.95);
            background: rgba(245, 158, 11, 0.1);
        }

        .card:active { cursor: grabbing; }

        .card-tree {
            display: flex;
            flex-direction: column;
            gap: 0.45rem;
            min-width: 0;
        }

        .image-card .card-tree {
            flex-direction: row;
            align-items: flex-start;
        }

        .card-children {
            margin-left: 1rem;
            padding-left: 0.75rem;
            border-left: 1px solid var(--border-editor);
            display: flex;
            flex-direction: column;
            gap: 0.45rem;
            min-width: 0;
        }

        .card-child {
            background: rgba(255, 255, 255, 0.025);
            padding: 0.65rem;
        }

        .card-child-image {
            padding: 0.55rem;
        }

        .card-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
        }

        .card-main {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            min-width: 0;
        }

        .image-card .card-main {
            flex: 1;
        }

        .card-child-image .card-main {
            flex-direction: row;
            align-items: center;
            gap: 0.6rem;
        }

        .card-text {
            min-width: 0;
            flex: 1;
        }

        .card-tag {
            background: rgba(255, 255, 255, 0.05);
            padding: 0.15rem 0.4rem;
            border-radius: 3px;
            font-weight: 600;
        }
        .card-tag.front { color: #f43f5e; background: rgba(244, 63, 94, 0.1); }
        .card-tag.editorial { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
        .card-tag.ad { color: #10b981; background: rgba(16, 185, 129, 0.1); }
        .card-tag.recurring { color: #a855f7; background: rgba(168, 85, 247, 0.1); }
        .card-tag.info { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
        .card-tag.chrome { color: #22c55e; background: rgba(34, 197, 94, 0.12); }

        .card-title {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 0.35rem;
            line-height: 1.3;
        }

        .card-child-image .card-title {
            font-size: 0.82rem;
            margin-bottom: 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .card-body {
            font-size: 0.75rem;
            color: var(--text-muted);
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .card-image-thumb {
            width: 100%;
            height: 96px;
            overflow: hidden;
            border: 1px solid var(--border-editor);
            margin-bottom: 0.6rem;
            background: rgba(255, 255, 255, 0.04);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .image-card .card-image-thumb {
            width: 96px;
            min-width: 96px;
            margin-bottom: 0;
            border-radius: 4px;
        }

        .card-image-thumb.compact {
            width: 64px;
            min-width: 64px;
            height: 64px;
            margin-bottom: 0;
            border-radius: 4px;
        }

        .card-image-preview {
            display: block;
            width: 100% !important;
            height: 100% !important;
            max-width: 100% !important;
            max-height: 100% !important;
            object-fit: contain;
            object-position: center;
        }

        .card-input-group {
            margin-top: 0.5rem;
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            background: rgba(0, 0, 0, 0.2);
            padding: 0.5rem;
            border-radius: 4px;
        }

        .card-input-group label {
            font-size: 0.65rem;
            color: var(--text-muted);
            text-transform: uppercase;
        }

        .card-input-group input {
            background: var(--phrond-surface-panel);
            border: 1px solid var(--border-editor);
            color: var(--text-main);
            padding: 0.25rem 0.4rem;
            font-size: 0.75rem;
            border-radius: 3px;
            font-family: inherit;
        }

        .bucket-intake-row {
            display: flex;
            gap: 0.55rem;
            margin-bottom: 0.1rem;
        }

        .canvas-area {
            flex: 1;
            background-color: var(--phrond-bg);
            overflow-y: auto;
            padding: 2.5rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3rem;
            position: relative;
        }

        .canvas-toolbar {
            position: sticky;
            top: 0;
            z-index: 10;
            background: var(--phrond-surface-panel);
            backdrop-filter: blur(8px);
            padding: 0.75rem 1.5rem;
            border-radius: 30px;
            border: 1px solid var(--border-editor);
            display: flex;
            gap: 1.5rem;
            align-items: center;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
            margin-bottom: 1rem;
        }

        .pages-canvas {
            display: flex;
            flex-direction: column;
            gap: 2.5rem;
            align-items: center;
            width: 100%;
        }

        ::highlight(fern-document-selection) {
            color: HighlightText;
            background: Highlight;
        }

        .toolbar-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .toolbar-btn:hover { color: var(--text-main); }
        .toolbar-btn.active { color: var(--accent-gold); }

        .toolbar-segment {
            display: inline-flex;
            gap: 0.45rem;
            align-items: center;
        }

        .toolbar-segment-btn {
            background: none;
            border: 1px solid var(--border-editor);
            border-radius: 999px;
            color: var(--text-main);
            cursor: pointer;
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 600;
            padding: 0.45rem 0.85rem;
        }

        .toolbar-segment-btn:hover {
            border-color: var(--accent-gold);
            color: var(--accent-gold-light);
        }

        .toolbar-segment-btn.active {
            background: rgba(217, 119, 6, 0.12);
            border-color: rgba(217, 119, 6, 0.5);
            color: var(--accent-gold-light);
        }

        .paper-container {
            position: relative;
            background-color: var(--bg-paper);
            color: var(--color-ink);
            width: 700px;
            box-sizing: border-box;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            padding: 2.5rem;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .paper-canvas-surface {
            position: absolute;
            inset: 0;
            z-index: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .paper-container > .page-header-frame,
        .paper-container > .grid-layout,
        .paper-container > .page-footer-frame {
            position: relative;
            z-index: 1;
        }

        .spacing-guide-layer {
            position: absolute;
            inset: 0;
            z-index: 40;
            pointer-events: none;
            overflow: hidden;
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        }

        .spacing-guide {
            position: absolute;
            box-sizing: border-box;
            pointer-events: none;
            border: 1px solid transparent;
        }

        .spacing-guide-page-margin {
            --guide-label-background: rgba(233, 213, 255, 0.82);
            --guide-label-color: rgba(76, 29, 149, 0.9);
            --guide-label-outline: rgba(126, 34, 206, 0.34);
            background: repeating-linear-gradient(135deg, rgba(168, 85, 247, 0.18) 0 5px, rgba(168, 85, 247, 0.3) 5px 10px);
            border-color: rgba(126, 34, 206, 0.58);
        }

        .spacing-guide-margin {
            --guide-label-background: rgba(255, 224, 199, 0.82);
            --guide-label-color: rgba(124, 45, 18, 0.9);
            --guide-label-outline: rgba(194, 65, 12, 0.34);
            background: repeating-linear-gradient(135deg, rgba(249, 115, 22, 0.18) 0 5px, rgba(249, 115, 22, 0.32) 5px 10px);
            border-color: rgba(194, 65, 12, 0.62);
        }

        .spacing-guide-padding {
            --guide-label-background: rgba(209, 250, 229, 0.82);
            --guide-label-color: rgba(20, 83, 45, 0.9);
            --guide-label-outline: rgba(21, 128, 61, 0.34);
            background: repeating-linear-gradient(135deg, rgba(34, 197, 94, 0.16) 0 5px, rgba(34, 197, 94, 0.3) 5px 10px);
            border-color: rgba(21, 128, 61, 0.62);
        }

        .spacing-guide-gap {
            --guide-label-background: rgba(219, 234, 254, 0.82);
            --guide-label-color: rgba(30, 58, 138, 0.9);
            --guide-label-outline: rgba(29, 78, 216, 0.34);
            background: repeating-linear-gradient(135deg, rgba(59, 130, 246, 0.17) 0 5px, rgba(59, 130, 246, 0.31) 5px 10px);
            border-color: rgba(29, 78, 216, 0.62);
        }

        .spacing-guide-label {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            max-width: none;
            padding: 1px 3px;
            border-radius: 2px;
            background: var(--guide-label-background);
            color: var(--guide-label-color);
            font-size: 9px;
            font-weight: 600;
            line-height: 1.25;
            letter-spacing: 0;
            text-transform: none;
            white-space: nowrap;
            box-shadow: 0 0 0 1px var(--guide-label-outline);
        }

        .spacing-guide.is-vertical .spacing-guide-label {
            transform: translate(-50%, -50%) rotate(-90deg);
        }

        body.pdf-export-mode .spacing-guide-layer,
        .flow-measure-root .spacing-guide-layer {
            display: none !important;
        }

        .flow-measure-root {
            position: absolute;
            left: -99999px;
            top: 0;
            visibility: hidden;
            pointer-events: none;
            z-index: -1;
        }

        .quad-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.6rem;
        }

        .mini-field {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            font-size: 0.72rem;
            color: var(--text-muted);
        }

        .paper-container.chrome-editing .grid-layout {
            opacity: 0.22;
        }

        .paper-container.chrome-editing .chrome-region-shell {
            opacity: 1;
        }

        .paper-container.chrome-editing .chrome-region-shell {
            cursor: pointer;
        }

        .chrome-region-shell {
            position: relative;
            z-index: 10;
            transition: box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
        }

        .chrome-region-shell.workspace-hidden-chrome {
            opacity: 0.45;
        }

        .chrome-region-shell.editable-chrome {
            background: rgba(59, 130, 246, 0.08);
            box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
        }

        .chrome-region-shell.selected-chrome {
            background: transparent;
            box-shadow: none;
        }

        .chrome-region-body {
            display: grid;
            gap: 0;
            align-items: center;
        }

        .chrome-region-line {
            min-width: 0;
            min-height: 1em;
            display: block;
        }

        .chrome-region-columns {
            display: grid;
            grid-template-columns: var(--chrome-columns, 25% 50% 25%);
            gap: 0;
            align-items: center;
            font-size: inherit;
            font-weight: inherit;
            text-transform: none;
            letter-spacing: normal;
            padding-bottom: 0;
            margin-bottom: 0;
        }

        .chrome-region-columns .seg-left { text-align: left; }
        .chrome-region-columns .seg-center { text-align: center; }
        .chrome-region-columns .seg-right { text-align: right; }

        .chrome-region-text {
            display: block;
        }

        .chrome-region-block {
            display: block;
            margin: 0;
        }

        .grid-layout {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            flex: 1;
            min-height: 0;
            overflow: hidden;
            transition: opacity 0.2s ease;
        }

        .page-header-frame,
        .page-footer-frame {
            flex: 0 0 auto;
            min-width: 0;
        }

        .sections-canvas {
            display: flex;
            flex-direction: column;
            gap: 0;
        }

        .page-section {
            border: 0;
            position: relative;
            transition: box-shadow 0.2s ease, opacity 0.2s ease;
        }

        .section-overlay,
        .section-chrome {
            position: absolute;
            inset: 0;
            border: 2px solid transparent;
            pointer-events: none;
            z-index: 3;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
            display: none;
        }

        .section-controls {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 4;
            display: none;
        }

        .pages-canvas.layout-mode .page-section .section-chrome,
        .pages-canvas.layout-mode .page-section .section-controls,
        .pages-canvas.layout-mode .child-section .section-chrome,
        .pages-canvas.layout-mode .child-section .section-controls,
        .pages-canvas.layout-mode .chrome-region-shell .section-chrome,
        .pages-canvas.layout-mode .chrome-region-shell .section-overlay {
            display: block;
        }

        .pages-canvas.layout-mode .page-section:not(.selected) .section-chrome,
        .pages-canvas.layout-mode .chrome-region-shell:not(.selected-chrome):not(.workspace-hidden-chrome) .section-chrome,
        .pages-canvas.layout-mode .chrome-region-shell:not(.selected-chrome):not(.workspace-hidden-chrome) .section-overlay {
            border-color: rgba(75, 85, 99, 0.45);
        }

        .page-section.selected .section-chrome {
            border-color: rgba(234, 179, 125, 0.48);
            box-shadow: none;
        }

        .pages-canvas.layout-mode .chrome-region-shell.selected-chrome .section-chrome,
        .pages-canvas.layout-mode .chrome-region-shell.selected-chrome .section-overlay {
            border-color: rgba(234, 179, 125, 0.48);
            box-shadow: none;
        }

        .section-corner {
            position: absolute;
            width: 16px;
            height: 16px;
            background: rgba(75, 85, 99, 0.55);
            pointer-events: none;
        }

        .page-section.selected .section-corner {
            background: rgba(234, 179, 125, 0.48);
        }

        .pages-canvas.layout-mode .chrome-region-shell.selected-chrome .section-corner {
            background: rgba(234, 179, 125, 0.48);
        }

        .pages-canvas.layout-mode .chrome-region-shell.workspace-hidden-chrome .section-corner,
        .pages-canvas.layout-mode .chrome-region-shell.workspace-hidden-chrome .section-chrome,
        .pages-canvas.layout-mode .chrome-region-shell.workspace-hidden-chrome .section-overlay {
            display: none;
        }

        .corner-top-left { top: 0; left: 0; }
        .corner-top-right { top: 0; right: 0; }
        .corner-bottom-left { bottom: 0; left: 0; }
        .corner-bottom-right { bottom: 0; right: 0; }

        .section-drag-handle {
            position: absolute;
            background: transparent;
            border: 0;
            padding: 0;
            margin: 0;
            cursor: grab;
            pointer-events: auto;
            z-index: 1;
            display: block;
            width: 18px;
            height: 18px;
        }

        .section-drag-handle:active {
            cursor: grabbing;
        }

        .section-drag-corner-top-left { top: -1px; left: -1px; }
        .section-drag-corner-top-right { top: -1px; right: -1px; }
        .section-drag-corner-bottom-left { bottom: -1px; left: -1px; }
        .section-drag-corner-bottom-right { bottom: -1px; right: -1px; }

        .page-section.selected {
            box-shadow: none;
        }

        .page-section.drag-over {
            outline: 2px solid var(--accent-gold);
            outline-offset: -2px;
        }

        .page-section.reorder-before {
            box-shadow: inset 0 6px 0 rgba(217, 119, 6, 0.85);
        }

        .page-section.reorder-after {
            box-shadow: inset 0 -6px 0 rgba(217, 119, 6, 0.85);
        }

        .page-section.dragging {
            opacity: 0.55;
        }

        .page-section.size-full,
        .page-section.size-half,
        .page-section.size-quarter,
        .page-section.size-flow {
            min-height: 0;
        }

        .section-content {
            position: relative;
            padding: 0;
            overflow: hidden;
            min-height: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .section-style-layer {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 0;
        }

        .section-body-layer {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            width: 100%;
            height: 100%;
            min-height: 0;
        }

        .section-stack {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 100%;
            height: 100%;
        }

        .section-stack-top,
        .section-stack-bottom {
            flex: 0 0 auto;
        }

        .section-stack-body {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }

        .section-stack-bottom {
            margin-top: auto;
        }

        .page-section.size-flow .section-content {
            overflow: hidden;
        }

        .child-section {
            position: relative;
            margin-bottom: 0;
            min-height: 0;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .pages-canvas.layout-mode .child-section {
            border: 0;
        }

        .child-section.selected {
            box-shadow: none;
        }

        .pages-canvas.layout-mode .child-section:not(.selected) .section-chrome {
            border-color: rgba(75, 85, 99, 0.45);
            border-style: dashed;
        }

        .child-section.selected .section-chrome {
            border-color: rgba(20, 184, 166, 0.9);
            border-style: solid;
            box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.32);
        }

        .pages-canvas.layout-mode .child-section:not(.selected) .section-corner {
            background: rgba(75, 85, 99, 0.55);
        }

        .child-section.selected .section-corner {
            background: rgba(20, 184, 166, 0.85);
        }

        .child-section-content {
            min-height: 0;
            overflow: hidden;
            flex: 1 1 auto;
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
        }

        .child-section .editable-content {
            min-height: 1.4em;
            user-select: text;
            -webkit-user-select: text;
        }

        .child-section .section-text-flow > :first-child,
        .child-section .editable-content > :first-child {
            margin-top: 0;
        }

        .child-section .section-text-flow > :last-child,
        .child-section .editable-content > :last-child {
            margin-bottom: 0;
        }

        .child-section-resize-handle {
            position: absolute;
            left: 50%;
            width: 56px;
            height: 12px;
            transform: translateX(-50%);
            cursor: ns-resize;
            z-index: 7;
            pointer-events: auto;
            border: 0;
            background: transparent;
            padding: 0;
            margin: 0;
        }

        .child-section-resize-handle::before {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 4px;
            height: 4px;
            background: rgba(20, 184, 166, 0.65);
        }

        .child-section-resize-handle-top {
            top: -6px;
        }

        .child-section-resize-handle-bottom {
            bottom: -6px;
        }

        .child-section.selected .child-section-resize-handle::before,
        .child-section:hover .child-section-resize-handle::before {
            background: rgba(20, 184, 166, 0.95);
        }

        .child-section-resize-handle:focus-visible,
        .flow-resize-handle:focus-visible,
        .inline-image-handle:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }

        .flow-resize-handle {
            position: absolute;
            left: 0;
            right: 0;
            bottom: -6px;
            height: 12px;
            cursor: ns-resize;
            z-index: 6;
            pointer-events: auto;
            border: 0;
            background: transparent;
            padding: 0;
            margin: 0;
        }

        .flow-resize-handle::before {
            content: '';
            position: absolute;
            left: 50%;
            top: 3px;
            width: 56px;
            height: 4px;
            transform: translateX(-50%);
            background: rgba(217, 119, 6, 0.55);
        }

        .page-section.selected .flow-resize-handle::before,
        .page-section:hover .flow-resize-handle::before {
            background: rgba(217, 119, 6, 0.9);
        }

        .section-columns {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            align-items: stretch;
            min-height: 100%;
            height: 100%;
            flex: 1 1 auto;
        }

        .section-column {
            position: relative;
            min-width: 0;
            min-height: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .pages-canvas.layout-mode .page-section .section-column:not(:first-child) {
            border-left: 1px dotted rgba(75, 85, 99, 0.7);
        }

        .pages-canvas.layout-mode .page-section .section-column:not(:last-child) {
            border-right: 1px dotted rgba(75, 85, 99, 0.7);
        }

        .pages-canvas.layout-mode .page-section.selected .section-column:not(:first-child) {
            border-left-color: rgba(217, 119, 6, 0.95);
        }

        .pages-canvas.layout-mode .page-section.selected .section-column:not(:last-child) {
            border-right-color: rgba(217, 119, 6, 0.95);
        }

        .pages-canvas.layout-mode .chrome-region-body .editable-chrome-field:not(:first-child) {
            border-left: 1px dotted rgba(75, 85, 99, 0.7);
            padding-left: 4px;
        }

        .pages-canvas.layout-mode .chrome-region-body .editable-chrome-field:not(:last-child) {
            padding-right: 4px;
        }

        .pages-canvas.layout-mode .chrome-region-shell.selected-chrome .editable-chrome-field:not(:first-child) {
            border-left-color: rgba(217, 119, 6, 0.95);
        }

        .section-empty {
            height: 100%;
            min-height: 120px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: var(--color-ink-muted);
            font-size: 0.72rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .flow-content-block {
            position: relative;
            box-sizing: border-box;
            min-width: 0;
            max-width: 100%;
        }

        .flow-content-block.flow-image-float {
            display: contents;
        }

        .flow-content-block.flow-image-float > .inline-flow-image {
            z-index: 3;
        }

        .flow-text-block .editable-content > span:has(p),
        .flow-text-block .editable-content > span > span:has(p) {
            display: contents;
        }

        .section-text-flow > .flow-text-block:only-child {
            display: flex;
            flex: 1 1 auto;
            flex-direction: column;
            min-height: 0;
        }

        .section-column-drop-indicator {
            position: absolute;
            left: 0;
            right: 0;
            height: 0;
            border-top: 2px solid rgba(217, 119, 6, 0.98);
            transform: translateY(-50%);
            pointer-events: none;
            z-index: 12;
        }

        .section-text-flow,
        .editable-column {
            font-family: 'Lora', Georgia, serif;
            font-size: 0.85rem;
            line-height: 1.45;
            color: var(--color-ink);
            text-align: justify;
            min-height: 0;
            display: block;
            box-sizing: border-box;
            max-width: 100%;
            overflow-wrap: break-word;
            word-break: normal;
        }

        .editable-content {
            box-sizing: border-box;
            min-width: 0;
            max-width: 100%;
            overflow-wrap: break-word;
            word-break: normal;
        }

        .pinned-flow-spacer {
            display: block;
            width: 100%;
            pointer-events: none;
        }

        .pinned-section-stack {
            position: absolute;
            left: 0;
            right: 0;
            display: flex;
            flex-direction: column;
            gap: 0;
            pointer-events: none;
            z-index: 2;
        }

        .pinned-section-stack-top {
            top: 0;
        }

        .pinned-section-stack-bottom {
            bottom: 0;
        }

        .pinned-section-stack .child-section {
            pointer-events: auto;
        }

        .section-text-flow:empty::before {
            content: '';
            display: block;
            min-height: 120px;
        }

        .empty-section-editor {
            display: block;
            flex: 1 1 auto;
            min-height: 0;
            width: 100%;
            outline: none;
            cursor: text;
        }

        .child-section .empty-section-editor {
            min-height: 1.4em;
        }

        .section-text-flow h1,
        .section-text-flow h2,
        .section-text-flow h3,
        .section-text-flow h4,
        .section-text-flow h5,
        .section-text-flow h6,
        .editable-content h1,
        .editable-content h2,
        .editable-content h3,
            .editable-content h4,
            .editable-content h5,
            .editable-content h6 {
            font-family: var(--stream-header-font, 'Playfair Display', serif);
            font-weight: 700;
            line-height: 1;
            margin: 0;
            margin-top: -0.28em;
            color: var(--color-ink);
        }

        .section-text-flow h1,
        .editable-content h1 {
            font-size: calc(var(--stream-header-size, 1.6rem) * 1.45);
            margin-bottom: var(--default-text-spacing, 0.9rem);
        }

        .section-text-flow h2,
        .editable-content h2 {
            font-size: calc(var(--stream-header-size, 1.6rem) * 1.15);
            margin-bottom: var(--default-text-spacing, 0.78rem);
        }

        .section-text-flow h3,
        .editable-content h3 {
            font-size: var(--stream-header-size, 1.6rem);
            margin-bottom: var(--default-text-spacing, 0.7rem);
        }

        .section-text-flow h4,
        .section-text-flow h5,
        .section-text-flow h6,
        .editable-content h4,
        .editable-content h5,
        .editable-content h6 {
            font-size: calc(var(--stream-header-size, 1.6rem) * 0.9);
            margin-bottom: var(--default-text-spacing, 0.6rem);
        }

        .section-text-flow h1 *,
        .section-text-flow h2 *,
        .section-text-flow h3 *,
        .section-text-flow h4 *,
        .section-text-flow h5 *,
        .section-text-flow h6 *,
        .editable-content h1 *,
        .editable-content h2 *,
        .editable-content h3 *,
        .editable-content h4 *,
        .editable-content h5 *,
        .editable-content h6 * {
            font-family: var(--stream-header-font, 'Playfair Display', serif);
        }

        .section-text-flow h1 + p,
        .section-text-flow h2 + p,
        .section-text-flow h3 + p,
        .section-text-flow h4 + p,
        .section-text-flow h5 + p,
        .section-text-flow h6 + p,
        .editable-content h1 + p,
        .editable-content h2 + p,
        .editable-content h3 + p,
        .editable-content h4 + p,
        .editable-content h5 + p,
        .editable-content h6 + p {
            margin-top: 0;
        }

        .section-text-flow > :first-child,
        .editable-content > :first-child {
            margin-top: 0;
        }

        .section-text-flow p,
        .section-text-flow ul,
        .section-text-flow ol,
        .section-text-flow blockquote,
        .editable-content p,
        .editable-content ul,
        .editable-content ol,
        .editable-content blockquote {
            margin: 0 0 var(--default-text-spacing, 0.65rem);
            break-inside: avoid-column;
        }

        .section-text-flow hr,
        .editable-content hr {
            border: none;
            border-top: 1px solid currentColor;
            margin: var(--default-text-spacing, 0.65rem) 0;
            opacity: 0.6;
            clear: both;
        }

        .section-text-flow ul,
        .section-text-flow ol,
        .editable-content ul,
        .editable-content ol {
            padding-left: 1.2rem;
        }

        .section-text-flow .inline-flow-image,
        .editable-content .inline-flow-image,
        .section-stack-top .inline-flow-image,
        .section-stack-bottom .inline-flow-image {
            width: 42%;
            max-width: 100%;
            margin: 0;
            break-inside: avoid-column;
            position: relative;
            overflow: visible;
            box-sizing: border-box;
        }

        .section-text-flow .inline-flow-image.align-left,
        .editable-content .inline-flow-image.align-left {
            float: left;
        }

        .section-text-flow .inline-flow-image.align-right,
        .editable-content .inline-flow-image.align-right {
            float: right;
        }

        .section-text-flow .inline-flow-image.full-column-image,
        .editable-content .inline-flow-image.full-column-image {
            float: none;
            clear: both;
            display: block;
        }

        .section-text-flow.has-pinned-bottom-image {
            flex: 1 1 auto;
            height: 100%;
        }

        .section-text-flow .inline-flow-image.pinned-flow-image-bottom {
            height: 100%;
            min-height: 100%;
            shape-outside: inset(calc(100% - var(--pinned-image-obstacle-height, 0px)) 0 0 0);
            pointer-events: none;
        }

        .section-text-flow .inline-flow-image.pinned-flow-image-bottom > .inline-flow-image-frame {
            position: absolute !important;
            right: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            pointer-events: auto;
        }

        .section-stack-top .inline-flow-image.align-left,
        .section-stack-bottom .inline-flow-image.align-left {
            float: none;
            display: block;
            margin-left: 0 !important;
            margin-right: auto !important;
        }

        .section-stack-top .inline-flow-image.align-right,
        .section-stack-bottom .inline-flow-image.align-right {
            float: none;
            display: block;
            margin-left: auto !important;
            margin-right: 0 !important;
        }

        .section-text-flow .inline-flow-image.align-block,
        .editable-content .inline-flow-image.align-block,
        .section-stack-top .inline-flow-image.align-block,
        .section-stack-bottom .inline-flow-image.align-block {
            float: none;
            clear: both;
            display: block;
        }

        .section-text-flow .inline-flow-image.align-center,
        .editable-content .inline-flow-image.align-center,
        .section-stack-top .inline-flow-image.align-center,
        .section-stack-bottom .inline-flow-image.align-center {
            float: none;
            clear: both;
            display: block;
            margin-left: auto !important;
            margin-right: auto !important;
        }

        .section-text-flow .inline-flow-image img,
        .editable-content .inline-flow-image img,
        .section-stack-top .inline-flow-image img,
        .section-stack-bottom .inline-flow-image img {
            display: block;
            width: 100%;
            height: auto;
        }

        .section-text-flow .inline-flow-image-frame,
        .editable-content .inline-flow-image-frame,
        .section-stack-top .inline-flow-image-frame,
        .section-stack-bottom .inline-flow-image-frame {
            position: relative;
            overflow: hidden;
        }

        .input-card {
            cursor: grab;
        }

        .input-card:active {
            cursor: grabbing;
        }

        .input-card.image-card {
            cursor: default;
        }

        .draggable-image-thumb {
            cursor: grab;
        }

        .draggable-image-thumb:active {
            cursor: grabbing;
        }

        .card-image-preview {
            -webkit-user-drag: none;
            user-select: none;
        }

        .pages-canvas .inline-flow-image.selected-inline-image {
            outline: 1px solid rgba(110, 142, 145, 0.95);
            outline-offset: -1px;
        }

        .pages-canvas .inline-flow-image.selected-inline-image.pinned-flow-image-bottom {
            outline: none;
        }

        .pages-canvas .inline-flow-image.selected-inline-image.pinned-flow-image-bottom > .inline-flow-image-frame {
            outline: 1px solid rgba(110, 142, 145, 0.95);
            outline-offset: -1px;
        }

        .column-break {
            break-after: column;
            height: 0;
            margin: 0;
            padding: 0;
            border: 0;
        }

        .column-seed {
            min-height: 1.6em;
        }

        .editable-content .drop-before-image,
        .editable-content .drop-after-image {
            position: relative;
        }

        .editable-content .drop-before-image {
            box-shadow: inset 0 2px 0 rgba(217, 119, 6, 0.95);
        }

        .editable-content .drop-after-image {
            box-shadow: inset 0 -2px 0 rgba(217, 119, 6, 0.95);
        }

        .editable-content.drop-after-image::after {
            content: '';
            display: block;
            height: 0;
            border-top: 2px solid rgba(217, 119, 6, 0.95);
            margin-top: 0.35rem;
        }

        .inline-image-handle {
            position: absolute;
            width: 10px;
            height: 10px;
            border: 1px solid rgba(52, 72, 74, 0.95);
            background: rgba(156, 182, 184, 0.95);
            padding: 0;
            margin: 0;
            z-index: 2;
        }

        .inline-image-handle-top-left { top: -5px; left: -5px; cursor: nwse-resize; }
        .inline-image-handle-top { top: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
        .inline-image-handle-top-right { top: -5px; right: -5px; cursor: nesw-resize; }
        .inline-image-handle-right { top: 50%; right: -5px; transform: translateY(-50%); cursor: ew-resize; }
        .inline-image-handle-bottom-right { right: -5px; bottom: -5px; cursor: nwse-resize; }
        .inline-image-handle-bottom { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
        .inline-image-handle-bottom-left { left: -5px; bottom: -5px; cursor: nesw-resize; }
        .inline-image-handle-left { top: 50%; left: -5px; transform: translateY(-50%); cursor: ew-resize; }

        .inline-flow-image.pinned-flow-image-bottom > .inline-image-handle {
            pointer-events: auto;
        }

        .inline-flow-image.pinned-flow-image-bottom > .inline-image-handle-top-left,
        .inline-flow-image.pinned-flow-image-bottom > .inline-image-handle-top,
        .inline-flow-image.pinned-flow-image-bottom > .inline-image-handle-top-right {
            top: calc(100% - var(--pinned-image-obstacle-height, 0px) - 5px);
        }

        .inline-flow-image.pinned-flow-image-bottom > .inline-image-handle-left,
        .inline-flow-image.pinned-flow-image-bottom > .inline-image-handle-right {
            top: calc(100% - var(--pinned-image-obstacle-midpoint, 0px));
        }

        .image-context-menu {
            width: min(160px, calc(100vw - 24px));
        }

        .placed-article-layout {
            display: grid;
            gap: 0;
            align-items: start;
            flex: 1;
            min-height: 0;
        }

        .placed-article-column {
            min-width: 0;
        }

        .placed-article > h2 {
            font-family: 'Playfair Display', serif;
            font-size: 1.6rem;
            font-weight: 700;
            line-height: 1.15;
            margin-bottom: 0.5rem;
            color: var(--color-ink);
        }

        .placed-article .author {
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            color: var(--color-ink-muted);
            margin-bottom: 0.75rem;
            letter-spacing: 0.05em;
        }

        .placed-article-body {
            font-family: 'Lora', Georgia, serif;
            font-size: 0.85rem;
            line-height: 1.45;
            color: var(--color-ink);
            text-align: justify;
        }

        .editable-article-stream {
            min-height: 220px;
        }

        .editable-columns-root {
            display: grid;
            align-items: start;
            min-height: 100%;
        }

        .editable-column {
            min-height: 220px;
            outline: none;
        }

        .editing-continuation-note {
            color: var(--color-ink-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .editable-content {
            outline: none;
            cursor: text;
            display: block;
            flex: 1 1 auto;
            min-height: 0;
        }

        .editable-content:focus {
            box-shadow: none;
            background: transparent;
        }

        .placed-ad {
            border: 2px solid var(--color-ink);
            padding: 1rem;
            text-align: center;
            background: #fff;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100%;
        }

        .placed-ad-title {
            font-size: 0.75rem;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            border-bottom: 1px solid var(--color-ink);
            padding-bottom: 0.25rem;
            margin-bottom: 0.5rem;
            width: 100%;
        }

        .placed-ad-body {
            font-family: 'Inter', sans-serif;
            font-size: 0.8rem;
            font-weight: 500;
        }

        .placed-image {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .placed-image img {
            display: block;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        .overflow-indicator {
            position: absolute;
            bottom: 4px;
            right: 4px;
            background: var(--accent-danger);
            color: white;
            font-size: 0.65rem;
            font-weight: 700;
            padding: 0.15rem 0.35rem;
            border-radius: 3px;
            box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
            z-index: 5;
            pointer-events: none;
            display: none;
        }

        .page-section.overflow-active {
            box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4);
            border-radius: 8px;
        }

        .page-section.overflow-active .overflow-indicator { display: block; }

        .paper-footer {
            margin-top: 0;
            padding-top: 0;
            font-size: inherit;
            color: inherit;
            text-transform: none;
            letter-spacing: normal;
        }

        .editable-chrome-field {
            outline: none;
            white-space: pre-wrap;
        }

        .editable-chrome-field p {
            margin: 0;
            padding: 0;
        }

        .editable-chrome-field img,
        .chrome-inline-image {
            width: 100%;
            max-width: 100%;
            height: auto;
            object-fit: contain;
            vertical-align: middle;
            display: block;
            pointer-events: auto;
            user-select: all;
            -webkit-user-select: all;
        }

        .selected-chrome .editable-chrome-field:focus {
            box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.35);
        }

        .chrome-hidden {
            display: none;
        }

        .section-context-menu {
            position: fixed;
            width: min(340px, calc(100vw - 24px));
            background: var(--phrond-surface-panel);
            border: 1px solid var(--border-editor);
            border-radius: 10px;
            box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
            padding: 0.55rem;
            z-index: 340;
        }

        .section-context-group + .section-context-group {
            margin-top: 0.45rem;
            padding-top: 0.45rem;
            border-top: 1px solid var(--border-editor);
        }

        .section-context-group-layout {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

        .section-context-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.2rem;
        }

        .section-context-split {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.55rem;
            margin-top: 0.45rem;
            padding-top: 0.45rem;
            border-top: 1px solid var(--border-editor);
        }

        .section-context-split .section-context-group + .section-context-group {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

        .section-context-label {
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            padding: 0 0.35rem 0.3rem;
        }

        .section-context-item {
            width: 100%;
            background: transparent;
            border: none;
            border-radius: 6px;
            color: var(--text-main);
            font-family: inherit;
            font-size: 0.8rem;
            text-align: left;
            padding: 0.5rem 1.9rem 0.5rem 0.6rem;
            cursor: pointer;
            position: relative;
        }

        .section-context-item:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        .section-context-item.disabled-option {
            opacity: 0.45;
            cursor: default;
        }

        .section-context-item.is-current::after {
            content: '✓';
            position: absolute;
            right: 0.65rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--accent-gold-light);
            font-size: 0.78rem;
            font-weight: 700;
        }

        .section-context-item.danger {
            color: #fca5a5;
        }

        .section-context-position-group[hidden] {
            display: none;
        }

        .image-inspector-dialog[hidden] {
            display: none !important;
        }

        .image-inspector-dialog {
            position: fixed;
            width: 440px;
            max-width: calc(100vw - 24px);
            max-height: calc(100vh - 40px);
            overflow-y: auto;
            background: var(--phrond-surface-panel, #18181b);
            border: 1px solid var(--border-editor, rgba(255, 255, 255, 0.12));
            border-radius: 12px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
            z-index: 350;
            display: flex;
            flex-direction: column;
            color: var(--text-main);
        }

        .image-inspector-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.65rem 0.85rem;
            border-bottom: 1px solid var(--border-editor, rgba(255, 255, 255, 0.12));
            background: rgba(255, 255, 255, 0.03);
            cursor: grab;
            user-select: none;
            position: sticky;
            top: 0;
            z-index: 10;
            backdrop-filter: blur(8px);
        }

        .image-inspector-header:active {
            cursor: grabbing;
        }

        .image-inspector-title {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-main);
        }

        .image-inspector-drag-icon {
            color: var(--text-muted);
            font-size: 1rem;
            line-height: 1;
        }

        .image-inspector-close-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-size: 1.25rem;
            cursor: pointer;
            line-height: 1;
            padding: 0.1rem 0.35rem;
            border-radius: 4px;
            transition: all 0.15s ease;
        }

        .image-inspector-close-btn:hover {
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.08);
        }

        .image-inspector-body {
            padding: 0.75rem 0.85rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .image-inspector-section {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
        }

        .image-inspector-section-label {
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            font-weight: 600;
        }

        .image-inspector-sublabel {
            font-size: 0.72rem;
            color: var(--text-muted);
            margin-bottom: 0.2rem;
        }

        .image-inspector-btn-group {
            display: flex;
            gap: 0.3rem;
            flex-wrap: wrap;
        }

        .image-inspector-btn {
            flex: 1 1 auto;
            min-width: 0;
            padding: 0.35rem 0.5rem;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border-editor, rgba(255, 255, 255, 0.12));
            border-radius: 6px;
            color: var(--text-main);
            font-size: 0.76rem;
            cursor: pointer;
            text-align: center;
            transition: all 0.15s ease;
        }

        .image-inspector-btn:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .image-inspector-btn.active,
        .image-inspector-btn.is-current {
            background: rgba(217, 119, 6, 0.18);
            border-color: var(--accent-gold);
            color: var(--accent-gold-light);
            font-weight: 600;
        }

        .image-inspector-row {
            display: flex;
            gap: 0.5rem;
        }

        .image-inspector-field-half {
            flex: 1 1 50%;
            display: flex;
            flex-direction: column;
        }

        .image-inspector-field-third {
            flex: 1 1 33.3%;
            display: flex;
            flex-direction: column;
        }

        .image-inspector-field-full {
            width: 100%;
            display: flex;
            flex-direction: column;
        }

        .image-inspector-select {
            background: #1f1f24;
            border: 1px solid var(--border-editor, rgba(255, 255, 255, 0.12));
            border-radius: 6px;
            color: var(--text-main);
            padding: 0.35rem 0.5rem;
            font-size: 0.76rem;
            outline: none;
            cursor: pointer;
        }

        .image-inspector-range-row {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 0.2rem;
        }

        .image-inspector-range {
            flex: 1;
            accent-color: var(--accent-gold);
            cursor: pointer;
        }

        .image-inspector-range-val {
            font-size: 0.75rem;
            font-family: ui-monospace, monospace;
            color: var(--accent-gold-light);
            min-width: 34px;
            text-align: right;
        }

        .image-inspector-margins-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.35rem;
        }

        .image-inspector-margin-col {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.2rem;
            background: rgba(255, 255, 255, 0.02);
            padding: 0.3rem 0.2rem;
            border-radius: 6px;
            border: 1px solid var(--border-editor, rgba(255, 255, 255, 0.08));
        }

        .image-inspector-margin-name {
            font-size: 0.68rem;
            color: var(--text-muted);
        }

        .image-inspector-margin-stepper {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.75rem;
            font-family: ui-monospace, monospace;
        }

        .image-inspector-margin-stepper button {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid var(--border-editor, rgba(255, 255, 255, 0.12));
            color: var(--text-main);
            width: 20px;
            height: 20px;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            transition: all 0.15s ease;
        }

        .image-inspector-margin-stepper button:hover {
            background: rgba(255, 255, 255, 0.16);
        }

        .image-inspector-textarea {
            background: #1f1f24;
            border: 1px solid var(--border-editor, rgba(255, 255, 255, 0.12));
            border-radius: 6px;
            color: var(--text-main);
            padding: 0.4rem 0.5rem;
            font-size: 0.78rem;
            resize: vertical;
            outline: none;
            font-family: inherit;
        }

        .image-inspector-actions-section {
            display: flex;
            flex-direction: row;
            gap: 0.45rem;
            padding-top: 0.55rem;
            border-top: 1px solid var(--border-editor, rgba(255, 255, 255, 0.12));
        }

        .image-inspector-action-btn {
            flex: 1;
            padding: 0.45rem 0.6rem;
            border-radius: 6px;
            border: 1px solid var(--border-editor, rgba(255, 255, 255, 0.12));
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-main);
            font-size: 0.78rem;
            cursor: pointer;
            font-weight: 500;
            text-align: center;
            transition: all 0.15s ease;
        }

        .image-inspector-action-btn:hover {
            background: rgba(255, 255, 255, 0.12);
        }

        .image-inspector-action-btn.danger {
            color: #fca5a5;
            border-color: rgba(239, 68, 68, 0.3);
            background: rgba(239, 68, 68, 0.08);
        }

        .image-inspector-action-btn.danger:hover {
            background: rgba(239, 68, 68, 0.18);
        }

        body.pdf-export-mode .image-inspector-dialog {
            display: none !important;
        }

        .section-padding-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.3rem 0.35rem;
        }

        .section-padding-name {
            color: var(--text-main);
            font-size: 0.8rem;
        }

        .section-padding-controls {
            display: inline-flex;
            gap: 0.35rem;
        }

        .section-padding-button {
            width: 1.75rem;
            height: 1.75rem;
            padding: 0;
            border: 1px solid var(--border-editor);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.04);
            color: var(--text-main);
            font: inherit;
            font-size: 0.95rem;
            line-height: 1;
            cursor: pointer;
        }

        .section-padding-button:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: var(--phrond-border-strong);
        }

        .image-context-caption-input {
            width: 100%;
            min-height: 4.5rem;
            resize: vertical;
            border: 1px solid var(--border-editor);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.04);
            color: var(--text-main);
            font: inherit;
            font-size: 0.8rem;
            line-height: 1.4;
            padding: 0.5rem 0.6rem;
        }

        .image-context-caption-input:focus {
            outline: none;
            border-color: rgba(217, 119, 6, 0.72);
            box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.25);
        }

        .inline-flow-image-caption {
            margin-top: 0.35rem;
            color: #334155;
            font-family: inherit;
            font-size: 1em;
            line-height: 1.35;
            font-style: italic;
        }

        .action-btn {
            width: 100%;
            background: var(--phrond-surface-control);
            border: 1px solid var(--border-editor);
            color: var(--text-main);
            padding: 0.75rem 0.85rem;
            border-radius: 6px;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 600;
            text-align: left;
        }

        .action-btn:hover {
            border-color: var(--accent-gold);
            color: var(--accent-gold-light);
        }

        .action-btn.inline {
            text-align: center;
        }

        .action-btn.secondary {
            background: var(--phrond-surface-control);
            color: var(--text-main);
            border-color: var(--border-editor);
        }

        .action-btn.secondary:hover {
            color: var(--text-main);
            background: var(--phrond-surface-control-hover);
            border-color: var(--accent-gold);
        }

        .action-btn.disabled,
        .action-btn:disabled {
            opacity: 0.45;
            cursor: default;
            pointer-events: none;
        }

        .action-note {
            font-size: 0.72rem;
            color: var(--text-muted);
            line-height: 1.45;
        }

        .chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
        }

        .chip-btn {
            background: var(--phrond-surface-control);
            border: 1px solid var(--border-editor);
            color: var(--text-main);
            padding: 0.45rem 0.65rem;
            border-radius: 999px;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.74rem;
            font-weight: 600;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.25rem;
            min-height: 2rem;
        }

        .chip-btn:hover {
            border-color: var(--accent-gold);
            color: var(--accent-gold-light);
        }

        .chip-btn.active {
            background: rgba(217, 119, 6, 0.12);
            border-color: rgba(217, 119, 6, 0.5);
            color: var(--accent-gold-light);
        }

        .toolbar-inline-separator {
            display: none;
            width: 1px;
            min-height: 2rem;
            align-self: stretch;
            background: var(--phrond-surface-control-hover);
            margin: 0 0.05rem;
        }

        body[data-toolbar-dock="top"] .toolbar-inline-separator {
            display: inline-block;
        }

        .select-pill {
            width: 100%;
            background: var(--phrond-surface-control);
            border: 1px solid var(--border-editor);
            color: var(--text-main);
            padding: 0.5rem 0.8rem;
            border-radius: 999px;
            font: inherit;
            font-size: 0.74rem;
            font-weight: 600;
        }

        .subgroup-title {
            font-size: 0.68rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            margin-bottom: 0.55rem;
        }

        .field-label {
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            margin-bottom: 0.4rem;
        }

        .issue-color-box {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            min-width: 0;
            padding: 0.45rem;
            border: 1px solid var(--border-editor);
            border-radius: var(--radius-color);
            color: var(--text-muted);
            background: var(--phrond-surface-control);
            cursor: pointer;
            font: inherit;
            font-size: 0.72rem;
            text-align: left;
        }

        .issue-color-box:hover,
        .issue-color-box.is-active {
            border-color: var(--accent-gold);
            color: var(--text-main);
            background: rgba(217, 119, 6, 0.12);
        }

        .issue-color-box-swatch {
            display: block;
            width: 1.55rem;
            height: 1.55rem;
            flex: 0 0 1.55rem;
            border: 1px solid rgba(255, 255, 255, 0.35);
            border-radius: var(--radius-swatch);
        }

        .issue-color-detail {
            display: grid;
            align-content: start;
            gap: 0.6rem;
            padding: 0.75rem;
            border: 1px solid var(--border-editor);
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.02);
        }

        .issue-color-account-controls {
            display: grid;
            gap: 0.6rem;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border-editor);
        }

        .issue-color-account-controls[hidden],
        .issue-color-login-message[hidden] {
            display: none;
        }

        .issue-color-account-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .issue-color-account-actions .action-btn {
            flex: 0 1 calc(50% - 0.25rem);
        }

        .issue-color-login-message {
            margin: 1rem 0 0;
            color: var(--text-muted);
            font-size: 0.75rem;
        }

        .issue-color-detail-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            color: var(--text-muted);
            font-size: 0.72rem;
            font-weight: 600;
        }

        .issue-active-color-swatch {
            width: 2rem;
            height: 2rem;
            flex: 0 0 2rem;
            border: 1px solid var(--border-editor);
            border-radius: 6px;
        }

        .settings-storage-notice {
            margin: 0 1rem;
            padding: 0.75rem;
            color: var(--text-muted);
            border: 1px solid var(--border-editor);
            font-size: 0.75rem;
            line-height: 1.4;
        }

        .subaccordion {
            border: 1px solid var(--border-editor);
            border-radius: 6px;
            overflow: hidden;
            background: rgba(255, 255, 255, 0.02);
        }

        .subaccordion-toggle {
            width: 100%;
            background: var(--phrond-surface-panel);
            border: none;
            color: var(--text-main);
            padding: 0.7rem 0.85rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-family: inherit;
            font-size: 0.76rem;
            font-weight: 700;
            cursor: pointer;
            text-align: left;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .subaccordion-toggle::after {
            content: '+';
            color: var(--accent-gold);
            font-size: 1rem;
            line-height: 1;
        }

        .subaccordion.open .subaccordion-toggle::after {
            content: '−';
        }

        .subaccordion-body {
            display: none;
            padding: 0.85rem;
            border-top: 1px solid var(--border-editor);
        }

        .subaccordion.open .subaccordion-body {
            display: block;
        }

        .inspector-row {
            padding: 1rem;
            border-bottom: 1px solid var(--border-editor);
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .inspector-row label {
            font-size: 0.75rem;
            font-weight: 500;
            color: var(--text-muted);
        }

        .inspector-row select, .inspector-row input {
            background: var(--phrond-surface-control);
            border: 1px solid var(--border-editor);
            color: var(--text-main);
            padding: 0.5rem;
            font-size: 0.8rem;
            border-radius: 4px;
            font-family: inherit;
            width: 100%;
        }

        .mini-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.5rem;
        }

        .project-font-note {
            margin: 0.25rem 0 0;
            color: var(--text-muted);
            font-size: 0.75rem;
            line-height: 1.4;
        }

        .project-font-link {
            align-self: flex-start;
            color: var(--accent-gold);
            font-size: 0.76rem;
        }

        .check-list {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
        }

        .check-row {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            font-size: 0.82rem;
            color: var(--text-main);
        }

        .check-row input[type="checkbox"] {
            accent-color: var(--accent-gold);
            width: auto;
            flex: 0 0 auto;
            padding: 0;
            border: 0;
            background: transparent;
        }

        .toast {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            background: var(--bg-panel);
            border: 1px solid var(--accent-success);
            padding: 0.75rem 1.25rem;
            border-radius: 6px;
            font-size: 0.8rem;
            color: var(--text-main);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
            transform: translateY(150%);
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            z-index: 360;
        }

        .toast.show { transform: translateY(0); }

        body[data-toolbar-dock="right"] .toast {
            right: 9rem;
        }

        .modal-shell {
            position: fixed;
            inset: 0;
            background: var(--phrond-overlay);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2rem;
            z-index: 1000;
        }

        .modal-shell[hidden] {
            display: none;
        }

        .modal-card {
            width: min(760px, 100%);
            max-height: 85vh;
            overflow: auto;
            background: var(--bg-panel);
            border: 1px solid var(--border-editor);
            border-radius: var(--radius-card);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
        }

        .modal-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            padding: 1rem;
            border-bottom: 1px solid var(--border-editor);
            background: var(--bg-panel-header);
        }

        .modal-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-main);
        }

        .modal-close-btn {
            width: 32px;
            height: 32px;
            background: transparent;
            border: 1px solid var(--border-editor);
            border-radius: 50%;
            color: var(--text-muted);
            cursor: pointer;
            font: inherit;
            font-size: 1.1rem;
            line-height: 1;
        }

        .modal-close-btn .material-icons {
            font-size: 1.1rem;
            line-height: 1;
        }

        .modal-close-btn:hover {
            color: var(--text-main);
            border-color: rgba(255, 255, 255, 0.22);
        }

        .modal-card input,
        .modal-card select,
        .modal-card textarea,
        .modal-card .paste-editor {
            border-radius: var(--radius-control);
        }

        .paste-editor {
            min-height: 260px;
            padding: 0.85rem;
            background: var(--phrond-surface-control);
            border: 1px solid var(--border-editor);
            color: var(--text-main);
            font-size: 0.84rem;
            line-height: 1.5;
            overflow: auto;
        }

        .paste-editor:focus {
            outline: 1px solid rgba(217, 119, 6, 0.45);
            border-color: rgba(217, 119, 6, 0.45);
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 0.65rem;
            padding: 1rem;
            border-top: 1px solid var(--border-editor);
        }

        .modal-actions .action-btn,
        .issue-color-account-actions .action-btn {
            width: auto;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            border-radius: 999px;
            text-align: center;
        }

        .modal-actions .action-btn {
            min-width: 6.5rem;
        }

        .modal-actions .action-btn .material-icons,
        .issue-color-account-actions .action-btn .material-icons {
            font-size: 1rem;
        }

        .preserved-library-accordion {
            margin-top: 0.5rem;
            border-top: 1px solid var(--border-editor);
            padding-top: 0.35rem;
        }

        .preserved-library-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            max-height: 55vh;
            overflow-y: auto;
            padding-right: 0.25rem;
        }

        .preserved-library-empty {
            padding: 2.5rem 1rem;
            text-align: center;
            color: var(--text-muted);
            font-size: 0.86rem;
            border: 1px dashed var(--border-editor);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.02);
        }

        .preserved-library-card {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            background: var(--phrond-surface-control);
            border: 1px solid var(--border-editor);
            border-radius: 6px;
            padding: 0.85rem;
        }

        .preserved-library-card-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
        }

        .preserved-library-name-input {
            flex: 1;
            background: var(--phrond-surface-panel);
            border: 1px solid var(--border-editor);
            border-radius: 4px;
            padding: 0.35rem 0.55rem;
            color: var(--text-main);
            font-size: 0.88rem;
            font-weight: 600;
        }

        .preserved-library-name-input:focus {
            outline: 1px solid var(--accent-gold);
            border-color: var(--accent-gold);
        }

        .preserved-library-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
        }

        .preserved-library-badge {
            font-size: 0.72rem;
            padding: 0.15rem 0.45rem;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 4px;
            color: var(--text-muted);
        }

        .preserved-library-preview {
            font-size: 0.8rem;
            color: var(--text-muted);
            line-height: 1.4;
            max-height: 4.2em;
            overflow: hidden;
            text-overflow: ellipsis;
            padding: 0.45rem 0.6rem;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 4px;
            border-left: 3px solid var(--accent-gold-light);
        }

        .preserved-library-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            margin-top: 0.25rem;
        }

        .preserved-library-order-btns {
            display: flex;
            gap: 0.25rem;
        }

        @media print {
            html,
            body.pdf-export-mode {
                width: auto !important;
                height: auto !important;
                margin: 0 !important;
                padding: 0 !important;
                overflow: visible !important;
                background: #fff !important;
            }

            body.pdf-export-mode {
                display: block !important;
                color: var(--color-ink);
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            body.pdf-export-mode > .workbench-header,
            body.pdf-export-mode > .site-footer,
            body.pdf-export-mode > .fern-shared-footer,
            body.pdf-export-mode .workspace > .panel,
            body.pdf-export-mode > input,
            body.pdf-export-mode > .modal-shell,
            body.pdf-export-mode > .section-context-menu,
            body.pdf-export-mode > .image-context-menu,
            body.pdf-export-mode > .toast,
            body.pdf-export-mode > .flow-measure-root {
                display: none !important;
            }

            body.pdf-export-mode .workspace,
            body.pdf-export-mode .canvas-area,
            body.pdf-export-mode .pages-canvas {
                display: block !important;
                width: auto !important;
                height: auto !important;
                min-height: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                overflow: visible !important;
                background: #fff !important;
            }

            body.pdf-export-mode .pages-canvas {
                gap: 0 !important;
            }

            body.pdf-export-mode .paper-container {
                margin: 0 !important;
                background: #ffffff !important;
                background-color: #ffffff !important;
                box-shadow: none !important;
                transform: scale(var(--pdf-export-scale, 1));
                transform-origin: top left;
                break-after: page;
                page-break-after: always;
            }

            body.pdf-export-mode .paper-canvas-surface {
                display: none !important;
            }

            body.pdf-export-mode .paper-container:last-child {
                break-after: auto;
                page-break-after: auto;
            }

            body.pdf-export-mode .section-chrome,
            body.pdf-export-mode .section-controls,
            body.pdf-export-mode .inline-image-handle,
            body.pdf-export-mode .overflow-indicator,
            body.pdf-export-mode .section-empty {
                display: none !important;
            }

            body.pdf-export-mode .section-column,
            body.pdf-export-mode .editable-chrome-field {
                border-left: 0 !important;
                border-right: 0 !important;
                outline: 0 !important;
                box-shadow: none !important;
            }
        }
.fern-mobile-blocker {
    display: none;
}

@media screen and (max-width: 760px) {
    body > *:not(.fern-mobile-blocker) {
        display: none !important;
    }

    body > .fern-mobile-blocker {
        position: fixed;
        inset: 0;
        z-index: 2147483647;
        display: grid;
        place-items: center;
        box-sizing: border-box;
        padding: 2rem;
        color: #d4d5d4;
        background: #060706;
        text-align: center;
        font: 400 1rem/1.5 Inter, "Segoe UI", sans-serif;
    }

    .fern-mobile-blocker-panel {
        width: min(100%, 28rem);
        padding: 2rem;
        border: 1px solid #79715f;
        border-radius: 12px;
        background: #1b1d1c;
    }

    .fern-mobile-blocker h1 {
        margin: 0 0 0.75rem;
        color: #d8caac;
        font: 700 1.5rem/1.2 Georgia, serif;
    }

    .fern-mobile-blocker p {
        margin: 0;
    }

    .fern-mobile-blocker a {
        display: inline-block;
        margin-top: 1.25rem;
        color: #d8caac;
    }
}
