@layer base {
/* Sidebar */
.sidebar {
    background: var(--sc-surface);
    border-right: 1px solid var(--sc-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-base);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--sc-border);
    background: var(--sc-surface);
    position: sticky;
    top: 0;
    z-index: 2;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
    transition: opacity var(--transition-fast);
}

.sidebar-group {
    padding: var(--space-sm) 0;
    flex-shrink: 0;
}

.sidebar-group-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sc-grey);
    padding: var(--space-sm) var(--space-lg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--transition-fast);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-item {
    position: relative;
}

.sidebar-nav-item a,
.sidebar-nav-item button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    color: var(--sc-light-grey);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.sidebar-nav-item a:hover,
.sidebar-nav-item button:hover {
    background: rgba(var(--sc-white-rgb), 0.04);
    color: var(--sc-white);
}

.sidebar-nav-item.active a,
.sidebar-nav-item.active button {
    background: linear-gradient(90deg, rgba(var(--sc-accent-rgb), 0.14), rgba(var(--sc-accent-rgb), 0.04) 70%, transparent);
    color: var(--sc-accent);
    box-shadow: inset 2px 0 0 var(--sc-accent), inset 12px 0 18px -12px rgba(var(--sc-accent-rgb), 0.35);
}

.sidebar-nav-item .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
}

.sidebar-nav-label {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-fast);
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: auto;
    padding: var(--space-sm) var(--space-sm);
    border-top: 1px solid var(--sc-border);
    background: var(--sc-surface);
    box-shadow: 0 -8px 16px -12px rgba(0, 0, 0, 0.6);
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-sm);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--sc-grey);
    font: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
    justify-content: flex-start;
    white-space: nowrap;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-toggle-btn:hover {
    background: rgba(var(--sc-white-rgb), 0.05);
    color: var(--sc-white);
}

.sidebar-toggle-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.sidebar-collapsed .sidebar-title,
.sidebar-collapsed .sidebar-group-title,
.sidebar-collapsed .sidebar-nav-label,
.sidebar-collapsed .sidebar-toggle-label {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar-collapsed .sidebar-header,
.sidebar-collapsed .sidebar-footer {
    padding-left: var(--space-xs);
    padding-right: var(--space-xs);
    justify-content: center;
}

.sidebar-collapsed .sidebar-nav-item a,
.sidebar-collapsed .sidebar-nav-item button {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
    gap: 0;
}

.sidebar-collapsed .sidebar-toggle-btn {
    justify-content: center;
    gap: 0;
    padding: var(--space-sm) 0;
}
.sidebar-collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    background: linear-gradient(180deg, var(--sc-surface-elevated), var(--sc-surface));
    border-bottom: 1px solid var(--sc-border);
    box-shadow: inset 0 -1px 0 rgba(var(--sc-accent-rgb), 0.07);
    gap: var(--space-md);
    min-width: 0;
    backdrop-filter: blur(6px);
}

.header-clock {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
    letter-spacing: 0.08em;
    padding: 2px 10px;
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-sm);
    background: rgba(var(--sc-white-rgb), 0.03);
    white-space: nowrap;
    user-select: none;
}

.header-clock .clock-label {
    color: var(--sc-grey);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    margin-right: 6px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--sc-white);
    cursor: pointer;
    padding: var(--space-sm);
}

.search-input-wrapper {
    position: relative;
    width: 280px;
}

.search-input-wrapper input {
    padding-left: 2.25rem;
    background: var(--sc-bg);
    border-color: var(--sc-border);
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--sc-grey);
    pointer-events: none;
}

.notification-bell {
    position: relative;
    background: none;
    border: none;
    color: var(--sc-light-grey);
    cursor: pointer;
    padding: var(--space-sm);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    background: var(--sc-amber);
    color: var(--on-amber);
    border-radius: 9px;
    box-shadow: 0 0 10px rgba(var(--sc-amber-rgb), 0.45);
    border-radius: 9px;
    pointer-events: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--sc-border);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.user-avatar:hover {
    border-color: var(--sc-accent);
}

.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--sc-surface-elevated);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    list-style: none;
    padding: var(--space-sm) 0;
    z-index: 100;
}

.user-dropdown-menu li a,
.user-dropdown-menu li button {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    color: var(--sc-light-grey);
    font-size: var(--font-size-sm);
    text-decoration: none;
    background: none;
    border: none;
    border-radius: 0;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.user-dropdown-menu li a:hover,
.user-dropdown-menu li button:hover {
    background: rgba(var(--sc-white-rgb), 0.04);
    color: var(--sc-white);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 90vw;
    max-width: 520px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(-10px);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--sc-border);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--sc-grey);
    cursor: pointer;
    padding: var(--space-xs);
    line-height: 1;
    font-size: var(--font-size-lg);
}

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

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--sc-border);
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--sc-border);
    border-top-color: var(--sc-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-sm { width: 16px; height: 16px; }
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

/* Toast */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-md));
    right: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 300;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--sc-surface-elevated);
    border: 1px solid var(--sc-border);
    border-left: 4px solid var(--sc-accent);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-md);
    min-width: 260px;
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    animation: toastIn 300ms ease;
}

.toast.toast-out {
    animation: toastOut 300ms ease forwards;
}

.toast-success { border-left-color: var(--sc-success); }
.toast-danger { border-left-color: var(--sc-danger); }
.toast-warning { border-left-color: var(--sc-warning); }

@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); }
}

/* Buttons (extended) */
.btn-secondary {
    background: var(--sc-surface);
    border-color: var(--sc-border-hover);
    color: var(--sc-light-grey);
}

.btn-secondary:hover {
    background: var(--sc-surface-elevated);
    border-color: var(--sc-grey);
    color: var(--sc-white);
}

.btn-success {
    background: rgba(var(--sc-success-rgb), 0.15);
    border-color: var(--sc-success);
    color: var(--sc-success);
}

.btn-success:hover {
    background: rgba(var(--sc-success-rgb), 0.25);
}

.btn-warning {
    background: rgba(var(--sc-amber-rgb), 0.15);
    border-color: var(--sc-warning);
    color: var(--sc-warning);
}

.btn-warning:hover {
    background: rgba(var(--sc-amber-rgb), 0.25);
}

.btn-info {
    background: rgba(var(--sc-accent-rgb), 0.15);
    border-color: var(--sc-accent);
    color: var(--sc-accent);
}

.btn-info:hover {
    background: rgba(var(--sc-accent-rgb), 0.25);
}

.btn-outline {
    background: transparent;
    border-color: var(--sc-border-hover);
    color: var(--sc-light-grey);
}

.btn-outline:hover {
    background: var(--sc-surface-elevated);
    border-color: var(--sc-accent);
    color: var(--sc-white);
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-md);
}

.btn-xs {
    padding: 2px 6px;
    font-size: 0.7rem;
}

.filter-btn.active,
.draft-filter.active,
.spotlight-filter.active {
    background: var(--sc-blue);
    border-color: var(--sc-blue);
    color: var(--on-fill);
}

/* Badges (extended) */
.badge-info {
    background: rgba(var(--sc-accent-rgb), 0.14);
    color: var(--sc-accent);
}

.badge-primary {
    background: color-mix(in srgb, var(--sc-blue) 35%, transparent);
    color: var(--sc-accent);
}

.badge-default,
.badge-muted {
    background: color-mix(in srgb, var(--sc-grey) 14%, transparent);
    color: var(--sc-light-grey);
}
.badge-success {
    background: rgba(var(--sc-success-rgb), 0.12);
    color: var(--sc-success);
}

.badge-danger {
    background: var(--sc-danger-bg);
    color: var(--sc-danger);
}

.badge-warning {
    background: rgba(var(--sc-amber-rgb), 0.12);
    color: var(--sc-warning);
}

.badge-secondary {
    background: color-mix(in srgb, var(--sc-grey) 12%, transparent);
    color: var(--sc-grey);
}

.badge-shared {
    background: rgba(var(--sc-accent-rgb), 0.12);
    color: var(--sc-accent);
}

.badge-active {
    background: rgba(var(--sc-success-rgb), 0.12);
    color: var(--sc-success);
}

.badge-pending {
    background: rgba(var(--sc-amber-rgb), 0.12);
    color: var(--sc-warning);
}

.badge-inactive {
    background: color-mix(in srgb, var(--sc-grey) 12%, transparent);
    color: var(--sc-grey);
}

.badge-online {
    background: rgba(var(--sc-success-rgb), 0.12);
    color: var(--sc-success);
}

.badge-offline {
    background: color-mix(in srgb, var(--sc-grey) 12%, transparent);
    color: var(--sc-grey);
}

.badge-live {
    background: var(--sc-danger-bg);
    color: var(--sc-danger);
}

.badge-synced {
    background: rgba(var(--sc-success-rgb), 0.12);
    color: var(--sc-success);
}

