:root {
    --bg: #f5f5f3;
    --surface: #ffffff;
    --surface-muted: #fafaf9;
    --surface-soft: #f0f1ec;
    --line: #d8d9d3;
    --line-strong: #d5d8d0;
    --text: #191919;
    --muted: #505050;
    --accent: #111827;
    --accent-soft: #f0f0ed;
    --danger: #b42318;
    --danger-soft: #fff1f0;
    --success: #027a48;
    --success-soft: #ecfdf3;
    --note: #2563eb;
    --note-soft: #eff6ff;
    --warning: #b54708;
    --warning-soft: #fff7ed;
    --check: #047857;
    --check-soft: #ecfdf5;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
    --topbar-bg: #f6f6f4;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Source Sans 3", sans-serif;
    color: var(--text);
    background: linear-gradient(160deg, #f8fafc 0%, var(--bg) 50%, #f0f4f8 100%);
}

a {
    color: inherit;
}

input,
textarea,
select,
button {
    font: inherit;
}

button,
a {
    transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.page-shell {
    min-height: calc(100vh - 70px);
    padding: 24px 32px 48px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 24px;
}

.topbar-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    height: 36px;
    display: block;
    object-fit: contain;
}

/* Topbar brand (admin/login pages without sidebar) */

/* ── App sidebar (fixed left) ── */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: 272px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    transition: width 0.2s ease;
    overflow: hidden;
}

.app-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 16px 16px;
    flex-shrink: 0;
    position: relative;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}
.sidebar-close-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

@media (max-width: 900px) {
    .sidebar-close-btn {
        display: flex;
    }
}

.brand-logo-full {
    height: 42px;
    display: block;
    object-fit: contain;
    opacity: 0.92;
    transition: opacity 0.18s ease;
}

.brand-logo-full:hover {
    opacity: 1;
}

.app-sidebar-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 4px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
}

.app-sidebar-body::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

.app-sidebar-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* ── App main (offset by sidebar) ── */

.app-main--with-sidebar {
    margin-left: 272px;
}

/* ── Main sidebar navigation ── */

.main-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.main-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.18s ease;
    letter-spacing: -0.01em;
}

.main-sidebar-link svg:first-child {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    opacity: 0.55;
    transition: all 0.18s ease;
}

.main-sidebar-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.main-sidebar-link:hover svg:first-child {
    opacity: 0.9;
    color: var(--accent);
}

.main-sidebar-link.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.main-sidebar-link.active svg {
    stroke: #fff;
    opacity: 1;
}

.sidebar-demo-badge {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 5px;
    border-radius: 4px;
    background: #fee2e2;
    color: #dc2626;
    line-height: 1.4;
    flex-shrink: 0;
}

.main-sidebar-link.active .sidebar-demo-badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

[data-demo-link] {
    opacity: 0.55;
    cursor: default;
}
[data-demo-link]:hover {
    background: none;
    color: inherit;
}

.main-sidebar-chevron {
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.main-sidebar-link:hover .main-sidebar-chevron {
    opacity: 0.7;
}

/* ── Docs sidebar back button ── */

.docs-sidebar-back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 0.87rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.15s ease;
    border: none;
    background: none;
}

.docs-sidebar-back:hover {
    cursor: pointer;
    background: rgba(0, 0, 0, 0.04);
    color: #1e293b;
}

/* ── Sidebar footer ── */

.sidebar-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 8px 12px;
}

.sidebar-nav-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar-nav-panel[hidden] {
    display: none;
}

.sidebar-sub-list {
    gap: 1px;
}

.main-sidebar-sublink {
    padding-left: 12px;
    font-size: 0.88rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-footer a {
    font-size: 0.7rem;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s ease;
}

.sidebar-footer a:hover {
    color: #475569;
}

.sidebar-footer-dot {
    font-size: 0.7rem;
    color: #cbd5e1;
}

/* ── Theme toggle ── */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--accent-soft);
    color: var(--text);
}

/* ── Modal / Popup ── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 720px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
}

.modal-close:hover {
    color: var(--text);
}

/* ── Welcome video overlay ── */

.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-overlay-inner {
    position: relative;
    width: 50%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-overlay-video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

iframe.welcome-overlay-video {
    width: 45vw;
    height: calc(45vw * 9 / 16);
    max-height: 45vh;
    max-width: calc(45vh * 16 / 9);
    border-radius: 8px;
}

.welcome-skip-btn {
    position: absolute;
    top: -40px;
    right: -30px;
    z-index: 10;
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.welcome-skip-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ── Home page ── */

.home-page {
    padding: 0 0 48px;
}

.orders-page {
    padding: 8px 0 32px;
}

/* ══════════════════════════════════
   News page
   ══════════════════════════════════ */

.news-page { padding: 0 0 48px; }

.news-filters {
    display: flex; gap: 2px; padding: 3px;
    background: var(--surface-soft); border-radius: 10px; flex-shrink: 0;
}

.news-featured { margin-bottom: 18px; }

.news-card--featured {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    overflow: hidden;
}
.news-card--featured .news-card-img img {
    height: 100%;
    min-height: 280px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.news-card { overflow: hidden; }

.news-card-img { position: relative; overflow: hidden; }
.news-card-img img {
    width: 100%; height: 190px; object-fit: cover; display: block;
}
.news-card-badge {
    position: absolute; top: 12px; left: 12px;
    background: var(--danger); color: #fff;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    padding: 3px 10px; border-radius: 4px; letter-spacing: 0.03em;
}

.news-card-body { padding: 18px 20px; }
.news-card-meta {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.news-card-meta time { font-size: 0.78rem; color: var(--muted); }

.news-card-body h2 { font-size: 1.2rem; font-weight: 600; margin: 0 0 8px; line-height: 1.35; }
.news-card-body h3 { font-size: 1rem; font-weight: 600; margin: 0 0 6px; line-height: 1.35; }
.news-card-body p { margin: 0; font-size: 0.88rem; color: var(--muted); line-height: 1.55; }

@media (max-width: 1000px) {
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .news-card--featured { grid-template-columns: 1fr; }
    .news-card--featured .news-card-img img { min-height: 200px; height: 200px; }
}
@media (max-width: 640px) {
    .news-grid { grid-template-columns: 1fr; }
    .dash-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* Billing tabs */
.billing-tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--surface-soft);
    border-radius: 10px;
    margin-bottom: 16px;
    width: fit-content;
}

.billing-tab {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.billing-tab:hover:not(.active) {
    color: var(--text);
}

.billing-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.billing-panel[hidden] {
    display: none;
}

/* ══════════════════════════════════
   Dashboard
   ══════════════════════════════════ */

.dash { padding: 0 0 48px; }

.dash-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0 20px;
}
.dash-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.dash-subtitle { font-size: 0.82rem; color: var(--muted); margin: 4px 0 0; }
.dash-period-select {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

/* ── KPIs ── */
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
.dash-kpi { padding: 18px 20px; }
.dash-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.dash-kpi-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }
.dash-kpi-change { font-size: 0.75rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.dash-kpi-change--up { background: var(--success-soft); color: var(--success); }
.dash-kpi-change--down { background: var(--danger-soft); color: var(--danger); }
.dash-kpi-change--neutral { background: var(--accent-soft); color: var(--muted); }
.dash-kpi-value { font-size: 1.65rem; font-weight: 700; line-height: 1.2; display: block; }
.dash-kpi-spark { height: 36px; margin-top: 10px; }
.dash-kpi-spark svg { width: 100%; height: 100%; display: block; }

/* ── Charts grid ── */
.dash-charts {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.dash-chart-card { padding: 0; overflow: hidden; }
.dash-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    gap: 12px;
}
.dash-chart-head h3 { font-size: 0.92rem; font-weight: 600; margin: 0; }
.dash-chart-head-link { font-size: 0.78rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.dash-chart-head-link:hover { color: var(--text); }
.dash-chart-legend { display: flex; gap: 14px; }
.dash-legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--muted); }
.dash-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dash-chart-body { padding: 4px 20px 20px; }

/* Bar chart */
.dash-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 180px;
}
.dash-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}
.dash-bar-pair {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    flex: 1;
    width: 100%;
}
.dash-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}
.dash-bar--current { background: var(--success); }
.dash-bar--prev { background: var(--muted); opacity: 0.18; }
.dash-bar-label { font-size: 0.68rem; color: var(--muted); }

/* Donut chart */
.dash-donut-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 4px;
}
.dash-donut {
    position: relative;
    width: 130px;
    height: 130px;
    flex-shrink: 0;
}
.dash-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dash-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.dash-donut-center strong { font-size: 1.5rem; line-height: 1; }
.dash-donut-center small { font-size: 0.72rem; color: var(--muted); }
.dash-donut-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dash-donut-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}
.dash-donut-row span:nth-child(2) { flex: 1; }
.dash-donut-row strong { font-weight: 600; }

/* ── Tables grid ── */
.dash-tables {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 14px;
}
.dash-table-card { padding: 0; overflow: hidden; }
.dash-table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.dash-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
.dash-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover { background: var(--accent-soft); }
.dash-td-mono { font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; color: var(--muted); }
.dash-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.dash-status--done { background: var(--success-soft); color: var(--success); }
.dash-status--ship { background: var(--note-soft); color: var(--note); }
.dash-status--pending { background: var(--warning-soft); color: var(--warning); }
.dash-status--cancel { background: var(--danger-soft); color: var(--danger); }

/* ── Ranking ── */
.dash-ranking { padding: 4px 0; }
.dash-rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
}
.dash-rank-row:last-child { border-bottom: none; }
.dash-rank-pos {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}
.dash-rank-info { flex: 1; min-width: 0; }
.dash-rank-info strong { display: block; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-rank-info small { font-size: 0.75rem; color: var(--muted); }
.dash-rank-value { font-weight: 700; font-size: 0.92rem; white-space: nowrap; }

/* Welcome row */
.dash-welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0 16px; }
.dash-welcome-text { }
.dash-quick-actions { display: flex; gap: 8px; flex-shrink: 0; }
.dash-action-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
    color: var(--text); font-size: 0.84rem; font-weight: 500; text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.dash-action-btn:hover { background: var(--accent-soft); border-color: var(--line-strong); }

