/* PNLSEO Console — refined dark shell (shared across all panel pages) */

:root {
    /* Surfaces — softer night defaults (overridden by theme-modes) */
    --bg-0: #0f1218;
    --bg-1: #141821;
    --bg-2: #1a2030;
    --surface: #161b26;
    --surface-raised: #1c2330;
    --glass: #171d28;
    --glass-strong: #1e2634;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-strong: rgba(255, 255, 255, 0.14);

    /* Text */
    --text: #e6eaf0;
    --text-soft: #9aa3b2;
    --muted: #6f7887;
    --muted-strong: #c2c9d4;

    /* Accent — restrained teal, not neon */
    --cyan: #5ec4b6;
    --cyan-strong: #3aafa0;
    --lime: #5ecf8a;
    --rose: #e87272;
    --amber: #e0b04a;

    /* Layout */
    --sidebar-w: 248px;
    --radius: 10px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --control-h: 2.25rem;

    /* Spacing scale (4px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* Type scale */
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.875rem;
    --text-md: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --leading-tight: 1.25;
    --leading-normal: 1.5;

    --font-display: "Vazirmatn", Tahoma, sans-serif;
    --font-sans: "Vazirmatn", Tahoma, sans-serif;
    --font-mono: "Vazirmatn", Tahoma, sans-serif;

    /* Bridges for older CSS */
    --bs-body-bg: var(--bg-0);
    --bs-body-color: var(--text);
    --surface-elevated: var(--surface-raised);
    --surface-muted: rgba(255, 255, 255, 0.04);
    --surface-subtle: rgba(255, 255, 255, 0.025);
    --border-color: var(--glass-border);
    --border-strong: var(--glass-border-strong);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.28);
    --accent: var(--cyan-strong);
    --accent-hover: #2f9a8c;
    --accent-soft: rgba(58, 175, 160, 0.12);
    --accent-muted: rgba(58, 175, 160, 0.07);
    --danger: var(--rose);
    --danger-hover: #d95c5c;
    --danger-soft: rgba(232, 114, 114, 0.12);
    --success: var(--lime);
    --success-soft: rgba(94, 207, 138, 0.12);
    --warning: var(--amber);
    --warning-soft: rgba(224, 176, 74, 0.12);
    --table-header-bg: rgba(255, 255, 255, 0.03);
    --table-stripe: rgba(255, 255, 255, 0.015);
    --overlay: rgba(4, 6, 10, 0.72);
    --shadow-xs: none;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);
    --card-shadow: none;
    --focus-ring: 0 0 0 3px rgba(58, 175, 160, 0.28);
    --transition-fast: 140ms ease;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body.panel-body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    background: var(--bg-0);
    letter-spacing: 0;
}

/* ─── Shell: sidebar + main (no topbar) ─── */

.shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-rows: 1fr;
    min-height: 100vh;
}

.shell-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-3) var(--space-3);
    border-inline-end: 1px solid var(--glass-border);
    background: var(--bg-1);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    z-index: 30;
}

.shell-sidebar__top {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-1) var(--space-3);
    margin-bottom: var(--space-1);
    border-bottom: 1px solid var(--glass-border);
}

.shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
    min-width: 0;
    flex: 1;
}

.shell-brand__mark {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: var(--radius-xs);
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    border: 1px solid rgba(58, 175, 160, 0.28);
    color: var(--cyan);
    font-size: 0.8rem;
    font-weight: 800;
    flex-shrink: 0;
}

.shell-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    font-size: var(--text-md);
    min-width: 0;
}

.shell-brand__text span {
    font-size: var(--text-xs);
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.shell-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: var(--space-1) 0;
}

.shell-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-soft);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid transparent;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    position: relative;
}

.shell-nav a svg {
    width: 1.05rem;
    height: 1.05rem;
    opacity: 0.75;
    flex-shrink: 0;
}

.shell-nav a:hover {
    background: var(--hover-fill, rgba(255, 255, 255, 0.035));
    color: var(--text);
}

.shell-nav a.is-active {
    background: var(--accent-muted);
    color: var(--text);
    border-color: rgba(58, 175, 160, 0.18);
}