.badge-syncing {
    background: rgba(var(--sc-amber-rgb), 0.12);
    color: var(--sc-warning);
}

.badge-running {
    background: rgba(var(--sc-accent-rgb), 0.12);
    color: var(--sc-accent);
}

.badge-failed {
    background: var(--sc-danger-bg);
    color: var(--sc-danger);
}

/* Forms (extended) */
.form {
    max-width: 560px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-row > * {
    min-width: 0;
}

.form-help {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    margin-top: var(--space-xs);
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

.form-inline input:not([type="checkbox"]):not([type="radio"]),
.form-inline select {
    width: auto;
    min-width: 140px;
    max-width: 100%;
}

.input-sm {
    padding: 4px 8px;
    font-size: var(--font-size-xs);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
}

.checkbox-label,
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
}

/* Toggle switch & structured settings rows */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.toggle-track {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    background: var(--sc-surface-elevated);
    border: 1px solid var(--sc-border-hover);
    border-radius: 9999px;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--sc-grey);
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-track {
    background: rgba(var(--sc-accent-rgb), 0.22);
    border-color: var(--sc-accent);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-track::after {
    transform: translateX(20px);
    background: var(--sc-accent);
}

.toggle-switch input[type="checkbox"]:focus-visible + .toggle-track {
    box-shadow: 0 0 0 2px rgba(var(--sc-accent-rgb), 0.35);
}

.toggle-state-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sc-grey);
    min-width: 56px;
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-state-label {
    color: var(--sc-accent);
}

.settings-list {
    display: flex;
    flex-direction: column;
}

.setting-row {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(220px, 380px) auto;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--sc-border);
}

.setting-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-row:first-child {
    padding-top: 0;
}

.setting-info {
    min-width: 0;
}

.setting-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--sc-white);
}

.setting-key {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    font-weight: 400;
}

.setting-desc {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    margin-top: 2px;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    min-width: 0;
}

.setting-control input:not([type="checkbox"]):not([type="radio"]),
.setting-control select,
.setting-control textarea {
    width: 100%;
    min-width: 0;
}

.setting-unit {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    white-space: nowrap;
}

.setting-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-xs);
}

.setting-row.setting-row-compact {
    grid-template-columns: minmax(180px, 1fr) auto;
}

@media (max-width: 768px) {
    .setting-row {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .setting-row.setting-row-compact {
        grid-template-columns: 1fr auto;
    }

    .setting-actions {
        justify-content: flex-start;
    }
}

/* Page header & tab bar aliases */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.page-header h1,
.page-header h2 {
    margin: 0;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--sc-border);
}

.tab-bar .tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--sc-grey);
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tab-bar .tab:hover {
    color: var(--sc-white);
    background: none;
}

.tab-bar .tab.active {
    color: var(--sc-accent);
    border-bottom-color: var(--sc-accent);
}

.search-result-item:hover {
    background: rgba(var(--sc-white-rgb), 0.06);
}

.input-select {
    font-family: inherit;
    font-size: var(--font-size-sm);
    color: var(--sc-white);
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
}

.input-select:focus {
    border-color: var(--sc-accent);
    box-shadow: 0 0 0 2px rgba(var(--sc-accent-rgb), 0.15);
}

.hint {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    margin-top: var(--space-xs);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--sc-grey);
    margin-bottom: var(--space-md);
}

.breadcrumb a {
    color: var(--sc-grey);
}

.breadcrumb a:hover {
    color: var(--sc-accent);
}

.breadcrumb span {
    color: var(--sc-white);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
    align-items: center;
}

.filter-bar .input,
.filter-bar select {
    width: auto;
    min-width: 160px;
}

/* Section header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--sc-white);
}

/* Card grid & extended card */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: var(--space-md);
}

.card-body {
    padding: var(--space-md);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--sc-border);
}

/* Data table responsive wrapper */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}
.data-table thead th {
    text-align: left;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sc-grey);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--sc-border-strong);
    white-space: nowrap;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--sc-border);
    transition: background var(--transition-fast);
}
.data-table tbody tr:nth-child(even) {
    background: rgba(var(--sc-white-rgb), 0.015);
}
.data-table tbody tr:hover {
    background: rgba(var(--sc-accent-rgb), 0.05);
}
.data-table tbody td {
    padding: var(--space-sm) var(--space-md);
    vertical-align: middle;
}

/* Progress bar */
.progress-bar {
    background: var(--sc-surface-elevated);
    border-radius: var(--radius-sm);
    height: 8px;
    overflow: hidden;
    width: 100%;
}

.progress-fill {
    height: 100%;
    width: var(--fill, 0%);
    border-radius: var(--radius-sm);
    background: var(--fill-color, var(--sc-accent));
    transition: width 0.3s ease;
}

.progress-success .progress-fill {
    background: var(--sc-success);
}

.progress-text {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    margin-top: var(--space-xs);
}

/* Tab content */
.tab-content {
    padding-top: var(--space-md);
}

.tab-btn + .tab-btn {
    margin-left: var(--space-xs);
}

/* Tags */
.tag, .tags {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.tag {
    background: rgba(var(--sc-accent-rgb), 0.1);
    color: var(--sc-accent);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.tags {
    flex-wrap: wrap;
    gap: var(--space-xs);
}

/* Info row */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--sc-border);
    font-size: var(--font-size-sm);
}

.info-row:last-child {
    border-bottom: none;
}

/* Alert */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--sc-accent);
    background: rgba(var(--sc-accent-rgb), 0.08);
    margin-bottom: var(--space-md);
    font-size: var(--font-size-sm);
}

.alert-warning {
    border-left-color: var(--sc-warning);
    background: rgba(var(--sc-amber-rgb), 0.08);
}

.alert-danger {
    border-left-color: var(--sc-danger);
    background: rgba(255, 59, 59, 0.08);
}

.alert-success {
    border-left-color: var(--sc-success);
    background: rgba(var(--sc-success-rgb), 0.08);
}

.alert-info {
    border-left-color: var(--sc-accent);
    background: rgba(var(--sc-accent-rgb), 0.08);
}

.alert-item {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--sc-border);
}

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

.alert-list {
    list-style: none;
}

.alert-message {
    font-size: var(--font-size-sm);
}

/* Notifications */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: border-color var(--transition-fast);
}

.notification-item:hover {
    border-color: var(--sc-border-hover);
}

.notification-item.notification-unread {
    border-left: 3px solid var(--sc-accent);
}

.notification-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

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

.notification-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--sc-white);
    margin-bottom: 2px;
}

.notification-message {
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
    margin-bottom: var(--space-xs);
}

.notification-time {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
}

/* Messaging layout */
.page-messages {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.messaging-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-md);
    flex: 1;
    min-height: 420px;
    overflow: hidden;
}

.conversation-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    min-height: 0;
    overflow: hidden;
}

.conversation-sidebar .toolbar {
    padding: var(--space-sm) var(--space-md);
    margin-bottom: 0;
    border-bottom: 1px solid var(--sc-border);
    flex-shrink: 0;
}

.conversation-sidebar #conversations {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.conversation-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--sc-border);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.conversation-item:hover {
    background: var(--sc-surface-elevated);
}

.conversation-item.active {
    background: rgba(26, 77, 124, 0.2);
    border-left: 3px solid var(--sc-accent);
}

.conv-partner {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--sc-white);
}

.conv-preview {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-pane {
    display: flex;
    flex-direction: column;
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.chat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.chat-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--sc-grey);
    font-size: var(--font-size-sm);
}

.chat-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--sc-border);
    font-weight: 600;
    font-size: var(--font-size-md);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.chat-input-bar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--sc-border);
}

.chat-input-bar .input {
    flex: 1;
}

.message {
    max-width: 70%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
}

.message.incoming {
    background: var(--sc-surface-elevated);
    align-self: flex-start;
}

.message.outgoing {
    background: var(--sc-blue);
    align-self: flex-end;
}

.message-content {
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.message-time {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    margin-top: 2px;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    gap: var(--space-md);
}

.achievement-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.achievement-card:hover {
    border-color: var(--sc-border-hover);
    box-shadow: var(--shadow-md);
}

.achievement-card.achievement-earned {
    border-color: var(--sc-success);
    background: rgba(var(--sc-success-rgb), 0.04);
}

.achievement-card.achievement-locked {
    opacity: 0.6;
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.achievement-points {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    margin-top: var(--space-sm);
}

/* Balance card */
.balance-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
}

.balance-label {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-xs);
}

.balance-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--sc-white);
}

/* Bookmark card */
.bookmark-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: border-color var(--transition-fast);
}

.bookmark-card:hover {
    border-color: var(--sc-border-hover);
}

.bookmark-url {
    font-size: var(--font-size-xs);
    color: var(--sc-accent);
    word-break: break-all;
    margin-bottom: var(--space-sm);
}