/* ── Date range picker ── */
.dash-date-bar { position: relative; padding-bottom: 4px; }
.dash-date-trigger {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
    color: var(--text); font-size: 0.84rem; font-weight: 500; cursor: pointer;
    transition: border-color 0.12s;
}
.dash-date-trigger:hover { border-color: var(--line-strong); }
.dash-date-dropdown {
    position: absolute; top: 100%; left: 0; z-index: 100; margin-top: 4px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12); min-width: 580px;
}
.dash-date-dd-inner { display: flex; }
.dash-date-presets {
    width: 170px; padding: 12px 0; border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
}
.dash-date-presets-head {
    display: flex; align-items: center; gap: 6px; padding: 6px 16px 10px;
    font-size: 0.82rem; font-weight: 600; color: var(--text);
}
.dash-date-preset {
    padding: 7px 16px; border: none; background: none; text-align: left;
    font-size: 0.84rem; color: var(--muted); cursor: pointer; transition: all 0.1s;
}
.dash-date-preset:hover { background: var(--surface-muted); color: var(--text); }
.dash-date-preset.active {
    background: var(--surface-muted); color: var(--text); font-weight: 600;
    border-left: 2px solid var(--text); padding-left: 14px;
}
.dash-date-calendars { flex: 1; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.dash-date-custom-row {
    display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text);
}
.dash-date-num {
    width: 60px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
    font-size: 0.84rem; text-align: center; background: var(--surface);
    color: var(--text);
}
.dash-date-unit {
    padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
    font-size: 0.84rem; background: var(--surface); color: var(--text);
}
.dash-date-today-label {
    display: none;
}
.dash-date-today-label input {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: var(--text);
}
.dash-date-cals-row { display: flex; gap: 16px; }
.dash-date-cal { flex: 1; }
.dash-date-cal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 8px; font-size: 0.82rem; font-weight: 600; color: var(--text);
}
.dash-date-cal-nav {
    border: none; background: none; cursor: pointer; padding: 2px 6px;
    color: var(--muted); font-size: 0.9rem; border-radius: 4px;
}
.dash-date-cal-nav:hover { background: var(--surface-muted); color: var(--text); }
.dash-date-cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
    text-align: center; font-size: 0.78rem;
}
.dash-date-cal-grid .dw {
    padding: 4px 0; font-weight: 600; color: var(--muted); font-size: 0.72rem;
}
.dash-date-cal-grid .dd {
    padding: 5px 2px; border-radius: 6px; cursor: pointer; color: var(--text);
    transition: background 0.1s;
}
.dash-date-cal-grid .dd:hover { background: var(--surface-muted); }
.dash-date-cal-grid .dd.empty { cursor: default; }
.dash-date-cal-grid .dd.in-range { background: #ebebea; border-radius: 0; }
.dash-date-cal-grid .dd.range-start { background: var(--text); color: var(--surface); border-radius: 6px 0 0 6px; font-weight: 600; }
.dash-date-cal-grid .dd.range-end { background: var(--text); color: var(--surface); border-radius: 0 6px 6px 0; font-weight: 600; }
.dash-date-cal-grid .dd.range-start.range-end { border-radius: 6px; }
.dash-date-cal-grid .dd.today { font-weight: 700; }
.dash-date-cal-grid .dd.outside { color: var(--muted); opacity: 0.4; }
.dash-date-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 10px; border-top: 1px solid var(--line);
}
.dash-date-range-text { font-size: 0.82rem; color: var(--muted); }
.dash-date-footer-btns { display: flex; gap: 6px; }
.dash-date-cancel {
    padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px;
    background: var(--surface); color: var(--text); font-size: 0.82rem;
    cursor: pointer;
}
.dash-date-cancel:hover { background: var(--surface-muted); }
.dash-date-apply {
    padding: 6px 14px; border: none; border-radius: 6px;
    background: var(--text); color: var(--surface); font-size: 0.82rem;
    font-weight: 600; cursor: pointer;
}
.dash-date-apply:hover { opacity: 0.9; }

/* Action required card */
.dash-actions-card { padding: 16px 20px; margin-bottom: 14px; border-left: 3px solid var(--warning); }
.dash-actions-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.dash-actions-head strong { font-size: 0.92rem; }
.dash-actions-count {
    font-size: 0.72rem; font-weight: 700; background: var(--warning-soft); color: var(--warning);
    padding: 1px 7px; border-radius: 10px;
}
.dash-actions-list { display: flex; flex-direction: column; gap: 8px; }
.dash-action-item {
    display: flex; align-items: center; gap: 10px; font-size: 0.85rem;
    padding: 8px 12px; border-radius: 8px; background: var(--surface-soft);
}
.dash-action-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dash-action-item span:nth-child(2) { flex: 1; }
.dash-action-link {
    font-size: 0.78rem; font-weight: 600; color: var(--note); text-decoration: none; white-space: nowrap;
}
.dash-action-link:hover { text-decoration: underline; }

/* KPI note */
.dash-kpi-note { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); }

/* Main 2-col grid */
.dash-main-grid { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
.dash-main-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dash-side-col { display: flex; flex-direction: column; gap: 14px; }

/* Mini tabs (inside card) */
.dash-mini-tabs { display: flex; gap: 2px; padding: 0 20px 12px; }
.dash-mini-tab {
    padding: 5px 12px; border: none; border-radius: 6px; background: transparent;
    color: var(--muted); font-size: 0.78rem; font-weight: 500; cursor: pointer;
}
.dash-mini-tab:hover { color: var(--text); }
.dash-mini-tab.active { background: var(--accent-soft); color: var(--text); }
.dash-mini-tab-count {
    font-size: 0.68rem; background: var(--surface-soft); padding: 1px 5px; border-radius: 8px; margin-left: 3px;
}

/* Side modules */
.dash-module { padding: 18px 20px; }
.dash-module-title { font-size: 0.88rem; font-weight: 600; margin: 0 0 14px; }

/* Progress bar */
.dash-progress-bar {
    height: 6px; background: var(--surface-soft); border-radius: 3px; overflow: hidden; margin-bottom: 6px;
}
.dash-progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s ease; }
.dash-progress-label { font-size: 0.78rem; color: var(--muted); margin: 0 0 12px; }

/* Checklist */
.dash-checklist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.dash-check { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.dash-check--done { color: var(--muted); }
.dash-check svg { flex-shrink: 0; }

.dash-module-link {
    font-size: 0.82rem; font-weight: 600; color: var(--note); text-decoration: none;
}
.dash-module-link:hover { text-decoration: underline; }
.dash-module-meta { font-size: 0.78rem; color: var(--muted); margin: 8px 0; }

/* Training stats */
.dash-training-stats { display: flex; gap: 24px; margin-bottom: 8px; }
.dash-training-stat { display: flex; flex-direction: column; }
.dash-training-stat strong { font-size: 1.4rem; line-height: 1.2; }
.dash-training-stat small { font-size: 0.75rem; color: var(--muted); }

/* Quick links */
.dash-quick-links { display: flex; flex-direction: column; gap: 2px; }
.dash-quick-link {
    display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px;
    font-size: 0.84rem; color: var(--text); text-decoration: none;
}
.dash-quick-link:hover { background: var(--accent-soft); }
.dash-quick-link svg { color: var(--muted); flex-shrink: 0; }

/* Contacts */
.dash-contacts { display: flex; flex-direction: column; gap: 10px; }
.dash-contact { display: flex; align-items: center; gap: 10px; }
.dash-contact-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; color: var(--muted); flex-shrink: 0;
}
.dash-contact-info strong { display: block; font-size: 0.82rem; }
.dash-contact-info small { font-size: 0.75rem; color: var(--muted); }

/* Updates compact */
.dash-updates-compact { padding: 0 20px 16px; }
.dash-update-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid var(--line); font-size: 0.84rem;
}
.dash-update-row:last-child { border-bottom: none; }
.dash-update-row span:nth-child(2) { flex: 1; }
.dash-update-row time { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.dash-update-tag {
    font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em;
    padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
.dash-update-tag--product { background: var(--success-soft); color: var(--success); }
.dash-update-tag--ops { background: var(--note-soft); color: var(--note); }
.dash-update-tag--portal { background: var(--warning-soft); color: var(--warning); }
.dash-update-tag--marketing { background: #f3e8ff; color: #7c3aed; }

/* ── Dashboard responsive ── */
@media (max-width: 1100px) {
    .dash-kpis { grid-template-columns: repeat(2, 1fr); }
    .dash-charts { grid-template-columns: 1fr; }
    .dash-tables { grid-template-columns: 1fr; }
    .dash-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .dash-kpis { grid-template-columns: 1fr; }
    .dash-welcome { flex-direction: column; align-items: flex-start; }
    .dash-header { flex-direction: column; align-items: flex-start; }
}

.home-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
}

/* Hero */
.home-hero {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 32px 0 28px;
}

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

.home-hero-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.25;
}

.home-hero-text p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 480px;
}

.home-hero-video {
    flex-shrink: 0;
    width: 340px;
}

.welcome-video {
    width: 100%;
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.welcome-video--yt,
.home-hero-video iframe.welcome-video {
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Stats */
.home-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.home-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}

.home-stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.home-stat-icon--blue { background: var(--note-soft); color: var(--note); }
.home-stat-icon--green { background: var(--success-soft); color: var(--success); }
.home-stat-icon--orange { background: var(--warning-soft); color: var(--warning); }
.home-stat-icon--purple { background: #f3e8ff; color: #7c3aed; }

.home-stat-data {
    display: flex;
    flex-direction: column;
}

.home-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-stat-label {
    font-size: 0.78rem;
    color: var(--muted);
}

/* Section */
.home-section {
    margin-bottom: 36px;
}

/* News grid */
.home-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.home-news-card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    overflow: hidden;
}

.home-news-card--featured .home-news-img img {
    height: 100%;
    min-height: 260px;
}

.home-news-card:not(.home-news-card--featured) {
    overflow: hidden;
}

.home-news-img {
    position: relative;
    overflow: hidden;
}

.home-news-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.home-news-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 4px;
}

.home-news-body {
    padding: 18px 20px;
}

.home-news-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.home-news-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 4px;
}

.home-news-category--ops { background: var(--note-soft); color: var(--note); }
.home-news-category--product { background: var(--success-soft); color: var(--success); }
.home-news-category--hr { background: #f3e8ff; color: #7c3aed; }
.home-news-category--system { background: var(--warning-soft); color: var(--warning); }

.home-news-meta time {
    font-size: 0.78rem;
    color: var(--muted);
}

.home-news-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.35;
}

.home-news-card--featured .home-news-body h3 {
    font-size: 1.2rem;
}

.home-news-body p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Recent updates */
.home-updates {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-update-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
}

.home-update-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.home-update-dot--blue { background: var(--note); }
.home-update-dot--green { background: var(--success); }
.home-update-dot--orange { background: var(--warning); }
.home-update-dot--purple { background: #7c3aed; }

.home-update-body {
    min-width: 0;
    flex: 1;
}

.home-update-body strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.home-update-body p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}

.home-update-body time {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}

/* Home responsive */
@media (max-width: 1100px) {
    .home-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .home-hero {
        flex-direction: column;
        gap: 20px;
    }
    .home-hero-video {
        width: 100%;
    }
    .home-hero-text h1 {
        font-size: 1.35rem;
    }
    .home-news-grid {
        grid-template-columns: 1fr;
    }
    .home-news-card--featured {
        grid-template-columns: 1fr;
    }
    .home-news-card--featured .home-news-img img {
        min-height: 180px;
        height: 180px;
    }
    .home-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .home-stats {
        grid-template-columns: 1fr;
    }
}

/* ── Landing page (external users) ── */

.landing-page { max-width: 1060px; margin: 0 auto; padding: 0 24px 64px; }

/* Hero */
.landing-hero { display: flex; align-items: center; gap: 40px; padding: 40px 0 32px; }
.landing-hero-content { flex: 1; min-width: 0; }
.landing-hero-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--note-soft); color: var(--note); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 16px; }
.landing-hero h1 { font-size: 2.2rem; font-weight: 700; margin: 0 0 14px; line-height: 1.2; }
.landing-subtitle { font-size: 1.05rem; color: var(--muted); line-height: 1.6; margin: 0 0 24px; max-width: 520px; }
.landing-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.landing-btn { padding: 10px 22px !important; font-size: 0.92rem !important; }
.landing-hero-img { flex-shrink: 0; width: 380px; }
.landing-hero-img img { width: 100%; border-radius: var(--radius); object-fit: cover; }

/* Sections */
.landing-section { padding: 40px 0; }
.landing-section-head { margin-bottom: 24px; }
.landing-section-head .eyebrow { margin-bottom: 6px; display: block; }
.landing-section-head h2 { font-size: 1.5rem; margin: 0 0 8px; }
.landing-section-desc { color: var(--muted); font-size: 0.95rem; margin: 0; max-width: 600px; }

/* Video wrap */
.landing-video-wrap { max-width: 720px; margin: 0 auto; }

