/* ===== Theme tokens (swap palette here; light/dark via data-theme) ===== */
:root,
[data-theme="light"] {
    --canvas: #f4f8fc;
    --surface: #ffffff;
    --card: #ffffff;
    --ink: #0f172a;
    --body: #45464d;
    --muted: #6b7280;
    --border: #d0dde9;
    --subtle: #e4edf6;
    --secondary: #e4edf6;
    --secondary-fg: #0f172a;
    --accent: #2991d7;
    --accent-fg: #ffffff;
    --brand: #e11d2e;
    --footer: #0f172a;
    --overlay-blur-color: #ffffff;
    --dock-bg: rgba(255, 255, 255, 0.9);
    --shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    --radius: 16px;
    --radius-lg: 28px;

    /* Back-compat aliases used across legacy rules */
    --multi-ink: var(--ink);
    --multi-muted: var(--muted);
    --multi-leaf: var(--accent);
    --multi-cream: color-mix(in srgb, var(--surface) 78%, transparent);
}

[data-theme="dark"] {
    --canvas: #080f1a;
    --surface: #0e1c2e;
    --card: #132436;
    --ink: #deeaf6;
    --body: #96b0c8;
    --muted: #5c7a94;
    --border: #1e3658;
    --subtle: #1a3050;
    --secondary: #1a3050;
    --secondary-fg: #deeaf6;
    --accent: #4aa3e0;
    --accent-fg: #081018;
    --brand: #ff4d5e;
    --footer: #0c1d30;
    --overlay-blur-color: #080f1a;
    --dock-bg: rgba(14, 28, 46, 0.92);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

/* Subtle site-wide background; home uses its own stronger layer */
.multi-layout:not(.multi-layout--home)::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background: url("/background.png") center center / cover no-repeat;
    opacity: 0.05;
    pointer-events: none;
}

.multi-layout:not(.multi-layout--home) > *:not(.mud-appbar) {
    position: relative;
    z-index: 1;
}

.multi-layout:not(.multi-layout--home) .mud-main-content,
.multi-main:not(.multi-main--home) {
    background: transparent !important;
}

.multi-layout--home .mud-main-content,
.multi-main--home {
    padding: 0 !important;
    background: transparent;
}

.multi-main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

.multi-appbar.mud-appbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 86%, transparent) !important;
    color: var(--ink) !important;
}

.multi-appbar.mud-appbar .mud-toolbar {
    height: 64px;
    min-height: 64px;
    flex-wrap: nowrap;
    overflow: visible;
}