.bookmark-notes {
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
    margin-bottom: var(--space-sm);
}

.bookmark-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

/* Calendar */
.calendar-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-lg);
}

.calendar-layout > * {
    min-width: 0;
}

.calendar-month {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-width: 0;
    overflow-x: auto;
}

/* Changelog */
.changelog-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.changelog-entry {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.changelog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.changelog-body {
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
    line-height: 1.6;
}

.changelog-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

/* Conversation (forum) */
.forum-category {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    padding: var(--space-lg);
}

.thread-list {
    list-style: none;
}

.thread-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--sc-border);
}

.thread-row:last-child {
    border-bottom: none;
}

.thread-title {
    font-weight: 600;
    color: var(--sc-white);
    font-size: var(--font-size-sm);
}

.thread-meta {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
}

/* Event list */
.event-list-panel {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.event-item {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--sc-border);
}

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

.event-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--sc-white);
}

.event-desc {
    font-size: var(--font-size-xs);
    color: var(--sc-light-grey);
}

.event-meta {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    margin-top: var(--space-xs);
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: var(--space-md);
}

.gallery-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.gallery-card:hover {
    border-color: var(--sc-border-hover);
}

.gallery-thumb {
    width: 100%;
    height: 200px;
    background: var(--sc-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.placeholder-thumb {
    width: 100%;
    height: 160px;
    background: var(--sc-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sc-grey);
}

.gallery-info {
    padding: var(--space-md);
}

/* Goal card */
.goal-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.goal-progress {
    margin-top: var(--space-sm);
}

/* Lottery */
.lottery-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.lottery-info {
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
}

/* Member card */
.member-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: border-color var(--transition-fast);
}

.member-card:hover {
    border-color: var(--sc-border-hover);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--sc-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--sc-accent);
    flex-shrink: 0;
}

.member-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--sc-white);
}

.member-handle {
    font-size: var(--font-size-xs);
    color: var(--sc-accent);
}

.member-role {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
}

/* Permission matrix */
.permission-matrix {
    width: 100%;
    border-collapse: collapse;
}

.permission-matrix th,
.permission-matrix td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--sc-border);
    font-size: var(--font-size-sm);
}

/* Post (forum/social) */
.post {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.post-body {
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
    line-height: 1.6;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Profile */
.profile-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(90deg, rgba(26, 77, 124, 0.3), transparent);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sc-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--sc-accent);
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sc-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--sc-accent);
    flex-shrink: 0;
}

.profile-details {
    flex: 1;
}

.profile-meta {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
}

.profile-body {
    padding: var(--space-lg);
}

.bio {
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

/* SOP card */
.sop-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.sop-meta {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    margin-bottom: var(--space-sm);
}

.sop-body {
    font-size: var(--font-size-sm);
    color: var(--sc-light-grey);
}

.sop-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Store card */
.store-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* Legal */
.legal-content {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    line-height: 1.7;
    color: var(--sc-light-grey);
}

.legal-footer {
    margin-top: var(--space-lg);
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
    text-align: center;
}

/* Ticket list */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.ticket-number {
    font-size: var(--font-size-xs);
    color: var(--sc-grey);
}

/* Transaction amount */
.tx-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tx-amount.positive {
    color: var(--sc-success);
}

/* Verification */
.verify-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sc-success);
    color: var(--on-fill);
    font-size: var(--font-size-sm);
}

.verify-approve-btn,
.verify-reject-btn {
    font-size: var(--font-size-xs);
    padding: 4px 10px;
}

.verify-approve-btn {
    background: rgba(var(--sc-success-rgb), 0.15);
    border-color: var(--sc-success);
    color: var(--sc-success);
}

.verify-reject-btn {
    background: rgba(255, 59, 59, 0.15);
    border-color: var(--sc-danger);
    color: var(--sc-danger);
}

/* Screenshot list */
.screenshot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: var(--space-sm);
}

/* Cron logs */
.cron-logs {
    max-height: 400px;
    overflow-y: auto;
    background: var(--sc-surface-elevated);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-family: monospace;
    font-size: var(--font-size-xs);
    color: var(--sc-light-grey);
}

/* Detail list */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

dl.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
}

dl.detail-list dt {
    font-weight: 600;
    color: var(--sc-grey);
}

dl.detail-list dd {
    color: var(--sc-light-grey);
    min-width: 0;
    word-break: break-word;
}

/* Placeholder panel */
.placeholder-panel {
    background: var(--sc-surface);
    border: 1px dashed var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    color: var(--sc-grey);
}

/* Project detail */
.project-detail {
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* Positive/negative utility */
.positive {
    color: var(--sc-success);
}

.negative {
    color: var(--sc-danger);
}

.warning {
    color: var(--sc-warning);
}

.compact {
    font-size: var(--font-size-xs);
}

.large {
    font-size: var(--font-size-2xl);
}

.handle {
    color: var(--sc-accent);
    font-size: var(--font-size-sm);
}

/* Mobile & Responsive */
@media (max-width: 768px) {
    .app-layout,
    .app-layout.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--sidebar-width);
        z-index: 150;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }

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

    .sidebar-collapsed .sidebar-title,
    .sidebar-collapsed .sidebar-group-title,
    .sidebar-collapsed .sidebar-nav-label,
    .sidebar-collapsed .sidebar-toggle-label {
        opacity: 1;
        pointer-events: auto;
        width: auto;
    }

    .sidebar-collapsed .sidebar-toggle-icon {
        transform: none;
    }

    .sidebar-collapsed .sidebar-toggle-btn {
        justify-content: flex-start;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-lg);
    }

    .sidebar-collapsed .sidebar-header,
    .sidebar-collapsed .sidebar-footer {
        padding: var(--space-md) var(--space-lg);
        justify-content: flex-start;
    }

    .sidebar-collapsed .sidebar-nav-item a,
    .sidebar-collapsed .sidebar-nav-item button {
        padding: var(--space-sm) var(--space-lg);
        justify-content: flex-start;
        gap: var(--space-sm);
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .header {
        padding: 0 var(--space-md);
        gap: var(--space-sm);
    }

    .header-left {
        flex: 1;
        gap: var(--space-sm);
    }

    .search-input-wrapper {
        width: auto;
        flex: 1;
        min-width: 100px;
        max-width: 220px;
    }

    .main-content {
        padding: var(--space-md);
    }

    .toast-container {
        right: var(--space-md);
        left: var(--space-md);
        align-items: flex-end;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
    }

    .messaging-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(160px, 35%) 1fr;
    }

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

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

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

/* ---- Category hub pages ---- */
.hub-page {
    max-width: 1280px;
}

.hub-eyebrow {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--sc-grey);
    margin-bottom: var(--space-md);
}

.hub-crumb {
    background: none;
    border: none;
    color: var(--sc-light-grey);
    font: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.hub-crumb:hover { color: var(--sc-accent); text-decoration: underline; }

.hub-crumb-sep { color: var(--sc-border-hover); }

.hub-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
}

.hub-header-icon {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(var(--sc-accent-rgb), 0.14), rgba(var(--sc-accent-rgb), 0.04));
    border: 1px solid rgba(var(--sc-accent-rgb), 0.25);
    color: var(--sc-accent);
}

.hub-header-icon svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
    fill: none;
}

.hub-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 var(--space-xs) 0;
}

.hub-subtitle {
    color: var(--sc-light-grey);
    margin: 0;
    max-width: 60ch;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-md);
}

.hub-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    text-align: left;
    padding: var(--space-lg);
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--sc-white);
    transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
    font: inherit;
}

.hub-card:hover,
.hub-card:focus-visible {
    border-color: var(--sc-border-hover);
    background: var(--sc-surface-elevated);
    transform: translateY(-2px);
    outline: none;
    box-shadow: var(--accent-glow-soft), var(--inset-highlight);
}

.hub-card:focus-visible {
    box-shadow: 0 0 0 2px var(--sc-accent);
}

.hub-card-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(var(--sc-accent-rgb), 0.08);
    color: var(--sc-accent);
}

.hub-card-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
}

.hub-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hub-card-title {
    font-weight: 600;
    font-size: var(--font-size-md);
}

.hub-card-desc {
    color: var(--sc-grey);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.hub-card-arrow {
    align-self: center;
    margin-left: auto;
    color: var(--sc-grey);
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.hub-card:hover .hub-card-arrow,
.hub-card:focus-visible .hub-card-arrow {
    color: var(--sc-accent);
    transform: translateX(3px);
}

@media (max-width: 640px) {
    .hub-grid {
        grid-template-columns: 1fr;
    }
    .hub-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
}

/* ---- Collapsible sidebar groups ---- */
.sidebar-pinned {
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-xs);
    border-bottom: 1px solid var(--sc-border);
    flex-shrink: 0;
}

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px var(--space-sm) 2px var(--space-md);
}