/* Features */
.landing-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.landing-feature-card { padding: 24px; }
.landing-feature-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; margin-bottom: 14px; }
.landing-feature-card h3 { margin: 0 0 8px; font-size: 1.02rem; }
.landing-feature-card p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

/* Products */
.landing-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.landing-product { padding: 20px; text-align: center; position: relative; }
.landing-product--highlight { border: 2px solid var(--note); }
.landing-product-img { width: 100%; max-width: 140px; height: 160px; object-fit: contain; margin: 0 auto 14px; display: block; }
.landing-product-tier { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.landing-tier--economy { background: var(--surface-soft); color: var(--muted); }
.landing-tier--commercial { background: var(--warning-soft); color: var(--warning); }
.landing-tier--pro { background: var(--note-soft); color: var(--note); }
.landing-tier--premium { background: var(--success-soft); color: var(--success); }
.landing-product h3 { font-size: 1.2rem; margin: 0 0 6px; }
.landing-product p { font-size: 0.82rem; color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
.landing-product-price { font-size: 0.88rem; }
.landing-product-price strong { font-size: 1.15rem; }
.landing-product-price span { color: var(--muted); }

/* Specialty */
.landing-specialty-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.landing-specialty { display: flex; gap: 16px; padding: 16px; overflow: hidden; }
.landing-specialty-img { width: 90px; height: 110px; object-fit: contain; flex-shrink: 0; }
.landing-specialty-body { min-width: 0; }
.landing-specialty-body h3 { font-size: 1rem; margin: 0 0 4px; }
.landing-specialty-body p { font-size: 0.82rem; color: var(--muted); margin: 0 0 8px; line-height: 1.45; }

/* Pricing table */
.landing-pricing-table-wrap { overflow-x: auto; }
.landing-pricing-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.landing-pricing-table th { text-align: left; padding: 12px 16px; background: var(--surface-soft); font-weight: 600; font-size: 0.82rem; border-bottom: 2px solid var(--line); }
.landing-pricing-table th small { font-weight: 400; color: var(--muted); }
.landing-pricing-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.landing-pricing-table tbody tr:hover { background: var(--accent-soft); }
.landing-pricing-table td:first-child { font-weight: 500; }
.landing-pricing-note { font-size: 0.78rem; color: var(--muted); margin-top: 12px; }

/* Steps */
.landing-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.landing-step { text-align: center; }
.landing-step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--surface); font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.landing-step h3 { font-size: 0.95rem; margin: 0 0 6px; }
.landing-step p { font-size: 0.82rem; color: var(--muted); margin: 0; line-height: 1.5; }

/* Final CTA */
.landing-cta-final { text-align: center; padding: 56px 24px; border-top: 1px solid var(--line); margin-top: 16px; }
.landing-cta-final h2 { font-size: 1.6rem; margin: 0 0 12px; }
.landing-cta-final p { color: var(--muted); margin: 0 0 20px; }
.landing-cta-actions { margin-bottom: 16px; }
.landing-cta-contact { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* Landing responsive */
@media (max-width: 900px) {
    .landing-hero { flex-direction: column; text-align: center; }
    .landing-hero-img { width: 100%; max-width: 360px; }
    .landing-subtitle { margin-left: auto; margin-right: auto; }
    .landing-hero-actions { justify-content: center; }
    .landing-products { grid-template-columns: repeat(2, 1fr); }
    .landing-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .landing-hero h1 { font-size: 1.5rem; }
    .landing-features { grid-template-columns: 1fr; }
    .landing-products { grid-template-columns: 1fr 1fr; }
    .landing-specialty-grid { grid-template-columns: 1fr; }
    .landing-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .landing-products { grid-template-columns: 1fr; }
    .landing-steps { grid-template-columns: 1fr; }
}

.landing-proof-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 24px; }
.landing-proof-item { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.landing-proof-item strong { display: block; font-size: 1.45rem; margin-bottom: 4px; }
.landing-proof-item span { color: var(--muted); font-size: 0.86rem; }
.landing-editorial { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: center; }
.landing-editorial-copy h2 { font-size: 2rem; line-height: 1.08; margin: 0 0 14px; max-width: 14ch; }
.landing-editorial-copy p { color: var(--muted); line-height: 1.7; margin: 0 0 14px; }
.landing-editorial-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 24px; box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14); }
.landing-mosaic { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.landing-mosaic-card { position: relative; min-height: 250px; overflow: hidden; border-radius: 22px; }
.landing-mosaic-card--tall { grid-row: span 2; min-height: 520px; }
.landing-mosaic-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.landing-mosaic-card figcaption { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 12px 14px; border-radius: 14px; color: #fff; background: linear-gradient(180deg, rgba(15,23,42,0.12), rgba(15,23,42,0.78)); }
.landing-company-story { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 28px; }
.landing-storyline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-story-step { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.landing-story-step span { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: 999px; background: #111827; color: #fff; font-size: 0.8rem; font-weight: 700; }
.landing-story-step h3 { margin: 0 0 8px; font-size: 1rem; }
.landing-story-step p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.landing-ops-band { color: #f8fafc; border-radius: var(--radius); background: var(--accent); }
.landing-ops-intro h2 { margin: 8px 0 0; font-size: 1.8rem; max-width: 14ch; }
.landing-ops-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 26px; }
.landing-ops-grid div { padding: 18px; border-radius: 18px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.09); }
.landing-ops-grid strong { display: block; margin-bottom: 8px; font-size: 0.98rem; }
.landing-ops-grid p { margin: 0; color: rgba(241,245,249,0.78); font-size: 0.88rem; line-height: 1.55; }
.landing-video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.landing-video-card { padding: 12px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.landing-video-card iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; display: block; }
.landing-video-card p { margin: 12px 4px 2px; color: var(--muted); font-size: 0.88rem; }
.landing-case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-case-card { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.landing-case-card:nth-child(2) { background: var(--surface); }
.landing-case-card:nth-child(3) { background: var(--surface); }
.landing-case-card h3 { margin: 0 0 10px; font-size: 1.08rem; }
.landing-case-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.landing-compare-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.landing-compare-card { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.landing-compare-card--accent { background: var(--accent); color: #fff; border-color: transparent; }
.landing-compare-card h3 { margin: 0 0 16px; font-size: 1.15rem; }
.landing-compare-card ul { margin: 0; padding-left: 18px; }
.landing-compare-card li { margin-bottom: 10px; color: var(--muted); }
.landing-compare-card--accent li { color: rgba(255,255,255,0.82); }
.landing-ribbon { display: grid; gap: 14px; }
.landing-ribbon-card { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.landing-ribbon-card img { width: 100%; height: 140px; object-fit: cover; border-radius: 16px; }
.landing-ribbon-card strong { display: block; margin-bottom: 6px; font-size: 1rem; }
.landing-ribbon-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.landing-quote-wall { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.landing-quote-card { padding: 26px; border-radius: var(--radius); background: var(--surface-soft); border: 1px solid var(--line); }
.landing-quote-card--dark { background: var(--accent); color: #fff; border-color: transparent; }
.landing-quote-card p { margin: 0 0 12px; font-size: 1.12rem; line-height: 1.55; }
.landing-quote-card span { color: var(--muted); font-size: 0.85rem; }
.landing-quote-card--dark span { color: rgba(255,255,255,0.68); }
.landing-faq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-faq-card { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.landing-faq-card h3 { margin: 0 0 10px; font-size: 1rem; }
.landing-faq-card p { margin: 0; color: var(--muted); line-height: 1.6; }

@media (max-width: 900px) {
    .landing-proof-strip,
    .landing-storyline,
    .landing-ops-grid,
    .landing-case-grid,
    .landing-faq-grid { grid-template-columns: repeat(2, 1fr); }
    .landing-editorial,
    .landing-compare-grid,
    .landing-quote-wall,
    .landing-video-grid { grid-template-columns: 1fr; }
    .landing-ribbon-card { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .landing-proof-strip,
    .landing-storyline,
    .landing-case-grid,
    .landing-faq-grid,
    .landing-ops-grid,
    .landing-mosaic { grid-template-columns: 1fr; }
    .landing-mosaic-card--tall { grid-row: auto; min-height: 320px; }
    .landing-editorial-copy h2,
    .landing-ops-intro h2 { max-width: none; font-size: 1.45rem; }
}

@media (max-width: 480px) {
    .landing-proof-strip { grid-template-columns: 1fr 1fr; }
}

.landing-segments { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.landing-segments .card h3 { margin: 0 0 6px; font-size: 0.95rem; }
.landing-segments .card p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }

/* ══════════════════════════════════════════════════
   HP — Internal Home Page (dashboard-inspired)
   ══════════════════════════════════════════════════ */

.hp { max-width: 1100px; margin: 0 auto; padding: 0 24px 60px; position: relative; }
.hp::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.05;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='400' fill='none'%3E%3Cpath d='M-40 200c200-80 400 60 600 0s400-120 600-40 400 80 600 20' stroke='%23334155' stroke-width='1.5'/%3E%3Cpath d='M-40 280c200-50 400 70 600 20s400-90 600-10 400 50 600-10' stroke='%23334155' stroke-width='1'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='400' fill='none'%3E%3Cpath d='M-40 180c300-60 500 50 700 10s300-80 500-20 400 60 600 10' stroke='%23334155' stroke-width='1.2'/%3E%3Cpath d='M-40 260c250-40 450 60 650 0s350-70 550-10 350 40 550 0' stroke='%23334155' stroke-width='0.75'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='400' fill='none'%3E%3Cpath d='M-40 220c350-70 550 40 750-10s250-60 450 0 400 50 550 10' stroke='%23334155' stroke-width='1'/%3E%3C/svg%3E"),
        radial-gradient(circle 300px at 15% 35%, rgba(51,65,85,0.04), transparent),
        radial-gradient(circle 250px at 85% 70%, rgba(51,65,85,0.03), transparent);
    background-repeat: no-repeat;
    background-position:
        center 0px,
        center 1200px,
        center 2800px,
        center center,
        center center;
    background-size:
        140% 400px,
        140% 400px,
        140% 400px,
        100% 100%,
        100% 100%;
}
.hp > * { position: relative; z-index: 1; }

/* Hero */
.hp-hero { padding: 32px 0 24px; }
.hp-hero__badge { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--note-soft); color: var(--note); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 14px; }
.hp-hero__title { font-size: 1.8rem; font-weight: 700; margin: 0 0 10px; line-height: 1.2; }
.hp-hero__subtitle { font-size: 0.95rem; color: var(--muted); line-height: 1.6; margin: 0 0 20px; max-width: 640px; }
.hp-hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* KPIs */
.hp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.hp-kpi { text-align: center; padding: 20px 16px; }
.hp-kpi strong { display: block; font-size: 1.45rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.hp-kpi span { display: block; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }

/* Sections */
.hp-section { padding: 36px 0; }
.hp-section__head { margin-bottom: 20px; }
.hp-section__eyebrow { display: block; margin-bottom: 6px; }
.hp-section__title { font-size: 1.35rem; margin: 0 0 8px; font-weight: 700; }
.hp-section__desc { color: var(--muted); font-size: 0.92rem; margin: 0; max-width: 600px; line-height: 1.5; }

/* Grids */
.hp-grid--2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.hp-grid--3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hp-grid--4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Editorial */
.hp-editorial { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: center; }
.hp-editorial__copy h2 { font-size: 1.5rem; line-height: 1.15; margin: 0 0 14px; }
.hp-editorial__copy p { color: var(--muted); line-height: 1.7; margin: 0 0 14px; font-size: 0.92rem; }
.hp-editorial__media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Products */
.hp-product { padding: 20px; text-align: center; position: relative; }
.hp-product--highlight { border: 2px solid var(--note); }
.hp-product__img { width: 100%; max-width: 130px; height: 150px; object-fit: contain; margin: 0 auto 12px; display: block; }
.hp-product__tier { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.hp-tier--economy { background: var(--surface-soft); color: var(--muted); }
.hp-tier--commercial { background: var(--warning-soft); color: var(--warning); }
.hp-tier--pro { background: var(--note-soft); color: var(--note); }
.hp-tier--premium { background: var(--success-soft); color: var(--success); }
.hp-product h3 { font-size: 1.1rem; margin: 0 0 6px; }
.hp-product p { font-size: 0.82rem; color: var(--muted); margin: 0 0 10px; line-height: 1.45; }
.hp-product__price { font-size: 0.88rem; }
.hp-product__price strong { font-size: 1.1rem; }
.hp-product__price span { color: var(--muted); }

/* Specialty */
.hp-specialty { display: flex; gap: 16px; padding: 16px; overflow: hidden; }
.hp-specialty__img { width: 85px; height: 105px; object-fit: contain; flex-shrink: 0; }
.hp-specialty__body h3 { font-size: 0.95rem; margin: 0 0 4px; }
.hp-specialty__body p { font-size: 0.82rem; color: var(--muted); margin: 0 0 6px; line-height: 1.45; }

/* Features */
.hp-feature { padding: 22px; }
.hp-feature__icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; margin-bottom: 12px; }
.hp-feature h3 { margin: 0 0 8px; font-size: 0.98rem; }
.hp-feature p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }

/* Table */
.hp-table-wrap { overflow-x: auto; }
.hp-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.hp-table th { text-align: left; padding: 12px 16px; background: var(--surface-soft); font-weight: 600; font-size: 0.82rem; border-bottom: 2px solid var(--line); }
.hp-table th small { font-weight: 400; color: var(--muted); }
.hp-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.hp-table tbody tr:hover { background: var(--accent-soft); }
.hp-table td:first-child { font-weight: 500; }
.hp-table-note { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }

/* Dark band */
.hp-dark-band { background: var(--accent); color: #f8fafc; border-radius: var(--radius); padding: 36px 28px; margin: 36px 0; }
.hp-dark-band__head .hp-section__eyebrow { color: rgba(255,255,255,0.5); }
.hp-dark-band__head h2 { color: #fff; margin: 8px 0 0; font-size: 1.35rem; }
.hp-dark-band__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.hp-dark-band__grid > div { padding: 18px; border-radius: var(--radius); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.09); }
.hp-dark-band__grid strong { display: block; margin-bottom: 8px; font-size: 0.95rem; }
.hp-dark-band__grid p { margin: 0; color: rgba(241,245,249,0.78); font-size: 0.86rem; line-height: 1.55; }

/* Video cards */
.hp-video-card iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius); display: block; }
.hp-video-card p { margin: 12px 4px 2px; color: var(--muted); font-size: 0.86rem; }

/* Ribbon */
.hp-ribbon { display: grid; gap: 14px; }
.hp-ribbon__card { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; padding: 14px; }
.hp-ribbon__card img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius); }
.hp-ribbon__card strong { display: block; margin-bottom: 6px; font-size: 0.95rem; }
.hp-ribbon__card p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.6; }

/* Segments */
.hp-segments { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.hp-segment h3 { margin: 0 0 6px; font-size: 0.95rem; }
.hp-segment p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }

/* Compare accent */
.hp-compare--accent { background: var(--accent); color: #fff; border-color: transparent; }
.hp-compare--accent li { color: rgba(255,255,255,0.82); }

/* Quotes */
.hp-quote { padding: 24px; }
.hp-quote p { margin: 0 0 10px; font-size: 1.05rem; line-height: 1.55; font-style: italic; }
.hp-quote span { color: var(--muted); font-size: 0.82rem; }
.hp-quote--dark { background: var(--accent); color: #fff; border-color: transparent; }
.hp-quote--dark span { color: rgba(255,255,255,0.6); }

/* FAQ */
.hp-faq h3 { margin: 0 0 8px; font-size: 0.95rem; }
.hp-faq p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.55; }

/* CTA */
.hp-cta { text-align: center; padding: 48px 24px; border-top: 1px solid var(--line); margin-top: 12px; }
.hp-cta h2 { font-size: 1.4rem; margin: 0 0 10px; }
.hp-cta p { color: var(--muted); margin: 0 0 18px; }
.hp-cta__actions { margin-bottom: 14px; }
.hp-cta__contact { font-size: 0.86rem; color: var(--muted); margin: 0; }

/* HP Responsive */
@media (max-width: 900px) {
    .hp-kpis { grid-template-columns: repeat(2, 1fr); }
    .hp-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .hp-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .hp-editorial { grid-template-columns: 1fr; }
    .hp-dark-band__grid { grid-template-columns: repeat(2, 1fr); }
    .hp-ribbon__card { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .hp-kpis { grid-template-columns: 1fr 1fr; }
    .hp-grid--4,
    .hp-grid--3,
    .hp-grid--2,
    .hp-dark-band__grid { grid-template-columns: 1fr; }
    .hp-hero__title { font-size: 1.4rem; }
}

.brand-icon {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
}

.brand strong {
    display: block;
    font-size: 1.08rem;
    font-weight: 700;
}

.brand small,
.user-chip small,
.eyebrow,
.tree-link,
.breadcrumbs a,
.helper-text,
.notice,
.paragraph-meta,
.doc-index-row small,
.child-card span,
.meta-list dt {
    color: var(--muted);
}

.global-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--line);
}

.nav-link.active {
    color: white;
    background: var(--accent);
    border-color: var(--accent);
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-search-icon {
    position: absolute;
    left: 11px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.18s ease;
}

.topbar-search:focus-within .topbar-search-icon {
    color: var(--accent);
}

.topbar-search-input {
    width: 220px;
    padding: 8px 12px 8px 34px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.18s ease, width 0.25s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.topbar-search-input::placeholder {
    color: #94a3b8;
}

.topbar-search-input:focus {
    border-color: var(--accent);
    background: #fff;
    width: 300px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-chip {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
}

.card,
.sidebar,
.auth-copy,
.auth-form,
.result-item,
.child-card,
.inline-edit-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card,
.sidebar,
.auth-copy,
.auth-form {
    padding: 18px;
}

.slim-card {
    padding: 12px 14px;
}

.documentation-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.documentation-shell--article {
    grid-template-columns: 320px minmax(0, 1fr);
}

.document-main,
.admin-shell,
.stacked-sections,
.result-list,
.doc-index-list,
.user-list,
.search-form,
.checkbox-grid,
.checkbox-list,
.translation-grid,
.inline-grid,
.stacked-form,
.paragraph-stack,
.media-grid,
.feature-list,
.auth-panel,
.library-list,
.context-card {
    display: grid;
    gap: 16px;
}

.sidebar {
    position: sticky;
    top: 90px;
}

.document-main {
    max-width: 1280px;
}

.sidebar-search {
    margin-bottom: 4px;
}

.documentation-shell .sidebar,
.documentation-shell--article .sidebar {
    padding: 20px 22px;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
}
.sidebar-label {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100px;
    transition: max-width 0.25s ease, opacity 0.2s ease;
    opacity: 1;
}
.sidebar-label.is-hidden {
    max-width: 0;
    opacity: 0;
}
.sidebar-search-inline {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.sidebar-search-inline input {
    width: 0;
    padding: 0;
    border: none;
    background: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text);
    transition: width 0.2s ease, padding 0.2s ease;
}
.sidebar-search-inline input::placeholder {
    color: var(--muted);
}
.sidebar-search-inline.is-open input {
    width: 100%;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
}
.sidebar-search-toggle {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.sidebar-search-toggle:hover {
    color: var(--text);
    background: var(--surface-soft);
}
.sidebar-search-toggle svg,
.sidebar-search-toggle i {
    width: 18px;
    height: 18px;
}

.sidebar-search--collapsed {
    display: none;
}
.sidebar-search--open {
    display: block;
    margin-bottom: 10px;
}

.sidebar-head,
.section-head,
.section-head.compact,
.document-header,
.result-topline,
.paragraph-meta,
.inline-actions,
.admin-nav,
.mode-switch,
.topline-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.section-head h1,
.section-head h2,
.sidebar-head h2,
.document-header h1,
.card h1,
.card h2,
.card h3,
.auth-panel h1 {
    margin: 0;
}

.eyebrow {
    display: inline-block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-list li + li {
    margin-top: 4px;
}

.tree-list .tree-list {
    margin-top: 6px;
    margin-left: 12px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
}

.tree-link {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    line-height: 1.35;
}

.tree-title {
    color: var(--text);
}

.tree-link:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.tree-link.active {
    background: var(--accent);
    color: white;
}

.tree-link.active .tree-title {
    color: white;
}

/* ===== Sidebar tree (inline expand/collapse) ===== */

.sidebar-tree-group {
    position: relative;
}
.sidebar-tree-toggle .sidebar-tree-chevron {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.35;
}
.sidebar-tree-toggle:hover .sidebar-tree-chevron {
    opacity: 0.6;
}
.sidebar-tree-toggle.open .sidebar-tree-chevron {
    transform: rotate(90deg);
    opacity: 0.5;
}
.sidebar-tree-children {
    list-style: none;
    margin: 0;
    padding: 2px 0 4px 14px;
    display: none;
    border-left: 1.5px solid rgba(0, 0, 0, 0.08);
    margin-left: 22px;
}
.sidebar-tree-children.open {
    display: block;
    animation: sidebarSlideIn 0.15s ease;
}
@keyframes sidebarSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.sidebar-tree-child-link {
    display: block;
    padding: 7px 11px;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #64748b;
    transition: all 0.15s ease;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.sidebar-tree-child-link:hover {
    background: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
}
.sidebar-tree-child-link.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ===== Home internal page ===== */
.home-internal { max-width: 1100px; margin: 0 auto; padding: 0 24px 60px; }
.hi-hero { display: flex; align-items: center; gap: 40px; padding: 40px 0 48px; }
.hi-hero-content { flex: 1; }
.hi-hero-visual { flex: 0 0 44%; }
.hi-hero-img { width: 100%; border-radius: 16px; object-fit: cover; aspect-ratio: 3/2; box-shadow: 0 8px 32px rgba(0,0,0,0.10); }
.hi-hero-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--accent-soft); color: var(--text); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 16px; }
.hi-hero-title { font-size: 2.4rem; font-weight: 700; line-height: 1.15; margin: 0 0 16px; color: var(--text); }
.hi-hero-title strong { color: var(--accent, #1a1a1a); }
.hi-hero-sub { font-size: 1.05rem; color: var(--muted); line-height: 1.6; margin: 0 0 24px; max-width: 520px; }
.hi-hero-actions { display: flex; gap: 10px; }
.hi-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; text-decoration: none; transition: all 0.15s; }
.hi-btn--primary { background: var(--text); color: var(--surface); }
.hi-btn--primary:hover { opacity: 0.85; text-decoration: none; color: var(--surface); }
.hi-btn--secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.hi-btn--secondary:hover { background: var(--surface-muted); text-decoration: none; }
.hi-btn--lg { padding: 14px 32px; font-size: 1rem; }
.hi-section { padding: 48px 0; }
.hi-section--alt { background: var(--surface-muted); margin: 0 -24px; padding: 48px 24px; border-radius: 16px; }
.hi-section-head { text-align: center; margin-bottom: 36px; }
.hi-section-label { display: inline-block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.hi-section-title { font-size: 1.8rem; font-weight: 700; color: var(--text); margin: 0; }
.hi-two-col { display: flex; gap: 40px; align-items: center; }
.hi-two-col--reverse { flex-direction: row-reverse; }
.hi-text-block { flex: 1; }
.hi-text-block p { font-size: 0.95rem; line-height: 1.7; color: var(--text); margin: 0 0 14px; }
.hi-video-block { flex: 0 0 48%; }
.hi-video-block iframe { width: 100%; aspect-ratio: 16/9; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.hi-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hi-feature { padding: 24px; text-align: center; }
.hi-feature-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; background: var(--accent-soft); color: var(--text); }
.hi-feature h3 { font-size: 0.95rem; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.hi-feature p { font-size: 0.84rem; color: var(--muted); line-height: 1.55; margin: 0; }
.hi-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.hi-step { text-align: center; }
.hi-step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--text); color: var(--surface); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 0.9rem; font-weight: 700; }
.hi-step h3 { font-size: 0.92rem; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.hi-step p { font-size: 0.84rem; color: var(--muted); line-height: 1.55; margin: 0; }
.hi-checklist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.hi-check-item { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text); }
.hi-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hi-gallery-item { position: relative; border-radius: 12px; overflow: hidden; }
.hi-gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.hi-gallery-item span { position: absolute; bottom: 0; left: 0; right: 0; padding: 10px 14px; background: linear-gradient(transparent, rgba(0,0,0,0.6)); color: white; font-size: 0.85rem; font-weight: 600; }
.hi-cta { text-align: center; padding: 56px 0 20px; }
.hi-cta h2 { font-size: 1.6rem; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.hi-cta p { font-size: 0.95rem; color: var(--muted); margin: 0 0 24px; }
@media (max-width: 768px) {
    .hi-hero { flex-direction: column; gap: 24px; padding: 24px 0; }
    .hi-hero-visual { flex: auto; width: 100%; }
    .hi-hero-title { font-size: 1.8rem; }
    .hi-two-col, .hi-two-col--reverse { flex-direction: column; }
    .hi-video-block { flex: auto; width: 100%; }
    .hi-features, .hi-steps, .hi-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Nav tree (docs sidebar, inline expand/collapse) ===== */

.nav-tree {
    position: relative;
}
.nav-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-tree-list li + li {
    margin-top: 1px;
}

.nav-tree-row {
    display: flex;
    align-items: center;
}

.nav-tree-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.12s;
}
.nav-tree-toggle:hover {
    background: var(--surface-muted);
}
.nav-tree-toggle--sub {
    font-weight: 400;
    font-size: 0.9rem;
    padding: 8px 12px;
}

.nav-tree-icon {
    width: 20px;
    height: 20px;
    color: var(--muted);
    flex-shrink: 0;
}

.nav-tree-label {
    flex: 1;
    min-width: 0;
}

.nav-tree-chevron {
    flex-shrink: 0;
    color: var(--muted);
    opacity: 0.5;
    transition: transform 0.2s ease;
}
.nav-tree-toggle.open .nav-tree-chevron {
    transform: rotate(90deg);
}

.nav-tree-children {
    list-style: none;
    margin: 0;
    padding: 0 0 0 18px;
    display: none;
    border-left: 1px solid var(--line);
    margin-left: 20px;
}
.nav-tree-children[data-tree-open],
.nav-tree-children.open {
    display: block;
}
.nav-tree-children[data-tree-open] ~ .nav-tree-row .nav-tree-toggle .nav-tree-chevron,
.nav-tree-children.open ~ .nav-tree-row .nav-tree-toggle .nav-tree-chevron {
    transform: rotate(90deg);
}

.nav-tree-children--deep {
    margin-left: 8px;
    padding-left: 12px;
}

.nav-tree-link {
    display: block;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.12s;
}
.nav-tree-link:hover {
    background: var(--surface-muted);
    text-decoration: none;
}
.nav-tree-link.active {
    background: var(--accent);
    color: white;
}
.nav-tree-link--overview {
    font-size: 0.84rem;
    color: var(--muted);
    font-weight: 500;
}
.nav-tree-link--overview.active {
    color: white;
}
.nav-tree-link--leaf {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.12s;
}
.nav-tree-link--leaf:hover {
    background: var(--surface-muted);
    text-decoration: none;
}
.nav-tree-link--leaf.active {
    background: var(--accent);
    color: white;
}
.nav-tree-link--nested {
    font-size: 0.84rem;
    color: var(--muted);
    padding: 5px 12px;
}
.nav-tree-link--nested:hover {
    color: var(--text);
}
.nav-tree-link--nested.active {
    color: white;
}

.document-card {
    padding: 32px;
}

.document-header {
    align-items: flex-start;
}

.document-header h1 {
    font-size: 2.15rem;
    line-height: 1.08;
}

.document-subtitle {
    margin: 10px 0 0;
    max-width: 74ch;
    font-size: 1.02rem;
    line-height: 1.65;
    color: #374151;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2px;
}

.breadcrumbs a {
    text-decoration: none;
    font-size: 0.92rem;
}

.breadcrumbs a:not(:last-child)::after {
    content: "›";
    margin-left: 6px;
    color: var(--muted);
    font-weight: 400;
}

.breadcrumbs a:hover {
    color: var(--text);
}

.search-panel h1 {
    font-size: 1.55rem;
}

.search-input-wrap {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
}

.search-input-wrap i {
    color: var(--muted);
}

.search-input-wrap input,
input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    height: 40px;
}

textarea {
    height: auto;
}

.search-input-wrap input {
    border: 0;
    padding: 0;
    background: transparent;
}

.search-input-wrap input:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.05);
}

/* 1. Field labels — wrapping input/select/textarea */
label.field-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label.field-label > span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

/* 2. Checkbox labels — inline row */
label.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

/* 3. Permission tree labels — handled by .perm-node-label */

/* Legacy: bare label fallback for templates not yet migrated */
label:not(.field-label):not(.checkbox-row):not(.perm-node-label):not(.perm-child-label) {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

legend {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

fieldset {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    min-width: 0;
}

legend {
    padding: 0 6px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.primary-button,
.ghost-button,
.mode-pill,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
}

.primary-button {
    background: var(--accent);
    color: white;
}

.primary-button:hover {
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.12);
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.secondary-button:hover {
    background: var(--accent-soft);
    border-color: var(--line-strong);
}

.ghost-button,
.mode-pill {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
}

.ghost-button:hover,
.mode-pill:hover {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.mode-pill.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.danger-button {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fecdca;
}

.compact-switch {
    justify-content: flex-start;
}

.notice {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.notice.success {
    background: var(--success-soft);
    border-color: #abefc6;
    color: var(--success);
}

.notice.error {
    background: var(--danger-soft);
    border-color: #fecdca;
    color: var(--danger);
}

.result-item h3,
.child-card strong {
    margin: 0;
    font-size: 1.05rem;
}

.result-item h3 a,
.child-card {
    text-decoration: none;
}

.result-item p,
.child-card span,
.empty-state p,
.card p,
.auth-copy p {
    margin: 0;
    line-height: 1.65;
}

.library-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.library-item {
    min-height: 158px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    font-size: 0.82rem;
    color: #374151;
}

.paragraph-stack {
    gap: 0;
}

.paragraph-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 24px;
    padding: 24px 0;
}

.paragraph-stack > .paragraph-row + .paragraph-row {
    border-top: 1px solid var(--line);
}

.paragraph-main {
    min-width: 0;
    padding-block: 12px;
}

.paragraph-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1f2937;
}

.paragraph-content p {
    margin: 0;
}

.paragraph-content p + p,
.paragraph-content .content-list + p,
.paragraph-content p + .content-list,
.paragraph-content .content-list + .content-list {
    margin-top: 16px;
}

.content-list {
    margin: 0;
    padding-left: 22px;
    display: grid;
    gap: 10px;
}

.content-list--ordered {
    padding-left: 26px;
}

.content-list--checklist {
    list-style: square;
}

.paragraph-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.paragraph-row.note .paragraph-main {
    padding-left: 16px;
    border-left: 3px solid #93c5fd;
    background: linear-gradient(to right, var(--note-soft), transparent 55%);
}

.paragraph-row.warning .paragraph-main {
    padding-left: 16px;
    border-left: 3px solid #fdba74;
    background: linear-gradient(to right, var(--warning-soft), transparent 55%);
}

.paragraph-row.checklist .paragraph-main,
.paragraph-row.steps .paragraph-main {
    padding-left: 16px;
    border-left: 3px solid #6ee7b7;
    background: linear-gradient(to right, var(--check-soft), transparent 55%);
}

.tag-drawer {
    display: grid;
    justify-items: end;
}

.tag-toggle {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.tag-toggle::-webkit-details-marker {
    display: none;
}

.tag-toggle:hover,
.tag-drawer[open] .tag-toggle {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--accent-soft);
}

.tag-toggle svg {
    width: 16px;
    height: 16px;
}

.tag-side-form {
    display: grid;
    gap: 10px;
    width: min(250px, 100%);
    margin-top: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
}

.tag-side-form .ghost-button {
    justify-self: start;
}

.paragraph-side {
    align-self: start;
}

.paragraph-side .tag-side-form input {
    width: 100%;
}

.meta-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.meta-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.meta-list dd {
    margin: 0;
    font-weight: 600;
    color: #374151;
}

.context-block {
    display: grid;
    gap: 12px;
}

.media-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.media-grid--nested {
    margin-top: 16px;
}

.media-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.media-card img,
.media-card iframe,
.media-card video {
    display: block;
    width: 100%;
    border: 0;
}

.media-card iframe,
.media-card video {
    aspect-ratio: 16 / 9;
}

.media-card img {
    width: auto;
    max-width: min(100%, var(--media-width, 100%));
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
}

.media-card--image img {
    margin: 0;
}

.media-card strong {
    display: block;
    padding: 10px 12px;
}

.children-panel {
    display: grid;
    gap: 14px;
}

.child-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.child-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    color: var(--text);
}

.child-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.empty-state {
    padding: 24px;
}

.empty-state--article {
    padding: 16px 0 4px;
}

/* ── Login split layout ── */

.page-shell:has(.login-split) {
    max-width: none;
    padding: 0;
}

.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.login-left {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.login-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.login-left-content {
    padding: 48px;
    z-index: 1;
}

.login-left-content h1 {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.login-right {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.login-right-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 56px;
    max-width: 550px;
    margin: 0 auto;
    width: 100%;
}

.login-right-top {
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex: 1;
    justify-content: center;
    padding-bottom: 10%;
}

.login-logo {
    height: 73px;
    object-fit: contain;
    align-self: center;
}

.login-welcome {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-welcome h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.login-welcome p {
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.login-form-area {
    display: grid;
    gap: 16px;
}

.login-form-area .auth-form {
    display: grid;
    gap: 20px;
    padding: 0;
    border: none;
    box-shadow: none;
    background: none;
}

.login-form-area .auth-form label {
    gap: 6px;
}

.login-form-area .auth-form input {
    padding: 12px 14px;
    font-size: 1rem;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--text);
}

.password-toggle .eye-closed {
    display: none;
}

.password-wrap.visible .password-toggle .eye-open {
    display: none;
}

.password-wrap.visible .password-toggle .eye-closed {
    display: block;
}

.login-form-area .auth-submit {
    margin-top: 8px;
    padding: 12px 16px;
    font-size: 1rem;
}

.login-support-hint {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.login-support-hint a {
    color: var(--accent);
    text-decoration: none;
}

.login-support-hint a:hover {
    text-decoration: underline;
}

.login-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
}

.login-footer-links {
    display: flex;
    gap: 12px;
}

.login-footer-links a {
    color: var(--muted);
    text-decoration: none;
}

.login-footer-links a:hover {
    color: var(--text);
}

.login-lang-list {
    list-style: none;
    margin: 0;
    padding: 2px;
    display: flex;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.login-lang-list a {
    color: var(--muted);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.78rem;
}

.login-lang-list a.active {
    background: var(--accent);
    color: #fff;
}

.login-lang-list a:hover:not(.active) {
    color: var(--text);
}

.login-social {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.login-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--muted);
    border: 1px solid var(--line);
    text-decoration: none;
}

.login-social-icon:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

/* ── Static pages (privacy, policy) ── */

.static-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px;
}

.static-page h1 {
    font-size: 1.8rem;
    margin: 0 0 24px;
}

.static-page h2 {
    font-size: 1.2rem;
    margin: 24px 0 8px;
}

.static-page p,
.static-page ul {
    color: var(--muted);
    line-height: 1.6;
}

.static-page a {
    color: var(--accent);
}

@media (max-width: 1120px) {
    .login-split {
        grid-template-columns: 1fr;
    }

    .login-left {
        min-height: 220px;
    }

    .login-media {
        position: absolute;
    }

    .login-left-content {
        padding: 32px 24px;
    }

    .login-left-content h1 {
        font-size: 1.6rem;
    }

    .login-right {
        min-height: auto;
    }

    .login-right-inner {
        padding: 0 24px;
    }

    .login-right-top {
        padding-top: 32px;
        padding-bottom: 32px;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .login-left {
        display: none;
    }

    .login-right-inner {
        padding: 0 20px;
    }

    .login-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .login-footer .login-copyright,
    .login-footer .login-footer-links,
    .login-footer .login-lang-list {
        order: 1;
    }

    .login-footer .login-social {
        order: 2;
        width: 100%;
        margin-left: 0;
        padding-top: 6px;
    }
}

/* ── Legacy auth shell (kept for compatibility) ── */

.auth-shell {
    min-height: calc(100vh - 88px);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.auth-panel {
    width: min(980px, 100%);
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
    position: relative;
    z-index: 1;
}

.auth-panel--minimal {
    width: min(880px, 100%);
    grid-template-columns: minmax(260px, 360px) minmax(320px, 420px);
    align-items: center;
    gap: 24px;
}

.auth-copy--minimal,
.auth-card-stack {
    backdrop-filter: blur(10px);
}

.auth-copy--minimal {
    padding: 28px;
    background: rgba(255, 255, 255, 0.82);
}

.auth-card-stack {
    display: grid;
    gap: 16px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.92);
}

.auth-copy-actions,
.auth-mode-switch,
.auth-step-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-copy-actions {
    margin-top: 18px;
}

.auth-step-meta {
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.94rem;
}

.auth-submit {
    width: 100%;
    justify-content: center;
}

.auth-inline-link {
    color: var(--muted);
    text-decoration: none;
}

.auth-inline-link:hover {
    color: var(--text);
}

.auth-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.75), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(229, 231, 235, 0.55), transparent 24%),
        linear-gradient(180deg, rgba(250, 250, 249, 0.72), rgba(240, 241, 236, 0.4));
}

.auth-bubbles span {
    position: absolute;
    left: var(--left);
    top: var(--top);
    width: var(--size);
    height: var(--size);
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(209, 213, 219, 0.78));
    box-shadow: 0 0 0 1px rgba(156, 163, 175, 0.18);
    opacity: 0.55;
    animation: authBubblePulse 4.8s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes authBubblePulse {
    0%, 100% {
        transform: scale(0.92);
        opacity: 0.34;
    }
    50% {
        transform: scale(1.28);
        opacity: 0.72;
    }
}

.feature-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.feature-list li {
    display: flex;
    gap: 10px;
    align-items: center;
}

.feature-list i {
    color: var(--muted);
}

.admin-shell {
    display: grid;
    gap: 20px;
}

.admin-nav {
    justify-content: flex-start;
}

.grid.two-col,
.admin-grid,
.editor-grid,
.translation-grid,
.inline-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.table-card,
.stacked-form,
.inline-edit-card,
.checkbox-list,
.doc-index-list,
.user-list {
    display: grid;
    gap: 14px;
}

/* Permission tree */
.perm-tree-fieldset {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
}
.perm-tree-fieldset legend {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0 6px;
}
.perm-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.perm-node {
    position: relative;
}
.perm-node-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.1s;
}
.perm-node-label:hover {
    background: var(--surface-soft);
}
.perm-node-label input[type="checkbox"] {
    accent-color: var(--accent);
}
.perm-children {
    margin-left: 24px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.perm-children .perm-node-label {
    font-size: 0.84rem;
    padding: 4px 8px;
    color: var(--muted);
}
.perm-children .perm-children .perm-node-label {
    font-size: 0.8rem;
    padding: 3px 8px;
}

/* Profile form */
.profile-form-card {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.profile-code-display {
    margin-top: 6px;
}

.profile-permissions-fieldset {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 0;
}

.profile-permissions-fieldset legend {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0 6px;
}

.profile-permissions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Permission tree checkboxes — not full width */
.perm-node-label input[type="checkbox"],
.perm-child-label input[type="checkbox"],
.profile-permissions-grid input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.perm-parent-node {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.perm-parent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 8px;
}

.perm-parent-row .perm-node-label {
    flex: 1;
}

.perm-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.perm-expand-btn:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.perm-chevron {
    transition: transform 0.15s ease;
}

.perm-expand-btn.open .perm-chevron {
    transform: rotate(180deg);
}

.perm-counter {
    font-variant-numeric: tabular-nums;
}

.perm-children-collapsible {
    border-top: 1px solid var(--line);
    padding: 6px 8px 6px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface-muted);
}

.perm-subtree {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

.perm-child-label {
    font-size: 0.84rem;
    color: var(--muted);
}

.perm-child-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 4px;
}

.perm-child-row .perm-child-label {
    flex: 1;
}

.perm-child-expand {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.perm-child-expand:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.perm-child-expand .perm-chevron {
    width: 14px;
    height: 14px;
}

.perm-child-expand.open .perm-chevron {
    transform: rotate(180deg);
}

.checkbox-row input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.doc-index-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 100px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
}

.doc-index-row:hover {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.inline-edit-card {
    padding: 14px;
}

.compact-empty {
    padding: 12px 0 0;
}

@media (max-width: 1360px) {
    .documentation-shell--article {
        grid-template-columns: 260px minmax(0, 1fr);
    }
}

@media (max-width: 1120px) {
    .documentation-shell,
    .documentation-shell--article,
    .auth-panel,
    .auth-panel--minimal,
    .grid.two-col,
    .admin-grid,
    .editor-grid,
    .translation-grid,
    .inline-grid,
    .inline-grid.two-up,
    .paragraph-row {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .paragraph-side {
        order: -1;
    }
}

@media (max-width: 760px) {
    .page-shell {
        padding: 0 16px;
    }

    .topbar {
        position: static;
    }
    .topbar-inner {
        padding-top: 0;
    }

    .topbar-inner,
    .topbar-main,
    .topbar-actions,
    .document-header,
    .section-head,
    .sidebar-head,
    .inline-actions,
    .doc-index-row {
        align-items: stretch;
    }

    .global-nav {
        width: 100%;
    }

    .doc-index-row {
        grid-template-columns: 1fr;
    }

    .document-card {
        padding: 20px;
    }

    .auth-copy--minimal,
    .auth-card-stack {
        padding: 18px;
    }
}
.admin-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-hero h1,
.user-card-head h3 {
    margin: 0;
}

.admin-workspace {
    display: grid;
    gap: 20px;
}

.admin-workspace--users {
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
}

.admin-create-card {
    position: sticky;
    top: 90px;
}

.admin-list-card {
    min-width: 0;
}

.user-directory {
    display: grid;
    gap: 14px;
}

.user-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-muted);
}

.user-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.user-card-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

.user-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: white;
    color: #374151;
    font-size: 0.84rem;
}

.badge--dark {
    color: white;
    background: var(--accent);
    border-color: var(--accent);
}

.badge--warning {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: #fed7aa;
}

.compact-grid {
    gap: 10px;
}

@media (max-width: 1120px) {
    .admin-workspace--users {
        grid-template-columns: 1fr;
    }

    .admin-create-card {
        position: static;
    }
}
.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-search {
    min-width: min(420px, 100%);
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.admin-table tbody tr:hover {
    background: var(--surface-muted);
}

.table-actions {
    text-align: right;
}

.admin-form {
    display: grid;
    gap: 28px;
    padding: 20px 0 0;
}

.admin-fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin: 0;
    display: grid;
    gap: 14px;
}

.admin-fieldset legend {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 6px;
}

.admin-form-actions {
    display: flex;
    gap: 10px;
}

.admin-preview {
    display: grid;
    gap: 8px;
    padding-top: 4px;
}

.admin-form-page {
    max-width: 1180px;
}

@media (max-width: 760px) {
    .admin-toolbar {
        align-items: stretch;
    }

    .admin-search {
        min-width: 100%;
    }

    .table-actions {
        text-align: left;
    }
}
.paragraph-content a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.paragraph-meta {
    display: none;
}

form.card.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-card-stack .auth-form {
    display: grid;
    gap: 12px;
}
.ghost-button--small {
    min-height: 36px;
    padding: 8px 12px;
}

.admin-shell--library,
.admin-shell--editor {
    max-width: 1280px;
}

.admin-tree-card {
    overflow: hidden;
}

.admin-tree-wrap {
    display: grid;
    gap: 2px;
}

/* Root list */
.admin-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 2px;
}

/* Nested lists — indented with tree lines */
.admin-tree-list .admin-tree-list {
    padding-left: 24px;
    position: relative;
}

/* Vertical line from parent down to children */
.admin-tree-list .admin-tree-list::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 12px;
    width: 1px;
    background: var(--line-strong);
}

/* Each nested item gets a horizontal branch line */
.admin-tree-list .admin-tree-list > .admin-tree-item {
    position: relative;
}

.admin-tree-list .admin-tree-list > .admin-tree-item::before {
    content: '';
    position: absolute;
    left: -13px;
    top: 16px;
    width: 10px;
    height: 1px;
    background: var(--line-strong);
}

.admin-tree-item {
    display: grid;
    gap: 2px;
}

.admin-tree-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 1.06rem;
}

.admin-tree-link:hover {
    background: var(--surface-soft);
}

.admin-tree-link i,
.admin-tree-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--muted);
}

.admin-tree-link span {
    min-width: 0;
}

/* Doc editor inputs — borderless */
.de-input {
    border: none;
    background: var(--surface-soft);
    border-radius: 8px;
}

.de-input:focus {
    border: none;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.1);
    background: var(--surface);
}

/* ── Toast notifications ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: toastIn 0.25s ease-out;
    max-width: 480px;
}

.toast.toast-success {
    border-color: #abefc6;
    background: var(--success-soft);
    color: var(--success);
}

.toast.toast-error {
    border-color: #fecdca;
    background: var(--danger-soft);
    color: var(--danger);
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0;
    margin-left: auto;
    display: flex;
}

.toast-close:hover {
    opacity: 1;
}

.toast.toast-out {
    animation: toastOut 0.2s ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* ── Content editor (3-column) ── */

.ce-shell {
    max-width: 1680px;
    margin: 0 auto;
}

.ce-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ce-header h1 {
    margin: 0;
    font-size: 1.3rem;
}

.ce-layout {
    display: grid;
    grid-template-columns: 220px 1fr 1fr;
    gap: 16px;
    align-items: start;
}

/* Sidebar */
.ce-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ce-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 8px;
    font-size: 0.88rem;
}

.ce-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    color: var(--muted);
    padding: 0;
}

