/* Global UI helpers shared across custom Blade pages. */

/* One floating tooltip for every [data-tooltip]; theme-init.js turns titles into tooltips and places it.
   It uses fixed coordinates inside the viewport, so the side nav, tables and lists that scroll or clip
   never cut it off. */
.ub-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: max-content;
    max-width: min(280px, calc(100vw - 16px));
    padding: 7px 10px;
    border: 1px solid rgba(118, 182, 255, 0.42);
    border-radius: 7px;
    color: #eaf0ff;
    background: rgba(5, 11, 23, 0.98);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
    font: 500 12px/1.35 "Outfit", "Segoe UI", sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
    white-space: normal;
}

.ub-tooltip.is-visible {
    opacity: 1;
}

html[data-theme="light"] .ub-tooltip {
    color: #0b1f4b;
    background: #ffffff;
    border-color: #9dabd2;
    box-shadow: 0 8px 22px rgba(11, 31, 75, 0.18);
}

/* ==================================================================
   App shell
   ------------------------------------------------------------------
   Every authenticated page marks its layout root with .workspace-shell
   and gets its whole shell from here: the side nav, the top bar and the
   content column. The front page does not use .workspace-shell and
   keeps its own centred layout.

   Desktop (>= 961px): side nav flush to the left edge and full height,
   top bar flush to the top of the remaining column, page content capped
   at --shell-content-max and left aligned against the nav.

   Below 961px the nav becomes an off-canvas drawer. That only applies
   to pages that ship a .side-backdrop element (and the matching toggle
   script); the onboarding page has neither and stays single column.
   ================================================================== */

.workspace-shell {
    --shell-nav-w: 240px;
    --shell-nav-w-collapsed: 78px;
    --shell-content-max: 1180px;
    --shell-gutter: 28px;

    display: grid;
    align-items: stretch;
    transition: grid-template-columns 220ms ease;
}

.workspace-shell .content-area {
    min-width: 0;
}

/* --- side nav ---------------------------------------------------- */

.workspace-shell .side-nav {
    border: 1px solid var(--line, rgba(118, 182, 255, 0.24));
    background: linear-gradient(160deg, rgba(8, 12, 24, 0.9), rgba(8, 20, 25, 0.58));
    padding: 12px;
    transition: padding 220ms ease;
}

.workspace-shell .side-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #9fb6d8;
    font-family: "Rajdhani", "Outfit", sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.workspace-shell .side-nav-title {
    transition: opacity 180ms ease;
    white-space: nowrap;
}

.workspace-shell .side-nav-links {
    display: grid;
    gap: 6px;
}

.workspace-shell .side-link-label {
    transition: opacity 160ms ease;
    white-space: nowrap;
}

.workspace-shell .side-collapse-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(118, 182, 255, 0.36);
    border-radius: 8px;
    background: rgba(86, 164, 255, 0.1);
    color: #d7e7ff;
    font-size: 14px;
    cursor: pointer;
}

.workspace-shell .side-collapse-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(135deg);
    transition: transform 200ms ease;
}

/* --- collapsed rail ---------------------------------------------- */

body.sidebar-collapsed .workspace-shell .side-collapse-chevron {
    transform: rotate(-45deg);
}

body.sidebar-collapsed .workspace-shell :is(.side-nav-title, .side-link-label) {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

body.sidebar-collapsed .workspace-shell .side-link {
    padding: 9px 6px;
    display: grid;
    place-items: center;
}

body.sidebar-collapsed .workspace-shell .side-link::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-family: "Rajdhani", "Outfit", sans-serif;
    color: #dce9ff;
    background: rgba(86, 164, 255, 0.15);
}

body.sidebar-collapsed .workspace-shell .side-link.active::before {
    color: #e8fff7;
    background: rgba(76, 245, 197, 0.24);
}

/* --- drawer controls (hidden until the nav goes off-canvas) ------- */

.workspace-shell .side-backdrop {
    display: none;
}

.workspace-shell .nav-toggle {
    display: none !important;
}

/* --- desktop ----------------------------------------------------- */