.sidebar-group-link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--sc-grey);
    cursor: pointer;
    text-align: left;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.sidebar-group-link:hover {
    color: var(--sc-white);
    background: rgba(var(--sc-white-rgb), 0.04);
}

.sidebar-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--sc-grey);
}

.sidebar-group-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.sidebar-group-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-group--active .sidebar-group-title,
.sidebar-group--active .sidebar-group-icon {
    color: var(--sc-accent);
}

.sidebar-group-count {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--sc-grey);
    background: rgba(var(--sc-white-rgb), 0.06);
    border-radius: 999px;
    padding: 1px 7px;
    line-height: 1.4;
    flex-shrink: 0;
}

.sidebar-group-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--sc-grey);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.sidebar-group-toggle:hover {
    color: var(--sc-white);
    background: rgba(var(--sc-white-rgb), 0.06);
}

.sidebar-group-toggle .chevron {
    width: 16px;
    height: 16px;
    transform: rotate(-90deg);
    transition: transform var(--transition-fast);
}

.sidebar-group--open .sidebar-group-toggle .chevron {
    transform: rotate(0deg);
}



/* Icon-only (collapsed) sidebar: show all items, hide group chrome */
.sidebar-collapsed .sidebar-group-header,
.sidebar-collapsed .sidebar-group-count {
    display: none;
}