.shell-nav a.is-active::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 20%;
    bottom: 20%;
    width: 2px;
    border-radius: 2px;
    background: var(--cyan-strong);
}

.shell-nav a.is-active svg {
    opacity: 1;
    color: var(--cyan);
}

.shell-sidebar__foot {
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.shell-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.4rem;
    min-width: 0;
}

.shell-user__avatar {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-xs);
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-soft);
    font-size: var(--text-xs);
    font-weight: 700;
    flex-shrink: 0;
}

.shell-user__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.shell-user__name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-user__role {
    font-size: 0.7rem;
    color: var(--muted);
}

.shell-sidebar__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.shell-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-h);
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--control-fill, rgba(255, 255, 255, 0.03));
    color: var(--text-soft);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 600;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.shell-action:hover {
    background: var(--hover-fill-strong, rgba(255, 255, 255, 0.06));
    color: var(--text);
    border-color: var(--glass-border-strong);
}

.shell-action--danger:hover {
    background: var(--danger-soft);
    border-color: rgba(232, 114, 114, 0.35);
    color: #fecaca;
}

.shell-sidebar-toggle {
    display: none;
    appearance: none;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0;
}

.shell-float-toggle {
    position: fixed;
    top: var(--space-3);
    inset-inline-start: var(--space-3);
    z-index: 50;
    appearance: none;
    border: 1px solid var(--glass-border);
    background: var(--surface-raised);
    color: var(--text);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

/* Keep float hamburger aligned with workflow bar, not covering actions */
body.is-workflow-studio .shell-float-toggle {
    top: 0.45rem;
    inset-inline-start: 0.45rem;
    width: 2rem;
    height: 2rem;
}

.shell-float-toggle:not([hidden]) {
    display: inline-flex;
}

.shell-main {
    padding: var(--space-5) var(--space-5) var(--space-8);
    min-width: 0;
    background: var(--bg-0);
}

/* Legacy topbar — removed from markup; keep inert if referenced */
.shell-topbar,
.shell-search,
.shell-actions { display: none !important; }

/* ─── Workflow studio ─── */

body.is-workflow-studio {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 100vw;
}

body.is-workflow-studio .shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    transition: grid-template-columns 0.2s ease;
}

body.is-workflow-studio .shell-sidebar-toggle {
    display: inline-flex;
}

body.is-workflow-studio .shell-main,
body.is-workflow-studio main.shell-main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

body.is-workflow-studio .shell-main > .alert {
    margin: 0.5rem 0.75rem 0;
    flex-shrink: 0;
}

body.is-sidebar-collapsed {
    --sidebar-w: 0px;
}

body.is-workflow-studio.is-sidebar-collapsed .shell {
    grid-template-columns: minmax(0, 1fr);
}

body.is-workflow-studio.is-sidebar-collapsed .shell-sidebar {
    display: none !important;
}

body.is-sidebar-collapsed .shell-sidebar {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    opacity: 0;
    pointer-events: none;
}

body.is-workflow-studio:not(.is-sidebar-collapsed) .shell {
    grid-template-columns: 220px minmax(0, 1fr);
}

/* ─── Shared surfaces ─── */

.glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.glass-strong {
    background: var(--glass-strong);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--glass-border);
}

.page-header h1 {
    margin: 0 0 var(--space-1);
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: var(--leading-tight);
}

.page-header .muted,
.page-header p {
    margin: 0;
    font-size: var(--text-sm);
    max-width: 42rem;
}

.page-kicker {
    display: none; /* drop English AI-style eyebrow labels */
}

.muted { color: var(--muted); }
.muted-strong { color: var(--text-soft); }

.alert {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
    font-size: var(--text-sm);
}

.alert-success {
    background: var(--success-soft);
    border-color: rgba(94, 207, 138, 0.22);
    color: #b8f0cd;
}

.alert-error {
    background: var(--danger-soft);
    border-color: rgba(232, 114, 114, 0.22);
    color: #fecaca;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: #fbbf24;
}

/* ─── Buttons — one size language everywhere ─── */

.btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    height: var(--control-h);
    padding: 0 0.9rem;
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { filter: brightness(0.96); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn-sm {
    height: 1.875rem;
    padding: 0 0.65rem;
    font-size: var(--text-xs);
    border-radius: var(--radius-xs);
}

.btn-primary {
    background: var(--cyan-strong);
    color: #041512;
    border-color: transparent;
}

.btn-primary:hover {
    background: var(--accent-hover);
    filter: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-soft);
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    filter: none;
}

.btn-danger {
    background: var(--danger-soft);
    border-color: rgba(232, 114, 114, 0.28);
    color: #fecaca;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* ─── Cards / panels ─── */

.stat-card,
.panel-section,
.form-card,
.auth-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.stat-card h3 {
    margin: 0;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin: var(--space-2) 0 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.panel-section { margin-bottom: var(--space-4); }
.panel-section h2,
.panel-section h3 {
    margin-top: 0;
    margin-bottom: var(--space-3);
    font-size: var(--text-lg);
    font-weight: 650;
}

.stack { display: flex; flex-direction: column; gap: var(--space-3); }

.stack label,
.form-card label,
.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-soft);
}

.stack input,
.stack textarea,
.stack select,
.form-card input,
.form-card textarea,
.form-card select,
.inline-form select,
.inline-form input,
.url-field input[type="url"],
.field input,
.field textarea,
.field select {
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    height: var(--control-h);
    padding: 0 0.75rem;
    font: inherit;
    font-size: var(--text-sm);
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.stack textarea,
.form-card textarea,
.field textarea {
    height: auto;
    padding: 0.65rem 0.75rem;
    min-height: 4.5rem;
    resize: vertical;
}

.stack input:focus,
.stack textarea:focus,
.stack select:focus,
.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus,
.url-field input[type="url"]:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: rgba(58, 175, 160, 0.45);
    box-shadow: var(--focus-ring);
}

.checkbox {
    flex-direction: row !important;
    align-items: center;
    gap: 0.55rem !important;
}

.store-fieldset {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    display: grid;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.015);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.empty-state {
    padding: var(--space-8) var(--space-5);
    text-align: center;
    color: var(--muted);
    border-radius: var(--radius);
    border: 1px dashed var(--glass-border);
    background: rgba(255, 255, 255, 0.015);
    font-size: var(--text-sm);
}

code {
    font-family: var(--font-mono);
    font-size: 0.84em;
    background: rgba(58, 175, 160, 0.08);
    color: #9ad9cf;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(58, 175, 160, 0.12);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th,
.data-table td {
    text-align: start;
    padding: 0.65rem 0.4rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: var(--text-xs);
}

.truncate {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn {
    width: var(--control-h);
    height: var(--control-h);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.icon-btn:hover {
    background: var(--accent-soft);
    border-color: rgba(58, 175, 160, 0.3);
    color: var(--cyan);
}

.icon-btn svg { width: 1.05rem; height: 1.05rem; }

.url-field { display: grid; gap: var(--space-2); }
.url-field__row { display: flex; align-items: center; gap: var(--space-2); }
.url-field__row input[type="url"] { flex: 1; min-width: 0; }
.url-field__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--muted);
}
.url-field .upload-status.is-success { color: var(--lime); }
.url-field .upload-status.is-error { color: var(--rose); }
.url-field.is-uploading .upload-status { color: var(--cyan); }

/* Shared chip language */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 1.5rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-xs);
    font-size: var(--text-xs);
    font-weight: 600;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    line-height: 1;
}

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

.modal[hidden] {
    display: none !important;
}

.modal__dialog {
    background: var(--surface-raised);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal__header { border-bottom-color: var(--glass-border); }

.media-library-toolbar input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text);
    border-radius: var(--radius-sm);
    height: var(--control-h);
    padding: 0 0.75rem;
    font: inherit;
    font-size: var(--text-sm);
}

/* Auth */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--bg-0);
    font-family: var(--font-sans);
}

.auth-card {
    width: min(400px, 92vw);
    background: var(--glass-strong);
}