@media (min-width: 961px) {
    body:has(.workspace-shell) {
        padding: 0 !important;
    }

    /* Some pages wrap the shell in a centred .page container - flatten it. */
    .page:has(> .workspace-shell) {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .workspace-shell {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        grid-template-columns: var(--shell-nav-w) minmax(0, 1fr) !important;
        gap: 0 !important;
        align-items: stretch !important;
        min-height: 100vh;
    }

    body.sidebar-collapsed .workspace-shell {
        grid-template-columns: var(--shell-nav-w-collapsed) minmax(0, 1fr) !important;
    }

    .workspace-shell .side-nav {
        position: sticky !important;
        top: 0 !important;
        align-self: start !important;
        height: 100vh !important;
        min-height: 100vh !important;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 0 !important;
        border-top: 0 !important;
        border-bottom: 0 !important;
        border-left: 0 !important;
        box-shadow: none !important;
        padding: 16px 12px !important;
    }

    body.sidebar-collapsed .workspace-shell .side-nav {
        padding: 16px 8px !important;
    }

    .workspace-shell .content-area {
        padding-bottom: 64px;
    }

    /* Top bar: flush to the top, spanning the column next to the nav. */
    .workspace-shell .content-area > .app-auth-ribbon {
        position: sticky !important;
        top: 0 !important;
        z-index: 30;
        width: 100%;
        max-width: none;
        margin: 0 0 22px !important;
        padding: 12px var(--shell-gutter) !important;
        border-radius: 0 !important;
        border-top: 0 !important;
        border-right: 0 !important;
        border-left: 0 !important;
        box-shadow: none !important;
    }

    /* Page content: capped width, left aligned against the nav.
       Everything except the full-bleed top bar and the fixed overlays,
       so a stray heading or paragraph lines up with the cards too. */
    .workspace-shell .content-area > *:not(.app-auth-ribbon, .modal, .release-prompt, script, style, template) {
        width: auto;
        max-width: var(--shell-content-max);
        margin-left: var(--shell-gutter);
        margin-right: var(--shell-gutter);
    }
}

/* --- off-canvas nav ---------------------------------------------- */

@media (max-width: 960px) {
    .workspace-shell {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .workspace-shell:has(> .side-backdrop) .side-nav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        min-height: 100vh;
        width: min(290px, 86vw);
        z-index: 50;
        border-radius: 0;
        border-left: 0;
        overflow-x: hidden;
        overflow-y: auto;
        transform: translateX(-102%);
        transition: transform 220ms ease;
    }

    body.nav-open .workspace-shell:has(> .side-backdrop) .side-nav {
        transform: translateX(0);
    }

    .workspace-shell > .side-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        border: 0;
        background: rgba(3, 8, 16, 0.56);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.nav-open .workspace-shell > .side-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .workspace-shell .nav-toggle {
        display: inline-flex !important;
    }

    .workspace-shell .side-collapse-btn {
        display: none;
    }
}

html[data-theme="light"] {
    color-scheme: light;
    /* Fills the window below pages shorter than the screen, which otherwise showed a dark band. */
    background: #eef1fa;
    /* The outermost scrollbar belongs to <html>, not <body>. */
    scrollbar-color: #5a77c7 #e7ebf7;
}

html[data-theme="light"] body {
    color: #0b1f4b !important;
    background: linear-gradient(160deg, #eaeef8, #f5f8ff 58%, #eef1fa) !important;
    scrollbar-color: #5a77c7 #e7ebf7;
}

html[data-theme="light"] :is(body, .table-wrap, .modal-card, .select-menu) {
    scrollbar-color: #5a77c7 #e7ebf7;
}

html[data-theme="light"]::-webkit-scrollbar-track,
html[data-theme="light"] :is(body, .table-wrap, .modal-card, .select-menu)::-webkit-scrollbar-track {
    background: #e7ebf7;
    border-color: #c3cce4;
}

html[data-theme="light"]::-webkit-scrollbar-thumb,
html[data-theme="light"] :is(body, .table-wrap, .modal-card, .select-menu)::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4d6fcb, #2563ff);
    border-color: #e7ebf7;
}

html[data-theme="light"]::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] :is(body, .table-wrap, .modal-card, .select-menu)::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563ff, #2563ff);
}

html[data-theme="light"] :is(.side-nav, .app-auth-ribbon, .auth-ribbon, .card, .modal-card, .confirm-modal-card, .panel, .guide, .chat-proof, .command-center, .roadmap, .bridge-vision, .bridge-node, .history-card, .settings-card, .kpi, .msg, .flow, .meter, .status-item) {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: rgba(11, 31, 75, 0.24) !important;
    box-shadow: 0 10px 26px rgba(11, 31, 75, 0.09);
}

html[data-theme="light"] :is(h1, h2, h3, h4, h5, p, li, label, th, td, pre, .muted, .sub, .side-nav-title, .side-nav-head, .side-link, .app-auth-note, .app-auth-user-label, .app-usage-pill, .status, .tag, .meta-mail) {
    color: #21305b !important;
}

html[data-theme="light"] :is(.app-auth-user-label strong, .app-usage-pill strong, .app-usage-reset, .kpi .label, .kpi .value, .scope-note) {
    color: #21305b !important;
    text-shadow: none !important;
}

html[data-theme="light"] .app-auth-user-label {
    color: #1a4fd6 !important;
    background: #e2e8f8 !important;
    border-color: #7590d9 !important;
}

html[data-theme="light"] .app-usage-pill,
html[data-theme="light"] .scope-note {
    background: #edf0fa !important;
    border-color: #b6c0dd !important;
}

html[data-theme="light"] .app-bridge-status.is-on,
html[data-theme="light"] .app-bridge-status.is-on strong,
html[data-theme="light"] .app-bridge-status.is-on span {
    color: #1a4fd6 !important;
}

html[data-theme="light"] .app-bridge-status.is-off,
html[data-theme="light"] .app-bridge-status.is-off strong,
html[data-theme="light"] .app-bridge-status.is-off span {
    color: #9a2b36 !important;
}

html[data-theme="light"] :is(input, textarea, select, .select-button, .select-menu, .query-select-button, .query-select-menu, .query-output) {
    color: #0b1f4b !important;
    background: #f5f8ff !important;
    border-color: #adb8d8 !important;
}

html[data-theme="light"] :is(.btn-secondary, .btn-link, .app-auth-actions a, .app-auth-actions button, .auth-actions a, .auth-actions button, .side-link) {
    color: #233872 !important;
    background: #edf1fc !important;
    border-color: #a9bae7 !important;
}

html[data-theme="light"] :is(.btn, .status-pill.ok, .app-bridge-status.is-on) {
    color: #0b1f4b !important;
}

html[data-theme="light"] .side-link.active {
    color: #1741b8 !important;
    background: #dfe5f7 !important;
    border-color: #6984cd !important;
}

html[data-theme="light"] .side-link.side-link-super {
    color: #7a4211 !important;
    background: #fff0de !important;
    border-color: #e9b87e !important;
}

html[data-theme="light"] .two-factor-tabs {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: #b6c0dd !important;
    box-shadow: 0 8px 20px rgba(11, 31, 75, 0.08);
}