.sidebar-home {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.sidebar-home:hover .sidebar-title {
    color: var(--sc-white);
}

/* Quick actions: restrained ghost buttons with accent reveal */
.quick-actions .qa-btn {
    justify-content: flex-start;
    border-color: var(--sc-border);
    color: var(--sc-light-grey);
    background: rgba(var(--sc-white-rgb), 0.02);
}
.quick-actions .qa-btn:hover {
    color: var(--sc-accent);
    border-color: var(--sc-border-hover);
    background: rgba(var(--sc-accent-rgb), 0.06);
    box-shadow: none;
}
.quick-actions .qa-danger {
    color: var(--sc-danger);
    border-color: rgba(var(--sc-danger-rgb), 0.4);
}
.quick-actions .qa-danger:hover {
    color: var(--sc-danger);
    border-color: var(--sc-danger);
    background: rgba(var(--sc-danger-rgb), 0.09);
}

/* ---- Utility classes (extracted from inline styles) ---- */
/* NB: not !important so JS can toggle with el.style.display */
.hidden { display: none !important; }
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.w-auto { width: auto; }
.text-muted { color: var(--sc-grey); }
.text-danger { color: var(--sc-danger); }
.text-success { color: var(--sc-success); }
.text-warning { color: var(--sc-warning); }
.text-accent { color: var(--sc-accent); }
.text-amber { color: var(--sc-amber); }
.text-sm { font-size: 0.85em; }
.text-xs { font-size: 0.75em; }
.text-muted-sm { font-size: 0.85em; color: var(--sc-grey); }

/* ---- Sidebar: mobile overlay, rail tooltips, group animation ---- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(4, 8, 16, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}
.app-layout.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-nav {
    overflow: hidden;
    max-height: 40rem;
    opacity: 1;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, visibility 0.28s;
    visibility: visible;
}
.sidebar-nav.sidebar-nav--closed {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Rail mode: icons for every item stay visible regardless of collapse state.
   Must come after the closed rule with equal/higher specificity. */
.sidebar-collapsed .sidebar-nav,
.sidebar-collapsed .sidebar-nav.sidebar-nav--closed,
.sidebar-collapsed .sidebar-nav--closed {
    max-height: none;
    opacity: 1;
    visibility: visible;
    overflow: visible;
    pointer-events: auto;
}

/* Icon-rail mode: group dividers instead of group chrome */
.sidebar-collapsed .sidebar-group {
    padding: var(--space-xs) 0;
    border-top: 1px solid var(--sc-border);
}
.sidebar-collapsed .sidebar-group:first-of-type {
    border-top: none;
}

/* Rail tooltip (rendered as a floating element by sidebar.js) */
.sidebar-tooltip {
    position: fixed;
    left: var(--tip-x, 0);
    top: var(--tip-y, 0);
    z-index: 1000;
    transform: translateY(-50%);
    background: var(--sc-surface-3, #1a2438);
    color: var(--sc-white);
    border: 1px solid var(--sc-border-strong, rgba(148,184,220,0.25));
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.sidebar-tooltip.visible { opacity: 1; }

.sidebar-tooltip .tip-hub {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--sc-grey);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-nav { transition: none; }
}

/* Icon-rail refinements */
.sidebar-collapsed .sidebar-nav-item {
    padding: 1px var(--space-xs);
}
.sidebar-collapsed .sidebar-nav-item a,
.sidebar-collapsed .sidebar-nav-item button {
    height: 42px;
    border-radius: var(--radius-md);
    border-left: none;
}
.sidebar-collapsed .sidebar-nav-item.active a,
.sidebar-collapsed .sidebar-nav-item.active button {
    border-left: none;
    background: linear-gradient(180deg, rgba(var(--sc-accent-rgb), 0.18), rgba(var(--sc-accent-rgb), 0.07));
    box-shadow: inset 0 0 0 1px rgba(var(--sc-accent-rgb), 0.4), 0 0 14px rgba(var(--sc-accent-rgb), 0.18);
}
.sidebar-collapsed .sidebar-header {
    padding: var(--space-sm) var(--space-xs);
    justify-content: center;
}

/* ---- Utility classes, batch 2 (extracted from inline styles) ---- */
.fs-70 { font-size: 0.7em; }
.fs-80 { font-size: 0.8em; }
.fs-90 { font-size: 0.9em; }
.fs-100 { font-size: 1em; }
.fs-085r { font-size: 0.85rem; }
.fs-150 { font-size: 1.5rem; }
.fs-200 { font-size: 2rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.text-strong { color: var(--sc-white); }
.text-soft { color: var(--sc-light-grey); }
.text-blue { color: var(--sc-blue); }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; }
.pre-wrap { white-space: pre-wrap; }
.no-border { border: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.object-cover { object-fit: cover; }
.rounded-sm { border-radius: 4px; }
.rounded { border-radius: 8px; }
.rounded-full { border-radius: 9999px; }
.p-0 { padding: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.my-xs { margin: var(--space-xs) 0; }
.my-sm { margin: var(--space-sm) 0; }
.my-md { margin: var(--space-md) 0; }
.ml-auto { margin-left: auto; }
.ml-sm { margin-left: var(--space-sm); }
.bg-elevated { background: var(--sc-surface-elevated); }
.bg-success { background: var(--sc-success); }
.bg-danger { background: var(--sc-danger); }
.bg-warning { background: var(--sc-warning); }
.border-l-danger { border-left: 3px solid var(--sc-danger); }
.border-l-success { border-left: 3px solid var(--sc-success); }
.border-l-warning { border-left: 3px solid var(--sc-warning); }
.border-l-grey { border-left: 3px solid var(--sc-grey); }

/* ---- Utility classes, batch 3 (extracted from inline styles) ---- */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.grid-auto-200 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid-auto-250 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-auto-280 { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.grid-auto-300 { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.grid-auto-320 { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.grid-fit-110 { grid-template-columns: repeat(auto-fit, minmax(min(110px, 100%), 1fr)); }
.grid-fit-140 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.grid-fit-220 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.grid-fit-260 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.min-w-0 { min-width: 0; }
.min-h-0 { min-height: 0; }
.min-w-60 { min-width: 60px; }
.min-w-80 { min-width: 80px; }
.min-w-100 { min-width: 100px; }
.min-w-120 { min-width: 120px; }
.min-w-140 { min-width: 140px; }
.min-w-150 { min-width: 150px; }
.min-w-180 { min-width: 180px; }
.min-w-200 { min-width: 200px; }
.min-w-220 { min-width: 220px; }
.min-w-240 { min-width: 240px; }
.min-w-full { min-width: 100%; }
.max-w-100 { max-width: 100px; }
.max-w-110 { max-width: 110px; }
.max-w-140 { max-width: 140px; }
.max-w-150 { max-width: 150px; }
.max-w-160 { max-width: 160px; }
.max-w-170 { max-width: 170px; }
.max-w-180 { max-width: 180px; }
.max-w-200 { max-width: 200px; }
.max-w-220 { max-width: 220px; }
.max-w-260 { max-width: 260px; }
.max-w-300 { max-width: 300px; }
.max-w-400 { max-width: 400px; }
.max-w-760 { max-width: 760px; }
.max-w-100p { max-width: 100%; }
.min-h-400 { min-height: 400px; }
.h-px-2 { height: 2px; }
.h-6 { height: 6px; }
.h-8 { height: 8px; }
.h-10px { height: 10px; }
.h-12 { height: 12px; }
.h-16 { height: 16px; }
.h-24 { height: 24px; }
.h-48 { height: 48px; }
.h-64 { height: 64px; }
.h-80 { height: 80px; }
.h-100 { height: 100px; }
.h-160 { height: 160px; }
.h-300 { height: 300px; }
.h-480 { height: 480px; }
.h-12rem { height: 12rem; }
.w-32 { width: 32px; }
.w-40 { width: 40px; }
.w-48 { width: 48px; }
.w-64 { width: 64px; }
.w-70 { width: 70px; }
.w-80 { width: 80px; }
.w-100 { width: 100px; }
.w-130 { width: 130px; }
.w-140 { width: 140px; }
.w-150 { width: 150px; }
.w-160 { width: 160px; }
.w-170 { width: 170px; }
.w-180 { width: 180px; }
.w-200 { width: 200px; }
.gap-2 { gap: 2px; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-04 { gap: 0.4rem; }
.gap-075 { gap: 0.75rem; }
.mt-2 { margin-top: 2px; }
.mt-6 { margin-top: 6px; }
.mt-075 { margin-top: 0.75rem; }
.mb-2 { margin-bottom: 2px; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-12 { margin-bottom: 12px; }
.mb-075 { margin-bottom: 0.75rem; }
.ml-2 { margin-left: 2px; }
.ml-4 { margin-left: 4px; }
.ml-6 { margin-left: 6px; }
.ml-8 { margin-left: 8px; }
.ml-025 { margin-left: 0.25rem; }
.ml-05 { margin-left: 0.5rem; }
.mr-2 { margin-right: 2px; }
.mr-4 { margin-right: 4px; }
.mr-05 { margin-right: 0.5rem; }
.ml-auto2 { margin-left: auto; }
.p-xs { padding: var(--space-xs); }
.p-4 { padding: 4px; }
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-1r { padding: 1rem; }
.p-075-1 { padding: 0.75rem 1rem; }
.p-6-12 { padding: 6px 12px; }
.p-8-12 { padding: 8px 12px; }
.p-2-6 { padding: 2px 6px; }
.p-0-xs { padding: 0 var(--space-xs); }
.p-075 { padding: 0.75rem; }
.p-2r { padding: 2rem; }
.pt-sm { padding-top: var(--space-sm); }
.pt-md { padding-top: var(--space-md); }
.pt-lg { padding-top: var(--space-lg); }
.pb-md { padding-bottom: var(--space-md); }
.pl-075 { padding-left: 0.75rem; }
.pl-20 { padding-left: 20px; }
.pl-2r { padding-left: 2rem; }
.fs-065 { font-size: 0.65rem; }
.fs-07r { font-size: 0.7rem; }
.fs-075r { font-size: 0.75rem; }
.fs-08r { font-size: 0.8rem; }
.fs-09r { font-size: 0.9rem; }
.fs-095r { font-size: 0.95rem; }
.fs-1r { font-size: 1rem; }
.fs-105r { font-size: 1.05em; }
.fs-11r { font-size: 1.1rem; }
.fs-12r { font-size: 1.2rem; }
.fs-110 { font-size: 1.1em; }
.fs-120 { font-size: 1.2em; }
.fs-150e { font-size: 1.5em; }
.fs-200e { font-size: 2em; }
.fs-95 { font-size: 0.95em; }
.fw-500 { font-weight: 500; }
.fw-bold { font-weight: 700; }
.line-height-14 { line-height: 1.4; }
.line-height-16 { line-height: 1.6; }
.line-height-17 { line-height: 1.7; }
.line-height-18 { line-height: 1.8; }
.vertical-middle { vertical-align: middle; }
.font-mono { font-family: var(--font-mono); }
.font-sans { font-family: sans-serif; }
.text-italic { font-style: italic; }
.text-underline { text-decoration: underline; }
.capitalize { text-transform: capitalize; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; }
.nowrap-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-visible { overflow: visible; }
.object-contain { object-fit: contain; }
.rounded-3 { border-radius: 3px; }
.rounded-6 { border-radius: 6px; }
.rounded-12 { border-radius: 12px; }
.rounded-16 { border-radius: 16px; }
.rounded-10 { border-radius: 10px; }
.rounded-2 { border-radius: 2px; }
.border-0 { border: none; }
.border { border: 1px solid var(--sc-border); }
.border-b { border-bottom: 1px solid var(--sc-border); }
.border-t { border-top: 1px solid var(--sc-border); }
.border-b-muted { border-bottom: 1px solid var(--color-border); }
.border-t-muted { border-top: 1px solid var(--color-border); }
.border-l-danger { border-left: 3px solid var(--sc-danger); }
.border-l-danger-4 { border-left: 4px solid var(--sc-danger); }
.border-l-success { border-left: 3px solid var(--sc-success); }
.border-l-success-4 { border-left: 4px solid var(--sc-success); }
.border-l-warning { border-left: 3px solid var(--sc-warning); }
.border-l-warning-4 { border-left: 4px solid var(--sc-warning); }
.border-l-grey { border-left: 3px solid var(--sc-grey); }
.border-l-accent { border-left: 3px solid var(--sc-blue); }
.border-danger { border: 1px solid var(--sc-danger); }
.border-warning { border: 1px solid var(--sc-warning); }
.border-warning-2 { border: 2px solid var(--sc-warning); }
.bg-elevated-2 { background: var(--sc-dark-3, var(--sc-surface-elevated)); }
.bg-info-soft { background: var(--sc-info-bg); }
.bg-danger-soft { background: var(--sc-danger-bg); }
.bg-warning-soft { background: var(--sc-warning-bg); }
.bg-gold-soft { background: color-mix(in srgb, var(--medal-gold) 15%, transparent); }
.bg-silver-soft { background: color-mix(in srgb, var(--medal-silver) 15%, transparent); }
.bg-bronze-soft { background: color-mix(in srgb, var(--medal-bronze) 15%, transparent); }
.bg-blue-soft { background: color-mix(in srgb, var(--sc-info) 13%, transparent); }
.text-gold { color: var(--medal-gold); }
.text-silver { color: var(--medal-silver); }
.text-bronze { color: var(--medal-bronze); }
.text-inverse { color: var(--on-fill); }
.text-shadow { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.sticky-top { position: sticky; top: 0; z-index: 100; }
.absolute-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.center-abs { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.flex-none { flex-shrink: 0; }
.flex-2 { flex: 2; }
.float-right { float: right; }
.list-none { list-style: none; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }
.opacity-85 { opacity: 0.85; }
.word-break { word-break: break-all; }
.square-32 { width: 32px; height: 32px; }
.square-40 { width: 40px; height: 40px; }
.square-48 { width: 48px; height: 48px; }
.square-64 { width: 64px; height: 64px; }
.track { height: 100%; }
.progress-thin { height: 6px; }
.progress-thin-8 { height: 8px; }

.p-xl { padding: var(--space-xl); }
.p-4-8 { padding: 4px 8px; }
.p-6-16 { padding: 6px 16px; }
.p-05-1 { padding: 0.5rem 1rem; }
.p-06-1 { padding: 0.6rem 1rem; }
.p-2-0 { padding: 2px 0; }
.p-0-05 { padding: 0.5rem 0; }
.mx-auto { margin: 0 auto; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mr-8 { margin-right: 8px; }
.mr-xs { margin-right: var(--space-xs); }
.mr-sm { margin-right: var(--space-sm); }
.mr-md { margin-right: var(--space-md); }
.min-w-30 { min-width: 30px; }
.min-w-110 { min-width: 110px; }
.max-w-120 { max-width: 120px; }
.max-w-800 { max-width: 800px; }
.max-w-720 { max-width: 720px; }
.max-w-640 { max-width: 640px; }
.max-h-64 { max-height: 64px; }
.max-h-80 { max-height: 80px; }
.max-h-150 { max-height: 150px; }
.max-h-200 { max-height: 200px; }
.max-h-320 { max-height: 320px; }
.max-h-480 { max-height: 480px; }
.max-h-500 { max-height: 500px; }
.max-h-600 { max-height: 600px; }
.max-h-60vh { max-height: 60vh; }
.grid-auto-240 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-auto-340 { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.grid-fit-100 { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.gap-4-16 { gap: 4px 16px; }
.bg-surface { background: var(--sc-surface); }
.bg-tertiary { background: var(--bg-tertiary, var(--sc-surface-3)); }
.bg-accent { background: var(--sc-accent); }
.bg-blue { background: var(--sc-blue); }
.bg-gold { background: var(--sc-gold); }
.bg-black { background: #000; }
.bg-overlay { background: var(--sc-overlay); }
.bg-white-05 { background: rgba(var(--sc-white-rgb), 0.05); }
.bg-gold-medal { background: var(--medal-gold); }
.bg-silver-medal { background: var(--medal-silver); }
.bg-bronze-medal { background: var(--medal-bronze); }
.text-light-blue { color: var(--sc-light-blue); }
.text-on-accent { color: var(--on-accent); }
.text-black { color: #000; }
.text-danger-strong { color: var(--sc-danger-strong); }
.border-t-2 { border-top: 2px solid var(--color-border); }
.border-color-muted { border-color: var(--color-border); }
.border-dash { border: 2px dashed var(--sc-border-strong); }
.border-b { border-bottom: 1px solid var(--sc-border); }
.center-xy { transform: translate(-50%, -50%); }
.z-1000 { z-index: 1000; }
.flex-07 { flex: 0.7; }
.tracking-wide { letter-spacing: 0.5px; }
.my-2 { margin: 2px 0; }
.my-4 { margin: 4px 0; }
.my-6 { margin: 6px 0; }
.my-8 { margin: 8px 0; }
.my-12 { margin: 12px 0; }
.my-05 { margin: 0.5rem 0; }
.my-02 { margin: 0.2rem 0; }
.my-lg { margin: var(--space-lg) 0; }
.my-md-sm { margin: var(--space-md) 0 var(--space-sm); }
.my-md-xs { margin: var(--space-md) 0 var(--space-xs); }
.my-sm-xs { margin: var(--space-sm) 0 var(--space-xs); }
.my-lg-sm { margin: var(--space-lg) 0 var(--space-sm); }
.m-0-0-sm { margin: 0 0 var(--space-sm); }
.m-0-0-xs { margin: 0 0 var(--space-xs); }
.m-0-0-8 { margin: 0 0 8px; }
.m-0-0-12 { margin: 0 0 12px; }
.m-0-0-sm-sm { margin: 0 0 var(--space-sm) var(--space-sm); }
.m-025-0-0 { margin: 0.25rem 0 0; }
.m-05-0-0 { margin: 0.5rem 0 0; }
.m-025-0-0-1 { margin: 0.25rem 0 0 1rem; }
.m-sm-0-0 { margin: var(--space-sm) 0 0; }
.m-xs-0-0 { margin: var(--space-xs) 0 0; }
.m-xs-0-0-sm { margin: var(--space-xs) 0 0 var(--space-sm); }
.m-02-0-02-1 { margin: 0.2rem 0 0.2rem 1rem; }
.m-0-4-4-0 { margin: 0 4px 4px 0; }
.m-8-0-2 { margin: 8px 0 2px; }
.m-0-auto-05 { margin: 0 auto 0.5rem; }
.m-2 { margin: 2px; }
.mx-8 { margin: 0 8px; }
.ml-1em { margin-left: 1em; }
.mb-1 { margin-bottom: 1px; }
.p-32 { padding: 32px; }
.p-05 { padding: 0.5rem; }
.p-05-075 { padding: 0.5rem 0.75rem; }
.p-02 { padding: 0.2rem; }
.p-04-06 { padding: 0.4rem 0.6rem; }
.p-6-8 { padding: 6px 8px; }
.p-2-8 { padding: 2px 8px; }
.p-2-10 { padding: 2px 10px; }
.p-0-1-075 { padding: 0 1rem 0.75rem; }
.p-0-8 { padding: 0 8px; }
.px-8 { padding: 0 8px; }
.py-xs { padding: var(--space-xs) 0; }
.py-sm { padding: var(--space-sm) 0; }
.p-sm-md { padding: var(--space-sm) var(--space-md); }
.h-20 { height: 20px; }
.h-30 { height: 30px; }
.h-32 { height: 32px; }
.h-auto { height: auto; }
.w-18 { width: 18px; }
.w-22 { width: 22px; }
.top-full { top: 100%; }
.top-8 { top: 8px; }
.bottom-8 { bottom: 8px; }
.sticky { position: sticky; }
.box-border { box-sizing: border-box; }
.transition-transform { transition: transform 0.4s ease; }
.transition-transform-fast { transition: transform 0.2s; }
.gap-03 { gap: 0.3rem; }
.gap-2r { gap: 2rem; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.opacity-70 { opacity: 0.7; }
.bg-purple { background: var(--sc-purple); }
.bg-twitch { background: var(--brand-twitch); }
.bg-danger-strong { background: var(--sc-danger-strong); }
.bg-border { background: var(--sc-border); }
.bg-base { background: var(--sc-dark); }
.text-dark { color: #333; }
.fs-140 { font-size: 1.4em; }
.fs-10 { font-size: 10px; }
.min-w-2_5em { min-width: 2.5em; }
.text-shadow { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.shadow-float { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.animate-pulse-live { animation: pulse-live 1.5s infinite; }
@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
.h-18 { height: 18px; }
.h-22 { height: 22px; }
.max-w-80 { max-width: 80px; }
.left-0 { left: 0; }
.left-12 { left: 12px; }
.right-8 { right: 8px; }
.top-0 { top: 0; }
.p-24-48 { padding: 24px 48px; }
.p-2-4 { padding: 2px 4px; }
.clear-both { clear: both; }
.transition-border { transition: border-color .2s; }
.font-system { font-family: system-ui, sans-serif; }
.mt-20vh { margin-top: 20vh; }
.right-0 { right: 0; }
.z-100 { z-index: 100; }
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--sc-surface); border: 1px solid var(--sc-border); border-radius: 0 0 6px 6px; max-height: 320px; overflow-y: auto; z-index: 1000; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.progress-fill.fill-success { --fill-color: var(--sc-success); }
.progress-fill.fill-warning { --fill-color: var(--sc-warning); }
.progress-fill.fill-danger { --fill-color: var(--sc-danger); }
.progress-fill.fill-accent { --fill-color: var(--sc-accent); }
.progress-fill.fill-accent-dim { --fill-color: var(--sc-accent-dim); }
.progress-fill.fill-grey { --fill-color: var(--sc-grey); }
.fw-400 { font-weight: 400; }
.fw-800 { font-weight: 800; }
.opacity-40 { opacity: 0.4; }
.p-4-6 { padding: 4px 6px; }
.vertical-top { vertical-align: top; }
.border-l-4 { border-left: 4px solid var(--sc-border-strong); }
.border-t-3 { border-top: 3px solid var(--sc-border-strong); }
.pos-abs-tl { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; }
.left-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; }
.border-t-accent { border-top: 3px solid var(--sc-accent); }
.border-t-success { border-top: 3px solid var(--sc-success); }
.border-t-warning { border-top: 3px solid var(--sc-warning); }
.border-t-danger { border-top: 3px solid var(--sc-danger); }
.border-t-blue { border-top: 3px solid var(--sc-blue); }
.pt-8 { padding-top: 8px; }
.seg { height: 100%; width: var(--seg, 0%); }
.bg-grey { background: var(--sc-grey); }
.seg-label { display: flex; align-items: center; justify-content: center; height: 100%; width: var(--seg, 0%); font-size: 0.7em; color: var(--on-fill); }
.seg-label.on-light { color: var(--on-amber); }
.text-on-fill { color: var(--on-fill); }

/* Recruitment stage chips (set --stage-color per stage) */
.stage-applied { --stage-color: var(--sc-grey); }
.stage-interview { --stage-color: var(--sc-accent-dim); }
.stage-trial { --stage-color: var(--sc-warning); }
.stage-evaluation { --stage-color: var(--sc-amber); }
.stage-accepted { --stage-color: var(--sc-success); }
.stage-rejected { --stage-color: var(--sc-danger); }
.stage-chip { background: var(--stage-color, var(--sc-grey)); color: var(--sc-dark); }
.stage-header { margin: 0 0 var(--space-sm); padding: var(--space-xs) var(--space-sm); background: var(--stage-color, var(--sc-grey)); color: var(--sc-dark); border-radius: var(--radius-sm); }
.done-item { text-decoration: line-through; opacity: 0.6; }
.prio-critical { --prio: var(--sc-danger); }
.prio-high { --prio: var(--sc-amber); }
.prio-normal { --prio: var(--sc-accent); }
.prio-low { --prio: var(--sc-grey); }
.border-l-prio { border-left: 3px solid var(--prio, var(--sc-accent)); }
.badge-prio { background: var(--prio, var(--sc-accent)); color: var(--on-fill); padding: 1px 6px; border-radius: 3px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sc-grey); }
.status-dot-sm { width: 8px; height: 8px; }
.status-dot-online { background: var(--sc-success); }
.status-dot-offline { background: var(--sc-grey); }
.carousel-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sc-grey); }
.carousel-dot-active { background: var(--sc-blue); }
.claim-dot { position: absolute; left: var(--x); top: var(--y); width: 12px; height: 12px; border-radius: 50%; background: var(--dot-color, var(--sc-success)); border: 2px solid rgba(var(--sc-white-rgb), 0.4); transform: translate(-50%, -50%); }
.carousel-track { transition: transform 0.4s ease; transform: translateX(calc(var(--slide, 0) * -100%)); }
.border-t-3 { border-top-width: 3px; border-top-style: solid; }
.signed-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; }
.badge-match-high { background: var(--sc-success); color: var(--sc-dark); }
.badge-match-mid { background: var(--sc-warning); color: var(--sc-dark); }
.badge-match-low { background: var(--sc-danger); color: var(--on-fill); }
.min-w-70 { min-width: 70px; }
.calendar-day { position: relative; padding: 4px 6px; min-height: 60px; vertical-align: top; }
.calendar-day-dim { opacity: 0.4; }
.cond-intact { --cond: var(--sc-success); }
.cond-minor { --cond: var(--sc-warning); }
.cond-major { --cond: var(--sc-danger); }
.cond-missing { --cond: var(--sc-purple); }
.badge-cond { background: var(--cond, var(--sc-grey)); color: var(--on-fill); }
.text-cond { color: var(--cond, var(--sc-grey)); }
.achievement-locked { opacity: 0.4; filter: grayscale(0.8); }
.celebration-star { position: absolute; left: 50%; top: 50%; font-size: var(--fs, 20px); opacity: 0; animation: celebration-pop 1.5s ease-out forwards; }
@keyframes celebration-pop {
    0% { opacity: 0; transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0); }
    30% { opacity: 1; transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(1.2); }
    60% { opacity: 1; transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(1); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0.8); }
}
.stack-seg { display: flex; align-items: center; justify-content: center; flex: var(--flex, 1); background: var(--seg-color, var(--sc-grey)); min-height: 100%; font-size: 0.7em; font-weight: 600; color: var(--on-fill); position: relative; }
.chart-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--swatch, var(--sc-grey)); }
.chart-swatch-sm { width: 8px; height: 8px; margin-right: 6px; vertical-align: middle; }
.fill-min { min-width: 2px; }
.tier-card { min-width: 140px; padding: var(--space-lg); border: 2px solid transparent; border-radius: var(--radius-md); }
.tier-card .tier-name { color: var(--tier-color, var(--sc-grey)); }
.tier-card.tier-card-active { border-color: var(--tier-color, var(--sc-grey)); }
.tier-bronze { --tier-color: var(--medal-bronze); }
.tier-silver { --tier-color: var(--medal-silver); }
.tier-gold { --tier-color: var(--medal-gold); }
.tier-none { --tier-color: var(--sc-grey); }
.badge-gold { background: var(--sc-gold); color: var(--on-amber); }
.gallery-thumb-img { width: 100%; height: 200px; object-fit: cover; display: block; }
/* Companion desktop overlay (injected by companion/src/inject.js) */
.companion-panel { position: fixed; right: 14px; bottom: 14px; z-index: 1500; background: color-mix(in srgb, var(--sc-surface-elevated) 94%, transparent); border: 1px solid var(--sc-border-strong); border-radius: 10px; padding: 10px 12px; color: var(--sc-white); font: 12px/1.5 'Rajdhani', system-ui, sans-serif; box-shadow: var(--shadow-lg); max-width: 280px; backdrop-filter: blur(6px); }
.companion-btn { cursor: pointer; background: var(--sc-surface-3); color: var(--sc-light-grey); border: 1px solid var(--sc-border-strong); border-radius: 6px; padding: 2px 8px; font: inherit; }
.companion-btn:hover { border-color: var(--sc-accent); color: var(--sc-accent); }
.companion-btn-danger { color: var(--sc-danger); border-color: color-mix(in srgb, var(--sc-danger) 45%, transparent); }
.companion-btn-danger:hover { border-color: var(--sc-danger); color: var(--sc-danger); }
.system-banner { text-align: center; padding: 8px; font-size: 14px; flex-shrink: 0; color: var(--on-fill); }
.system-banner-danger { background: var(--sc-danger-strong); }
.system-banner-critical { background: var(--sc-danger-strong); padding: 10px; font-weight: 600; position: relative; z-index: 9999; }
.ready-check-banner { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 1200; background: var(--surface-2, var(--sc-surface-elevated)); border: 1px solid var(--sc-accent); border-radius: 10px; padding: 14px 18px; box-shadow: var(--shadow-lg); min-width: 320px; max-width: 90vw; }
.webrtc-peer { position: relative; min-width: 200px; }
.webrtc-video { max-width: 240px; border-radius: 8px; background: #000; }
.webrtc-label { position: absolute; bottom: 4px; left: 8px; color: var(--on-fill); font-size: 0.75em; background: rgba(0, 0, 0, 0.6); padding: 2px 6px; border-radius: 3px; }
.celebration-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10000; pointer-events: none; text-align: center; }
.chevron { transition: transform 0.2s ease; }
.chevron-open { transform: rotate(180deg); }
#import-drop-zone.dragover { border-color: var(--sc-accent); }
}
.top-half { top: 50%; }
.left-half { left: 50%; }
.ml-md { margin-left: var(--space-md); }
.ml-xs { margin-left: var(--space-xs); }
.max-h-48 { max-height: 48px; }

/* ---- Voice channels board (comms → Channels tab) ---- */
.vc-board { display: flex; flex-direction: column; gap: var(--space-lg); }
.vc-board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.vc-title { font-size: var(--font-size-xl); margin: 0; }
.vc-sub { color: var(--sc-grey); margin: var(--space-xs) 0 0; font-size: var(--font-size-sm); }
.vc-actions { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; }
.vc-search { position: relative; }
.vc-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--sc-grey); pointer-events: none; }
.vc-filter { padding-left: 38px; min-width: 220px; }

.vc-section-head { display: flex; align-items: center; gap: var(--space-sm); margin: var(--space-md) 0 var(--space-sm); }
.vc-section-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius-md); flex-shrink: 0; }
.vc-section-icon svg { width: 17px; height: 17px; }
.vc-section-head h3 { margin: 0; font-size: var(--font-size-sm); text-transform: uppercase; letter-spacing: 0.09em; color: var(--sc-light-grey); font-weight: 600; }
.vc-section-sub { color: var(--sc-grey); font-size: var(--font-size-xs); margin-top: 2px; }
.vc-section-count { margin-left: auto; font-size: var(--font-size-xs); color: var(--sc-grey); background: rgba(var(--sc-white-rgb), 0.05); border-radius: var(--radius-full); padding: 2px 10px; font-weight: 600; }

.vc-section-ops .vc-section-icon { background: rgba(var(--sc-amber-rgb), 0.14); color: var(--sc-amber); }
.vc-section-squad .vc-section-icon { background: color-mix(in srgb, var(--sc-purple) 16%, transparent); color: var(--sc-purple); }
.vc-section-social .vc-section-icon { background: rgba(var(--sc-accent-rgb), 0.14); color: var(--sc-accent); }
.vc-section-adhoc .vc-section-icon { background: rgba(var(--sc-white-rgb), 0.07); color: var(--sc-light-grey); }

.vc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-md); }

.vc-card { position: relative; display: flex; flex-direction: column; gap: var(--space-sm); background: var(--sc-surface-elevated); border: 1px solid var(--sc-border); border-radius: var(--radius-lg); padding: var(--space-md); transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast); }
.vc-card:hover { transform: translateY(-2px); border-color: var(--sc-border-hover); box-shadow: var(--shadow-md); }
.vc-card:focus-within { border-color: var(--sc-accent); }
.vc-card.is-member { border-color: rgba(var(--sc-accent-rgb), 0.35); }
.vc-card.is-live { box-shadow: 0 0 0 1px rgba(var(--sc-success-rgb), 0.45), var(--shadow-md); }

.vc-card-head { display: flex; gap: var(--space-sm); align-items: flex-start; }
.vc-tile { flex-shrink: 0; width: 46px; height: 46px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.vc-tile svg { width: 23px; height: 23px; }
.vc-tile-ops { background: rgba(var(--sc-amber-rgb), 0.16); color: var(--sc-amber); }
.vc-tile-social { background: rgba(var(--sc-accent-rgb), 0.16); color: var(--sc-accent); }
.vc-tile-squad { background: color-mix(in srgb, var(--sc-purple) 16%, transparent); color: var(--sc-purple); }
.vc-tile-adhoc { background: rgba(var(--sc-white-rgb), 0.07); color: var(--sc-light-grey); }

.vc-title-block { min-width: 0; flex: 1; }
.vc-name { margin: 0; font-size: var(--font-size-md); font-weight: 600; color: var(--sc-white); display: flex; align-items: center; gap: 6px; }
.vc-name .badge { flex-shrink: 0; }
.vc-desc { margin: 2px 0 0; font-size: var(--font-size-xs); color: var(--sc-grey); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }

.vc-live-pill { display: none; align-items: center; gap: 6px; font-size: var(--font-size-xs); font-weight: 700; color: var(--sc-success); background: var(--sc-success-bg); border-radius: var(--radius-full); padding: 2px 8px; white-space: nowrap; }
.vc-card.is-live .vc-live-pill { display: inline-flex; }
.vc-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sc-success); animation: vc-blink 1.4s ease-in-out infinite; }
@keyframes vc-blink { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(var(--sc-success-rgb), 0.5); } 50% { opacity: 0.6; box-shadow: 0 0 0 3px rgba(var(--sc-success-rgb), 0.18); } }