.site-header {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.site-header .mud-popover-provider {
    position: absolute;
    width: 0;
    height: 0;
    overflow: visible;
}

/* Dialogs: keep fully on screen below the fixed app bar */
.mud-dialog-container {
    align-items: safe center !important;
    justify-content: safe center !important;
    padding: 5.5rem 1rem 1.5rem !important;
    box-sizing: border-box !important;
}

.mud-dialog {
    max-height: calc(100vh - 7rem);
    display: flex;
    flex-direction: column;
}

.mud-dialog .mud-dialog-content {
    overflow-y: auto;
    max-height: calc(100vh - 12rem);
}

.multi-appbar-nav {
    display: flex;
    align-items: center;
    flex: 1 1 0px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

.multi-nav-slot {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.multi-appbar-nav > .multi-nav-slot + .multi-nav-slot {
    margin-left: 1rem;
}

.multi-appbar-end {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.15rem;
}

@media (max-width: 1099px) {
    .multi-appbar-nav {
        display: none;
    }
}

.multi-brand {
    letter-spacing: 0.12em;
    font-weight: 700 !important;
    color: var(--ink) !important;
}

.multi-nav-link,
.multi-appbar-nav .mud-button-root {
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif !important;
    font-size: 0.875rem !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

.multi-nav-link--active,
.multi-nav-slot--active .mud-button-root {
    color: var(--brand) !important;
}

.multi-lang {
    min-width: 0;
    font-weight: 700 !important;
    text-transform: none !important;
}

.multi-login {
    text-transform: none !important;
    border-color: var(--border) !important;
}

/* ===== Bottom dock ===== */
.bottom-dock {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 1200;
    width: min(42rem, calc(100vw - 1.5rem));
    pointer-events: none;
}

@media (min-width: 1100px) {
    .bottom-dock {
        display: none;
    }

    .multi-main {
        padding-bottom: 2.5rem !important;
    }
}

.bottom-dock__bar {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
    background: var(--dock-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    width: 100%;
    overflow: hidden;
    flex-wrap: nowrap;
}

.bottom-dock__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-width: 3.25rem;
    padding: 0.35rem 0.45rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font: inherit;
    flex: 0 0 auto;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.bottom-dock__item:hover {
    color: var(--ink);
    background: var(--subtle);
}

.bottom-dock__item--active {
    color: var(--brand);
}

.bottom-dock__item--active .bottom-dock__icon {
    background: color-mix(in srgb, var(--brand) 18%, transparent);
    color: var(--brand);
}

.bottom-dock__icon {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
}

.multi-nav-overflow {
    display: none !important;
}

.is-measuring > .multi-nav-overflow {
    display: flex !important;
}

.public-menu-popover {
    border-radius: 16px;
}

.public-menu-panel {
    min-width: 14rem;
    max-width: min(22rem, 80vw);
    max-height: min(70vh, 28rem);
    overflow: auto;
    padding: 0.35rem;
}

.public-menu-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.15rem 0;
}

.public-menu-group .public-menu-group {
    margin-left: 0.65rem;
}

.public-menu-group__title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.45rem 0.7rem 0.15rem;
}

.public-menu-link {
    display: block;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.public-menu-link:hover {
    background: var(--subtle);
}

.public-menu-link--active {
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
}

.public-menu-search {
    width: 100%;
    box-sizing: border-box;
    margin: 0.25rem 0 0.35rem;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.public-menu-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: color-mix(in srgb, var(--ink) 40%, transparent);
}

.public-menu-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1310;
    max-height: 75vh;
    overflow: auto;
    background: var(--surface);
    color: var(--ink);
    border-radius: 20px 20px 0 0;
    padding: 0.85rem 0.85rem calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow);
}

.public-menu-sheet__title {
    font-weight: 700;
    padding: 0.2rem 0.7rem 0.55rem;
}

.public-menu-sheet__title a {
    color: inherit;
    text-decoration: none;
}

.office-nav {
    margin-bottom: 1.25rem;
}

.office-nav-link {
    text-transform: none !important;
}

.office-checklist {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.65rem;
}

.office-checklist li {
    padding-left: 0.25rem;
}

.office-field-help {
    display: flex;
    align-items: flex-end;
    gap: 0.15rem;
}

.office-field-help > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.office-field-help--center {
    align-items: center;
}

.office-help-hint {
    position: relative;
    flex: 0 0 auto;
}

.office-help-hint__btn {
    margin-bottom: 0.15rem;
}

.office-help-hint__panel {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 20;
    min-width: 16rem;
    max-width: min(28rem, 80vw);
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow);
    white-space: pre-line;
}

.office-help-hint__body {
    max-width: 28rem;
    white-space: pre-line;
}

.multi-lang-switch {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.office-primer-body {
    white-space: pre-line;
}

.office-tour-spotlight {
    position: relative;
    z-index: 1401;
    border-radius: 10px;
    box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px color-mix(in srgb, var(--ink) 48%, transparent);
}

.office-tour-card {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1402;
    width: min(28rem, calc(100vw - 2.5rem));
    padding: 1.25rem 1.35rem;
    background: var(--card);
    color: var(--ink);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* ===== Content-first article editor ===== */
.article-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 1.25rem;
    align-items: start;
    width: 100%;
}

.article-edit__main {
    min-width: 0;
    width: 100%;
}

.article-edit__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    position: sticky;
    top: 4.5rem;
    z-index: 5;
    padding: 0.5rem 0;
    background: color-mix(in srgb, var(--canvas) 92%, transparent);
    backdrop-filter: blur(8px);
}

.article-edit__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.article-edit__sidebar {
    position: sticky;
    top: 5.25rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}

.article-edit__sidebar h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.article-edit__editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 960px) {
    .article-edit {
        grid-template-columns: 1fr;
    }

    .article-edit__sidebar {
        position: static;
        max-height: none;
        order: -1;
    }

    .article-edit__sidebar--collapsed .article-edit__sidebar-body {
        display: none;
    }
}

/* ===== MultiContentEditor (reusable) ===== */
.multi-content-editor {
    width: 100%;
}