html[data-theme="light"] .two-factor-tab,
html[data-theme="light"] .btn-clear,
html[data-theme="light"] .details-btn {
    color: #233872 !important;
}

html[data-theme="light"] .two-factor-tab:hover,
html[data-theme="light"] .two-factor-tab.active {
    color: #1a4fd6 !important;
    background: #dfe5f7 !important;
}

html[data-theme="light"] .details-btn {
    background: #edf1fc !important;
    border-color: #a9bae7 !important;
}

html[data-theme="light"] .details-btn:hover,
html[data-theme="light"] .details-btn:focus-visible,
html[data-theme="light"] .btn-clear:hover,
html[data-theme="light"] .btn-clear:focus-visible {
    color: #1a4fd6 !important;
}

html[data-theme="light"] .details-btn {
    transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

html[data-theme="light"] .details-btn:hover {
    color: #1a4fd6 !important;
    background: #dfe5f7 !important;
    border-color: #6984cd !important;
    box-shadow: 0 3px 8px rgba(37, 99, 255, 0.16);
    transform: translateY(-1px);
}

html[data-theme="light"] .details-btn:focus-visible {
    outline: 2px solid #2563ff;
    outline-offset: 2px;
}

html[data-theme="light"] .file-picker,
html[data-theme="light"] .file-input {
    background: #f5f8ff !important;
    border-color: #adb8d8 !important;
}

html[data-theme="light"] .file-picker-btn {
    color: #1a4fd6 !important;
    background: #e2e8f8 !important;
    border-color: #7590d9 !important;
}

html[data-theme="light"] .file-name {
    color: #414f75 !important;
}

html[data-theme="light"] #trusted-devices .test-note {
    background: #f3f5fc !important;
    border-color: #bec7e1 !important;
    color: #21305b !important;
}

html[data-theme="light"] #trusted-devices .test-note > div > div {
    background: #ffffff !important;
    border-color: #b6c0dd !important;
    box-shadow: 0 4px 10px rgba(11, 31, 75, 0.06);
}

html[data-theme="light"] #trusted-devices .test-note > div > div :is(span, p) {
    color: #293965 !important;
}

html[data-theme="light"] :is(.bridge-token-panel, .corp-uniconta-box, .corp-inline-form) {
    background: #f5f8ff !important;
    border-color: #b6c0dd !important;
    box-shadow: 0 6px 16px rgba(11, 31, 75, 0.07);
}


html[data-theme="light"] .entity-api-name {
    color: #293965 !important;
}

/* Read / Edit / Write: the dark-theme segment background turned grey on white. */
html[data-theme="light"] .permission-levels {
    background: #f3f5fb !important;
    border-color: #b6c0dd !important;
}

html[data-theme="light"] .permission-levels .permission-level {
    color: #4a5984 !important;
}

html[data-theme="light"] .permission-levels .permission-level + .permission-level {
    border-left-color: #cfd6e8 !important;
}

html[data-theme="light"] .permission-levels .permission-level:hover {
    background: #e8edf9 !important;
}