.ce-add-btn:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.ce-section-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ce-section-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    color: var(--text);
}

.ce-section-item:hover {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.ce-section-item.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.ce-section-item i,
.ce-section-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--muted);
}

.ce-section-item-text {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.ce-section-item-kind {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.ce-section-item-preview {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Editor */
.ce-editor {
    min-height: 400px;
}

.ce-editor-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--muted);
    font-size: 0.95rem;
}

.ce-editor-form {
    display: grid;
    gap: 14px;
}

.ce-editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ce-kind-select {
    width: auto;
    min-width: 120px;
}

.ce-editor-actions {
    display: flex;
    gap: 4px;
}

.ce-move-btn,
.ce-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
}

.ce-move-btn:hover:not(:disabled) {
    background: var(--surface-soft);
    color: var(--text);
}

.ce-move-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.ce-delete-btn:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}

.ce-textarea-group {
    display: grid;
    gap: 12px;
}

.ce-textarea-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ce-textarea-label > span {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.ce-editor-fields {
    display: grid;
    gap: 12px;
}

.ce-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ce-field > span {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.ce-format-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: var(--surface, #f5f5f0);
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.ce-format-toolbar + .de-input {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.ce-fmt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--muted, #777);
    cursor: pointer;
}

.ce-fmt-btn:hover {
    background: var(--line, #ddd);
    color: var(--fg, #1a1a1a);
}

.ce-kind-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--surface-soft);
    color: var(--muted);
}

.ce-save-btn {
    justify-self: start;
}

/* Block picker */
.ce-block-picker {
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
    display: grid;
    gap: 6px;
}

.ce-picker-search {
    height: 32px;
    font-size: 0.82rem;
    padding: 6px 10px;
}

.ce-picker-grid {
    display: grid;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}

.ce-picker-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    text-align: left;
    width: 100%;
}

.ce-search {
    height: 34px;
    font-size: 0.82rem;
    padding: 6px 10px;
}

.ce-picker-item:hover {
    background: var(--surface-soft);
}

.ce-picker-item i,
.ce-picker-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--muted);
}

