@font-face {
    font-family: "Kompendium UI";
    src: url("fonts/kompendium/JetBrainsMonoNL-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Kompendium UI";
    src: url("fonts/kompendium/JetBrainsMonoNL-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Kompendium UI";
    src: url("fonts/kompendium/JetBrainsMonoNL-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Kompendium Display";
    src: url("fonts/kompendium/JetBrainsMonoNL-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Kompendium Mono";
    src: url("fonts/kompendium/JetBrainsMono-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Kompendium Mono";
    src: url("fonts/kompendium/JetBrainsMono-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --font-ui: "Kompendium UI", "JetBrains Mono", "Segoe UI", sans-serif;
    --font-display: "Kompendium Display", "Kompendium UI", "Segoe UI", sans-serif;
    --font-mono: "Kompendium Mono", "JetBrains Mono", Consolas, monospace;
    --bg: #f3f6fb;
    --bg-soft: #f3f6fb;
    --panel: #f3f6fb;
    --panel-soft: #f3f6fb;
    --sidebar: #edf2fa;
    --line: rgba(0, 0, 0, 0.08);
    --line-strong: rgba(0, 0, 0, 0.14);
    --text: #000000;
    --muted: rgba(0, 0, 0, 0.64);
    --accent: #7632ff;
    --accent-soft: rgba(118, 50, 255, 0.1);
    --accent-strong: rgba(118, 50, 255, 0.24);
    --accent-alt: #7632ff;
    --accent-alt-soft: rgba(118, 50, 255, 0.08);
    --success: #158a5a;
    --warning: #ad6d10;
    --danger: #c53f3f;
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.05);
    --glass: #edf2fa;
    --glass-strong: #ffffff;
    --page-glow-1: rgba(118, 50, 255, 0.1);
    --page-glow-2: rgba(118, 50, 255, 0.05);
    --hero-border: rgba(0, 0, 0, 0.08);
    --module-group-color: #7c3aed;
    --module-group-live: #6d28d9;
    --module-group-focus: rgba(124, 58, 237, 0.42);
    --module-group-glow: rgba(124, 58, 237, 0.16);
    --module-subgroup-color: #c65a11;
    --module-subgroup-live: #9a3412;
    --module-subgroup-focus: rgba(198, 90, 17, 0.42);
    --module-subgroup-glow: rgba(198, 90, 17, 0.16);
    --module-command-color: #0f6f9b;
    --module-command-live: #155e75;
    --module-command-focus: rgba(15, 111, 155, 0.42);
    --module-command-glow: rgba(15, 111, 155, 0.16);
    --module-command-soft: rgba(15, 111, 155, 0.08);
    --module-command-border: rgba(15, 111, 155, 0.22);
    --star-field: none;
    --star-field-near: none;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
    background: var(--bg);
}

body {
    font-family: var(--font-ui);
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    background: var(--bg);
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    will-change: transform, opacity;
    opacity: 0;
}

.dashboard-shell {
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-areas: "sidebar main";
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-x: clip;
    position: relative;
    z-index: 1;
    background: transparent;
}

.dashboard-shell.guest-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main";
}

.mobile-topbar,
.sidebar-backdrop {
    display: none;
}

.sidebar {
    grid-area: sidebar;
    background: var(--sidebar);
    padding: 22px 16px;
    gap: 22px;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    box-shadow: 1px 0 0 var(--line);
    z-index: 30;
}

.main {
    grid-area: main;
    min-width: 0;
    padding: 36px clamp(24px, 4vw, 56px) 48px;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    color: var(--text);
    background: var(--bg);
    animation: page-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.main > .messages,
.main > .stack {
    width: 100%;
    margin-inline: 0;
}

.main > .studio-page {
    width: 100%;
    margin-inline: 0;
}

.main > *,
.stack > *,
.studio-page > *,
.grid-2 > *,
.grid-3 > *,
.stat-grid > * {
    min-width: 0;
    max-width: 100%;
}

.main.is-loading {
    opacity: 0.58;
    transform: translateY(6px);
    pointer-events: none;
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dashboard-star-drift {
    0% {
        opacity: 0.68;
        transform: translate3d(0, 0, 0) scale(1);
    }
    19% {
        opacity: 0.82;
        transform: translate3d(-1.4vw, 1.1vh, 0) scale(1.012);
    }
    41% {
        opacity: 0.72;
        transform: translate3d(1.8vw, -0.6vh, 0) scale(1.02);
    }
    67% {
        opacity: 0.88;
        transform: translate3d(-0.8vw, -1.6vh, 0) scale(1.006);
    }
    100% {
        opacity: 0.68;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes dashboard-star-wander {
    0% {
        opacity: 0.34;
        transform: translate3d(0, 0, 0) scale(1.02);
    }
    23% {
        opacity: 0.56;
        transform: translate3d(1.1vw, -1.8vh, 0) scale(1.035);
    }
    52% {
        opacity: 0.42;
        transform: translate3d(-2.2vw, 0.8vh, 0) scale(1.015);
    }
    79% {
        opacity: 0.58;
        transform: translate3d(0.7vw, 1.7vh, 0) scale(1.03);
    }
    100% {
        opacity: 0.34;
        transform: translate3d(0, 0, 0) scale(1.02);
    }
}

.brand-mark {
    border-radius: 0;
    box-shadow: none;
}

.brand-title {
    font-family: var(--font-display);
    letter-spacing: 0;
}

h1,
h2,
h3,
.module-title,
.page-kicker,
.eyebrow,
.spawn-message-title {
    font-family: var(--font-display);
    letter-spacing: 0;
}

input,
select,
textarea,
button,
.btn {
    font-family: inherit;
}

code,
pre,
kbd,
.command-preview code,
.runtime-version-details strong,
.tag-chip-value,
input[name="bot_token"] {
    font-family: var(--font-mono);
}

.secret-field {
    position: relative;
    display: flex;
    align-items: stretch;
}

.secret-field input {
    padding-right: 52px;
}

.secret-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    transform: translateY(-50%);
}

.secret-toggle:hover {
    color: var(--text);
    transform: translateY(-50%);
}

.secret-toggle .dashboard-icon {
    width: 17px;
    height: 17px;
}

.spawn-message-weight[hidden] {
    display: none !important;
}

.brand-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 166px;
}

.brand-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: capitalize;
}

.brand-status.running {
    color: var(--success);
    border-color: rgba(21, 138, 90, 0.22);
    background: rgba(21, 138, 90, 0.08);
}

.brand-status.errored {
    color: var(--danger);
    border-color: rgba(197, 63, 63, 0.22);
    background: rgba(197, 63, 63, 0.08);
}

.brand-status.stopped,
.brand-status.provisioning,
.brand-status.suspended,
.brand-status.not-linked {
    background: var(--panel);
}

.mobile-topbar {
    display: none;
}

.icon-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
}

.dashboard-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.dashboard-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.side-section {
    gap: 12px;
}

.side-nav {
    gap: 5px;
}

.side-link {
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--muted);
    transition:
        color 160ms ease,
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.side-link:hover {
    color: var(--text);
    transform: translateX(2px);
}

.side-link.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent-strong);
}

.side-link-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: inherit;
    background: transparent;
}

.side-link.active .side-link-icon {
    background: var(--accent-soft);
}

.sidebar-footer {
    gap: 12px;
}

.sidebar-status {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.sidebar-status div {
    display: grid;
    gap: 2px;
}

.sidebar-status strong {
    color: var(--text);
    font-weight: 700;
}

.plan-badge {
    border-radius: 0;
    padding: 12px;
    display: grid;
    gap: 3px;
    background: var(--bg);
    color: var(--muted);
}

.plan-badge strong {
    color: var(--text);
}

.panel {
    border-radius: 0;
    border: 0;
    background: var(--bg);
    box-shadow: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.page-kicker {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.page-copy {
    color: var(--muted);
    max-width: 760px;
}

.status-pill,
.runtime-status-pill {
    min-width: auto;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.86rem;
    text-transform: capitalize;
}

.overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: 18px;
    align-items: start;
}

.overview-primary {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.overview-actions {
    align-items: stretch;
}

.runtime-version-panel {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
    gap: 16px;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.runtime-version-copy {
    display: grid;
    gap: 8px;
    align-content: center;
}

.runtime-version-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.runtime-version-copy h2 {
    margin: 0;
    font-size: 1.38rem;
}

.runtime-version-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.runtime-version-details div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(29, 22, 43, 0.72);
    padding: 10px 12px;
}

.runtime-version-details span,
.runtime-version-details small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.runtime-version-details strong {
    display: block;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.runtime-version-details small {
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.runtime-version-update-form {
    margin-top: 4px;
}

.runtime-version-update-form button {
    width: auto;
}

.runtime-update-chip {
    color: var(--warning);
    border-color: rgba(240, 184, 91, 0.32);
    background: rgba(240, 184, 91, 0.1);
}

.runtime-current-chip {
    color: var(--success);
    border-color: rgba(67, 209, 158, 0.28);
    background: rgba(67, 209, 158, 0.08);
}

.overview-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.overview-status-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(29, 22, 43, 0.58);
}

.overview-status-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.overview-status-card strong {
    font-size: 1rem;
}

.overview-status-copy {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.overview-status-meta {
    color: var(--muted);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.overview-status-chip.synced {
    color: var(--success);
    border-color: rgba(67, 209, 158, 0.28);
    background: rgba(67, 209, 158, 0.08);
}

.overview-status-chip.pending {
    color: var(--warning);
    border-color: rgba(240, 184, 91, 0.28);
    background: rgba(240, 184, 91, 0.08);
}

.overview-status-chip.error {
    color: var(--danger);
    border-color: rgba(255, 111, 145, 0.28);
    background: rgba(255, 111, 145, 0.08);
}

.overview-status-chip.idle {
    color: var(--muted);
}

.text-success {
    color: var(--success);
}

.table-scroll-spaced {
    margin-top: 12px;
}

.metric-row.overview-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.status-pill.running,
.runtime-status-pill.running {
    color: var(--success);
    border-color: rgba(22, 132, 95, 0.26);
    background: rgba(22, 132, 95, 0.08);
}

.status-pill.stopped,
.runtime-status-pill.stopped {
    color: var(--muted);
    background: var(--bg);
}

.status-pill.errored,
.runtime-status-pill.errored {
    color: var(--danger);
    border-color: rgba(196, 62, 86, 0.28);
    background: rgba(196, 62, 86, 0.08);
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    border-radius: 0;
    background: var(--bg);
    border-color: var(--accent);
    transition: transform 160ms ease, border-color 160ms ease;
}

.overview-metrics .stat-card {
    padding: 11px 12px;
}

.overview-metrics .stat-label {
    font-size: 0.68rem;
    overflow-wrap: anywhere;
}

.overview-metrics .stat-value {
    margin-top: 4px;
    font-size: 1.22rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
}

.action-surface {
    display: grid;
    gap: 14px;
    align-content: start;
}

.danger-zone {
    border-color: rgba(196, 62, 86, 0.28);
    background:
        linear-gradient(135deg, rgba(196, 62, 86, 0.08), transparent 58%),
        var(--panel);
}

.muted-small {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 5px 9px;
    background: var(--bg);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

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

.module-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--accent);
    border-radius: 0;
    background: var(--bg);
    padding: 12px;
    box-shadow: none;
}

.module-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.module-summary {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.module-summary .muted-small {
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.module-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.module-card-actions form {
    margin: 0;
}

.module-card-actions .btn,
.module-card-actions button {
    padding: 8px 10px;
}

.module-title {
    margin: 0;
    font-size: 1.08rem;
}

.module-panel {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    display: grid;
    gap: 12px;
}

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

.command-preview {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow: hidden;
}

.command-preview code {
    flex: 0 0 auto;
    font-size: 0.82rem;
}

.compact-form {
    display: grid;
    gap: 12px;
}

.module-command-groups {
    display: grid;
    gap: 14px;
}

.module-command-group {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 12px;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0) 140px),
        rgba(10, 10, 18, 0.58);
}

.module-command-group-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.module-command-group-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.module-command-inline-stack {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.editable-surface {
    position: relative;
    border-radius: 10px;
    outline: none;
    cursor: text;
    transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.editable-surface:hover,
.editable-surface:focus {
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.38), 0 0 0 4px rgba(148, 163, 184, 0.08);
}

.editable-surface:focus {
    background: rgba(255, 255, 255, 0.04);
}

.editable-surface:empty::before {
    content: attr(data-placeholder);
    color: inherit;
    opacity: 0.92;
}

.editable-surface-token {
    min-width: 72px;
    background: transparent;
}

.editable-surface-description {
    display: inline-block;
    max-width: min(100%, 720px);
    min-height: 1.45em;
    padding: 4px 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.editable-surface-group {
    caret-color: var(--module-group-live);
}

.editable-surface-subgroup {
    caret-color: var(--module-subgroup-live);
}

.editable-surface-command {
    caret-color: var(--module-command-live);
}

.editable-surface-group.editable-surface-description {
    color: var(--module-group-color);
}

.editable-surface-subgroup.editable-surface-description {
    color: var(--module-subgroup-color);
}

.editable-surface-command.editable-surface-description {
    color: var(--module-command-color);
}

.editable-surface-group.is-live-edit {
    box-shadow: inset 0 0 0 1px var(--module-group-focus), 0 0 0 4px var(--module-group-glow);
}

.editable-surface-subgroup.is-live-edit {
    box-shadow: inset 0 0 0 1px var(--module-subgroup-focus), 0 0 0 4px var(--module-subgroup-glow);
}

.editable-surface-command.is-live-edit {
    box-shadow: inset 0 0 0 1px var(--module-command-focus), 0 0 0 4px var(--module-command-glow);
}

.module-command-path {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.module-command-static-segment {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.command-slash {
    color: var(--muted);
    font-weight: 700;
}

.command-token {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    background: transparent;
}

.command-token-group {
    color: var(--module-group-color);
}

.command-token-subgroup {
    color: var(--module-subgroup-color);
}

.command-token-command {
    color: var(--module-command-color);
}

.module-live-preview {
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.module-live-preview-group-description,
.module-live-preview-subgroup-description,
.module-live-preview-command-description {
    transition: color 140ms ease, text-shadow 140ms ease;
}

.module-live-preview-group.is-live-edit,
.module-live-preview-group-description.is-live-edit {
    color: var(--module-group-live);
    text-shadow: 0 0 18px var(--module-group-glow);
}

.module-live-preview-subgroup.is-live-edit,
.module-live-preview-subgroup-description.is-live-edit {
    color: var(--module-subgroup-live);
    text-shadow: 0 0 18px var(--module-subgroup-glow);
}

.module-live-preview-command.is-live-edit,
.module-live-preview-command-description.is-live-edit {
    color: var(--module-command-live);
    text-shadow: 0 0 18px var(--module-command-glow);
}

.command-token.is-live-edit {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.module-command-root-tree {
    position: relative;
    display: grid;
    gap: 14px;
    margin-top: 14px;
    padding-left: 28px;
}

.module-command-root-tree::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 8px;
    bottom: 20px;
    width: 1px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.36), rgba(148, 163, 184, 0.08));
}

.module-command-branch-section,
.module-command-subgroup-branch {
    position: relative;
}

.module-command-branch-section::before,
.module-command-subgroup-branch::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 20px;
    width: 18px;
    height: 1px;
    background: rgba(148, 163, 184, 0.28);
}

.module-command-branch-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.module-command-branch-header-subgroup {
    align-items: flex-start;
}

.module-command-branch-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.module-command-branch-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    height: 28px;
    margin-top: 1px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.module-command-branch-toggle:hover {
    border-color: rgba(148, 163, 184, 0.38);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.module-command-branch-toggle:disabled {
    opacity: 0.6;
    cursor: default;
}

.module-command-toggle-glyph {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 220ms ease;
}

.module-command-subgroup-branch.is-open .module-command-toggle-glyph {
    transform: rotate(135deg);
}

.module-command-cluster {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 14px 14px;
}

.module-command-cluster-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.module-command-cluster-body {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.module-command-cluster-subgroup .module-command-cluster-body {
    padding-left: 0;
}

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

.module-command-subtree {
    position: relative;
    display: grid;
    gap: 14px;
    padding-left: 22px;
}

.module-command-subtree::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    bottom: 18px;
    width: 1px;
    background: linear-gradient(180deg, rgba(251, 146, 60, 0.42), rgba(251, 146, 60, 0.1));
}

.module-command-entry {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    background: rgba(7, 10, 18, 0.56);
}

.module-command-entry-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.module-command-entry-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.module-command-entry-subgroup {
    position: relative;
    margin-left: 22px;
}

.module-command-entry-subgroup::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 24px;
    width: 22px;
    height: 1px;
    background: rgba(251, 146, 60, 0.38);
}

.module-command-entry-subgroup::after {
    content: "";
    position: absolute;
    left: -22px;
    top: -12px;
    bottom: 24px;
    width: 1px;
    background: rgba(251, 146, 60, 0.24);
}

.module-command-entry-subgroup:last-child::after {
    bottom: calc(100% - 24px);
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.field-error {
    color: var(--danger);
    font-size: 0.78rem;
    line-height: 1.4;
}

input.input-error,
select.input-error,
textarea.input-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(255, 111, 145, 0.12);
}

.activity-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.activity-pagination button {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
}

.activity-pagination button.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.command-enable-heading,
.command-enable-cell {
    width: 128px;
    text-align: center;
}

.command-enable-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 108px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.08);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.command-enable-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

.command-enable-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.command-enable-box {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.command-enable-box::after {
    content: "";
    width: 8px;
    height: 5px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    opacity: 0;
    transform: rotate(-45deg) translateY(-1px) scale(0.8);
    transition: opacity 120ms ease, transform 120ms ease;
}

.command-enable-input:checked ~ .command-enable-box {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.command-enable-input:checked ~ .command-enable-box::after {
    opacity: 1;
    transform: rotate(-45deg) translateY(-1px) scale(1);
}

.command-enable-input:checked ~ .command-enable-text-off,
.command-enable-input:not(:checked) ~ .command-enable-text-on {
    display: none;
}

.command-enable-input:checked ~ .command-enable-text-on {
    color: var(--text);
}

.command-enable-button:has(.command-enable-input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

.command-enable-input:focus-visible ~ .command-enable-box {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.reset-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 5, 13, 0.72);
    animation: fade-in 160ms ease both;
}

.reset-modal {
    width: min(480px, 100%);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    padding: 20px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
    display: grid;
    gap: 14px;
    animation: modal-in 180ms ease both;
}

.reset-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.dirty-managed-empty-actions {
    display: none;
}

.dirty-save-prompt {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #1f1f24;
    color: var(--text);
    padding:
        10px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom))
        max(14px, env(safe-area-inset-left));
    box-shadow: 0 -16px 42px rgba(0, 0, 0, 0.42);
    animation: dirty-save-in 180ms ease both;
}

.dirty-save-prompt[hidden] {
    display: none;
}

.dirty-save-text {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.dirty-save-copy {
    min-width: 0;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.3;
}

.dirty-save-status {
    min-height: 1.1em;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.dirty-save-status.is-error {
    color: var(--danger);
}

.dirty-save-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.dirty-save-actions button {
    min-width: 104px;
    border-radius: 8px;
    padding: 9px 13px;
}

.dirty-discard-button {
    min-width: auto;
    border-color: transparent;
    background: transparent;
    color: #9ca3ff;
}

.dirty-discard-button:hover {
    background: rgba(156, 163, 255, 0.08);
    border-color: transparent;
    color: #c4c8ff;
}

.dirty-save-button,
.dirty-save-button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.dirty-save-button:hover {
    background: #9333ea;
    border-color: #9333ea;
}

button:disabled,
input[type="submit"]:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.52;
    cursor: not-allowed;
    transform: none;
}

button:disabled:hover,
input[type="submit"]:disabled:hover,
.btn[aria-disabled="true"]:hover {
    transform: none;
    background: inherit;
    border-color: inherit;
    color: inherit;
}

@keyframes dirty-save-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1080px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "topbar"
            "main";
    }

    .mobile-topbar {
        grid-area: topbar;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 45;
        padding: 12px 16px;
        background: color-mix(in srgb, var(--panel) 92%, transparent);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--line);
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(280px, 84vw);
        min-height: 100vh;
        min-height: 100dvh;
        transform: translateX(-100%);
        transition: transform 180ms ease;
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 20;
        background: rgba(7, 5, 13, 0.62);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .main {
        padding: 20px 16px 28px;
    }

    .dashboard-overview-top,
    .dashboard-detail-grid,
    .dashboard-metric-switches {
        grid-template-columns: 1fr;
    }

    .dashboard-overview-controls {
        justify-items: stretch;
    }

    .overview-layout {
        grid-template-columns: 1fr;
    }

    .runtime-version-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .overview-status-grid {
        grid-template-columns: 1fr;
    }

    .module-grid,
    .metric-row {
        grid-template-columns: 1fr;
    }

    .module-card-header {
        grid-template-columns: 1fr;
    }

    .module-card-actions {
        justify-content: flex-start;
    }

    .module-command-group-header,
    .module-command-entry-header,
    .module-command-cluster-summary {
        align-items: flex-start;
    }
}

@media (max-width: 760px) {
    h1 {
        font-size: 1.72rem;
    }

    .panel {
        padding: 15px;
    }

    .inline-actions {
        width: 100%;
    }

    .inline-actions > .btn,
    .inline-actions > button,
    .inline-actions > form {
        flex: 1 1 auto;
    }

    .inline-actions > form > button {
        width: 100%;
    }

    .dirty-save-prompt {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .dirty-save-actions {
        width: 100%;
    }

    .runtime-version-details {
        grid-template-columns: 1fr;
    }

    .dashboard-analytics,
    .dashboard-chart-shell {
        padding: 12px;
    }

    .dashboard-chart-frame {
        height: 230px;
    }

    .dirty-save-actions button {
        flex: 1 1 0;
    }

    .page-copy,
    .module-summary .muted-small {
        max-width: none;
    }

    table {
        min-width: 0;
        font-size: 0.84rem;
    }

    th,
    td {
        padding: 9px 6px;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    code {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .command-preview {
        flex-wrap: wrap;
        overflow: visible;
    }

    .module-command-group,
    .module-command-entry,
    .module-command-cluster {
        padding: 14px;
    }

    .module-command-branch-header,
    .module-command-cluster-summary,
    .module-command-entry-header {
        align-items: stretch;
        flex-direction: column;
    }

    .module-command-branch-toggle {
        align-self: flex-start;
    }

    .module-command-path {
        gap: 6px;
    }

    .module-command-subtree {
        gap: 12px;
        padding-left: 14px;
    }

    .module-command-subtree::before {
        left: 4px;
    }

    .module-command-entry-subgroup {
        margin-left: 14px;
    }

    .module-command-entry-subgroup::before {
        left: -14px;
        width: 14px;
    }

    .module-command-entry-subgroup::after {
        left: -14px;
    }

    .command-enable-heading,
    .command-enable-cell {
        width: auto;
        text-align: left;
    }

    .command-enable-button {
        width: 100%;
        min-width: 0;
    }

    .dirty-save-actions {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after,
    .main {
        animation: none;
    }
}

html[data-dashboard-theme="light"] {
    color-scheme: light;
    --font-ui: "SF Pro Text", "Inter Variable", "Segoe UI", sans-serif;
    --font-display: "SF Pro Display", "SF Pro Text", "Inter Variable", "Segoe UI", sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", Consolas, monospace;
    --bg: #f3f6fb;
    --bg-soft: #f3f6fb;
    --panel: #f3f6fb;
    --panel-soft: #f3f6fb;
    --sidebar: #edf2fa;
    --line: rgba(0, 0, 0, 0.08);
    --line-strong: rgba(0, 0, 0, 0.14);
    --text: #000000;
    --muted: rgba(0, 0, 0, 0.64);
    --accent: #7632ff;
    --accent-soft: rgba(118, 50, 255, 0.1);
    --accent-strong: rgba(118, 50, 255, 0.24);
    --accent-alt: #7632ff;
    --accent-alt-soft: rgba(118, 50, 255, 0.08);
    --success: #158a5a;
    --warning: #ad6d10;
    --danger: #c53f3f;
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.05);
    --glass: #edf2fa;
    --glass-strong: #ffffff;
    --page-glow-1: rgba(118, 50, 255, 0.1);
    --page-glow-2: rgba(118, 50, 255, 0.05);
    --hero-border: rgba(0, 0, 0, 0.08);
    --module-group-color: #7c3aed;
    --module-group-live: #6d28d9;
    --module-group-focus: rgba(124, 58, 237, 0.42);
    --module-group-glow: rgba(124, 58, 237, 0.16);
    --module-subgroup-color: #c65a11;
    --module-subgroup-live: #9a3412;
    --module-subgroup-focus: rgba(198, 90, 17, 0.42);
    --module-subgroup-glow: rgba(198, 90, 17, 0.16);
    --module-command-color: #0f6f9b;
    --module-command-live: #155e75;
    --module-command-focus: rgba(15, 111, 155, 0.42);
    --module-command-glow: rgba(15, 111, 155, 0.16);
    --module-command-soft: rgba(15, 111, 155, 0.08);
    --module-command-border: rgba(15, 111, 155, 0.22);
}

html[data-dashboard-theme="dark"] {
    color-scheme: dark;
    --font-ui: "SF Pro Text", "Inter Variable", "Segoe UI", sans-serif;
    --font-display: "SF Pro Display", "SF Pro Text", "Inter Variable", "Segoe UI", sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", Consolas, monospace;
    --bg: #171717;
    --bg-soft: #171717;
    --panel: #171717;
    --panel-soft: #171717;
    --sidebar: #1d1d1d;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.72);
    --accent: #7632ff;
    --accent-soft: rgba(118, 50, 255, 0.18);
    --accent-strong: rgba(118, 50, 255, 0.32);
    --accent-alt: #7632ff;
    --accent-alt-soft: rgba(118, 50, 255, 0.14);
    --success: #34b97d;
    --warning: #e0a24c;
    --danger: #f06b6b;
    --shadow: none;
    --glass: #1d1d1d;
    --glass-strong: #171717;
    --page-glow-1: rgba(118, 50, 255, 0.16);
    --page-glow-2: rgba(118, 50, 255, 0.1);
    --hero-border: rgba(255, 255, 255, 0.08);
    --module-group-color: #d8b4fe;
    --module-group-live: #edd5ff;
    --module-group-focus: rgba(168, 85, 247, 0.42);
    --module-group-glow: rgba(168, 85, 247, 0.18);
    --module-subgroup-color: #fdba74;
    --module-subgroup-live: #ffcf9d;
    --module-subgroup-focus: rgba(251, 146, 60, 0.42);
    --module-subgroup-glow: rgba(251, 146, 60, 0.18);
    --module-command-color: #67e8f9;
    --module-command-live: #a5f3fc;
    --module-command-focus: rgba(34, 211, 238, 0.4);
    --module-command-glow: rgba(34, 211, 238, 0.18);
    --module-command-soft: rgba(34, 211, 238, 0.08);
    --module-command-border: rgba(34, 211, 238, 0.22);
}

body.dashboard-user {
    background: var(--bg);
}

body.dashboard-user .main {
    padding: 36px clamp(24px, 4vw, 56px) 48px;
}

body.dashboard-user::before,
body.dashboard-user::after {
    display: none;
}

body.dashboard-user .dashboard-shell {
    grid-template-columns: 224px minmax(0, 1fr);
    gap: 0;
    max-width: none;
    margin: 0;
    padding: 0;
}

body.dashboard-user .sidebar {
    background: var(--sidebar);
    border: 0;
    border-right: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 14px 10px 12px;
}

body.dashboard-user .main {
    padding: 16px 18px 24px;
    background: var(--bg);
}

body.dashboard-user .main > .messages,
body.dashboard-user .main > .stack,
body.dashboard-user .main > .studio-page {
    max-width: none;
    margin-inline: 0;
}

body.dashboard-user .brand-title {
    font-size: 0.98rem;
    font-weight: 700;
}

body.dashboard-user .brand-subtitle {
    max-width: none;
    color: var(--muted);
    font-size: 0.78rem;
}

body.dashboard-user .side-link {
    border-radius: 3px;
    padding: 8px 10px;
    color: var(--text);
    font-size: 0.88rem;
}

body.dashboard-user .side-link:hover {
    transform: translateX(3px);
}

body.dashboard-user .side-link.active {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent-strong);
}

body.dashboard-user .side-link-icon {
    width: 26px;
    height: 26px;
    border-radius: 2px;
    background: transparent;
}

body.dashboard-user .sidebar-status,
body.dashboard-user .sidebar .panel {
    background: var(--bg);
    border: 1px solid var(--accent);
    border-radius: 0;
    padding: 10px;
}

body.dashboard-user .sidebar-status {
    gap: 6px;
}

body.dashboard-user .sidebar-status strong {
    font-size: 0.92rem;
}

body.dashboard-user .side-section-label {
    color: var(--muted);
    font-size: 0.68rem;
}

body.dashboard-user .sidebar-footer {
    gap: 10px;
}

body.dashboard-user input,
body.dashboard-user select,
body.dashboard-user textarea {
    border-radius: 2px;
    border-color: var(--line);
    background: var(--panel);
    box-shadow: none;
    padding: 9px 11px;
}

body.dashboard-user input:focus,
body.dashboard-user select:focus,
body.dashboard-user textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(118, 50, 255, 0.12);
}

body.dashboard-user .btn,
body.dashboard-user button,
body.dashboard-user input[type="submit"] {
    border-radius: 2px;
    padding: 8px 11px;
    border-color: var(--line);
    background: var(--panel);
    box-shadow: none;
    font-size: 0.88rem;
}

body.dashboard-user .btn:hover,
body.dashboard-user button:hover,
body.dashboard-user input[type="submit"]:hover {
    background: var(--bg);
}

body.dashboard-user .btn-primary {
    background: var(--accent);
    border-color: transparent;
    color: #ffffff;
}

body.dashboard-user .btn-primary:hover {
    background: #6726ea;
    color: #ffffff;
}

body.dashboard-user .btn-danger {
    background: var(--panel);
    border-color: rgba(197, 63, 63, 0.22);
    color: var(--danger);
}

body.dashboard-user .btn-danger:hover {
    background: rgba(197, 63, 63, 0.08);
}

body.dashboard-user .chip {
    border-radius: 0;
    padding: 4px 8px;
    background: var(--bg);
    border: 0;
    font-size: 0.74rem;
}

body.dashboard-user .message {
    border-radius: 0;
    border: 1px solid var(--accent);
    background: var(--bg);
    box-shadow: none;
}

body.dashboard-user .panel {
    border: 0;
    padding: 18px;
}

body.dashboard-user .messages {
    margin-bottom: 16px;
}

.dashboard-overview-panel {
    display: grid;
    gap: 18px;
}

.dashboard-overview-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
}

.dashboard-overview-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.dashboard-overview-copy h1 {
    margin-bottom: 0;
}

.dashboard-overview-meta {
    margin-top: 2px;
}

.dashboard-overview-controls {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.dashboard-analytics {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 0;
    border-radius: 0;
    background: var(--bg);
}

.dashboard-analytics-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-sync {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-sync-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.dashboard-sync-copy span {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-sync-copy strong {
    font-size: 0.9rem;
}

.dashboard-metric-switches {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-metric-switch {
    display: grid;
    gap: 4px;
    text-align: left;
    align-content: start;
    min-width: 0;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: var(--bg);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dashboard-metric-switch:hover {
    transform: translateY(-1px);
}

.dashboard-metric-switch.is-active {
    border-color: var(--accent-strong);
    background: var(--accent-soft);
}

.dashboard-metric-label {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-metric-switch strong {
    font-size: 1.08rem;
    line-height: 1.1;
}

.dashboard-range-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dashboard-range-button {
    min-width: 0;
    padding-inline: 10px;
    background: transparent;
}

.dashboard-range-button.is-active {
    border-color: var(--accent-strong);
    background: var(--accent-soft);
    color: var(--text);
}

.dashboard-chart-shell {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 0;
    border-radius: 0;
    background: var(--bg);
}

.dashboard-chart-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-chart-summary strong {
    font-size: 1.28rem;
    line-height: 1;
}

.dashboard-chart-summary span {
    color: var(--muted);
    font-size: 0.86rem;
}

.dashboard-chart-frame {
    position: relative;
    height: 280px;
}

.dashboard-chart-frame svg {
    width: 100%;
    height: 100%;
    display: block;
}

.dashboard-chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.88rem;
}

.dashboard-chart-axis {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.78rem;
}

.dashboard-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-detail-card {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: var(--bg);
}

.dashboard-detail-label {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-detail-card strong {
    font-size: 1rem;
    line-height: 1.2;
}

.dashboard-detail-card small {
    color: var(--muted);
    line-height: 1.45;
}

.theme-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--accent);
    border-radius: 0;
    background: var(--bg);
}

.theme-switch-button {
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    padding: 10px 12px;
}

.theme-switch-button.is-active {
    background: var(--panel);
    color: var(--text);
    box-shadow: none;
}

.sidebar-appearance {
    display: grid;
    gap: 10px;
}

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-mini-toggle {
    min-width: 82px;
}

.modules-page {
    gap: 42px;
}

.modules-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: clamp(24px, 4vw, 42px);
    align-items: stretch;
    padding: clamp(28px, 4vw, 44px);
    border-radius: 2px;
    border: 1px solid var(--hero-border);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        linear-gradient(160deg, var(--accent-soft), rgba(255, 255, 255, 0) 52%),
        var(--glass-strong);
    box-shadow: var(--shadow);
}

.modules-hero-copy {
    display: grid;
    gap: 16px;
    align-content: center;
}

.modules-hero h1 {
    margin: 0;
    max-width: 11ch;
    font-size: clamp(2.15rem, 4.3vw, 3.65rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.modules-hero .page-copy {
    margin: 0;
    max-width: 34rem;
    font-size: 0.98rem;
    line-height: 1.58;
}

.modules-hero-aside {
    display: grid;
    gap: 14px;
    align-content: center;
    padding: 22px;
    border-radius: 0;
    border: 1px solid var(--accent);
    background: var(--bg);
}

.modules-hero-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.modules-hero-stat-list {
    display: grid;
    gap: 10px;
}

.modules-hero-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.modules-hero-stat:last-child {
    border-bottom: 0;
}

.modules-hero-stat strong {
    color: var(--text);
    font-size: 1.18rem;
}

.module-shelf {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

.module-shelf-intro {
    position: sticky;
    top: 28px;
    display: grid;
    gap: 12px;
    align-content: start;
}

.module-shelf-intro h2 {
    margin: 0;
    font-size: clamp(1.55rem, 1.7vw, 2rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.module-shelf-count {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

body.dashboard-user .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

body.dashboard-user .module-card {
    gap: 18px;
    min-height: 100%;
    padding: 22px;
    border-radius: 0;
    border: 1px solid var(--accent);
    background: var(--bg);
    box-shadow: none;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

body.dashboard-user .module-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-strong);
}

body.dashboard-user .module-card-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

body.dashboard-user .module-summary {
    gap: 12px;
}

body.dashboard-user .module-summary .muted-small {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    line-height: 1.6;
}

body.dashboard-user .module-title-row {
    align-items: flex-start;
    justify-content: space-between;
}

body.dashboard-user .module-title {
    font-size: 1.18rem;
    letter-spacing: -0.02em;
}

body.dashboard-user .command-preview {
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
}

body.dashboard-user .command-preview code {
    padding: 9px 12px;
    border-radius: 0;
    background: var(--module-command-soft);
    border: 1px solid var(--module-command-border);
    color: var(--module-command-color);
}

body.dashboard-user .module-card-actions {
    justify-content: flex-start;
    gap: 10px;
}

body.dashboard-user .module-panel {
    gap: 18px;
    padding-top: 6px;
    border-top: 0;
}

body.dashboard-user .module-panel > form {
    border: 1px solid var(--accent);
    border-radius: 0;
    padding: 18px;
    background: var(--bg);
}

body.dashboard-user .module-command-group {
    gap: 18px;
    padding: 18px;
    border-radius: 0;
    border: 1px solid var(--accent);
    background: var(--bg);
}

body.dashboard-user .module-command-group-header {
    gap: 18px;
}

body.dashboard-user .module-command-root-tree {
    gap: 18px;
    margin-top: 4px;
}

body.dashboard-user .module-command-root-tree::before {
    background: linear-gradient(180deg, rgba(118, 50, 255, 0.26), rgba(118, 50, 255, 0.06));
}

body.dashboard-user .module-command-entry,
body.dashboard-user .module-command-cluster {
    border-radius: 0;
    border: 1px solid var(--accent);
    background: var(--bg);
}

body.dashboard-user .module-command-entry {
    padding: 18px 20px;
}

body.dashboard-user .module-command-cluster {
    padding: 18px 20px 20px;
}

body.dashboard-user .editable-surface {
    background: var(--bg);
}

body.dashboard-user .editable-surface:hover,
body.dashboard-user .editable-surface:focus {
    box-shadow: inset 0 0 0 1px var(--accent-strong), 0 0 0 4px rgba(118, 50, 255, 0.1);
}

body.dashboard-user .command-enable-button {
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

body.dashboard-user .dirty-save-prompt {
    border-radius: 0;
    background: var(--bg);
    border: 1px solid var(--accent);
    box-shadow: none;
}

@media (max-width: 1200px) {
    .module-shelf {
        grid-template-columns: 1fr;
    }

    .module-shelf-intro {
        position: static;
    }

    body.dashboard-user .module-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1080px) {
    body.dashboard-user .dashboard-shell {
        padding: 0;
        gap: 0;
    }

    body.dashboard-user .mobile-topbar {
        border-radius: 0;
        margin: 0;
        background: var(--panel);
        box-shadow: none;
        border: 0;
        border-bottom: 1px solid var(--line);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    body.dashboard-user .main {
        padding: 16px 16px 24px;
    }
}

@media (max-width: 760px) {
    .modules-hero {
        grid-template-columns: 1fr;
        padding: 24px;
        border-radius: 0;
    }

    .modules-hero h1 {
        max-width: none;
        font-size: clamp(1.92rem, 10vw, 2.7rem);
    }

    body.dashboard-user .module-card,
    body.dashboard-user .panel,
    body.dashboard-user .message {
        border-radius: 0;
    }

    body.dashboard-user .module-panel > form,
    body.dashboard-user .module-command-group {
        padding: 18px;
        border-radius: 0;
    }
}