html[data-theme="light"] .permission-levels .permission-level.read { --level-color: #2563ff; --level-tint: #dfe5f7; }
html[data-theme="light"] .permission-levels .permission-level.edit { --level-color: #a8580a; --level-tint: #fff0de; }
html[data-theme="light"] .permission-levels .permission-level.write { --level-color: #b42b3a; --level-tint: #fdecee; }

html[data-theme="light"] .permission-levels .permission-level:has(input:checked) {
    color: var(--level-color) !important;
    background: var(--level-tint) !important;
}

/* Help and note text was a pale blue meant for the dark background. */
html[data-theme="light"] :is(.api-note, .copilot-field-help) {
    color: #3f4e78 !important;
}

html[data-theme="light"] .api-note {
    border-color: #adb8d8 !important;
}

html[data-theme="light"] .create-permission-chip {
    color: #1a4fd6 !important;
    background: #e2e8f8 !important;
    border-color: #7590d9 !important;
}



html[data-theme="light"] .company-off-note a {
    color: #9a520f !important;
}

html[data-theme="light"] .perm-group {
    background: #f5f8ff !important;
    border-color: #c3cce4 !important;
}

html[data-theme="light"] .perm-group-title,
html[data-theme="light"] .perm-name strong { color: #0b1f4b !important; }
html[data-theme="light"] :is(.perm-group-count, .perm-total, .perm-api) { color: #4a5984 !important; }
html[data-theme="light"] .perm-row { border-top-color: #e1e5f1 !important; }
html[data-theme="light"] .perm-group > summary::before { border-color: #2563ff !important; }

html[data-theme="light"] .perm-info {
    color: #2563ff !important;
    border-color: #9fafdc !important;
}

html[data-theme="light"] .perm-bulk {
    color: #1a4fd6 !important;
    background: #e2e8f8 !important;
    border-color: #7590d9 !important;
}

html[data-theme="light"] .perm-row.is-company-off { background: #fff8ee !important; }
html[data-theme="light"] .perm-row.is-company-off strong { color: #5b6991 !important; }
html[data-theme="light"] .perm-row .entity-company-off { color: #9a520f !important; }

html[data-theme="light"] .company-off-note {
    color: #6b3a0e !important;
    background: #fff4e5 !important;
    border-color: #f0b878 !important;
}

html[data-theme="light"] .kill-switch {
    border-color: #7590d9 !important;
}

html[data-theme="light"] .kill-switch.is-off {
    border-color: #e7a1a8 !important;
    background: #fdf1f2 !important;
}

html[data-theme="light"] .kill-switch-state {
    color: #1a4fd6 !important;
    border-color: #7590d9 !important;
}

html[data-theme="light"] .kill-switch.is-off .kill-switch-state {
    color: #9a2b36 !important;
    border-color: #e7a1a8 !important;
}

html[data-theme="light"] :is(.bridge-token-panel, .corp-uniconta-box, .corp-inline-form) :is(h2, h3, h4, p, label, span, td, th, strong, .muted, .sub, .hint, .meta-mail) {
    color: #21305b !important;
}

html[data-theme="light"] .corp-uniconta-box-title {
    color: #1a4fd6 !important;
}

html[data-theme="light"] .corp-uniconta-box-note {
    color: #415078 !important;
}

html[data-theme="light"] .icon-action {
    color: #1d4ed8 !important;
    background: #dce4fa !important;
    border-color: #7491e0 !important;
    box-shadow: 0 2px 6px rgba(37, 99, 255, 0.14);
}

html[data-theme="light"] .icon-action:hover,
html[data-theme="light"] .icon-action:focus-visible {
    color: #0b1f4b !important;
    background: #d7dff4 !important;
    border-color: #2563ff !important;
}

html[data-theme="light"] .icon-action.danger {
    color: #b4233c !important;
    background: #ffe4e7 !important;
    border-color: #ef7990 !important;
}

html[data-theme="light"] .icon-action.danger:hover,
html[data-theme="light"] .icon-action.danger:focus-visible {
    color: #7f1026 !important;
    background: #ffd2d9 !important;
    border-color: #d94a67 !important;
}

html[data-theme="light"] :is(.test-block, .test-output, .query-output, .query-select-menu, .query-select-button) {
    color: #21305b !important;
    background: #f5f8ff !important;
    border-color: #b6c0dd !important;
    box-shadow: 0 4px 10px rgba(11, 31, 75, 0.06);
}

html[data-theme="light"] .test-block :is(h3, h4, p, label, span, textarea) {
    color: #21305b !important;
}

html[data-theme="light"] .test-output:empty {
    background: #f2f4fb !important;
}

html[data-theme="light"] .note-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(241, 244, 252, 0.93)) !important;
    border-color: #b6c0dd !important;
    box-shadow: 0 10px 26px rgba(11, 31, 75, 0.09);
}

html[data-theme="light"] :is(.note-title-wrap h2, .note-excerpt, .notes-body, .notes-body h1, .notes-body h2, .notes-body h3, .notes-body p, .notes-body li, .notes-body strong, .note-meta, .meta) {
    color: #21305b !important;
    text-shadow: none !important;
}

html[data-theme="light"] .note-excerpt {
    color: #172a60 !important;
}

html[data-theme="light"] .chip {
    color: #233872 !important;
    background: #edf1fc !important;
    border-color: #a9bae7 !important;
}

html[data-theme="light"] .chip-new {
    color: #1a4fd6 !important;
    background: #dfe5f7 !important;
    border-color: #6984cd !important;
}

html[data-theme="light"] .guide code {
    color: #172a60 !important;
    background: #eaeffb !important;
    border-color: #aab8dd !important;
}

html[data-theme="light"] #history-modal .modal-card {
    background: #ffffff !important;
    border-color: #b6c0dd !important;
}

html[data-theme="light"] #history-modal .modal-head h2,
html[data-theme="light"] #history-modal .meta-box strong {
    color: #172a60 !important;
}

html[data-theme="light"] #history-modal .meta-box,
html[data-theme="light"] #history-modal pre {
    color: #293965 !important;
    background: #f3f5fc !important;
    border-color: #b6c0dd !important;
}

html[data-theme="light"] #history-modal .close {
    color: #233872 !important;
    background: #edf1fc !important;
    border-color: #a9bae7 !important;
}

/*
 * Native date pickers have limited styling support.
 * We render a custom light icon and keep native picker behavior.
 */
input[type="date"] {
    color-scheme: dark;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b8ceef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 16px 16px;
}

html[data-theme="light"] .bridge-toggle-pill.is-on,
html[data-theme="light"] .bridge-toggle-pill.is-on :is(span, strong) {
    color: #1a4fd6 !important;
    background: #dfe5f7 !important;
    border-color: #6984cd !important;
}

html[data-theme="light"] .bridge-toggle-pill.is-on .bridge-toggle-pill-dot {
    background: #2563ff !important;
}

html[data-theme="light"] .bridge-toggle-pill.is-off,
html[data-theme="light"] .bridge-toggle-pill.is-off :is(span, strong) {
    color: #9a2b36 !important;
    background: #ffe4e7 !important;
    border-color: #ef7990 !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    width: 36px;
    height: 100%;
    cursor: pointer;
}

input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: inherit;
}

input[type="date"]::-webkit-clear-button,
input[type="date"]::-webkit-inner-spin-button {
    display: none;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

html {
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 245, 197, 0.55) rgba(8, 14, 24, 0.9);
}

body,
.table-wrap,
.modal-card,
.select-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 245, 197, 0.55) rgba(8, 14, 24, 0.9);
}

body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.select-menu::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track,
.select-menu::-webkit-scrollbar-track {
    background: rgba(8, 14, 24, 0.9);
    border: 1px solid rgba(118, 182, 255, 0.18);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb,
.select-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(76, 245, 197, 0.78), rgba(86, 164, 255, 0.74));
    border: 2px solid rgba(8, 14, 24, 0.85);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.modal-card::-webkit-scrollbar-thumb:hover,
.select-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(112, 255, 220, 0.95), rgba(112, 184, 255, 0.9));
}