/* Inline forms (dashboard filters etc.) */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: flex-end;
    margin-bottom: var(--space-4);
}

.inline-form label {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--muted);
    font-weight: 600;
}

/* Mobile drawer overlay (created in layout JS) */
.shell-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 210;
    background: rgba(6, 10, 16, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.shell-nav-overlay.is-visible {
    display: block;
}

body.nav-drawer-open {
    overflow: hidden;
}

/* ─── Responsive ─── */

@media (max-width: 980px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 1fr;
    }

    /* Workflow studio: sidebar is collapsed; do NOT leave main in an `auto` row
       (that collapses the canvas height to ~0 on phones). */
    body.is-workflow-studio .shell,
    body.is-workflow-studio.is-sidebar-collapsed .shell {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: 100dvh;
        max-height: 100dvh;
    }

    body.is-workflow-studio .shell-sidebar {
        display: none !important;
    }

    body.is-workflow-studio .shell-main,
    body.is-workflow-studio main.shell-main {
        grid-row: 1;
        grid-column: 1;
        min-height: 0;
        height: 100%;
        max-height: 100%;
    }

    /* Off-canvas drawer for normal panel pages (desktop layout unchanged above 980px) */
    body:not(.is-workflow-studio) .shell-sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: min(17.5rem, 86vw) !important;
        min-width: 0 !important;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        overflow: auto !important;
        padding: var(--space-4) var(--space-3) var(--space-3) !important;
        gap: var(--space-3);
        border-inline-end: 1px solid var(--glass-border) !important;
        box-shadow: var(--shadow-lg, 0 18px 40px rgba(0, 0, 0, 0.35));
        z-index: 220;
        opacity: 1 !important;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
        transition: transform 0.22s ease, visibility 0.22s ease;
    }

    html[dir="rtl"] body:not(.is-workflow-studio).is-sidebar-collapsed .shell-sidebar {
        transform: translateX(105%);
        visibility: hidden;
        pointer-events: none !important;
    }

    html:not([dir="rtl"]) body:not(.is-workflow-studio).is-sidebar-collapsed .shell-sidebar {
        transform: translateX(-105%);
        visibility: hidden;
        pointer-events: none !important;
    }

    body:not(.is-workflow-studio) .shell-sidebar-toggle {
        display: inline-flex;
    }

    body:not(.is-workflow-studio) .shell-float-toggle {
        top: max(0.75rem, env(safe-area-inset-top, 0px));
        inset-inline-start: max(0.75rem, env(safe-area-inset-left, 0px));
        width: 2.5rem;
        height: 2.5rem;
        z-index: 230;
    }

    body:not(.is-workflow-studio) .shell-nav {
        flex-direction: column;
        overflow: visible;
        gap: 2px;
        padding: var(--space-1) 0;
        flex: 1;
        min-height: 0;
    }

    body:not(.is-workflow-studio) .shell-nav a {
        white-space: normal;
        flex-shrink: 0;
        min-height: 2.75rem;
        padding: 0.7rem 0.85rem;
        font-size: var(--text-base);
    }

    body:not(.is-workflow-studio) .shell-nav a svg {
        width: 1.15rem;
        height: 1.15rem;
    }

    body:not(.is-workflow-studio) .shell-sidebar__foot {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
        padding-top: var(--space-3);
    }

    body:not(.is-workflow-studio) .shell-sidebar__actions {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }

    body:not(.is-workflow-studio) .shell-theme-toggle,
    body:not(.is-workflow-studio) .shell-action {
        min-height: 2.75rem;
    }

    body:not(.is-workflow-studio) .shell-main {
        grid-column: 1;
        padding: calc(var(--space-4) + 2.75rem) var(--space-3) var(--space-6);
    }

    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    body:not(.is-workflow-studio) .shell-sidebar {
        width: min(100vw - 2.5rem, 18rem) !important;
    }

    body:not(.is-workflow-studio) .shell-brand__text span {
        display: none;
    }

    body:not(.is-workflow-studio) .shell-main {
        padding: calc(var(--space-3) + 2.75rem) var(--space-3) var(--space-5);
    }
}