.vc-presence { display: flex; align-items: center; gap: var(--space-sm); min-height: 34px; }
.vc-avatars { display: flex; align-items: center; }
.vc-avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--sc-surface-elevated); margin-left: -8px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.02em; user-select: none; }
.vc-avatar:first-child { margin-left: 0; }
.vc-avatar.is-live { box-shadow: 0 0 0 2px var(--sc-success); }
.vc-avatar-more { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--sc-surface-elevated); margin-left: -8px; background: var(--sc-surface-3); color: var(--sc-light-grey); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.vc-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.vc-av-0 { background: #3b82f6; } .vc-av-1 { background: #8b5cf6; } .vc-av-2 { background: #ec4899; } .vc-av-3 { background: #f97316; } .vc-av-4 { background: #14b8a6; } .vc-av-5 { background: #84cc16; } .vc-av-6 { background: #06b6d4; } .vc-av-7 { background: #f43f5e; }
.vc-members-label { font-size: var(--font-size-xs); color: var(--sc-grey); white-space: nowrap; }
.vc-empty-members { font-size: var(--font-size-xs); color: var(--sc-grey); font-style: italic; }

.vc-cap { height: 4px; background: var(--sc-surface-3); border-radius: var(--radius-full); overflow: hidden; }
.vc-cap > span { display: block; height: 100%; width: var(--fill, 0%); background: var(--sc-accent); border-radius: inherit; transition: width 0.3s ease; }
.vc-cap.vc-cap-full > span { background: var(--sc-warning); }
.vc-cap-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--sc-grey); margin-top: 2px; }