/* Sidebar links: base look plus the shared premium hover treatment. */
.side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    overflow: hidden;
    padding: 9px 10px;
    border: 1px solid rgba(118, 182, 255, 0.24);
    border-radius: 10px;
    background: rgba(86, 164, 255, 0.08);
    color: #d7e7ff;
    font-size: 13px;
    text-decoration: none;
    transition: padding 220ms ease, border-color 260ms ease, box-shadow 280ms ease, transform 260ms ease, background-color 260ms ease;
}

/* The two-letter marker shown when the nav is collapsed to a rail. */
.side-link::before {
    content: attr(data-short);
    display: none;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.side-link.active {
    border-color: rgba(76, 245, 197, 0.58);
    background: rgba(76, 245, 197, 0.14);
    color: #e6fff8;
}

.side-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(76, 245, 197, 0.06), rgba(86, 164, 255, 0.32), rgba(76, 245, 197, 0.06));
    transform: translateX(-120%);
    transition: transform 420ms ease;
    pointer-events: none;
}

.side-link:hover {
    border-color: rgba(76, 245, 197, 0.72) !important;
    background: rgba(86, 164, 255, 0.16) !important;
    box-shadow: 0 0 0 1px rgba(76, 245, 197, 0.4), 0 8px 24px rgba(86, 164, 255, 0.3);
    transform: translateY(-1px);
}

.side-link:hover::after {
    transform: translateX(120%);
}

.side-link.is-disabled,
.side-link.is-disabled:hover {
    opacity: 0.5;
    border-color: rgba(123, 142, 176, 0.32) !important;
    background: rgba(101, 118, 151, 0.12) !important;
    color: rgba(208, 218, 236, 0.72) !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: not-allowed;
    pointer-events: none;
}

.side-link.is-disabled::after {
    display: none;
}

.side-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    margin-left: auto;
    border-radius: 999px;
    border: 1px solid rgba(76, 245, 197, 0.6);
    background: rgba(76, 245, 197, 0.22);
    color: #e9fff7;
    font-family: "Rajdhani", "Outfit", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    padding: 0 7px;
}

.side-link.side-link-super {
    border-color: rgba(255, 175, 92, 0.55) !important;
    background: rgba(255, 159, 67, 0.15) !important;
    color: #ffe6c8 !important;
}

.side-link.side-link-super:hover {
    border-color: rgba(255, 199, 136, 0.85) !important;
    background: rgba(255, 168, 78, 0.22) !important;
    box-shadow: 0 0 0 1px rgba(255, 192, 122, 0.48), 0 8px 24px rgba(255, 167, 70, 0.24) !important;
}

.side-link.side-link-super.active {
    border-color: rgba(255, 204, 145, 0.9) !important;
    background: rgba(255, 174, 82, 0.28) !important;
    color: #fff1dc !important;
}

body.sidebar-collapsed .side-link-badge {
    display: none;
}

/* The four admin sections: the app's main navigation, set apart with a dashed border. */
.side-group-core {
    display: grid;
    gap: 6px;
    margin-bottom: 6px;
}

.side-link.side-link-core {
    border-style: dashed;
    border-color: rgba(76, 245, 197, 0.5);
    font-weight: 600;
}

.side-link.side-link-core.active {
    border-color: rgba(76, 245, 197, 0.85);
}

.side-nav-spacer {
    display: block;
    height: 1px;
    margin: 6px 4px;
    background: rgba(118, 182, 255, 0.18);
}

html[data-theme="light"] .side-link.side-link-core {
    border-color: #6984cd !important;
}

html[data-theme="light"] .workspace-shell .side-collapse-btn {
    border-color: #c3cfef;
    background: #ffffff;
    color: #0b1f4b;
}

html[data-theme="light"] .side-nav-spacer {
    background: #c3cce4;
}

@keyframes appCubeSpin {
    0% { transform: rotateX(-18deg) rotateY(0deg) rotateZ(2deg); }
    100% { transform: rotateX(-18deg) rotateY(360deg) rotateZ(2deg); }
}

@keyframes appCubeFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-9px) translateX(6px); }
}

.app-wire-deco {
    position: fixed;
    right: 18px;
    top: clamp(96px, 18vh, 200px);
    width: 220px;
    aspect-ratio: 1;
    perspective: 900px;
    display: none;
    place-items: center;
    pointer-events: none;
    z-index: 1;
    animation: appCubeFloat 3000ms ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(86, 164, 255, 0.2));
    opacity: 0.9;
}

.app-wire-deco::before,
.app-wire-deco::after {
    content: "";
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px dashed rgba(76, 245, 197, 0.2);
    filter: blur(0.3px);
    pointer-events: none;
}

.app-wire-deco::after {
    inset: 26%;
    border-style: solid;
    border-color: rgba(86, 164, 255, 0.26);
}

.app-wire-cube {
    position: relative;
    width: 96px;
    height: 96px;
    transform-style: preserve-3d;
    animation: appCubeSpin 10s linear infinite;
}

.app-wire-cube .face {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(141, 220, 255, 0.56);
    background: linear-gradient(150deg, rgba(103, 188, 255, 0.08), rgba(76, 245, 197, 0.02));
    box-shadow: inset 0 0 20px rgba(103, 188, 255, 0.12);
}

.app-wire-cube .f1 { transform: translateZ(48px); }
.app-wire-cube .f2 { transform: rotateY(180deg) translateZ(48px); }
.app-wire-cube .f3 { transform: rotateY(90deg) translateZ(48px); }
.app-wire-cube .f4 { transform: rotateY(-90deg) translateZ(48px); }
.app-wire-cube .f5 { transform: rotateX(90deg) translateZ(48px); }
.app-wire-cube .f6 { transform: rotateX(-90deg) translateZ(48px); }