.multi-content-editor__toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 0 0.75rem;
}

.multi-content-editor__insert-hint {
    color: var(--muted);
}

.multi-content-editor__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.multi-content-editor__segment {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.multi-content-editor__segment--focused {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

.multi-content-editor__segment-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--subtle) 70%, var(--surface));
}

.multi-content-editor__segment-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.multi-content-editor__segment-icon {
    color: var(--accent);
}

.multi-content-editor__segment-label {
    font-weight: 700;
    font-size: 0.9rem;
}

.multi-content-editor__segment-hint {
    font-size: 0.78rem;
    color: var(--muted);
}

.multi-content-editor__segment-actions {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.multi-content-editor__segment-body {
    padding: 0.75rem;
}

.multi-content-editor__text .mudex-richtext,
.multi-content-editor__text .ql-container {
    min-height: 140px !important;
}

.multi-content-editor__text .ql-editor {
    min-height: 100px;
}

.multi-content-editor__effect-body {
    font-size: 0.85rem;
    color: var(--muted);
}

.multi-content-editor__dual-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.multi-content-editor__dual-preview-side {
    min-width: 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    background: var(--subtle);
    color: var(--ink);
}

.multi-content-editor__dual-preview-side--em {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.multi-content-editor__dual-preview-caption {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.multi-content-editor__dual-preview-title {
    font-weight: 700;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.multi-content-editor__dual-preview-text {
    margin-top: 0.3rem;
    font-size: 0.82rem;
    color: var(--body);
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .multi-content-editor__dual-preview {
        grid-template-columns: 1fr;
    }
}

/* Compact editor previews for all content blocks */
.editor-fx-preview {
    color: var(--ink);
}

.editor-fx-preview__empty {
    font-size: 0.85rem;
    color: var(--muted);
}

.editor-fx-preview__meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.editor-fx-preview__title {
    font-weight: 700;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.editor-fx-preview__text {
    font-size: 0.82rem;
    color: var(--body);
    margin-top: 0.2rem;
    overflow-wrap: anywhere;
}

.editor-fx-preview__caption {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.editor-fx-preview__thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--subtle);
    flex: 0 0 auto;
}

.editor-fx-preview__thumb--lg {
    width: 120px;
    height: 80px;
}

.editor-fx-preview__thumb--video {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.editor-fx-preview--media,
.editor-fx-preview--hero {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.editor-fx-preview__copy {
    min-width: 0;
}

.editor-fx-preview__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.editor-fx-preview__chip {
    display: inline-flex;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
}

.editor-fx-preview__chip--muted {
    background: var(--subtle);
    color: var(--muted);
}

.editor-fx-preview__thumbs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.editor-fx-preview__thumbs img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--subtle);
}

.editor-fx-preview--marquee {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.editor-fx-preview__quote {
    padding: 0.45rem 0.6rem;
    border-left: 3px solid var(--accent);
    background: var(--subtle);
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
}

.editor-fx-preview__author {
    display: inline-block;
    margin-left: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.editor-fx-preview--cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.editor-fx-preview__card {
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    background: var(--subtle);
    min-width: 0;
}

.editor-fx-preview__card-icon {
    color: var(--accent);
    font-size: 1.1rem !important;
}

.editor-fx-preview__card-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    overflow-wrap: anywhere;
}

.editor-fx-preview--dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.editor-fx-preview__dual-side {
    min-width: 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    background: var(--subtle);
}

.editor-fx-preview__dual-side--em {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

@media (max-width: 640px) {
    .editor-fx-preview--dual {
        grid-template-columns: 1fr;
    }

    .editor-fx-preview--hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

.article-link-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.article-link-field__select {
    width: 100%;
}

.dual-card-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    align-items: start;
}

.dual-card-editor__field {
    width: 100%;
}

.dual-card-editor__field .mud-input-outlined,
.dual-card-editor__field .mud-input-slot,
.dual-card-editor__field textarea {
    color: var(--ink) !important;
    background: var(--surface);
}

.dual-card-editor__field .mud-input-outlined-border {
    border-color: var(--border) !important;
}

@media (max-width: 700px) {
    .dual-card-editor {
        grid-template-columns: 1fr;
    }
}

.media-image-picker {
    margin-bottom: 0.75rem;
}

.media-image-picker__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.media-image-picker__empty {
    color: var(--muted);
}

.media-image-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.55rem;
    max-height: 280px;
    overflow: auto;
    padding: 0.15rem;
}

.media-image-picker__item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.35rem;
    border: 2px solid var(--border);
    border-radius: calc(var(--radius) - 6px);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
    min-width: 0;
}

.media-image-picker__item:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.media-image-picker__item--selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.media-image-picker__item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: var(--subtle);
}

.media-image-picker__name {
    font-size: 0.68rem;
    line-height: 1.25;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-image-picker__video-tile {
    display: grid;
    place-items: center;
    gap: 0.2rem;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    background: var(--subtle);
    color: var(--muted);
    font-size: 0.72rem;
}

/* Folder-aware media library picker (editor sideload) */
.media-library-picker {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    padding: 0.75rem;
    background: var(--surface);
    margin-bottom: 0.75rem;
}

.media-library-picker__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.media-library-picker__label {
    font-size: 0.85rem;
    font-weight: 600;
}

.media-library-picker__shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.media-library-picker__breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.media-library-picker__crumb {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.media-library-picker__sep {
    opacity: 0.5;
}

.media-library-picker__body {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) 1fr;
    gap: 0.75rem;
}

@media (max-width: 720px) {
    .media-library-picker__body {
        grid-template-columns: 1fr;
    }
}

.media-library-picker__section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.media-library-picker__folders {
    border-right: 1px solid var(--border);
    padding-right: 0.65rem;
    max-height: 280px;
    overflow: auto;
}

@media (max-width: 720px) {
    .media-library-picker__folders {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 0.65rem;
        max-height: 140px;
    }
}

.media-library-picker__folder {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.35rem 0.25rem;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
}

.media-library-picker__folder:hover {
    background: var(--subtle);
}

.media-library-picker__files {
    min-width: 0;
}

.media-library-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.5rem;
    max-height: 220px;
    overflow: auto;
    margin-bottom: 0.65rem;
}

.media-library-picker__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem;
    background: var(--canvas);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.media-library-picker__item--selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.media-library-picker__item img,
.media-library-picker__video-tile {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: var(--subtle);
}

.media-library-picker__video-tile {
    display: grid;
    place-items: center;
    gap: 0.15rem;
    color: var(--muted);
    font-size: 0.7rem;
}

.media-library-picker__name {
    font-size: 0.68rem;
    line-height: 1.25;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-library-picker__empty,
.media-library-picker__hint,
.media-library-picker__msg {
    font-size: 0.78rem;
    color: var(--muted);
}

.media-library-picker__upload {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
}

.media-library-picker__upload input[type="file"] {
    font-size: 0.8rem;
}

.block-palette__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
}

.block-palette__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    text-align: left;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
}

.block-palette__item:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.block-palette__icon {
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.block-palette__title {
    font-weight: 700;
    font-size: 0.9rem;
}

.block-palette__desc {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
}

multi-block.multi-block-placeholder,
.multi-block-placeholder {
    display: block;
    margin: 0.75rem 0;
    padding: 1rem 1.1rem;
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--ink);
    user-select: none;
}

.multi-block-placeholder__label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
}

.multi-block-placeholder [data-quote],
.multi-block-placeholder [data-card],
.multi-block-placeholder [data-dual] {
    display: none;
}

/* ===== Home / hero ===== */
.home-stage {
    position: relative;
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
    background: var(--canvas);
}

.home-stage__copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3.5rem);
}