.vc-foot { display: flex; align-items: center; gap: var(--space-sm); margin-top: auto; padding-top: var(--space-sm); border-top: 1px solid var(--sc-border); }
.vc-foot .btn { white-space: nowrap; }
.vc-spacer { flex: 1; }
.vc-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: var(--radius-md); background: transparent; border: 1px solid transparent; color: var(--sc-grey); cursor: pointer; transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast); }
.vc-icon-btn:hover { color: var(--sc-white); background: rgba(var(--sc-white-rgb), 0.06); }
.vc-icon-btn.danger:hover { color: var(--sc-danger); border-color: rgba(var(--sc-danger-rgb), 0.4); background: var(--sc-danger-bg); }
.vc-icon-btn svg { width: 16px; height: 16px; }

.vc-empty { text-align: center; padding: var(--space-xl) var(--space-md); border: 1px dashed var(--sc-border-strong); border-radius: var(--radius-lg); color: var(--sc-grey); }
.vc-empty h3 { color: var(--sc-light-grey); margin: var(--space-sm) 0 var(--space-xs); }
.vc-empty-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: var(--radius-lg); background: rgba(var(--sc-accent-rgb), 0.12); display: flex; align-items: center; justify-content: center; color: var(--sc-accent); }
.vc-empty-icon svg { width: 28px; height: 28px; }