.app-wire-tag {
    position: absolute;
    color: rgba(158, 205, 242, 0.75);
    font-size: 12px;
    letter-spacing: 0.08em;
    font-family: "Rajdhani", "Outfit", sans-serif;
    text-transform: uppercase;
}

.app-wire-tag.s1 { top: 4%; left: 45%; }
.app-wire-tag.s2 { top: 34%; right: 5%; }
.app-wire-tag.s3 { bottom: 15%; right: 7%; }
.app-wire-tag.s4 { bottom: 7%; left: 8%; }
.app-wire-tag.s5 { top: 33%; left: 8%; }

@media (min-width: 1688px) and (min-height: 720px) {
    .app-wire-deco {
        display: grid;
        right: max(18px, calc((100vw - 1180px - 472px) / 2));
    }
}

.app-auth-ribbon {
    position: sticky;
    top: 10px;
    z-index: 25;
    margin: 0 0 14px;
    border: 1px solid rgba(118, 182, 255, 0.25);
    background: rgba(8, 14, 24, 0.78);
    backdrop-filter: blur(5px);
    border-radius: 14px;
    padding: 12px 14px;
}

.app-auth-top-row {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
}

.app-auth-mobile-toggle {
    display: none;
    border: 1px solid rgba(118, 182, 255, 0.35);
    border-radius: 999px;
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(86, 164, 255, 0.1);
    color: #d7e7ff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-auth-mobile-toggle-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 180ms ease;
    margin-top: -2px;
}

.app-auth-ribbon.is-mobile-collapsed .app-auth-mobile-toggle-icon {
    transform: rotate(-135deg);
    margin-top: 2px;
}

.app-auth-profile-link {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0 !important;
    border-radius: 50%;
    border: 1px solid rgba(118, 182, 255, 0.35);
    background: rgba(86, 164, 255, 0.12);
    color: #d7e7ff;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-family: "Rajdhani", "Outfit", sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.app-auth-profile-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-auth-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.app-auth-actions form {
    margin: 0;
}

/* Sign out matches the 36px language and theme switches next to it. */
.app-auth-actions form > button {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
}

.app-auth-actions a,
.app-auth-actions button {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(118, 182, 255, 0.35);
    border-radius: 999px;
    color: #d7e7ff;
    background: rgba(86, 164, 255, 0.1);
    text-decoration: none;
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
    transition: border-color 260ms ease, box-shadow 280ms ease, transform 260ms ease, background-color 260ms ease;
}

.app-auth-actions a::before,
.app-auth-actions button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(76, 245, 197, 0.05), rgba(86, 164, 255, 0.3), rgba(76, 245, 197, 0.05));
    transform: translateX(-120%);
    transition: transform 420ms ease;
    pointer-events: none;
}

.app-auth-actions a:hover,
.app-auth-actions button:hover {
    border-color: rgba(76, 245, 197, 0.72);
    background: rgba(86, 164, 255, 0.16);
    box-shadow: 0 0 0 1px rgba(76, 245, 197, 0.4), 0 8px 24px rgba(86, 164, 255, 0.3);
    transform: translateY(-1px);
}

.app-auth-actions a:hover::before,
.app-auth-actions button:hover::before {
    transform: translateX(120%);
}

.app-auth-actions a:focus-visible,
.app-auth-actions button:focus-visible {
    outline: 2px solid rgba(76, 245, 197, 0.75);
    outline-offset: 2px;
}


.app-auth-note {
    margin: 10px 0 0;
    color: #d7e7ff;
    font-size: 14px;
    line-height: 1.45;
}

.app-auth-user-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 8px 0 12px;
    border: 1px solid rgba(76, 245, 197, 0.42);
    border-radius: 999px;
    padding: 4px 10px;
    color: #d9fff3;
    background: rgba(76, 245, 197, 0.12);
    font-family: "Rajdhani", "Outfit", sans-serif;
    letter-spacing: 0.03em;
}

.app-auth-user-label strong {
    color: #eefff9;
    font-weight: 700;
}

.app-bridge-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid rgba(118, 182, 255, 0.3);
    background: rgba(12, 24, 42, 0.7);
    color: #cde2ff;
    font-size: inherit;
    line-height: normal;
    width: fit-content;
    font-family: "Rajdhani", "Outfit", sans-serif;
    letter-spacing: 0.03em;
}

.app-bridge-status strong {
    font-family: inherit;
    letter-spacing: inherit;
    color: #e9f3ff;
}

.app-bridge-status.is-on {
    border-color: rgba(76, 245, 197, 0.5);
    background: rgba(76, 245, 197, 0.12);
    color: #defff5;
}

.app-bridge-status.is-off {
    border-color: rgba(255, 159, 159, 0.55);
    background: rgba(255, 120, 120, 0.12);
    color: #ffd3d3;
}

.app-usage-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.app-usage-pill {
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
    border: 1px solid rgba(118, 182, 255, 0.3);
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(9, 18, 32, 0.72);
    color: #cde2ff;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.app-usage-pill strong {
    color: #e9f3ff;
    font-family: "Rajdhani", "Outfit", sans-serif;
    letter-spacing: 0.02em;
}

.app-usage-reset {
    color: #9cb4d8;
    font-size: 11px;
    letter-spacing: 0.01em;
    line-height: 1;
}

.release-prompt {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 9, 18, 0.62);
    backdrop-filter: blur(3px);
}

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

.release-prompt-card {
    width: min(560px, 96vw);
    border: 1px solid rgba(118, 182, 255, 0.36);
    border-radius: 16px;
    background: linear-gradient(150deg, rgba(8, 15, 28, 0.94), rgba(9, 28, 28, 0.78));
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.46);
    padding: 18px;
}