.home-stage__media {
    position: relative;
    min-height: 280px;
}

.home-stage__image {
    position: absolute;
    inset: 0;
    background: url("/background.png") center center / cover no-repeat;
    pointer-events: none;
}

.home-stage__fade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to right, var(--canvas), transparent 42%);
}

.home-panel {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
}

.home-panel .office-article-edit-link {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
}

.article-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.article-header .mud-typography {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.office-article-edit-link {
    flex: 0 0 auto;
}

.home-kicker {
    margin: 0 0 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.home-title {
    margin: 0 0 1.1rem;
    font-size: clamp(2rem, 5vw, 3.35rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    font-weight: 750;
    color: var(--ink);
}

.home-title__accent {
    color: var(--accent);
}

.home-lead,
.home-empty {
    font-size: 1.08rem;
    line-height: 1.65;
    color: var(--body);
}

.home-lead p {
    margin: 0 0 1rem;
}

.home-lead p:last-child {
    margin-bottom: 0;
}

.home-days {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.home-day {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    font-weight: 600;
    font-size: 0.92rem;
}

.home-day:hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
}

@media (max-width: 900px) {
    .home-stage {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .home-stage__media {
        min-height: 42vh;
        order: -1;
    }

    .home-stage__fade {
        background: linear-gradient(to top, var(--canvas), transparent 55%);
    }
}

.article-body img {
    max-width: 100%;
    height: auto;
}

.article-body .ql-align-left {
    text-align: left;
}

.article-body .ql-align-center {
    text-align: center;
}

.article-body .ql-align-center img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article-body .ql-align-right {
    text-align: right;
}

.article-body .ql-align-right img {
    display: block;
    margin-left: auto;
    margin-right: 0;
}

.article-body .ql-align-justify {
    text-align: justify;
}

.article-body ul,
.article-body ol {
    margin: 0.75rem 0;
    padding-left: 1.75rem;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body li {
    margin: 0.25rem 0;
    padding-left: 0.25rem;
}

.article-body .ql-indent-1 { padding-left: 3em; }
.article-body .ql-indent-2 { padding-left: 6em; }
.article-body .ql-indent-3 { padding-left: 9em; }
.article-body .ql-indent-4 { padding-left: 12em; }
.article-body .ql-indent-5 { padding-left: 15em; }
.article-body .ql-indent-6 { padding-left: 18em; }
.article-body .ql-indent-7 { padding-left: 21em; }
.article-body .ql-indent-8 { padding-left: 24em; }

.article-body iframe {
    display: block;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    margin: 1rem 0;
}

/* ===== Content effect blocks ===== */
.effect-block {
    margin: 1.75rem 0;
}

.effect-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.effect-card {
    padding: 1.15rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.effect-card__icon {
    color: var(--accent);
    margin-bottom: 0.65rem;
}

.effect-card__title {
    margin: 0;
    font-weight: 700;
    color: var(--ink);
}

.effect-card__subtitle {
    margin: 0.15rem 0 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.effect-card__text {
    margin: 0;
    color: var(--body);
    font-size: 0.92rem;
    line-height: 1.45;
}

.effect-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.effect-dual__side {
    padding: 1.35rem;
    border-radius: var(--radius-lg);
    background: var(--subtle);
    color: var(--ink);
}

.effect-dual__side--em {
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.effect-dual__badge {
    display: inline-flex;
    margin-bottom: 0.65rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.effect-dual__eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--muted);
}

.effect-dual__title {
    margin: 0.35rem 0 0.65rem;
    font-size: 1.35rem;
}

.effect-dual__text {
    margin: 0 0 0.75rem;
    color: var(--body);
    line-height: 1.5;
}

.effect-dual__list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--body);
}

@media (max-width: 800px) {
    .effect-dual {
        grid-template-columns: 1fr;
    }
}

.effect-marquee {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.effect-marquee__track {
    display: flex;
    gap: 1rem;
    width: max-content;
    animation: multiMarqueeL 48s linear infinite;
}

.effect-marquee__card {
    width: min(22rem, 78vw);
    flex: 0 0 auto;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius);
    background: var(--card);
    border-top: 3px solid var(--brand);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.effect-marquee__quote {
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.effect-marquee__author {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

@keyframes multiMarqueeL {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .effect-marquee__track {
        animation: none;
        flex-wrap: wrap;
        width: auto;
    }
}

/* Unified image block */
.effect-image {
    margin: 1.25rem 0;
    max-width: 100%;
}

.effect-image--align-start {
    width: min(100%, 22rem);
    margin-inline-end: auto;
}

.effect-image--align-center {
    width: min(100%, 36rem);
    margin-inline: auto;
}

.effect-image--align-end {
    width: min(100%, 22rem);
    margin-inline-start: auto;
}

.effect-image--align-wide {
    width: 100%;
}

.effect-image--align-bleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.effect-image__frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--subtle);
}

.effect-image__media {
    overflow: hidden;
}

.effect-image__media img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 180px;
    max-height: 36rem;
    object-fit: cover;
}

.effect-image--align-bleed .effect-image__media img {
    min-height: 240px;
    max-height: 48rem;
}

.effect-image__caption {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    color: var(--muted);
    text-align: center;
}

.effect-image--align-start .effect-image__caption {
    text-align: start;
}

.effect-image--align-end .effect-image__caption {
    text-align: end;
}

/* Soft edge mask */
.effect-image--mask-soft-edge .effect-image__frame {
    min-height: 240px;
}

.effect-image--mask-soft-edge .effect-image__media img {
    min-height: 240px;
    height: 100%;
}

.effect-image__soft-edge {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to right, var(--canvas), transparent 35%);
    z-index: 1;
}

/* Photo strip mask */
.effect-image--mask-photo-strip .effect-image__frame {
    border-radius: 4px;
    background: #111;
    padding: 0.55rem 1.15rem;
}

.effect-image--mask-photo-strip .effect-image__media {
    border-radius: 2px;
}

.effect-image__strip-edge {
    position: absolute;
    top: 0.4rem;
    bottom: 0.4rem;
    width: 0.7rem;
    background:
        radial-gradient(circle at center, transparent 38%, #111 40%) 0 0 / 100% 0.85rem repeat-y;
    pointer-events: none;
    z-index: 1;
}

.effect-image__strip-edge--start {
    left: 0.2rem;
}

.effect-image__strip-edge--end {
    right: 0.2rem;
}

/* Polaroid mask */
.effect-image--mask-polaroid {
    width: min(100%, 20rem);
}

.effect-image--align-wide.effect-image--mask-polaroid {
    width: min(100%, 28rem);
    margin-inline: auto;
}

.effect-image--mask-polaroid .effect-image__frame {
    border-radius: 2px 2px 0 0;
    background: #f7f4ef;
    padding: 0.7rem 0.7rem 0;
    box-shadow: none;
}

.effect-image--mask-polaroid .effect-image__media img {
    min-height: 14rem;
    max-height: 22rem;
}

.effect-image__caption--polaroid {
    margin: 0;
    padding: 0.85rem 0.7rem 1.1rem;
    background: #f7f4ef;
    color: #333;
    font-family: "Caveat", "Segoe Script", "Comic Sans MS", cursive;
    font-size: 1.15rem;
    text-align: center;
    border-radius: 0 0 2px 2px;
    box-shadow: 0 10px 28px color-mix(in srgb, #000 16%, transparent);
}

/* Album tape mask — dirty white torn strips like an old photo album */
.effect-image--mask-album-tape {
    overflow: visible;
    padding: 1.6rem;
}

.effect-image--mask-album-tape .effect-image__frame {
    border-radius: 2px;
    box-shadow: 0 1px 2px color-mix(in srgb, #000 12%, transparent);
    overflow: visible;
}

.effect-image--mask-album-tape .effect-image__media {
    overflow: hidden;
    border-radius: 1px;
}

.effect-image__album-tape {
    position: absolute;
    z-index: 2;
    width: 6.2rem;
    height: 2.1rem;
    pointer-events: none;
    transform-origin: center center;
    /* Dirty off-white tape + faint fiber streaks */
    background:
        repeating-linear-gradient(
            105deg,
            transparent 0 3px,
            color-mix(in srgb, #6b6354 7%, transparent) 3px 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0 2px,
            color-mix(in srgb, #000 3.5%, transparent) 2px 3px
        ),
        linear-gradient(
            160deg,
            #f2eee3 0%,
            #ddd6c6 38%,
            #ebe4d4 62%,
            #cfc6b4 100%
        );
    box-shadow:
        0 1px 2px color-mix(in srgb, #000 18%, transparent),
        inset 0 0 0 1px color-mix(in srgb, #8a8170 18%, transparent);
    /*
     * Long edges (top/bottom) stay straight.
     * Short ends (left/right) get the torn tear-off edge.
     */
    clip-path: polygon(
        12% 0%,
        0% 10%,
        9% 20%,
        1% 30%,
        10% 40%,
        0% 50%,
        10% 60%,
        1% 70%,
        9% 80%,
        0% 90%,
        12% 100%,
        88% 100%,
        100% 90%,
        91% 80%,
        99% 70%,
        90% 60%,
        100% 50%,
        90% 40%,
        99% 30%,
        91% 20%,
        100% 10%,
        88% 0%
    );
    opacity: 0.94;
}

/* Center of each strip sits on the photo corner at ±45° */
.effect-image__album-tape--tl {
    top: 0;
    left: 0;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.effect-image__album-tape--tr {
    top: 0;
    right: 0;
    transform: translate(50%, -50%) rotate(45deg);
}

.effect-image__album-tape--bl {
    bottom: 0;
    left: 0;
    transform: translate(-50%, 50%) rotate(45deg);
}

.effect-image__album-tape--br {
    bottom: 0;
    right: 0;
    transform: translate(50%, 50%) rotate(-45deg);
}

/* Motion */
.effect-image--motion-hover .effect-image__media img {
    transition: transform 0.45s ease;
    transform-origin: center center;
}

.effect-image--motion-hover:hover .effect-image__media img {
    transform: scale(1.04);
}

.effect-image--motion-kenburns .effect-image__media img {
    /* linear: sofort sichtbare Bewegung (ease-in-out wirkt am Anfang wie Verzögerung) */
    animation: effect-image-kenburns 14s linear infinite alternate;
    transform-origin: 50% 50%;
    will-change: transform;
}

@keyframes effect-image-kenburns {
    0% {
        transform: scale(1.02) translate(0.4%, 0.2%);
    }

    100% {
        transform: scale(1.14) translate(-2.2%, -1.8%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .effect-image--motion-hover .effect-image__media img,
    .effect-image--motion-kenburns .effect-image__media img {
        transition: none;
        animation: none;
        transform: none;
    }

    .effect-image--motion-hover:hover .effect-image__media img {
        transform: none;
    }
}

/* Video block */
.effect-video {
    margin: 1.25rem 0;
    max-width: 100%;
}

.effect-video--align-start {
    width: min(100%, 22rem);
    margin-inline-end: auto;
}

.effect-video--align-center {
    width: min(100%, 42rem);
    margin-inline: auto;
}

.effect-video--align-end {
    width: min(100%, 22rem);
    margin-inline-start: auto;
}

.effect-video--align-wide {
    width: 100%;
}

.effect-video--align-bleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.effect-video__frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #111;
    box-shadow: 0 10px 28px color-mix(in srgb, #000 14%, transparent);
    aspect-ratio: 16 / 9;
}

.effect-video--aspect-9-16 .effect-video__frame {
    aspect-ratio: 9 / 16;
    max-width: min(100%, 22rem);
    margin-inline: auto;
}

.effect-video--aspect-1-1 .effect-video__frame {
    aspect-ratio: 1 / 1;
}

.effect-video--aspect-4-3 .effect-video__frame {
    aspect-ratio: 4 / 3;
}

.effect-video__player,
.effect-video__poster,
.effect-video__poster img,
.effect-video__poster-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
}

.effect-video__poster {
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: #1a1a1a;
    color: inherit;
}

.effect-video__poster-fallback {
    background:
        radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 35%, #222), transparent 55%),
        #1c1c1c;
}

.effect-video__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.effect-video__play .mud-icon-root {
    width: 3.4rem !important;
    height: 3.4rem !important;
    padding: 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, #000 45%, transparent);
    color: #fff;
    box-shadow: 0 6px 18px color-mix(in srgb, #000 35%, transparent);
}

.effect-video__caption {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    color: var(--muted);
    text-align: center;
}

.effect-video--align-start .effect-video__caption {
    text-align: start;
}

.effect-video--align-end .effect-video__caption {
    text-align: end;
}

.effect-video__empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #bbb;
    font-size: 0.9rem;
}

.effect-split-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
}

.effect-split-hero__copy {
    padding: clamp(1.25rem, 3vw, 2.25rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.effect-split-hero__media {
    position: relative;
    min-height: 220px;
}

.effect-split-hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.effect-split-hero__fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--surface), transparent 40%);
    pointer-events: none;
}

.effect-split-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.effect-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
}

.effect-btn--primary {
    background: var(--accent);
    color: var(--accent-fg);
}

.effect-btn--ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border);
}

@media (max-width: 800px) {
    .effect-split-hero {
        grid-template-columns: 1fr;
    }
}

/* ===== Sphere gallery ===== */
.sphere-root {
    --radius: 420px;
    --viewer-pad: 72px;
    --circ: calc(var(--radius) * 3.14);
    --segments-x: 24;
    --segments-y: 8;
    --rot-y: calc((360deg / var(--segments-x)) / 2);
    --rot-x: calc((360deg / var(--segments-y)) / 2);
    --item-width: calc(var(--circ) / var(--segments-x));
    --item-height: calc(var(--circ) / var(--segments-y));
    --tile-radius: 12px;
    position: relative;
    width: 100%;
    height: min(70vh, 640px);
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    cursor: grab;
    border-radius: var(--radius-lg);
    background: var(--canvas);
}

.sphere-root[data-dragging] {
    cursor: grabbing;
}

.sphere-root * {
    box-sizing: border-box;
}

.sphere-main {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.stage {
    width: 100%;
    height: 100%;
    perspective: calc(var(--radius) * 2);
    perspective-origin: 50% center;
    display: grid;
    place-items: center;
}

.sphere,
.item,
.item__image {
    transform-style: preserve-3d;
}

.sphere {
    transform: translateZ(calc(var(--radius) * -1));
    will-change: transform;
}

.item {
    position: absolute;
    width: calc(var(--item-width) * var(--item-size-x, 1));
    height: calc(var(--item-height) * var(--item-size-y, 1));
    left: 50%;
    top: 50%;
    margin-left: calc(var(--item-width) * var(--item-size-x, 1) / -2);
    margin-top: calc(var(--item-height) * var(--item-size-y, 1) / -2);
    transform:
        rotateY(calc(var(--offset-x) * var(--rot-y)))
        rotateX(calc(var(--offset-y) * var(--rot-x)))
        translateZ(var(--radius));
}

.item__image {
    position: absolute;
    inset: 8px;
    border-radius: var(--tile-radius);
    overflow: hidden;
    backface-visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.item__image:hover {
    transform: translateZ(4px) scale(1.06);
}

.item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    backface-visibility: hidden;
}

.sphere-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background-image: radial-gradient(#ebebeb00 60%, var(--overlay-blur-color) 100%);
}

.sphere-overlay--blur {
    mask-image: radial-gradient(#ebebeb00 65%, var(--overlay-blur-color) 88%);
    backdrop-filter: blur(4px);
}

.sphere-edge {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 5;
    height: 120px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--overlay-blur-color));
}

.sphere-edge--top {
    top: 0;
    transform: rotate(180deg);
}

.sphere-edge--bottom {
    bottom: 0;
}

.sphere-fallback {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.sphere-fallback img {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    flex: 0 0 auto;
}

@media (max-width: 700px) {
    .sphere-root {
        --radius: 280px;
        height: 420px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sphere-root .sphere {
        transform: none !important;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.gallery-grid__item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.5rem;
    border: 0;
    border-radius: 8px;
    background: var(--subtle);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.gallery-grid img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.gallery-lightbox {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-width: min(96vw, 1200px);
    color: #fff;
    outline: none;
}

.gallery-lightbox__stage {
    margin: 0;
    max-width: min(86vw, 1100px);
    text-align: center;
}

.gallery-lightbox__stage img {
    max-width: 86vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox__stage figcaption {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.gallery-lightbox__close,
.gallery-lightbox__download,
.gallery-lightbox__nav {
    color: #fff !important;
}

.gallery-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.gallery-lightbox__download {
    position: absolute;
    top: 1rem;
    right: 4.2rem;
}

.gallery-lightbox__nav--prev,
.gallery-lightbox__nav--next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-lightbox__nav--prev { left: 0.4rem; }
.gallery-lightbox__nav--next { right: 0.4rem; }

.gallery-browser {
    display: grid;
    grid-template-columns: minmax(200px, 260px) 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: start;
}

.gallery-browser__tree {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.gallery-tree-node__btn {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
}

.gallery-tree-node__btn:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.gallery-tree-node__btn--active {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    font-weight: 600;
}

.gallery-tree-node__children {
    margin-left: 0.85rem;
    padding-left: 0.4rem;
    border-left: 1px solid var(--border);
}

@media (max-width: 800px) {
    .gallery-browser {
        grid-template-columns: 1fr;
    }
}

.login-demo-picker {
    margin-bottom: 0.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--border);
}

.multi-label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.multi-field {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 1rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font: inherit;
    color: var(--ink);
}

.multi-field:focus {
    outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-color: var(--accent);
}

select.multi-field {
    appearance: auto;
}

.multi-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.35rem;
    padding: 0.7rem 1.25rem;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-fg);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.multi-submit:hover {
    filter: brightness(1.08);
}