.ce-picker-item-label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
}

.ce-picker-item-desc {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.3;
}

/* Gallery row */
.gallery-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
}

/* ── Block type styles (public + preview) ── */

.block-image {
    margin: 0;
}

.block-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.block-image figcaption {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 6px;
    text-align: center;
}

.block-video {
    position: relative;
    padding-bottom: 56.25%;
    border-radius: 8px;
    overflow: hidden;
}

.block-video iframe,
.block-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.block-link-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
}

.block-link-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.block-link-card-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.block-link-card-body strong {
    display: block;
    margin-bottom: 4px;
}

.block-link-card-body p {
    font-size: 0.88rem;
    color: var(--muted);
    margin: 0;
}

.block-divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 8px 0;
}

.block-gallery {
    display: grid;
    grid-template-columns: repeat(var(--gallery-cols, 3), 1fr);
    gap: 10px;
}

.block-gallery figure {
    margin: 0;
}

.block-gallery img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.block-gallery figcaption {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
    text-align: center;
}

/* Repeater */
.ce-repeater {
    display: grid;
    gap: 8px;
}

.ce-repeater-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ce-field-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.ce-repeater-items {
    display: grid;
    gap: 6px;
}

.ce-repeater-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ce-repeater-row input {
    flex: 1;
    min-width: 0;
}