.release-prompt-kicker {
    margin: 0;
    font-family: "Rajdhani", "Outfit", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #92d7ff;
    font-size: 11px;
}

.release-prompt-card h2 {
    margin: 8px 0 6px;
    font-family: "Rajdhani", "Outfit", sans-serif;
    font-size: clamp(28px, 3.8vw, 38px);
    line-height: 1;
    letter-spacing: -0.01em;
    color: #f1f7ff;
}

.release-prompt-card p {
    margin: 0;
    color: #c8dcff;
    line-height: 1.5;
}

.release-prompt-date {
    margin-top: 8px !important;
    font-family: "Rajdhani", "Outfit", sans-serif;
    color: #98b9e3 !important;
    letter-spacing: 0.04em;
    font-size: 12px;
}

.release-prompt-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.release-prompt-actions form {
    margin: 0;
}

.release-prompt-read,
.release-prompt-later {
    border: 1px solid rgba(118, 182, 255, 0.36);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    color: #d9edff;
    background: rgba(86, 164, 255, 0.12);
    cursor: pointer;
}

.release-prompt-read {
    border-color: rgba(76, 245, 197, 0.58);
    background: rgba(76, 245, 197, 0.2);
    color: #ebfff9;
}

.release-prompt-later {
    background: rgba(86, 164, 255, 0.08);
}

.release-prompt-read:hover,
.release-prompt-later:hover {
    border-color: rgba(76, 245, 197, 0.76);
}

@media (max-width: 560px) {
    .app-auth-ribbon {
        padding: 12px;
    }

    .app-auth-mobile-toggle {
        display: inline-flex;
    }

    .app-auth-ribbon.is-mobile-collapsed .app-auth-details {
        display: none;
    }

    .app-auth-profile-link {
        width: 44px;
        height: 44px;
        min-height: 44px;
        font-size: 17px;
    }
}

/* --- Light theme: pages with their own dark-only styles ---------- */