@media (prefers-reduced-motion: reduce) {
    .vc-live-dot { animation: none; }
    .vc-card { transition: none; }
}

/* ---- Comms console (voice nets) ---- */
.cv-console { gap: var(--space-lg); }
.cv-netstat { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-size-xs); font-weight: 600; color: var(--sc-grey); background: rgba(var(--sc-white-rgb), 0.05); border: 1px solid var(--sc-border); border-radius: var(--radius-full); padding: 5px 12px; }
.cv-netstat .vc-live-dot { display: none; }
.cv-netstat.is-live { color: var(--sc-success); background: var(--sc-success-bg); border-color: rgba(var(--sc-success-rgb), 0.35); }
.cv-netstat.is-live .vc-live-dot { display: inline-block; }
#cv-live-total { font-weight: 700; }

.cv-devices { display: flex; align-items: center; padding: var(--space-sm) var(--space-md); background: var(--sc-surface-elevated); border: 1px solid var(--sc-border); border-radius: var(--radius-lg); }
.cv-device-row { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; flex: 1; min-width: 0; }
.cv-device { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.cv-device-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-md); background: rgba(var(--sc-accent-rgb), 0.12); color: var(--sc-accent); flex-shrink: 0; }
.cv-device-icon svg { width: 17px; height: 17px; }
.cv-device-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cv-device-field > span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sc-grey); font-weight: 600; }
.cv-device-field .input { min-width: 200px; max-width: 280px; }
.cv-device-empty { margin: 0; color: var(--sc-grey); font-size: var(--font-size-sm); }
.cv-refresh { margin-left: auto; flex-shrink: 0; }

.cv-launch { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); border-radius: var(--radius-lg); border: 1px solid rgba(var(--sc-accent-rgb), 0.35); background: linear-gradient(120deg, rgba(var(--sc-accent-rgb), 0.14), rgba(var(--sc-amber-rgb), 0.07)); }
.cv-launch-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: rgba(var(--sc-accent-rgb), 0.18); color: var(--sc-accent); flex-shrink: 0; }
.cv-launch-icon svg { width: 22px; height: 22px; }
.cv-launch-body { flex: 1; min-width: 0; }
.cv-eyebrow { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--sc-accent); }
.cv-launch-body strong { display: block; margin-top: 2px; font-size: var(--font-size-lg); color: var(--sc-white); }
.cv-launch-body p { margin: 2px 0 0; font-size: var(--font-size-xs); color: var(--sc-grey); }

.cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: var(--space-md); }
.cv-card { min-height: 0; }
.cv-card.is-locked { border-style: dashed; }

.cv-meters { display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-sm) 0; border-top: 1px solid var(--sc-border); border-bottom: 1px solid var(--sc-border); }
.cv-meter-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sc-grey); font-weight: 600; }
.cv-meter-value { color: var(--sc-light-grey); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.cv-range { width: 100%; height: 20px; margin: 0; }
.cv-selects { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.cv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cv-field > span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sc-grey); font-weight: 600; }
.cv-field .input { width: 100%; }
.cv-chips { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.cv-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-size-xs); color: var(--sc-light-grey); background: rgba(var(--sc-white-rgb), 0.03); border: 1px solid var(--sc-border); border-radius: var(--radius-full); padding: 4px 11px; cursor: pointer; user-select: none; transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast); }
.cv-chip:hover { border-color: var(--sc-border-hover); color: var(--sc-white); }
.cv-chip:has(input:checked) { color: var(--sc-white); border-color: rgba(var(--sc-accent-rgb), 0.5); background: rgba(var(--sc-accent-rgb), 0.1); }
.cv-chip input { width: 14px; height: 14px; margin: 0; accent-color: var(--sc-accent); }

.cv-roster { display: flex; flex-direction: column; gap: var(--space-xs); }
.cv-roster-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sc-grey); font-weight: 600; }
.cv-roster-count { color: var(--sc-light-grey); }
.cv-ops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cv-op { display: flex; align-items: center; gap: var(--space-sm); padding: 4px 8px 4px 6px; border-radius: var(--radius-md); border: 1px solid transparent; background: rgba(var(--sc-white-rgb), 0.03); }
.cv-op.is-speaking { border-color: rgba(var(--sc-success-rgb), 0.45); background: var(--sc-success-bg); }
.cv-op-avatar { width: 26px; height: 26px; margin-left: 0; border-width: 0; font-size: 10px; flex-shrink: 0; }
.cv-op-name { flex: 1; min-width: 0; font-size: var(--font-size-sm); color: var(--sc-light-grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-op-state { font-size: 9px; letter-spacing: 0.09em; font-weight: 700; color: var(--sc-success); opacity: 0; }
.cv-op.is-speaking .cv-op-state { opacity: 1; }
.cv-op-vol { width: 84px; flex-shrink: 0; accent-color: var(--sc-accent); }
.cv-roster-empty { font-size: var(--font-size-xs); color: var(--sc-grey); font-style: italic; padding: var(--space-xs) 0; }
.cv-foot-note { font-size: var(--font-size-xs); color: var(--sc-grey); white-space: nowrap; }

@media (max-width: 640px) {
    .cv-selects { grid-template-columns: 1fr; }
    .cv-device-field .input { min-width: 0; width: 100%; }
    .cv-device { flex: 1 1 100%; }
    .cv-refresh { margin-left: auto; }
}