.ce-repeater-remove {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-remove {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Preview */
.ce-preview {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.ce-preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.ce-preview-topbar strong {
    font-size: 0.82rem;
    color: var(--muted);
}

.ce-preview-lang {
    display: flex;
    gap: 2px;
}

.ce-lang-btn {
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: none;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
}

.ce-lang-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.ce-preview-frame {
    padding: 20px 18px;
}

.ce-preview-highlight {
    outline: 2px solid #2563eb;
    outline-offset: 4px;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 1280px) {
    .ce-layout {
        grid-template-columns: 200px 1fr;
    }
    .ce-preview {
        display: none;
    }
}

@media (max-width: 900px) {
    .ce-layout {
        grid-template-columns: 1fr;
    }
    .ce-sidebar {
        position: static;
        max-height: none;
    }
}

/* ── Section manager ── */

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.section-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
}

.section-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.section-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--surface-soft);
    border-radius: 8px;
    color: var(--muted);
}

.section-card-icon i,
.section-card-icon svg {
    width: 18px;
    height: 18px;
}

.section-card-body {
    min-width: 0;
}

.section-card-body strong {
    display: block;
    font-size: 0.95rem;
}

.section-card-body code {
    font-size: 0.75rem;
    color: var(--muted);
}

.section-card-body p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