/* Settings: first-login card and avatar placeholder. */
html[data-theme="light"] .onboarding-panel {
    background: linear-gradient(135deg, #e6ebf8, #eef2fc) !important;
    border-color: #9fafdc !important;
    box-shadow: 0 12px 30px rgba(11, 31, 75, 0.1) !important;
}

html[data-theme="light"] .onboarding-kicker { color: #2563ff !important; }

html[data-theme="light"] .onboarding-score {
    color: #1a4fd6 !important;
    background: #ffffff !important;
    border-color: #9fafdc !important;
}

html[data-theme="light"] .onboarding-step {
    background: #ffffff !important;
    border-color: #c3cce4 !important;
}

html[data-theme="light"] .onboarding-step.done {
    background: #e8ecf8 !important;
    border-color: #7590d9 !important;
}

html[data-theme="light"] .onboarding-step.current {
    background: #fff4e5 !important;
    border-color: #f0b878 !important;
}

html[data-theme="light"] .step-label { color: #0b1f4b !important; }

html[data-theme="light"] .step-dot {
    color: #2563ff !important;
    border-color: #9fafdc !important;
}

html[data-theme="light"] :is(.onboarding-panel .hint, .onboarding-panel .sub) { color: #3f4e78 !important; }


html[data-theme="light"] .avatar-preview {
    color: #233872 !important;
    background: #edf1fc !important;
    border-color: #a9bae7 !important;
}

/* 2FA and trusted devices: breadcrumbs. */
html[data-theme="light"] .breadcrumbs,
html[data-theme="light"] .crumb-sep { color: #4a5984 !important; }
html[data-theme="light"] .breadcrumbs a { color: #2563ff !important; }

/* Administration > Copilot: field panels and help buttons. */
html[data-theme="light"] .copilot-settings-panel .field {
    background: #f5f8ff !important;
    border-color: #c3cce4 !important;
}

html[data-theme="light"] .field-help-button {
    color: #233872 !important;
    background: #edf1fc !important;
    border-color: #a9bae7 !important;
}

/* Copilot Studio guide: the five-step flow. */
html[data-theme="light"] .flow-node {
    background: #f5f8ff !important;
    border-color: #bec7e1 !important;
}

html[data-theme="light"] :is(.flow-node h3, .flow-key strong) { color: #0b1f4b !important; }
html[data-theme="light"] :is(.flow-node p, .flow-key) { color: #3f4e78 !important; }

/* Release notes: inline code. */
html[data-theme="light"] .notes-body code {
    color: #21305b !important;
    background: #edf0f9 !important;
    border-color: #bec7e1 !important;
}

/* Sign-in, password reset, 2FA code and account request: the card is the form itself. */
html[data-theme="light"] form.card > button[type="submit"] {
    color: #0b1f4b !important;
    background: #dfe5f7 !important;
    border-color: #6984cd !important;
}

html[data-theme="light"] .back-link {
    color: #233872 !important;
    border-color: #a9bae7 !important;
}

html[data-theme="light"] .microsoft-button {
    color: #21305b !important;
    background: #ffffff !important;
    border-color: #a9bae7 !important;
}

html[data-theme="light"] form.card a:not(.back-link):not(.microsoft-button) { color: #2563ff !important; }
html[data-theme="light"] form.card .hint { color: #4a5984 !important; }

html[data-theme="light"] form.card .error {
    color: #9a2b36 !important;
    background: #fdecee !important;
    border-color: #e7a1a8 !important;
}

html[data-theme="light"] .card .actions a {
    color: #233872 !important;
    background: #edf1fc !important;
    border-color: #a9bae7 !important;
}

/* Administration > Uniconta: connection test and the Copilot table list. */
html[data-theme="light"] .uniconta-test-result { color: #4a5984 !important; }
html[data-theme="light"] .uniconta-test-result.is-ok { color: #2563ff !important; }
html[data-theme="light"] .uniconta-test-result.is-error { color: #b42b3a !important; }

html[data-theme="light"] .ct-group {
    background: #f5f8ff !important;
    border-color: #c3cce4 !important;
}

html[data-theme="light"] :is(.ct-group-title, .ct-title strong) { color: #0b1f4b !important; }
html[data-theme="light"] .ct-group > summary::before { border-color: #2563ff !important; }
html[data-theme="light"] .ct-desc { color: #3f4e78 !important; }
html[data-theme="light"] .ct-users { color: #4a5984 !important; }
html[data-theme="light"] .ct-row { border-top-color: #e1e5f1 !important; }
html[data-theme="light"] .ct-row:hover { background: #eef2fc !important; }

html[data-theme="light"] .ct-badge {
    color: #9a520f !important;
    background: #fff4e5 !important;
    border-color: #f0b878 !important;
}

/* Language and theme switches in the account ribbon: two small segmented controls next to Sign out. */
.app-auth-actions .app-pref-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 3px;
    border: 1px solid rgba(118, 182, 255, 0.35);
    border-radius: 999px;
    background: rgba(86, 164, 255, 0.06);
}

.app-auth-actions .app-pref-switch button {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    color: #9fb4d4;
    background: transparent;
    font: 600 12px "Outfit", "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    box-shadow: none;
    transform: none;
}

.app-auth-actions .app-pref-switch button::before { display: none; }
.app-auth-actions .app-pref-switch button:hover { color: #eafff9; background: rgba(86, 164, 255, 0.18); box-shadow: none; transform: none; }
.app-auth-actions .app-pref-switch button.is-active { color: #eafff9; background: rgba(76, 245, 197, 0.2); }
.app-auth-actions .app-pref-switch svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }


html[data-theme="light"] .app-auth-actions .app-pref-switch {
    background: #edf1fc !important;
    border-color: #a9bae7 !important;
}

html[data-theme="light"] .app-auth-actions .app-pref-switch button {
    color: #4a5984 !important;
    background: transparent !important;
    border: 0 !important;
}

html[data-theme="light"] .app-auth-actions .app-pref-switch button:hover { color: #0b1f4b !important; background: #dfe5f5 !important; }
html[data-theme="light"] .app-auth-actions .app-pref-switch button.is-active { color: #1a4fd6 !important; background: #d3dcf3 !important; }

/* ==================================================================
   Controls
   ------------------------------------------------------------------
   Fields and buttons that sit together share one height, so a form
   row lines up: 40px. Buttons in table rows are compact: 32px. The
   account ribbon has its own 36px row (see above).
   ================================================================== */

.workspace-shell {
    --control-h: 40px;
    --control-h-compact: 32px;
}

/* Kept apart from the dropdown button below so the compact table rule can still win on specificity. */
.workspace-shell :is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="hidden"]), select, .select-button) {
    height: var(--control-h);
    min-height: var(--control-h);
    box-sizing: border-box;
}

.workspace-shell .ux-select .ux-select-button {
    height: var(--control-h);
}

/* Long labels may wrap on narrow screens, so the height is a minimum. */
.workspace-shell :is(.btn, .btn-secondary, .btn-danger):not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: auto;
    min-height: var(--control-h);
    padding: 6px 16px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.workspace-shell td :is(.btn, .btn-secondary, .btn-danger):not([hidden]) {
    min-height: var(--control-h-compact);
    padding: 4px 12px;
    font-size: 12px;
}

.workspace-shell td :is(select, .select-button, input:not([type="checkbox"], [type="radio"], [type="hidden"])) {
    height: var(--control-h-compact);
    min-height: var(--control-h-compact);
}

/* ==================================================================
   Wireframe cube (front page, sign-in, wide app screens)
   ------------------------------------------------------------------
   On the light theme the cube is drawn in the Raimiq colors: blue
   edges with a cyan-to-violet tint, so it holds its own on white.
   ================================================================== */

html[data-theme="light"] :is(.cube-cloud, .deco-cube-wrap, .app-wire-deco) {
    filter: drop-shadow(0 12px 28px rgba(37, 99, 255, 0.2));
}

html[data-theme="light"] :is(.cube-cloud, .deco-cube-wrap, .app-wire-deco)::before {
    border-color: rgba(37, 99, 255, 0.3);
}

html[data-theme="light"] :is(.cube-cloud, .deco-cube-wrap, .app-wire-deco)::after {
    border-color: rgba(124, 58, 237, 0.26);
}

html[data-theme="light"] :is(.cube-cloud .face, .deco-cube .face, .app-wire-cube .face) {
    border-color: rgba(37, 99, 255, 0.72);
    background:
        linear-gradient(90deg, transparent 48.5%, rgba(0, 212, 255, 0.28) 50%, transparent 51.5%),
        linear-gradient(transparent 48.5%, rgba(124, 58, 237, 0.2) 50%, transparent 51.5%),
        linear-gradient(135deg, rgba(0, 212, 255, 0.04), rgba(124, 58, 237, 0.04));
    box-shadow: inset 0 0 18px rgba(37, 99, 255, 0.08);
}

html[data-theme="light"] :is(.cube-tag, .deco-tag, .app-wire-tag) {
    color: #2563ff;
    text-shadow: none;
    opacity: 0.85;
}

/* People who ask their system for less motion get still pages. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
