.OfficeToolbarButton,
.OfficeToolbarSelect,
.OfficeToolbarColorInput,
.OfficeSidebarButton,
.OfficeSidebarInput,
.OfficeDocTitleInput {
    font: inherit;
}

.OfficeDocumentEditorShell {
    --office-accent: #18c8c8;
    --office-accent-alt: #3a7bff;
    --office-surface: #0e1014;
    --office-surface-strong: #0b0d11;
    --office-panel: rgba(255, 255, 255, 0.04);
    --office-input: rgba(255, 255, 255, 0.05);
    --office-border: rgba(255, 255, 255, 0.08);
    --office-text: var(--text-color, #e6ebf5);
    --office-muted: var(--unselected-text-color, rgba(230, 235, 245, 0.62));
    --office-canvas-bg: #121821;
    --office-canvas-text: #e6edf7;
    --office-canvas-heading: #f5f8ff;
    --office-canvas-quote: #a8bfd1;
    --office-shadow: 0 20px 48px rgba(0, 0, 0, 0.36);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--office-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(24, 200, 200, 0.1), transparent 28%),
        linear-gradient(180deg, var(--office-surface-strong), var(--office-surface));
    box-shadow: var(--office-shadow);
    overflow: hidden;
}

html.light-theme .OfficeDocumentEditorShell {
    --office-surface: #ffffff;
    --office-surface-strong: #f7f9fc;
    --office-panel: rgba(48, 69, 96, 0.08);
    --office-input: rgba(48, 69, 96, 0.08);
    --office-border: rgba(48, 69, 96, 0.14);
    --office-text: var(--text-color, #304560);
    --office-muted: var(--unselected-text-color, rgba(48, 69, 96, 0.7));
    --office-canvas-bg: #fdfefe;
    --office-canvas-text: #22374d;
    --office-canvas-heading: #16283a;
    --office-canvas-quote: #4d6a82;
    --office-shadow: 0 18px 38px rgba(48, 69, 96, 0.12);
}

.OfficeToolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--office-border);
    background: var(--office-surface-strong);
}

.OfficeToolbarGroup {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-right: 14px;
    border-right: 1px solid var(--office-border);
}

.OfficeToolbarGroup:last-child {
    border-right: none;
    padding-right: 0;
}

.OfficeToolbarButton,
.OfficeToolbarSelect,
.OfficeSidebarButton {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--office-border);
    border-radius: 12px;
    background: var(--office-panel);
    color: var(--office-text);
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.OfficeToolbarButton:hover,
.OfficeToolbarSelect:hover,
.OfficeSidebarButton:hover {
    background: rgba(24, 200, 200, 0.12);
    border-color: rgba(24, 200, 200, 0.28);
    transform: translateY(-1px);
}

.OfficeToolbarButton[data-variant='primary'],
.OfficeSidebarButton[data-variant='primary'] {
    background: linear-gradient(135deg, var(--office-accent), var(--office-accent-alt));
    border-color: transparent;
    color: #ffffff;
}

.OfficeToolbarColorInput {
    width: 38px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--office-border);
    border-radius: 12px;
    background: var(--office-panel);
    cursor: pointer;
}

.OfficeDocumentMetaRow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--office-border);
    background: var(--office-surface);
}

.OfficeDocTitleInput,
.OfficeSidebarInput {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--office-border);
    border-radius: 14px;
    background: var(--office-input);
    color: var(--office-text);
}

.OfficeDocTitleInput::placeholder,
.OfficeSidebarInput::placeholder {
    color: var(--office-muted);
}

.OfficeDocumentStatus,
.OfficeSidebarMeta {
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--office-muted);
}

.OfficeDocumentCanvasWrap {
    display: flex;
    justify-content: center;
    padding: 26px;
    overflow: auto;
    min-height: 0;
    background:
        radial-gradient(circle at top, rgba(24, 200, 200, 0.06), transparent 38%),
        linear-gradient(180deg, var(--office-surface-strong), var(--office-surface));
}

.OfficeDocumentCanvas {
    width: min(100%, 920px);
    min-height: 720px;
    padding: 54px 64px;
    border: 1px solid var(--office-border);
    border-radius: 22px;
    background: var(--office-canvas-bg);
    color: var(--office-canvas-text);
    box-shadow: var(--office-shadow);
    line-height: 1.7;
    outline: none;
}

.OfficeDocumentCanvas:empty::before {
    content: attr(data-placeholder);
    color: var(--office-muted);
}

.OfficeDocumentCanvas h1,
.OfficeDocumentCanvas h2,
.OfficeDocumentCanvas h3 {
    color: var(--office-canvas-heading);
    line-height: 1.18;
    margin: 0 0 0.6em;
}

.OfficeDocumentCanvas p,
.OfficeDocumentCanvas ul,
.OfficeDocumentCanvas ol,
.OfficeDocumentCanvas blockquote {
    margin: 0 0 1em;
}

.OfficeDocumentCanvas a {
    color: var(--office-accent-alt);
}

.OfficeDocumentCanvas blockquote {
    padding-left: 18px;
    border-left: 4px solid var(--office-accent);
    color: var(--office-canvas-quote);
}

.OfficeDocumentFooter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--office-border);
    background: var(--office-surface-strong);
}

.OfficeDocumentFooterLabel {
    color: var(--office-text);
    font-size: 0.95rem;
}

@media (max-width: 960px) {
    .OfficeDocumentCanvasWrap {
        padding: 14px;
    }

    .OfficeDocumentCanvas {
        min-height: 520px;
        padding: 28px 22px;
    }

    .OfficeToolbar,
    .OfficeDocumentMetaRow {
        padding: 12px;
    }
}