/* Section editor */
.sec-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.sec-editor-header h1 {
    margin: 0;
    font-size: 1.3rem;
}

.sec-editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.sec-editor-code {
    display: grid;
    gap: 10px;
}

.sec-editor-code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sec-editor-textarea {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    min-height: 500px;
    resize: vertical;
    tab-size: 2;
    height: auto;
}

.sec-editor-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 0.85rem;
    font-family: "IBM Plex Mono", monospace;
}

.sec-editor-preview {
    position: sticky;
    top: 80px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.sec-editor-preview-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 0.82rem;
}

.sec-editor-preview-frame {
    padding: 16px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.sec-preview-info {
    display: grid;
    gap: 14px;
}

.sec-preview-meta strong {
    font-size: 1.1rem;
    margin-right: 8px;
}

.sec-preview-field {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 0;
}

.sec-preview-field code {
    font-size: 0.82rem;
}

.sec-preview-field small {
    color: var(--muted);
    font-size: 0.75rem;
}

.sec-preview-section {
    display: grid;
    gap: 6px;
}

.sec-preview-code {
    margin: 0;
    padding: 10px 12px;
    background: var(--surface-soft);
    border-radius: 8px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.sec-preview-render {
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

@media (max-width: 1120px) {
    .sec-editor-layout {
        grid-template-columns: 1fr;
    }

    .sec-editor-preview {
        position: static;
    }
}

.doc-position-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.field-label-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.doc-position-arrows {
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-position-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    color: var(--muted);
    padding: 0;
}

.doc-position-arrow:hover:not(:disabled) {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--line-strong);
}

.doc-position-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.doc-position-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    min-width: 40px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Doc editor layout */
.doc-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.doc-editor-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.doc-editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.doc-editor-form .stacked-form {
    display: grid;
    gap: 20px;
}

.doc-editor-fieldset {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 16px;
    margin: 0;
    display: grid;
    gap: 12px;
}

.doc-editor-fieldset .translation-grid fieldset {
    border-color: var(--line);
    opacity: 0.92;
}

.doc-editor-fieldset legend {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0 6px;
}

.doc-editor-preview {
    position: sticky;
    top: 80px;
    display: grid;
    gap: 12px;
}

.doc-preview-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.doc-preview-title {
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doc-preview-tree {
    max-height: 240px;
    overflow-y: auto;
    position: relative;
}

.doc-preview-tree::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    display: block;
    background: linear-gradient(transparent, var(--surface));
    pointer-events: none;
}

.doc-preview-parent {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--line);
}

.doc-preview-parent i,
.doc-preview-parent svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--muted);
}

.doc-preview-children {
    padding-left: 20px;
    position: relative;
}

.doc-preview-children::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 14px;
    width: 1px;
    background: var(--line-strong);
}

.doc-preview-child {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 0.84rem;
    color: var(--text);
    position: relative;
}

.doc-preview-child::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    width: 8px;
    height: 1px;
    background: var(--line-strong);
}

.doc-preview-child i,
.doc-preview-child svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--muted);
}

.doc-preview-child.doc-preview-new {
    background: var(--success-soft);
    color: var(--success);
    font-weight: 600;
    border-radius: 6px;
    margin: 2px 0;
}

.doc-preview-child.doc-preview-new i,
.doc-preview-child.doc-preview-new svg {
    color: var(--success);
}

.doc-preview-empty {
    padding: 20px 14px;
    font-size: 0.88rem;
    color: var(--muted);
    text-align: center;
}

.doc-preview-body {
    padding: 12px 14px;
    display: grid;
    gap: 10px;
}

.doc-preview-detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-preview-detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--surface-soft);
    border-radius: 8px;
    color: var(--muted);
}

.doc-preview-detail-icon i,
.doc-preview-detail-icon svg {
    width: 18px;
    height: 18px;
}

.doc-preview-detail-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.doc-preview-detail-sub {
    font-size: 0.82rem;
    color: var(--muted);
}

.doc-preview-detail-summary {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.doc-preview-lang-block {
    display: grid;
    gap: 2px;
}

.doc-preview-lang-block strong {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Icon picker */
.icon-picker-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-picker-wrap input {
    flex: 1;
    cursor: pointer;
}

.icon-picker-current {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface-soft);
    border-radius: 8px;
    flex-shrink: 0;
    color: var(--muted);
}

.icon-picker-current i,
.icon-picker-current svg {
    width: 20px;
    height: 20px;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--surface-soft);
    border-radius: 8px;
}

.icon-picker-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
}

.icon-picker-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.icon-picker-btn i,
.icon-picker-btn svg {
    width: 18px;
    height: 18px;
}

.doc-editor-sections {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 1120px) {
    .doc-editor-layout {
        grid-template-columns: 1fr;
    }

    .doc-editor-preview {
        position: static;
    }
}

.admin-hero--editor {
    align-items: center;
}

@media (max-width: 760px) {
    .admin-tree-list .admin-tree-list {
        padding-left: 16px;
    }
}

.admin-shell--ai-import {
    max-width: 1380px;
}

.admin-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-preview-grid p {
    margin: 6px 0 0;
}

@media (max-width: 1120px) {
    .admin-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════
   Support widget (FAB → menu → chat / feedback)
   ══════════════════════════════════ */

.support-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
}

.support-fab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--accent);
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(16, 24, 40, 0.15);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    font-size: 0.88rem;
    font-weight: 600;
}

.support-fab:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.2);
}

.support-fab-icon { flex-shrink: 0; }

/* ── Support menu ── */
.support-menu {
    display: none;
    position: absolute;
    bottom: 56px;
    right: 0;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}
.support-menu.open { display: block; }

.support-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}
.support-menu-header strong { font-size: 0.95rem; }
.support-menu-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px;
}
.support-menu-close:hover { background: var(--accent-soft); color: var(--text); }

.support-menu-options { padding: 8px; }

.support-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s ease;
}
.support-option:hover { background: var(--accent-soft); }

.support-option-icon {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; flex-shrink: 0;
}
.support-option-icon--chat { background: var(--note-soft); color: var(--note); }
.support-option-icon--feedback { background: var(--warning-soft); color: var(--warning); }
.support-option-icon--docs { background: var(--success-soft); color: var(--success); }

.support-option-text { min-width: 0; }
.support-option-text strong { display: block; font-size: 0.88rem; color: var(--text); }
.support-option-text small { font-size: 0.78rem; color: var(--muted); }

/* ── Chat panel ── */
.support-chat {
    display: none;
    position: absolute;
    bottom: 56px;
    right: 0;
    width: 340px;
    height: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
    transition: width .25s ease, height .25s ease, bottom .25s ease, right .25s ease, border-radius .25s ease;
    overflow: hidden;
    flex-direction: column;
}
.support-chat.open { display: flex; }

.support-chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.support-chat-header strong { flex: 1; font-size: 0.92rem; }
.support-chat-header-actions { display: flex; align-items: center; gap: 2px; }
.support-chat-new {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px;
}
.support-chat-new:hover { background: var(--accent-soft); color: var(--text); }
.support-chat-expand {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px;
}
.support-chat-expand:hover { background: var(--accent-soft); color: var(--text); }
.support-chat-expand .collapse-icon { display: none; }
.support-chat.expanded .support-chat-expand .expand-icon { display: none; }
.support-chat.expanded .support-chat-expand .collapse-icon { display: block; }

.support-chat.expanded {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: min(680px, calc(100vw - 48px));
    height: min(700px, calc(100vh - 48px));
    z-index: 9999;
    border-radius: 16px;
}
.support-chat.expanded .chat-msg-bubble { max-width: 480px; }
.support-chat-back {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px;
}
.support-chat-back:hover { background: var(--accent-soft); color: var(--text); }

.support-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-msg--user { flex-direction: row-reverse; }

.chat-msg-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700;
    flex-shrink: 0;
}
.chat-msg--user .chat-msg-avatar { background: var(--note); }

.chat-msg-bubble {
    max-width: 280px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.45;
    background: var(--surface-soft);
    color: var(--text);
}
.chat-msg--user .chat-msg-bubble {
    background: var(--note);
    color: #fff;
}
.chat-msg-bubble p { margin: 0 0 6px; }
.chat-msg-bubble p:last-child { margin-bottom: 0; }
.chat-msg-bubble code { background: rgba(0,0,0,.08); padding: 1px 4px; border-radius: 3px; font-size: 0.8rem; }
.chat-msg-bubble .chat-link { color: var(--note, #3b82f6); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.chat-msg-bubble .chat-link:hover { opacity: .8; }
.chat-msg--user .chat-msg-bubble .chat-link { color: #fff; opacity: .9; }
.chat-msg-bubble .chat-list { margin: 4px 0; padding-left: 18px; }
.chat-msg-bubble .chat-list li { margin-bottom: 4px; }
.chat-msg-bubble .chat-list li:last-child { margin-bottom: 0; }
.chat-msg-bubble strong { font-weight: 600; }
.chat-msg-bubble em { font-style: italic; }

.typing-dots { display: inline-flex; gap: 3px; padding: 4px 0; }
.typing-dots span { width: 6px; height: 6px; background: var(--text-soft, #999); border-radius: 50%; animation: typingBounce .6s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-4px) } }

.support-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}
.support-chat-input input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    background: var(--surface-soft);
    color: var(--text);
    outline: none;
}
.support-chat-input input:focus { border-color: var(--line-strong); }
.support-chat-send {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 8px;
    background: var(--accent); color: white; cursor: pointer;
}
.support-chat-send:hover { opacity: 0.9; }

.feedback-panel {
    display: none;
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(16, 24, 40, 0.12);
    overflow: hidden;
}

.feedback-panel.open {
    display: block;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.feedback-title { flex: 1; }

.feedback-title {
    font-weight: 600;
    font-size: 1rem;
}

.feedback-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
}

.feedback-close:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.feedback-close svg {
    width: 18px;
    height: 18px;
}

.feedback-form {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.feedback-field {
    display: grid;
    gap: 8px;
}

.feedback-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
}

.feedback-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feedback-cat {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.feedback-cat:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.feedback-cat.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.feedback-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
}

.feedback-input:focus {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.05);
}

.feedback-submit {
    width: 100%;
    justify-content: center;
}

.feedback-status {
    font-size: 0.88rem;
    text-align: center;
    min-height: 20px;
}

.feedback-status.success {
    color: var(--success);
}

.feedback-status.error {
    color: var(--danger);
}

.feedback-fab--sent {
    background: var(--success);
    border-color: var(--success);
}

.feedback-badge {
    display: none;
    position: absolute;
    bottom: 6px;
    right: 56px;
    white-space: nowrap;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid #abefc6;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(16, 24, 40, 0.1);
    animation: feedbackBadgeIn 0.2s ease;
}

.feedback-badge.show {
    display: flex;
}

.feedback-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@keyframes feedbackBadgeIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 480px) {
    .feedback-widget {
        bottom: 16px;
        right: 16px;
    }

    .feedback-panel {
        width: calc(100vw - 32px);
        right: 0;
    }
}

.search-mode-switch {
    display: none;
}

.search-mode-switch.is-visible {
    display: flex;
}

@media (min-width: 1121px) {
    .documentation-shell,
    .documentation-shell--article {
        display: block;
    }

    .documentation-shell .sidebar,
    .documentation-shell--article .sidebar {
        position: fixed;
        top: 96px;
        left: max(24px, calc((100vw - 1680px) / 2 + 24px));
        width: 280px;
        max-height: calc(100vh - 120px);
        overflow: auto;
    }

    .documentation-shell .document-main,
    .documentation-shell--article .document-main {
        margin-left: calc(280px + 28px);
        max-width: none;
    }
}

.mobile-doc-actions,
.mobile-sidebar-drawer {
    display: none;
}
.mobile-sidebar-trigger {
    display: none !important;
}

.icon-action-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    text-decoration: none;
    padding: 0;
}

.icon-action-button:hover {
    border-color: var(--line-strong);
    background: var(--surface);
}

.inline-icon-form {
    margin: 0;
}

.mobile-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}
.mobile-head-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .mobile-sidebar-trigger {
        display: inline-flex !important;
    }

    .mobile-doc-actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .desktop-doc-action {
        display: none !important;
    }

    .documentation-shell .sidebar,
    .documentation-shell--article .sidebar {
        display: none;
    }

    .mobile-sidebar-drawer .sidebar-top {
        display: none;
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(17, 24, 39, 0.38);
    }

    .mobile-sidebar-drawer {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 40;
        width: min(88vw, 340px);
        padding: 16px;
        background: var(--surface);
        border-right: 1px solid var(--line);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
        overflow: auto;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .mobile-sidebar-drawer.is-open {
        transform: translateX(0);
    }

    body.mobile-sidebar-active {
        overflow: hidden;
    }
}

.admin-shell--focused-editor {
    max-width: 1480px;
}

.focused-editor-layout {
    display: grid;
    grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.focused-editor-sidebar {
    display: grid;
    gap: 18px;
}

.focused-editor-form,
.focused-preview-card,
.focused-block-list {
    display: grid;
    gap: 14px;
}

.focused-mode-switch,
.focused-chip-row,
.focused-inline-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.focused-inline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.focused-block-items {
    display: grid;
    gap: 10px;
}

.focused-block-item {
    display: grid;
    gap: 6px;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
}

.focused-block-item:hover,
.focused-block-item.active {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.focused-block-item small {
    color: var(--muted);
}

.focused-preview-card {
    position: sticky;
    top: 88px;
}

.focused-preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.focused-preview-page {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-muted);
}

.focused-preview-page__header h1 {
    margin: 4px 0 8px;
}

.focused-preview-page__header p {
    margin: 0;
    color: var(--muted);
}

.focused-preview-stack {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.focused-preview-draft {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.focused-mode-switch .ghost-button.active {
    background: var(--text);
    color: var(--surface);
    border-color: var(--text);
}

@media (max-width: 1120px) {
    .focused-editor-layout,
    .focused-inline-grid {
        grid-template-columns: 1fr;
    }

    .focused-preview-card {
        position: static;
    }
}

/* ===== Profile avatar & dropdown ===== */

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    transition: all 0.18s ease;
}
.topbar-icon-btn:hover {
    border-color: rgba(0, 0, 0, 0.12);
    color: #1e293b;
    background: #f1f5f9;
}

.profile-dropdown-wrap {
    position: relative;
}

.profile-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.06);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.profile-avatar-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-avatar-letter {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    z-index: 100;
    overflow: hidden;
}
.profile-dropdown.open {
    display: block;
}

.profile-dropdown-header {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.profile-dropdown-header strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}
.profile-dropdown-header small {
    font-size: 0.78rem;
    color: #94a3b8;
}

.profile-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #334155;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.profile-dropdown-item:hover {
    background: #f1f5f9;
    text-decoration: none;
}
.profile-dropdown-item svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.profile-dropdown-logout {
    color: var(--danger);
}
.profile-dropdown-logout svg {
    color: var(--danger);
}

/* Profile page */
.profile-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--line);
}
.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-avatar-large span {
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ===== Language switch ===== */
.lang-switch {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-muted);
}
.lang-switch-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.lang-switch-opt:hover {
    color: var(--text);
    text-decoration: none;
}
.lang-switch-opt.active {
    background: var(--accent);
    color: #fff;
}

/* ===== User group (notif + avatar) ===== */
.topbar-user-group {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    background: #f8fafc;
    padding: 2px;
    transition: border-color 0.18s ease;
}
.topbar-user-group:hover {
    border-color: rgba(0, 0, 0, 0.12);
}
.notif-wrap {
    position: relative;
}

.topbar-notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: none;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    transition: all 0.18s ease;
}

.topbar-notif-btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: 360px;
    max-height: 440px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.notif-panel.open {
    display: flex;
    flex-direction: column;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.notif-panel-header strong {
    font-size: 0.92rem;
}

.notif-mark-read {
    border: none;
    background: none;
    color: var(--muted);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
}

.notif-mark-read:hover {
    color: var(--text);
}

.notif-list {
    overflow-y: auto;
    flex: 1;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    transition: background 0.1s ease;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--surface-soft);
}

.notif-item.unread {
    background: var(--accent-soft);
}

.notif-item.unread:hover {
    background: var(--surface-soft);
}

.notif-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.notif-icon--update {
    background: var(--note-soft);
    color: var(--note);
}

.notif-icon--system {
    background: var(--warning-soft);
    color: var(--warning);
}

.notif-icon--announcement {
    background: var(--success-soft);
    color: var(--success);
}

.notif-body {
    min-width: 0;
    flex: 1;
}

.notif-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text);
}

.notif-time {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
    display: block;
}

/* ===== Admin dev bar ===== */
.admin-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    pointer-events: none;
}
.admin-bar-inner {
    pointer-events: auto;
}
.admin-bar-inner {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #1e293b;
    border-radius: 0 0 10px 10px;
    padding: 4px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.admin-bar-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.18s ease;
}
.admin-bar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}
.admin-bar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}
.admin-bar-link svg {
    flex-shrink: 0;
}

/* ===== Settings page ===== */
.settings-page {
    width: 100%;
}
.settings-content {
    max-width: 480px;
    margin: 32px auto;
    padding: 0 24px;
}
.settings-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
}
.settings-avatar-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}
.settings-avatar-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-file-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.settings-file-btn:hover {
    border-color: var(--line-strong);
}
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.settings-form .field-input[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.settings-field .field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}

.settings-field .field-label svg {
    flex-shrink: 0;
}

@media (max-width: 760px) {
    .profile-dropdown {
        right: -12px;
        min-width: 200px;
    }
    .topbar {
        position: relative;
    }
    .topbar-inner {
        padding: 12px 16px;
        gap: 0;
    }
    .topbar-main {
        position: static;
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: center;
    }
    .mobile-sidebar-trigger {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    .brand-logo {
        height: 36px;
        margin-left: 0;
    }
    .topbar-actions {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    .lang-switch {
        display: none;
    }
    .admin-bar-inner {
        flex-wrap: wrap;
        justify-content: center;
    }
    .settings-content {
        margin-top: 20px;
    }
}

@media (max-width: 900px) {
    .app-sidebar {
        transform: translateX(-100%);
        z-index: 60;
        box-shadow: none;
    }
    .app-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    .app-main--with-sidebar {
        margin-left: 0 !important;
    }
    .mobile-sidebar-trigger {
        display: flex !important;
    }
    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(0, 0, 0, 0.3);
    }
    .mobile-sidebar-backdrop[hidden] {
        display: none;
    }
}

@media (min-width: 901px) {
    .mobile-sidebar-trigger {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .landing-hero h1 {
        font-size: 1.5rem;
    }
    .landing-features {
        grid-template-columns: 1fr;
    }
}
