:root {
    --bg: #000000;
    --bg-soft: #000000;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: #ffffff;
    --ink: #121212;
    --muted: #656b73;
    --line: rgba(18, 18, 18, 0.1);
    --brand-pink: #fb289b;
    --brand-yellow: #fcd11d;
    --brand-mint: #35c9bc;
    --brand-purple: #6b42b2;
    --accent: var(--brand-pink);
    --accent-dark: var(--brand-purple);
    --accent-soft: rgba(251, 40, 155, 0.16);
    --highlight-yellow: var(--brand-yellow);
    --highlight-mint: var(--brand-mint);
    --highlight-purple: var(--brand-purple);
    --success: var(--brand-mint);
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    --flash-info-bg: #eef6ff;
    --flash-info-text: #17324d;
    --flash-success-bg: #dcf7f1;
    --flash-success-text: #123f3a;
    --flash-warning-bg: #fff3bf;
    --flash-warning-text: #4b3900;
    --flash-error-bg: #ffe5ef;
    --flash-error-text: #6f153e;
}

/* 2.1.0 customer cooperation and manual contract-intake workflow. */
.cooperation-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cooperation-module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.cooperation-module-card {
    display: flex;
    min-width: 0;
    margin-bottom: 0;
    flex-direction: column;
    gap: 1rem;
}

.cooperation-module-card-body {
    display: grid;
    min-width: 0;
    gap: 0.65rem;
}

.cooperation-module-card-body :is(h2, p) {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.cooperation-module-actions {
    display: flex;
    min-width: 0;
    margin-top: auto;
    padding-top: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.cooperation-module-link {
    font-weight: 800;
    line-height: 1.35;
}

.cooperation-module-action {
    width: fit-content;
    max-width: 100%;
    padding: 0.58rem 0.82rem;
    font-size: 0.8rem;
}

.activation-step-list {
    display: grid;
    gap: 0.75rem;
}

.activation-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color, rgba(127, 127, 127, 0.24));
    border-left: 0.3rem solid var(--accent-color, #6fd3c7);
    border-radius: var(--radius-md, 0.75rem);
}

.activation-step-body {
    display: grid;
    min-width: 0;
    flex: 1 1 28rem;
    gap: 0.55rem;
}

.activation-step-heading,
.activation-step-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.activation-step-actions {
    flex: 0 1 auto;
    justify-content: flex-end;
}

.activation-step-actions form {
    margin: 0;
}

.activation-step-message {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-color, rgba(127, 127, 127, 0.24));
    border-radius: var(--radius-sm, 0.55rem);
    background: var(--surface-soft, rgba(127, 127, 127, 0.08));
}

.activation-step-message p {
    margin: 0;
}

.activation-step-message-failed,
.activation-step-message-blocked {
    border-color: color-mix(in srgb, var(--danger-color, #ef6b73) 55%, transparent);
}

.activation-step-message-warning {
    border-color: color-mix(in srgb, var(--warning-color, #f1c75b) 55%, transparent);
}

.activation-step-message-success {
    border-color: color-mix(in srgb, var(--success-color, #66c58f) 55%, transparent);
}

.activation-step-failed,
.activation-step-blocked {
    border-left-color: var(--danger-color, #ef6b73);
}

.activation-step-completed {
    border-left-color: var(--success-color, #66c58f);
}

.activation-step-waiting,
.activation-step-needs_attention {
    border-left-color: var(--warning-color, #f1c75b);
}

.workspace-section-nav,
.contract-intake-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.workspace-section-nav a {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border-color, rgba(127, 127, 127, 0.24));
    border-radius: 999px;
}

.contract-intake-layout {
    display: grid;
    grid-template-columns: minmax(22rem, 1fr) minmax(28rem, 1fr);
    gap: 1rem;
    align-items: start;
}

.contract-intake-layout .contract-preview-panel {
    position: sticky;
    top: 6.5rem;
    min-height: 75vh;
    min-width: 22rem;
    max-width: 70vw;
    resize: horizontal;
    overflow: hidden;
}

.contract-intake-layout .contract-preview-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.contract-intake-layout .contract-preview-toolbar button {
    min-width: 2.6rem;
    min-height: 2.6rem;
}

.contract-import-frame {
    width: 100%;
    min-height: calc(68vh + 56px);
    border: 0;
    background: #fff;
    transform: translateY(-56px);
    transform-origin: center;
}

.contract-import-pdf-viewport {
    height: 68vh;
    overflow: hidden;
    background: #fff;
}

.contract-import-image {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    margin: auto;
    transform-origin: center;
}

.contract-intake-tabs {
    display: none;
    margin-bottom: 0.75rem;
}

.match-review {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, rgba(127, 127, 127, 0.24));
}

@media (max-width: 980px) {
    .cooperation-summary-grid,
    .contract-intake-layout {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .contract-intake-tabs {
        display: flex;
    }

    .contract-intake-layout .contract-preview-panel {
        position: static;
        min-height: 60vh;
        min-width: 0;
        max-width: none;
        resize: none;
    }

    .contract-intake-layout .is-mobile-hidden {
        display: none;
    }
}

@media (max-width: 560px) {
    .cooperation-module-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .activation-step {
        align-items: stretch;
        flex-direction: column;
    }

    .activation-step-actions {
        justify-content: flex-start;
    }

    .activation-step-actions :is(form, .button) {
        width: 100%;
    }

    .contract-intake-layout .contract-preview-toolbar button {
        flex: 1 1 2.8rem;
    }
}

.global-loading-overlay[hidden] {
    display: none;
}

.global-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(9, 6, 14, 0.62);
    backdrop-filter: blur(4px);
    cursor: wait;
}

.global-loading-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: min(100%, 15rem);
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    font-size: 1rem;
}

.global-loading-spinner {
    width: 1.65rem;
    height: 1.65rem;
    flex: 0 0 1.65rem;
    border: 3px solid rgba(107, 66, 178, 0.2);
    border-top-color: var(--brand-pink);
    border-radius: 50%;
    animation: global-loading-spin 0.75s linear infinite;
}

.global-loading-active {
    cursor: wait;
}

.is-loading-disabled {
    pointer-events: none;
}

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

@media (prefers-reduced-motion: reduce) {
    .global-loading-spinner {
        animation-duration: 1.8s;
    }
}

/* Business Centre and isolated customer portal */
.business-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.business-form-grid .form-field:has(textarea),
.business-form-grid .form-field:has(.form-input-multiselect),
.business-form-grid .form-field:has([type="file"]) {
    grid-column: 1 / -1;
}

.form-field-choice-group {
    grid-column: 1 / -1;
}

div.choice-checkbox {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0.75rem;
}

div.choice-checkbox > div {
    min-width: 0;
}

div.choice-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    min-height: 3.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(31, 36, 48, 0.14);
    border-radius: 16px;
    background: var(--panel-strong);
    cursor: pointer;
}

div.choice-checkbox label:hover {
    border-color: rgba(251, 40, 155, 0.35);
    background: rgba(251, 40, 155, 0.04);
}

div.choice-checkbox input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--brand-pink);
}

div.choice-checkbox label:has(input:disabled) {
    color: var(--muted);
    background: rgba(18, 18, 18, 0.035);
    cursor: not-allowed;
}

.choice-tooltip-indicator {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: auto;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--brand-purple);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
}

.business-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.business-metric-grid article {
    display: grid;
    gap: 0.35rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
}

.business-metric-grid article span,
.business-metric-grid article small {
    color: var(--muted);
}

.business-metric-grid article strong {
    font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.business-visibility-columns,
.portal-document-grid,
.portal-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.business-visibility-columns > div,
.portal-document-grid > article {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.portal-body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 16%, rgba(251, 40, 155, 0.2), transparent 24%),
        radial-gradient(circle at 82% 10%, rgba(252, 209, 29, 0.18), transparent 22%),
        radial-gradient(circle at 74% 80%, rgba(53, 201, 188, 0.16), transparent 24%),
        radial-gradient(circle at 56% 44%, rgba(107, 66, 178, 0.14), transparent 26%),
        #000;
    color: var(--ink);
}

.portal-body > .background-glow {
    z-index: -1;
}

.portal-header {
    position: sticky;
    top: 1rem;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: min(1400px, calc(100% - 2rem));
    min-height: 76px;
    margin: 1rem auto 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(251, 40, 155, 0.08), rgba(107, 66, 178, 0.08)),
        rgba(5, 5, 8, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    padding: 0.2rem 0.45rem 0.2rem 0.2rem;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-decoration: none;
}

.portal-brand img {
    width: 3.15rem;
    height: 3.15rem;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.3));
}

.portal-nav {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

.portal-nav a {
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.portal-nav a:hover,
.portal-nav a:focus-visible,
.portal-nav a.is-active {
    color: #171219;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.portal-nav a.is-active {
    color: var(--brand-purple);
    box-shadow: inset 0 -3px 0 var(--brand-pink), 0 8px 22px rgba(0, 0, 0, 0.2);
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(24rem, 35vw);
    color: #fff;
}

.portal-user > span {
    min-width: 0;
    max-width: 100%;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
    white-space: normal;
}

.portal-user form {
    margin: 0;
}

.portal-header .button-secondary {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-header-auth {
    justify-content: center;
}

.portal-header-auth .portal-brand {
    justify-content: center;
    text-align: center;
}

.portal-shell {
    width: min(1240px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(3rem, 6vw, 5rem) 0 4rem;
    position: relative;
    z-index: 1;
}

.portal-page-head {
    max-width: 920px;
    margin-bottom: 1.75rem;
    padding: 0 0.25rem;
    color: #fff;
}

.portal-page-head h1 {
    margin: 0.25rem 0 0.5rem;
    color: #fff;
    text-wrap: balance;
}

.portal-page-head p {
    max-width: 72ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

.portal-page-head .eyebrow {
    color: var(--brand-yellow);
}

.portal-two-column {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 1.25rem;
}

.portal-body .content-card,
.portal-body .auth-card-form {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.portal-dashboard-grid {
    gap: 1.25rem;
}

.portal-dashboard-grid > .content-card {
    position: relative;
    overflow: hidden;
    margin: 0;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.portal-dashboard-grid > .content-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-pink), var(--brand-purple));
}

.portal-dashboard-grid > .content-card:nth-child(4n + 2)::before {
    background: linear-gradient(90deg, var(--brand-yellow), var(--brand-pink));
}

.portal-dashboard-grid > .content-card:nth-child(4n + 3)::before {
    background: linear-gradient(90deg, var(--brand-mint), var(--brand-purple));
}

.portal-dashboard-grid > .content-card:nth-child(4n + 4)::before {
    background: linear-gradient(90deg, var(--brand-purple), var(--brand-yellow));
}

.portal-dashboard-grid > .content-card:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 40, 155, 0.34);
    box-shadow: 0 28px 68px rgba(0, 0, 0, 0.34);
}

.portal-dashboard-grid h2 {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.portal-dashboard-grid > .content-card > a,
.portal-document-grid a:not(.button),
.request-thread a:not(.button) {
    color: var(--brand-purple);
    font-weight: 800;
}

.portal-dashboard-grid > .content-card > a:hover,
.portal-dashboard-grid > .content-card > a:focus-visible,
.portal-document-grid a:not(.button):hover,
.portal-document-grid a:not(.button):focus-visible,
.request-thread a:not(.button):hover,
.request-thread a:not(.button):focus-visible {
    color: var(--brand-pink);
}

.portal-item-list {
    display: grid;
    gap: 0;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.portal-item-list li {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.portal-item-list li:last-child {
    border-bottom: 0;
}

.portal-item-list li span,
.portal-consent-row small {
    color: var(--muted);
}

.portal-overview-shell {
    width: min(1320px, calc(100% - 2rem));
}

.portal-overview-hero,
.portal-account-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    background:
        radial-gradient(circle at 88% 18%, rgba(252, 209, 29, 0.3), transparent 22%),
        radial-gradient(circle at 8% 96%, rgba(251, 40, 155, 0.26), transparent 30%),
        linear-gradient(135deg, rgba(41, 20, 55, 0.98), rgba(15, 11, 24, 0.94));
    box-shadow: 0 28px 76px rgba(0, 0, 0, 0.35);
    color: #fff;
}

.portal-overview-hero > div:first-child,
.portal-account-identity {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.portal-overview-hero h1,
.portal-account-hero h1 {
    margin: 0.25rem 0 0.55rem;
    color: #fff;
    font-size: clamp(2rem, 4.5vw, 3.65rem);
    line-height: 1.02;
    text-wrap: balance;
}

.portal-overview-hero p,
.portal-account-hero p {
    max-width: 68ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

.portal-overview-hero .eyebrow,
.portal-account-hero .eyebrow {
    color: var(--brand-yellow);
}

.portal-overview-hero-actions,
.portal-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    position: relative;
    z-index: 1;
}

.portal-overview-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.portal-overview-summary > div {
    display: grid;
    gap: 0.1rem;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(14px);
}

.portal-overview-summary strong {
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
}

.portal-overview-summary span {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.82rem;
    font-weight: 700;
}

.portal-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.portal-overview-card {
    display: flex;
    flex-direction: column;
    min-height: 315px;
    padding: clamp(1.25rem, 2.5vw, 1.8rem);
    border: 1px solid rgba(31, 24, 40, 0.1);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.portal-overview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
}

.portal-overview-card-wide {
    grid-column: 1 / -1;
    min-height: auto;
}

.portal-overview-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.portal-overview-card-head h2 {
    margin: 0.15rem 0 0;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.portal-overview-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 2.6rem;
    min-height: 2.6rem;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    box-shadow: 0 10px 22px rgba(107, 66, 178, 0.24);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.portal-overview-card .portal-item-list {
    flex: 1;
    margin-top: 0.35rem;
}

.portal-overview-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--brand-purple);
    font-weight: 850;
}

.portal-overview-link span {
    font-size: 1.25rem;
    transition: transform 0.18s ease;
}

.portal-overview-link:hover span,
.portal-overview-link:focus-visible span {
    transform: translateX(0.25rem);
}

.portal-manager-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(247, 241, 252, 0.97));
}

.portal-manager-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: auto 0;
    padding: 1.25rem 0;
}

.portal-manager-profile > div:last-child {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
}

.portal-manager-profile a {
    color: var(--brand-purple);
    overflow-wrap: anywhere;
}

.portal-manager-avatar,
.portal-account-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 4rem;
    width: 4rem;
    height: 4rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--brand-yellow), var(--brand-pink));
    color: #1c1020;
    font-size: 1.55rem;
    font-weight: 900;
}

.portal-account-hero {
    justify-content: flex-start;
    margin-bottom: 0;
}

.portal-account-hero > .status-pill {
    margin-left: auto;
}

.portal-account-primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 1.25rem;
}

.portal-account-card {
    margin: 0;
}

.portal-contact-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.portal-contact-list > div {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(31, 36, 48, 0.05);
}

.portal-contact-list span,
.portal-account-caption {
    color: var(--muted);
    font-size: 0.82rem;
}

.portal-contact-list strong {
    overflow-wrap: anywhere;
}

@media (max-width: 860px) {
    .portal-overview-hero,
    .portal-account-hero,
    .portal-account-primary-grid {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .portal-overview-hero,
    .portal-account-hero {
        flex-wrap: wrap;
    }

    .portal-account-hero > .status-pill {
        margin-left: 0;
    }

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

    .portal-overview-card-wide {
        grid-column: auto;
    }

    .portal-contact-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .portal-overview-hero-actions,
    .portal-overview-hero-actions .button,
    .portal-account-actions,
    .portal-account-actions form,
    .portal-account-actions .button {
        width: 100%;
    }

    .portal-account-avatar {
        flex-basis: 3.25rem;
        width: 3.25rem;
        height: 3.25rem;
        border-radius: 16px;
    }
}

.portal-consent-row {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.64);
}

.portal-onboarding-shell {
    max-width: 1240px;
}

.portal-onboarding-card {
    padding: clamp(1rem, 2.4vw, 1.75rem);
}

.portal-onboarding-form,
.portal-onboarding-documents {
    display: grid;
    gap: 1.25rem;
}

.portal-contact-confirmation,
.portal-consent-document {
    min-width: 0;
    padding: clamp(1rem, 2vw, 1.4rem);
    border: 1px solid rgba(31, 36, 48, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
}

.portal-contact-confirmation {
    display: grid;
    gap: 0.8rem;
}

.portal-contact-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: 0.7rem;
    margin: 0.2rem 0;
}

.portal-contact-data-item {
    min-width: 0;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 14px;
    background: rgba(31, 36, 48, 0.04);
}

.portal-contact-data-item dt {
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-contact-data-item dd {
    margin: 0;
    color: var(--ink);
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.portal-contact-confirmation h2,
.portal-consent-document h2 {
    margin: 0.15rem 0 0.35rem;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.portal-contact-confirmation p,
.portal-consent-document-head p {
    margin: 0;
    color: var(--muted);
}

.portal-consent-kicker {
    display: block;
    color: var(--brand-purple);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-consent-document {
    display: grid;
    gap: 1rem;
}

.portal-consent-document-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.portal-consent-document-head > div {
    min-width: 0;
}

.portal-consent-document-head .status-pill {
    flex: 0 0 auto;
}

.portal-consent-document-content {
    max-height: min(24rem, 48vh);
    overflow: auto;
    padding: clamp(1rem, 2vw, 1.25rem);
    border: 1px solid rgba(31, 36, 48, 0.12);
    border-radius: 16px;
    background: #fffefb;
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: normal;
}

.portal-consent-document-content:focus-visible {
    outline: 3px solid rgba(107, 66, 178, 0.3);
    outline-offset: 2px;
}

.portal-consent-decision {
    display: grid;
    gap: 0.45rem;
}

.portal-consent-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(31, 36, 48, 0.14);
    border-radius: 16px;
    background: #fffefb;
    cursor: pointer;
}

.portal-consent-choice:hover {
    border-color: rgba(107, 66, 178, 0.38);
}

.portal-consent-choice .form-checkbox {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

.portal-consent-choice span {
    min-width: 0;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.portal-onboarding-actions {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

.portal-onboarding-actions .button {
    width: 100%;
}

.portal-onboarding-support {
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.62);
}

@media (max-width: 640px) {
    .portal-consent-document-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-consent-document-content {
        max-height: 22rem;
    }
}

.request-thread {
    display: grid;
    gap: 0.8rem;
}

.request-thread article {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.request-thread article small {
    display: block;
    color: var(--muted);
}

.compact-inline-form {
    display: grid;
    gap: 0.45rem;
    min-width: 240px;
}

.strategy-document {
    max-width: 82ch;
    line-height: 1.65;
}

.strategy-preview-copy {
    padding: clamp(1rem, 2.4vw, 1.55rem);
    border: 1px solid rgba(31, 36, 48, 0.11);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    color: #22212a;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.75;
    box-shadow: inset 0 1px 0 #fff, 0 10px 26px rgba(24, 18, 35, 0.05);
    overflow-wrap: anywhere;
}

.strategy-preview-copy p,
.strategy-preview-copy li,
.strategy-preview-copy dd {
    color: #22212a;
}

.strategy-preview-copy strong,
.strategy-preview-copy b,
.strategy-preview-copy h1,
.strategy-preview-copy h2,
.strategy-preview-copy h3,
.strategy-preview-copy h4 {
    color: #111017;
}

.strategy-preview-copy a {
    color: #5d2da0;
    font-weight: 750;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

.strategy-preview-copy ul,
.strategy-preview-copy ol {
    padding-left: 1.4rem;
}

.portal-document-grid > article {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(251, 40, 155, 0.05), rgba(107, 66, 178, 0.04));
}

.portal-document-grid > article::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 5rem;
    height: 5rem;
    border-radius: 0 0 0 100%;
    background: linear-gradient(135deg, rgba(252, 209, 29, 0.25), rgba(251, 40, 155, 0.14));
    pointer-events: none;
}

.portal-body .portal-auth-layout {
    min-height: calc(100vh - 7rem);
    padding-top: 3rem;
}

.portal-auth-layout .auth-card-accent {
    border-color: rgba(252, 209, 29, 0.18);
    background: rgba(0, 0, 0, 0.22);
}

/* Customer password recovery */
.portal-reset-shell {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: min(1120px, calc(100% - 2rem));
    min-height: calc(100vh - 13rem);
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3.5rem) 0 4rem;
}

.portal-reset-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(18rem, 0.82fr) minmax(0, 1.18fr);
    width: 100%;
    min-height: 34rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(22px);
}

.portal-reset-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: clamp(1.8rem, 4vw, 3rem);
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    background:
        radial-gradient(circle at 15% 10%, rgba(252, 209, 29, 0.32), transparent 26%),
        radial-gradient(circle at 84% 82%, rgba(53, 201, 188, 0.28), transparent 32%),
        linear-gradient(145deg, #15101f 0%, #4f267a 52%, #8b2d88 100%);
}

.cms-reset-visual {
    background:
        radial-gradient(circle at 12% 12%, rgba(252, 209, 29, 0.3), transparent 27%),
        radial-gradient(circle at 86% 84%, rgba(251, 40, 155, 0.3), transparent 34%),
        linear-gradient(145deg, #120d18 0%, #481640 49%, #79245f 100%);
}

.cms-reset-card .eyebrow {
    color: var(--brand-pink);
}

.cms-reset-card .button-primary {
    background: linear-gradient(135deg, var(--brand-pink), #8f2f91 58%, var(--brand-purple));
}

.portal-reset-visual::before,
.portal-reset-visual::after {
    content: "";
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
}

.portal-reset-visual::before {
    width: 20rem;
    height: 20rem;
    right: -9rem;
    top: -7rem;
}

.portal-reset-visual::after {
    width: 12rem;
    height: 12rem;
    left: -5rem;
    bottom: -4rem;
}

.portal-reset-brand-logo {
    width: clamp(7rem, 12vw, 10rem);
    height: auto;
    max-height: 5rem;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.24));
}

.portal-reset-visual-copy {
    display: grid;
    gap: 0.85rem;
    max-width: 28rem;
}

.portal-reset-kicker {
    color: var(--brand-yellow);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-reset-visual h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 0.98;
    text-wrap: balance;
}

.portal-reset-visual p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
}

.portal-reset-lock-mark {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
}

.portal-reset-lock-mark svg {
    width: 2.15rem;
    height: 2.15rem;
    fill: none;
    stroke: #fff;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-reset-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(2rem, 5vw, 4.5rem);
}

.portal-reset-back {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 750;
}

.portal-reset-back:hover,
.portal-reset-back:focus-visible {
    color: var(--brand-purple);
}

.portal-reset-heading {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 2rem;
}

.portal-reset-heading h1 {
    max-width: 12ch;
    margin: 0;
    color: var(--ink);
    font-size: clamp(2.2rem, 4.4vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.portal-reset-heading p {
    max-width: 34rem;
    margin: 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.6;
}

.portal-reset-form {
    gap: 1.15rem;
}

.portal-reset-form .form-input,
.portal-reset-form input[type="password"] {
    width: 100%;
    min-height: 3.5rem;
    border: 1px solid rgba(31, 36, 48, 0.13);
    border-radius: 17px;
    padding: 0.95rem 1.05rem;
    background: var(--panel-strong);
    color: var(--ink);
    font: inherit;
    box-shadow: 0 9px 24px rgba(31, 22, 47, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.portal-reset-form .form-input:focus,
.portal-reset-form input[type="password"]:focus {
    outline: none;
    border-color: rgba(107, 66, 178, 0.5);
    box-shadow: 0 0 0 4px rgba(107, 66, 178, 0.11), 0 12px 28px rgba(31, 22, 47, 0.08);
    transform: translateY(-1px);
}

.portal-reset-form .button {
    min-height: 3.55rem;
    justify-content: space-between;
    padding-inline: 1.35rem;
    border-radius: 17px;
}

.portal-reset-status-panel {
    align-items: flex-start;
}

.portal-reset-status-icon {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: 1.5rem;
    border-radius: 20px;
    background: rgba(53, 201, 188, 0.15);
    color: #14766c;
    font-size: 1.6rem;
    font-weight: 950;
}

.portal-reset-status-icon-error {
    background: rgba(181, 47, 47, 0.1);
    color: #9f263f;
}

@media (max-width: 820px) {
    .portal-reset-shell {
        min-height: auto;
        padding-top: 1.5rem;
    }

    .portal-reset-card {
        grid-template-columns: 1fr;
        min-height: 0;
        border-radius: 28px;
    }

    .portal-reset-visual {
        min-height: 15rem;
        gap: 2rem;
        padding: 1.6rem;
    }

    .portal-reset-visual-copy {
        padding-right: 5rem;
    }

    .portal-reset-visual h2 {
        font-size: clamp(1.8rem, 8vw, 2.7rem);
    }

    .portal-reset-lock-mark {
        position: absolute;
        right: 1.5rem;
        bottom: 1.5rem;
    }

    .portal-reset-panel {
        padding: clamp(1.5rem, 7vw, 2.5rem);
    }

    .portal-reset-back {
        position: static;
        align-self: flex-start;
        margin-bottom: 2rem;
    }
}

@media (max-width: 520px) {
    .portal-reset-shell {
        width: min(100% - 1rem, 100%);
        padding-bottom: 2rem;
    }

    .portal-reset-visual {
        min-height: 12rem;
    }

    .portal-reset-brand-logo {
        width: 7rem;
    }

    .portal-reset-visual-copy p,
    .portal-reset-lock-mark {
        display: none;
    }

    .portal-reset-heading h1 {
        font-size: clamp(2.1rem, 12vw, 3rem);
    }
}

@media (max-width: 900px) {
    .business-metric-grid,
    .portal-dashboard-grid,
    .portal-document-grid,
    .business-visibility-columns,
    .portal-two-column,
    .business-form-grid {
        grid-template-columns: 1fr;
    }

    .portal-header {
        align-items: flex-start;
        flex-wrap: wrap;
        top: 0.5rem;
        width: min(100% - 1rem, 1400px);
        margin-top: 0.5rem;
        border-radius: 22px;
    }

    .portal-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: thin;
    }

    .portal-nav a {
        flex: 0 0 auto;
    }

    .portal-user {
        margin-left: auto;
    }
}

@media (max-width: 640px) {
    .portal-header {
        gap: 0.65rem;
        padding: 0.65rem;
    }

    .portal-brand img {
        width: 2.7rem;
        height: 2.7rem;
    }

    .portal-user {
        width: 100%;
        max-width: none;
        margin-left: 0;
        justify-content: space-between;
    }

    .portal-user > span {
        display: block;
        flex: 1 1 auto;
    }

    .portal-shell {
        width: min(100% - 1rem, 1240px);
        padding-top: 2.25rem;
    }

    .portal-page-head {
        padding-inline: 0.5rem;
    }

    .portal-body .portal-auth-layout {
        padding-top: 2rem;
    }
}

/* Focused 2.0 workspaces: realizations, chat, notifications, and vault */
.realization-page .realization-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
    gap: 0.8rem;
}

.realization-page .realization-summary-card {
    min-height: 0;
    padding: 1rem;
}

.realization-page .realization-overview,
.realization-page .realization-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
}

.realization-page .realization-title-block {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.realization-page .realization-period-panel {
    grid-template-columns: minmax(18rem, 1.2fr) minmax(18rem, 0.9fr) max-content;
    align-items: end;
    border-radius: 18px;
    box-shadow: none;
}

.realization-page .realization-history-panel {
    align-self: stretch;
}

.realization-page .realization-period-actions {
    align-self: center;
}

.realization-page .realization-filter-panel,
.realization-page .realization-split-form {
    border-radius: 18px;
    box-shadow: none;
}

.realization-page .realization-split-form {
    border-top-width: 1px;
}

.realization-page .realization-filter-grid,
.realization-page .realization-split-form .realization-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    max-width: none;
}

.realization-page .realization-filter-query-field {
    grid-column: span 2;
}

.realization-page .realization-results-card {
    overflow: visible;
}

.realization-page .realization-board-guidance {
    border-color: rgba(107, 66, 178, 0.14);
    background: rgba(107, 66, 178, 0.06);
    color: var(--primary-dark);
}

.realization-page .realization-board-guidance strong,
.realization-page .realization-board-guidance small {
    color: inherit;
}

.realization-page .realization-board-guidance-icon {
    background: rgba(107, 66, 178, 0.12);
}

.realization-page .realization-bulk-toolbar {
    border-left-width: 1px;
    background: rgba(31, 36, 48, 0.035);
    box-shadow: none;
}

.realization-select-all-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.15rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.realization-page .realization-table-wrap {
    max-height: none;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.realization-page .realization-data-table {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
}

.realization-page .realization-data-table thead {
    display: none;
}

.realization-page .realization-data-table tbody {
    display: grid;
    gap: 0.85rem;
    width: 100%;
}

.realization-page .realization-data-table tbody tr {
    display: grid;
    grid-template-columns: 3rem repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 0;
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-top: 4px solid rgba(107, 66, 178, 0.54);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 26px rgba(28, 19, 45, 0.07);
}

.realization-page .realization-data-table tbody tr.realization-work-row-info {
    border-top-color: rgba(74, 144, 226, 0.78);
}

.realization-page .realization-data-table tbody tr.realization-work-row-warning {
    border-top-color: rgba(242, 163, 58, 0.88);
}

.realization-page .realization-data-table tbody tr.realization-work-row-success {
    border-top-color: rgba(57, 201, 152, 0.88);
}

.realization-page .realization-data-table tbody tr.realization-work-row-danger {
    border-top-color: rgba(223, 54, 101, 0.86);
}

.realization-page .realization-data-table tbody tr.realization-row-copy {
    border-top-color: rgba(53, 201, 188, 0.9);
}

.realization-page .realization-data-table tbody td,
.realization-page .realization-data-table tbody td:first-child,
.realization-page .realization-data-table tbody td:last-child {
    position: static;
    z-index: auto;
    display: grid;
    align-content: start;
    gap: 0.45rem;
    min-width: 0;
    width: auto;
    padding: 0.9rem;
    border: 0;
    border-right: 1px solid rgba(31, 36, 48, 0.07);
    border-bottom: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    white-space: normal;
}

.realization-page .realization-data-table tbody td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    line-height: 1.25;
    text-transform: uppercase;
}

.realization-page .realization-data-table td.realization-select-cell {
    grid-column: 1;
    grid-row: 1 / span 4;
    align-content: center;
    justify-items: center;
    padding: 0.7rem 0.45rem;
    background: rgba(31, 36, 48, 0.025);
}

.realization-page .realization-data-table td.realization-select-cell::before {
    display: none;
}

.realization-page .realization-data-table td.realization-primary-cell {
    grid-column: 2 / span 2;
}

.realization-page .realization-data-table td.realization-service-cell {
    grid-column: 4;
}

.realization-page .realization-data-table tbody tr:hover > td {
    border-color: rgba(31, 36, 48, 0.07);
    background: transparent;
}

.realization-page .realization-data-table .realization-inline-select,
.realization-page .realization-data-table .realization-inline-text,
.realization-page .realization-data-table .realization-inline-assignee-select,
.realization-page .realization-data-table .realization-inline-status-select,
.realization-page .realization-data-table .realization-inline-portal-select,
.realization-page .realization-data-table .realization-scope-pill {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.realization-page .realization-data-table .realization-action-cell {
    justify-items: start;
    text-align: left;
}

.chat-page .chat-layout {
    grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr);
    gap: 1rem;
}

.chat-page .chat-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: 0.2rem;
    scrollbar-width: thin;
}

.chat-page .chat-conversations-card,
.chat-page .chat-quick-start-card,
.chat-page .chat-conversation-card {
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(28, 19, 45, 0.1);
}

.chat-page .chat-thread-list {
    gap: 0.45rem;
}

.chat-page .chat-thread-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 4rem;
    padding: 0.65rem 0.75rem;
    border-radius: 15px;
    background: rgba(31, 36, 48, 0.035);
    box-shadow: none;
}

.chat-page .chat-thread-card:hover {
    transform: none;
    box-shadow: none;
    background: rgba(107, 66, 178, 0.07);
}

.chat-page .chat-thread-card.is-selected {
    border-color: rgba(107, 66, 178, 0.24);
    background: linear-gradient(135deg, rgba(107, 66, 178, 0.13), rgba(251, 40, 155, 0.07));
    box-shadow: inset 4px 0 0 var(--brand-purple);
}

.chat-thread-avatar {
    display: inline-grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(107, 66, 178, 0.16), rgba(251, 40, 155, 0.12));
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 950;
}

.chat-thread-avatar-announcement {
    background: rgba(252, 209, 29, 0.22);
    color: #765b00;
}

.chat-thread-avatar-room {
    background: rgba(53, 201, 188, 0.18);
    color: #126a62;
}

.chat-page .chat-conversation-card {
    padding: 0;
    overflow: hidden;
}

.chat-page .chat-conversation-head {
    margin: 0;
    padding: 1.25rem 1.35rem;
    background: rgba(31, 36, 48, 0.025);
}

.chat-page .chat-conversation-card > .inline-note,
.chat-page .chat-conversation-card > .chat-pinned-panel {
    margin-right: 1.25rem;
    margin-left: 1.25rem;
}

.chat-page .chat-message-list {
    max-height: min(62vh, 44rem);
    margin: 0;
    padding: 1.25rem;
    border-top: 1px solid rgba(31, 36, 48, 0.07);
    border-bottom: 1px solid rgba(31, 36, 48, 0.07);
    background:
        radial-gradient(circle at top left, rgba(107, 66, 178, 0.045), transparent 34%),
        rgba(31, 36, 48, 0.025);
}

.chat-page .chat-message-card {
    max-width: min(72%, 42rem);
    border-radius: 18px 18px 18px 6px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(28, 19, 45, 0.07);
}

.chat-page .chat-message-card.is-own {
    border-color: rgba(107, 66, 178, 0.18);
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(135deg, rgba(107, 66, 178, 0.14), rgba(251, 40, 155, 0.09));
    text-align: left;
}

.chat-page .chat-compose-form {
    margin: 0 1.25rem 1.25rem;
    padding: 1rem;
    border: 1px solid rgba(107, 66, 178, 0.13);
    border-radius: 18px;
    background: rgba(107, 66, 178, 0.045);
}

.chat-page .chat-compose-form textarea {
    min-height: 6rem;
    resize: vertical;
}

.notifications-page .notifications-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.notifications-overview-card {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    box-shadow: 0 10px 26px rgba(28, 19, 45, 0.08);
}

.notifications-overview-card:hover {
    transform: translateY(-1px);
    border-color: rgba(107, 66, 178, 0.24);
}

.notifications-overview-card span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notifications-overview-card strong {
    overflow-wrap: anywhere;
    font-size: 1.65rem;
}

.notifications-overview-card-accent {
    background: linear-gradient(135deg, rgba(107, 66, 178, 0.13), rgba(251, 40, 155, 0.08)), #fff;
}

.notifications-overview-card-calendar {
    background: linear-gradient(135deg, rgba(53, 201, 188, 0.14), rgba(252, 209, 29, 0.1)), #fff;
}

.notifications-page .notifications-accordion {
    gap: 0.85rem;
}

.notifications-page .notifications-section {
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(28, 19, 45, 0.08);
}

.notifications-page .notifications-section.is-open {
    border-color: rgba(107, 66, 178, 0.17);
    box-shadow: 0 16px 36px rgba(28, 19, 45, 0.11);
}

.notifications-page .settings-accordion-trigger {
    min-height: 5.6rem;
}

.notification-filter-form {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 18px;
    background: rgba(31, 36, 48, 0.035);
}

.notification-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.notifications-page .notification-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.notifications-page .notification-feed-item {
    min-height: 9rem;
    align-content: start;
    gap: 0.55rem;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-left: 4px solid var(--notification-custom-color, rgba(107, 66, 178, 0.46));
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(28, 19, 45, 0.06);
}

.notifications-page .notification-feed-actions {
    align-self: end;
    margin-top: auto;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(31, 36, 48, 0.07);
}

.vault-page .vault-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 18px;
    background: rgba(31, 36, 48, 0.035);
}

.vault-entry-grid {
    display: grid;
    gap: 1rem;
}

.vault-entry-card {
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1.1rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(107, 66, 178, 0.07), transparent 34%),
        rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(28, 19, 45, 0.08);
}

.vault-entry-head,
.vault-entry-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.vault-entry-head {
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.vault-entry-title {
    min-width: 0;
}

.vault-entry-title h2,
.vault-entry-title p {
    margin: 0;
}

.vault-entry-title h2 {
    overflow-wrap: anywhere;
    font-size: 1.15rem;
}

.vault-entry-title p {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.vault-entry-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(107, 66, 178, 0.17), rgba(251, 40, 155, 0.12));
    color: var(--primary-dark);
    font-weight: 950;
}

.vault-entry-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 0.75rem;
}

.vault-entry-fact {
    display: grid;
    align-content: start;
    gap: 0.4rem;
    min-width: 0;
    padding: 0.8rem;
    border-radius: 14px;
    background: rgba(31, 36, 48, 0.035);
}

.vault-entry-fact > span,
.vault-secret-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.vault-entry-fact p {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

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

.vault-page .vault-secret {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid rgba(107, 66, 178, 0.1);
    border-radius: 16px;
    background: rgba(107, 66, 178, 0.04);
}

.vault-page .vault-secret-label {
    grid-column: 1 / -1;
}

.vault-page .vault-secret-value {
    min-width: 0;
}

@media (max-width: 1100px) {
    .realization-page .realization-period-panel,
    .notifications-page .notifications-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .realization-page .realization-period-actions {
        grid-column: 1 / -1;
    }

    .notifications-page .notification-feed {
        grid-template-columns: 1fr;
    }

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

    .vault-entry-notes {
        grid-column: 1 / -1;
    }
}

@media (max-width: 960px) {
    .realization-page .realization-data-table tbody tr {
        grid-template-columns: 3rem repeat(2, minmax(0, 1fr));
    }

    .realization-page .realization-data-table td.realization-primary-cell {
        grid-column: 2 / span 2;
    }

    .realization-page .realization-data-table td.realization-service-cell {
        grid-column: auto;
    }

    .chat-page .chat-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .chat-page .chat-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .chat-page .chat-message-card {
        max-width: 88%;
    }

    .notification-filter-grid {
        grid-template-columns: 1fr;
    }

    .vault-page .vault-credentials-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .realization-page .realization-period-panel,
    .notifications-page .notifications-overview-grid,
    .vault-entry-meta-grid {
        grid-template-columns: 1fr;
    }

    .realization-page .realization-period-actions,
    .vault-entry-notes {
        grid-column: auto;
    }

    .realization-page .realization-filter-query-field {
        grid-column: auto;
    }

    .realization-page .realization-data-table tbody tr {
        grid-template-columns: 2.7rem minmax(0, 1fr);
    }

    .realization-page .realization-data-table td.realization-select-cell {
        grid-row: 1 / span 9;
    }

    .realization-page .realization-data-table td:not(.realization-select-cell),
    .realization-page .realization-data-table td.realization-primary-cell,
    .realization-page .realization-data-table td.realization-service-cell {
        grid-column: 2;
    }

    .realization-page .realization-bulk-action-row {
        grid-template-columns: 1fr;
    }

    .chat-page .chat-message-card {
        max-width: 94%;
    }

    .chat-page .chat-conversation-card > .inline-note,
    .chat-page .chat-conversation-card > .chat-pinned-panel,
    .chat-page .chat-compose-form {
        margin-right: 0.8rem;
        margin-left: 0.8rem;
    }

    .chat-page .chat-message-list {
        padding: 0.8rem;
    }

    .vault-entry-head,
    .vault-entry-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .vault-page .vault-toolbar {
        grid-template-columns: 1fr;
    }

    .vault-page .vault-secret {
        grid-template-columns: 1fr;
    }

    .vault-page .vault-secret-label {
        grid-column: auto;
    }
}

* {
    box-sizing: border-box;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 16%, rgba(251, 40, 155, 0.2), transparent 24%),
        radial-gradient(circle at 82% 10%, rgba(252, 209, 29, 0.18), transparent 22%),
        radial-gradient(circle at 74% 80%, rgba(53, 201, 188, 0.16), transparent 24%),
        radial-gradient(circle at 56% 44%, rgba(107, 66, 178, 0.14), transparent 26%),
        linear-gradient(180deg, #000000 0%, #000000 52%, #000000 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

p,
li {
    color: var(--muted);
    line-height: 1.6;
}

.background-glow {
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(10px);
    pointer-events: none;
    opacity: 0.7;
}

.background-glow-a {
    top: 4rem;
    right: 6rem;
    width: 18rem;
    height: 18rem;
    background: rgba(252, 209, 29, 0.28);
}

.background-glow-b {
    bottom: 2rem;
    left: 3rem;
    width: 20rem;
    height: 20rem;
    background: rgba(53, 201, 188, 0.18);
}

.dashboard-body .dashboard-easter-egg-trigger {
    pointer-events: auto;
    cursor: pointer;
}

.dashboard-body .dashboard-easter-egg-trigger:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.7);
    outline-offset: 0.35rem;
}

.auth-body,
.app-body {
    position: relative;
}

.auth-layout,
.shell {
    width: min(100% - 2rem, 100%);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.auth-layout {
    width: min(1180px, calc(100% - 2rem));
}

.shell {
    width: min(1400px, calc(100% - 2rem));
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    align-items: center;
    padding: 7rem 0 2rem;
}

.auth-layout-compact {
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
}

.auth-card,
.hero-panel,
.content-card,
.module-card {
    background: var(--panel);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.auth-card {
    padding: 2rem;
}

.auth-card-brand-only {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.auth-brand-lockup {
    margin: 0;
    width: 100%;
    height: 100%;
}

.auth-brand-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
}

.auth-card-accent {
    min-height: 420px;
    background: transparent;
    color: #fffdf7;
}

.auth-card-accent p,
.auth-card-accent li {
    color: rgba(255, 253, 247, 0.76);
}

.auth-card-form {
    background: rgba(255, 255, 255, 0.94);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.auth-card-accent .eyebrow {
    color: var(--highlight-yellow);
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.8rem);
    margin-top: 0.7rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    margin-top: 0.65rem;
}

h3 {
    font-size: 1.2rem;
}

.lead {
    max-width: 36rem;
    font-size: 1.08rem;
    margin-top: 1rem;
}

.feature-list {
    margin: 1.5rem 0 0;
    padding-left: 1.1rem;
}

.section-head p,
.content-card-head p,
.page-header p,
.topbar p {
    margin: 0.55rem 0 0;
}

.stack-md {
    display: grid;
    gap: 1rem;
}

.stack-xs {
    display: grid;
    gap: 0.35rem;
}

.stack-lg {
    display: grid;
    gap: 1.5rem;
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

.form-field label {
    font-size: 0.95rem;
    font-weight: 700;
}

.form-input {
    width: 100%;
    border: 1px solid rgba(31, 36, 48, 0.14);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    background: #fffefb;
    color: var(--ink);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: rgba(251, 40, 155, 0.5);
    box-shadow: 0 0 0 4px rgba(251, 40, 155, 0.12);
    transform: translateY(-1px);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border: none;
    border-radius: 999px;
    padding: 0.95rem 1.3rem;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    box-shadow: 0 12px 28px rgba(107, 66, 178, 0.32);
}

.button-secondary {
    color: #fff;
    background: linear-gradient(135deg, #7a001f, #c2185b);
    box-shadow: 0 10px 22px rgba(122, 0, 31, 0.28);
}

.button-danger {
    color: #fff;
    background: linear-gradient(135deg, #7f102d, #d61f5c);
    box-shadow: 0 10px 24px rgba(127, 16, 45, 0.3);
}

.button-danger:hover,
.button-danger:focus-visible {
    background: linear-gradient(135deg, #690b24, #b90f48);
}

.button-muted {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-purple), #1d1d1d);
    box-shadow: 0 10px 22px rgba(107, 66, 178, 0.22);
}

.button-full {
    width: 100%;
}

.button-compact {
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
}

.auth-links {
    margin-top: 1.25rem;
    font-weight: 600;
    color: var(--accent-dark);
}

.auth-inline-form {
    margin-top: 0.85rem;
}

.form-errors {
    border-radius: 16px;
    padding: 0.9rem 1rem;
    background: rgba(181, 47, 47, 0.08);
    color: #8a2020;
}

.form-errors p,
.field-error {
    margin: 0;
    color: inherit;
}

.invoice-error-summary {
    display: grid;
    gap: 0.65rem;
    border: 1px solid color-mix(in srgb, #e03562 52%, var(--v16-border));
    background: color-mix(in srgb, #e03562 10%, var(--v16-surface-raised));
    color: var(--v16-text);
}

.invoice-error-summary ul {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding-left: 1.3rem;
}

.invoice-error-summary a {
    color: color-mix(in srgb, #ff7b9a 82%, var(--v16-text));
    font-weight: 750;
}

.invoice-error-summary:focus-visible {
    outline: 3px solid color-mix(in srgb, #e03562 65%, transparent);
    outline-offset: 3px;
}

.reminder-color-field {
    display: grid;
    gap: 0.6rem;
}

.reminder-color-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.reminder-color-text-input {
    min-width: 0;
    flex: 1 1 12rem;
    text-transform: uppercase;
}

.reminder-color-picker {
    width: 3rem;
    min-width: 3rem;
    height: 3rem;
    padding: 0.2rem;
    border: 1px solid rgba(31, 36, 48, 0.14);
    border-radius: 14px;
    background: #fffefb;
    cursor: pointer;
}

.reminder-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.reminder-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 10px;
}

.reminder-color-recent-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.reminder-color-swatch {
    width: 2.1rem;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 999px;
    border: 2px solid rgba(31, 36, 48, 0.1);
    background: transparent;
    box-shadow: none;
}

.site-header-row {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: min(1400px, calc(100% - 2rem));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    align-items: start;
    gap: 0.8rem;
    pointer-events: none;
}

.site-header-spacer {
    display: none;
}

.site-header-actions {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex-shrink: 1;
    width: 100%;
    justify-self: stretch;
    pointer-events: none;
}

.site-brand-mark {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.3rem;
    padding: 0.9rem 1.25rem;
    border-radius: 999px;
    background: #000;
    border: 1px solid rgba(252, 209, 29, 0.18);
    box-shadow: var(--shadow);
    width: fit-content;
    max-width: min(100%, 34rem);
    justify-self: center;
    pointer-events: auto;
}

.site-header-actions > *,
.site-header-actions > form,
.site-header-actions > form .button {
    pointer-events: auto;
}

.site-brand-logo-link {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
}

.site-brand-name-link {
    grid-column: 2 / span 2;
    grid-row: 1;
    color: #fff;
    min-width: 0;
}

.site-brand-mark-image {
    width: 3.4rem;
    height: 3.4rem;
    object-fit: contain;
    flex-shrink: 0;
}

.site-brand-mark-text {
    display: block;
    color: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: left;
}

.site-version-trigger {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(252, 209, 29, 0.92);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.16s ease, transform 0.16s ease;
}

.site-version-trigger:hover {
    color: #fff1a8;
    transform: translateY(-1px);
}

.site-license-trigger {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.16s ease, transform 0.16s ease;
}

.site-license-trigger:hover {
    color: #fff;
    transform: translateY(-1px);
}

.license-file-view {
    margin: 0;
    padding: 1.25rem;
    border-radius: 24px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    background: rgba(255, 255, 255, 0.74);
    color: #17181d;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.92rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.audit-log-details {
    display: block;
}

.audit-log-details summary {
    cursor: pointer;
    color: #6c4df6;
    font-weight: 700;
}

.audit-log-payload {
    margin: 0.75rem 0 0;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    background: rgba(255, 255, 255, 0.74);
    color: #17181d;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.audit-log-shell {
    display: grid;
    gap: 1.1rem;
}

.audit-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.audit-summary-grid > article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "value label"
        "value copy";
    align-items: center;
    column-gap: 0.85rem;
    min-height: 6.5rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(24, 18, 43, 0.07);
}

.audit-summary-grid > article > span {
    grid-area: label;
    align-self: end;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.audit-summary-grid > article > strong {
    grid-area: value;
    color: var(--accent-dark);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1;
}

.audit-summary-grid > article > p {
    grid-area: copy;
    align-self: start;
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.audit-filter-card {
    display: grid;
    gap: 1rem;
}

.audit-filter-heading,
.audit-stream-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.audit-filter-heading h2,
.audit-filter-heading p,
.audit-stream-heading h2 {
    margin: 0;
}

.audit-filter-heading h2,
.audit-stream-heading h2 {
    margin-top: 0.2rem;
}

.audit-filter-heading p {
    margin-top: 0.35rem;
    color: var(--muted);
    line-height: 1.45;
}

.audit-filter-form {
    display: grid;
    gap: 0.75rem;
}

.audit-primary-search {
    display: grid;
    gap: 0.35rem;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 800;
}

.audit-filter-disclosure {
    overflow: hidden;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 14px;
    background: rgba(247, 247, 250, 0.88);
}

.audit-filter-disclosure > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.65rem;
    min-height: 3rem;
    padding: 0.65rem 0.8rem;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.audit-filter-disclosure > summary::-webkit-details-marker {
    display: none;
}

.audit-filter-disclosure[open] > summary {
    border-bottom: 1px solid rgba(31, 36, 48, 0.09);
    background: rgba(255, 255, 255, 0.8);
}

.audit-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.8rem;
}

.audit-filter-grid .form-field {
    margin: 0;
}

.audit-filter-actions {
    justify-content: flex-end;
}

.audit-stream-section {
    display: grid;
    gap: 0.8rem;
}

.audit-result-count {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 800;
}

.audit-event-list {
    display: grid;
    gap: 0.7rem;
}

.audit-event-card {
    overflow: hidden;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 10px 26px rgba(24, 18, 43, 0.06);
}

.audit-event-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
    background: rgba(248, 248, 251, 0.9);
}

.audit-event-head time {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.audit-event-head time strong {
    color: var(--ink);
}

.audit-event-action {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.audit-event-summary {
    padding: 0.85rem 0.9rem 0.3rem;
}

.audit-event-summary h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.45;
}

.audit-event-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.5rem;
    padding: 0.55rem 0.9rem 0.85rem;
}

.audit-event-facts > div {
    min-width: 0;
    padding: 0.65rem;
    border-radius: 12px;
    background: rgba(246, 247, 250, 0.86);
}

.audit-event-facts span {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.audit-event-facts strong,
.audit-event-facts small {
    display: block;
    overflow-wrap: anywhere;
}

.audit-event-facts strong {
    color: var(--ink);
    font-size: 0.84rem;
}

.audit-event-facts small {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.audit-event-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.65rem 0.9rem;
    border-top: 1px solid rgba(31, 36, 48, 0.08);
    background: rgba(249, 249, 251, 0.9);
}

.audit-event-details .audit-log-details {
    flex: 1 1 16rem;
    min-width: 0;
}

.audit-event-details .audit-log-details > summary {
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    background: rgba(107, 66, 178, 0.08);
}

.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
}

.audit-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    padding: 2rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--muted);
    text-align: center;
}

.audit-empty-state strong {
    color: var(--ink);
}

.audit-empty-state .button {
    margin-top: 0.45rem;
}

.modal-open {
    overflow: hidden;
}

.release-dialog {
    width: min(920px, calc(100% - 2rem));
    max-width: 920px;
    max-height: min(82vh, 920px);
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    overflow: visible;
}

.release-dialog::backdrop {
    background: rgba(5, 5, 8, 0.72);
    backdrop-filter: blur(12px);
}

.release-modal-card {
    width: 100%;
    max-height: min(82vh, 920px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 32px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(13, 12, 18, 0.98), rgba(21, 18, 28, 0.96)),
        linear-gradient(135deg, rgba(251, 40, 155, 0.08), rgba(107, 66, 178, 0.08));
    color: #f7f3ff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
}

.release-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.release-modal-close {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    text-decoration: none;
}

.release-modal-head h2 {
    margin: 0;
    color: #fff;
}

.release-modal-head p {
    margin: 0;
    color: rgba(241, 235, 255, 0.72);
}

.release-modal-scroll {
    min-height: 0;
    overflow-y: auto;
    display: grid;
    gap: 1rem;
    padding-right: 0.35rem;
    overscroll-behavior: contain;
}

.release-modal-scroll::-webkit-scrollbar {
    width: 0.65rem;
}

.release-modal-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.release-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.release-entry {
    display: grid;
    gap: 0.9rem;
    padding: 1.2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.release-entry.is-current {
    background: linear-gradient(135deg, rgba(251, 40, 155, 0.12), rgba(107, 66, 178, 0.14));
    border-color: rgba(251, 40, 155, 0.24);
}

.release-entry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.release-entry-head h3,
.release-entry-section h4 {
    margin: 0;
    color: #fff;
}

.release-entry-head p {
    margin: 0.25rem 0 0;
    color: rgba(241, 235, 255, 0.72);
}

.release-entry-list {
    margin: 0.55rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.5rem;
    color: rgba(241, 235, 255, 0.84);
}

.release-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.4rem;
}

.release-modal-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: rgba(241, 235, 255, 0.82);
    font-size: 0.92rem;
}

.release-modal-checkbox input {
    margin-top: 0.15rem;
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand-pink);
    flex-shrink: 0;
}

.language-switch {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 20;
}

.language-switch-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.language-label {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.language-select {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    background: #000000;
    color: #fff;
    font-weight: 700;
}

.flash-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: grid;
    gap: 0.75rem;
    width: min(26rem, calc(100% - 2rem));
}

.flash-message {
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow);
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.flash-message.is-dismissing {
    opacity: 0;
    transform: translateX(1rem);
    pointer-events: none;
}

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

.flash-warning {
    background: var(--flash-warning-bg);
    color: var(--flash-warning-text);
}

.flash-error {
    background: var(--flash-error-bg);
    color: var(--flash-error-text);
}

.flash-info {
    background: var(--flash-info-bg);
    color: var(--flash-info-text);
}

[data-tooltip]:not([data-tooltip=""]) {
    position: relative;
}

[data-tooltip]:not([data-tooltip=""])::before,
[data-tooltip]:not([data-tooltip=""])::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    transition-delay: 0s;
    z-index: 70;
}

[data-tooltip]:not([data-tooltip=""])::before {
    content: "";
    bottom: calc(100% + 0.22rem);
    transform: translate(-50%, 0.2rem);
    border-width: 0.4rem 0.4rem 0;
    border-style: solid;
    border-color: rgba(18, 18, 24, 0.96) transparent transparent;
}

[data-tooltip]:not([data-tooltip=""])::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 0.62rem);
    transform: translate(-50%, 0.2rem);
    width: max-content;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    background: rgba(18, 18, 24, 0.96);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    box-shadow: 0 1rem 2.2rem rgba(0, 0, 0, 0.26);
}

[data-tooltip]:not([data-tooltip=""]):hover::before,
[data-tooltip]:not([data-tooltip=""]):hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
    transition-delay: 1s;
}

[data-tooltip]:not([data-tooltip=""]):focus-visible::before,
[data-tooltip]:not([data-tooltip=""]):focus-visible::after,
[data-tooltip]:not([data-tooltip=""]):focus-within::before,
[data-tooltip]:not([data-tooltip=""]):focus-within::after,
[data-tooltip]:not([data-tooltip=""]):has(+ :focus)::before,
[data-tooltip]:not([data-tooltip=""]):has(+ :focus)::after,
[data-tooltip]:not([data-tooltip=""]):has(+ * :focus)::before,
[data-tooltip]:not([data-tooltip=""]):has(+ * :focus)::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.finance-period-picker {
    width: min(100%, 30rem);
}

.finance-period-trigger {
    width: 100%;
    cursor: pointer;
}

.finance-period-popover {
    width: min(30rem, 88vw);
}

.finance-period-weekdays {
    margin-bottom: 0.45rem;
}

.finance-period-day {
    border: none;
    cursor: pointer;
}

.finance-period-day:focus-visible {
    outline: 2px solid rgba(53, 201, 188, 0.82);
    outline-offset: 2px;
}

.reporting-period-field {
    display: grid;
    min-width: min(13rem, 100%);
    gap: 0.35rem;
    font-weight: 750;
}

.reporting-period-submit {
    align-self: end;
    min-height: 3.5rem;
}

.invoice-list-action-cell {
    min-width: 6.5rem;
    white-space: nowrap;
}

.invoice-list-action-cell .button {
    white-space: nowrap;
    overflow-wrap: normal;
}

.field-error {
    font-size: 0.84rem;
    color: #a11255;
}

.shell {
    padding: 7rem 0 3rem;
}

.has-global-header-actions main.shell,
.has-global-header-actions .business-breadcrumb-shell {
    padding-top: 13rem;
}

.shell-spacious {
    display: grid;
    gap: 1.75rem;
}

.business-breadcrumb-shell {
    padding-bottom: 0;
}

.business-breadcrumb-shell + .shell {
    padding-top: 0;
}

.has-global-header-actions .business-breadcrumb-shell + main.shell,
.has-global-header-actions .business-breadcrumb-shell + .shell {
    padding-top: 0;
}

.shell-customer-list {
    width: min(1560px, calc(100% - 2rem));
}

.shell-spacious > .page-header,
.shell-spacious > .content-card,
.shell-spacious > .realization-summary-grid,
.shell-spacious > .catalog-manage-grid {
    margin-bottom: 0;
}

.topbar,
.page-header,
.content-card {
    margin-bottom: 1.5rem;
}

.topbar,
.page-header,
.content-card {
    padding: 1.5rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    background: transparent;
    color: #fff;
}

.topbar p {
    color: rgba(255, 255, 255, 0.72);
}

.page-header {
    background: transparent;
    color: #ffffff;
}

.page-header h1,
.page-header h2,
.page-header h3 {
    color: #ffffff !important;
}

.page-header p {
    color: rgba(255, 255, 255, 0.76) !important;
}

.topbar-actions {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.user-badge {
    display: grid;
    gap: 0.15rem;
    padding: 0.75rem 0.9rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    min-width: 180px;
    max-width: 220px;
    overflow: hidden;
}

.user-badge strong {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge span {
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-layout {
    --dashboard-module-card-height: 220px;
    --dashboard-module-grid-gap: 1rem;
    --dashboard-module-block-height: calc((var(--dashboard-module-card-height) * 2) + var(--dashboard-module-grid-gap));
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.dashboard-main,
.dashboard-sidebar {
    min-width: 0;
}

.dashboard-sidebar {
    display: grid;
    gap: 1rem;
}

.dashboard-section-head {
    margin-bottom: 1rem;
}

.dashboard-section-head h2 {
    margin: 0.15rem 0 0;
}

.dashboard-section-head p {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.dashboard-category-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.dashboard-category-preview span {
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(107, 66, 178, 0.13);
    border-radius: 999px;
    background: rgba(107, 66, 178, 0.07);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.dashboard-easter-egg {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: rgba(5, 5, 10, 0.76);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.dashboard-easter-egg[hidden] {
    display: none;
}

.dashboard-easter-egg-visible {
    opacity: 1;
}

.dashboard-easter-egg-image {
    width: min(72rem, 92vw);
    max-height: 82vh;
    border-radius: 18px;
    object-fit: contain;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.dashboard-easter-egg-close {
    position: fixed;
    top: clamp(1rem, 3vw, 2rem);
    right: clamp(1rem, 3vw, 2rem);
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    cursor: pointer;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

.dashboard-easter-egg-close:focus-visible {
    outline: 3px solid rgba(251, 40, 155, 0.45);
    outline-offset: 0.2rem;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--dashboard-module-grid-gap);
}

.hub-module-grid {
    gap: clamp(1.35rem, 2vw, 2rem);
}

.app-body-dashboard-compact .module-grid {
    gap: 0.8rem;
}

.module-card {
    min-height: var(--dashboard-module-card-height);
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.app-body-dashboard-compact .dashboard-layout {
    --dashboard-module-card-height: 180px;
    --dashboard-module-grid-gap: 0.8rem;
}

.app-body-dashboard-compact .module-card {
    min-height: var(--dashboard-module-card-height);
    padding: 1.1rem;
    gap: 0.6rem;
}

.module-card h3 {
    color: var(--ink);
}

.module-card p {
    color: var(--muted);
}

.module-card-active {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.module-card-active:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 40, 155, 0.3);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.2);
}

.module-card-disabled {
    opacity: 0.66;
}

.module-state,
.module-link {
    font-size: 0.84rem;
    font-weight: 700;
}

.module-state {
    color: var(--accent-dark);
}

.module-link {
    margin-top: auto;
}

.widget-card {
    min-height: 0;
}

.dashboard-notifications-card {
    min-height: var(--dashboard-module-block-height);
    max-height: var(--dashboard-module-block-height);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    position: relative;
    overflow: hidden;
    border-color: rgba(107, 66, 178, 0.16);
    background:
        radial-gradient(circle at 100% 0%, rgba(251, 40, 155, 0.11), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 241, 248, 0.96));
}

.dashboard-notifications-card::before {
    content: "";
    position: absolute;
    inset: 0 1.4rem auto;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, #fb289b, #6b42b2);
}

.dashboard-notifications-head {
    align-items: flex-start;
    gap: 0.8rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.dashboard-notifications-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.dashboard-notifications-title > div {
    min-width: 0;
}

.dashboard-notifications-title .eyebrow {
    display: block;
    margin-bottom: 0.18rem;
    color: var(--accent-dark);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.dashboard-notifications-title h2,
.dashboard-notifications-title p {
    margin: 0;
}

.dashboard-notifications-title h2 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.dashboard-notifications-title p {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    line-height: 1.3;
}

.dashboard-notifications-icon {
    width: 2.8rem;
    min-width: 2.8rem;
    height: 2.8rem;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg, #fb289b, #6b42b2);
    box-shadow: 0 10px 24px rgba(107, 66, 178, 0.24);
}

.dashboard-notifications-icon svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: currentColor;
}

.dashboard-notifications-open {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    white-space: nowrap;
}

.dashboard-notifications-card .widget-placeholder {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-notifications-card .dashboard-notification-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.dashboard-notification-widget {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding-top: 0.1rem;
}

.dashboard-notification-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.4rem;
    border: 1px solid rgba(107, 66, 178, 0.09);
    border-radius: 16px;
    background: rgba(107, 66, 178, 0.055);
}

.dashboard-notification-summary-item {
    min-width: 0;
    display: grid;
    gap: 0.08rem;
    padding: 0.5rem 0.6rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.dashboard-notification-summary-item span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-notification-summary-item strong {
    font-size: 1.12rem;
    line-height: 1.15;
}

.dashboard-notification-summary-item.has-important-items {
    background: rgba(255, 235, 222, 0.94);
}

.dashboard-notification-summary-item.has-important-items strong {
    color: #a43e16;
}

.widget-card-inactive {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 247, 248, 0.92)),
        linear-gradient(120deg, rgba(252, 209, 29, 0.08), rgba(107, 66, 178, 0.08));
}

.widget-placeholder {
    display: grid;
    gap: 0.75rem;
}

.widget-placeholder p {
    margin: 0;
}

.reminder-list {
    display: grid;
    gap: 0.65rem;
}

.dashboard-notification-list {
    max-height: min(32rem, 60vh);
    overflow-y: auto;
    padding-right: 0.35rem;
}

.dashboard-widget-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(69, 130, 236, 0.18);
    border-radius: 13px;
    background: rgba(69, 130, 236, 0.08);
}

.dashboard-day-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #285a9f;
    font-size: 0.76rem;
    font-weight: 750;
}

.dashboard-day-filter-label > span {
    color: #4582ec;
    font-size: 0.58rem;
}

.dashboard-filter-clear {
    color: #285a9f;
    font-size: 0.74rem;
    font-weight: 800;
    text-decoration: none;
}

.dashboard-filter-clear:hover {
    text-decoration: underline;
}

.calendar-scope-controls {
    display: grid;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0.75rem;
}

.calendar-scope-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.calendar-scope-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.calendar-scope-button,
.calendar-scope-icon,
.calendar-scope-form .form-input {
    flex-shrink: 0;
}

.calendar-scope-icon-button {
    width: 3.15rem;
    min-width: 3.15rem;
    height: 3.15rem;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-scope-icon {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
}

.calendar-scope-form .form-input {
    min-width: 0;
    width: 100%;
}

.dashboard-notification-list .reminder-item {
    gap: 0.28rem;
    padding: 0.52rem 0.6rem;
    border-left-width: 3px;
    border-radius: 13px;
}

.dashboard-notification-list .reminder-item-head {
    gap: 0.35rem;
}

.dashboard-notification-list .reminder-item strong {
    font-size: 0.88rem;
    line-height: 1.25;
}

.dashboard-notification-list .reminder-item p {
    font-size: 0.76rem;
    line-height: 1.25;
}

.dashboard-notification-list .table-helper,
.dashboard-notification-list .table-link {
    font-size: 0.74rem;
}

.dashboard-notification-list .status-pill {
    padding: 0.22rem 0.52rem;
    font-size: 0.72rem;
}

.dashboard-notification-list .notification-ack-trigger {
    width: 1.8rem;
    height: 1.8rem;
}

.reminder-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.reminder-item {
    display: grid;
    gap: 0.45rem;
    padding: 0.8rem 0.9rem;
    border-radius: 18px;
    background: var(--reminder-custom-color-soft, rgba(18, 18, 18, 0.05));
    border-left: 4px solid var(--reminder-custom-color, rgba(107, 66, 178, 0.4));
}

.reminder-item-priority-info {
    border-left-color: rgba(69, 130, 236, 0.68);
}

.reminder-item-priority-warning {
    border-left-color: rgba(242, 163, 58, 0.75);
}

.reminder-item-priority-danger {
    border-left-color: rgba(212, 67, 67, 0.74);
}

.reminder-item-priority-accent {
    border-left-color: rgba(251, 40, 155, 0.72);
}

.dashboard-notification-list {
    display: grid;
    align-content: start;
    gap: 0.55rem;
    scrollbar-color: rgba(107, 66, 178, 0.3) transparent;
    scrollbar-width: thin;
}

.dashboard-notification-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1fr);
    gap: 0.72rem;
    padding: 0.68rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-left: 4px solid var(--reminder-custom-color, rgba(107, 66, 178, 0.45));
    border-radius: 16px;
    background:
        linear-gradient(90deg, var(--reminder-custom-color-soft, rgba(107, 66, 178, 0.055)), transparent 38%),
        rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 20px rgba(31, 36, 48, 0.045);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.dashboard-notification-item:hover {
    border-color: rgba(107, 66, 178, 0.2);
    box-shadow: 0 11px 25px rgba(31, 36, 48, 0.075);
    transform: translateY(-1px);
}

.dashboard-notification-item.reminder-item-priority-info {
    border-left-color: rgba(69, 130, 236, 0.68);
}

.dashboard-notification-item.reminder-item-priority-warning {
    border-left-color: rgba(242, 163, 58, 0.75);
}

.dashboard-notification-item.reminder-item-priority-danger {
    border-left-color: rgba(212, 67, 67, 0.74);
}

.dashboard-notification-item.reminder-item-priority-accent {
    border-left-color: rgba(251, 40, 155, 0.72);
}

.dashboard-notification-date {
    min-height: 3.15rem;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.02rem;
    padding: 0.35rem 0.25rem;
    border: 1px solid rgba(107, 66, 178, 0.1);
    border-radius: 12px;
    color: var(--accent-dark);
    background: rgba(107, 66, 178, 0.08);
    font-style: normal;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}

.dashboard-notification-date strong {
    font-size: 1.05rem;
}

.dashboard-notification-date span {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.035em;
}

.dashboard-notification-date .dashboard-notification-date-today {
    max-width: 100%;
    color: #b10e60;
    font-size: 0.58rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.dashboard-notification-body {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.28rem;
}

.dashboard-notification-meta-row,
.dashboard-notification-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.dashboard-notification-meta-row {
    flex-wrap: wrap;
}

.dashboard-notification-full-date {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 650;
}

.dashboard-notification-body h3,
.dashboard-notification-body p {
    margin: 0;
    overflow-wrap: anywhere;
}

.dashboard-notification-body h3 {
    font-size: 0.9rem;
    line-height: 1.25;
}

.dashboard-notification-body p {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.3;
}

.dashboard-notification-actions {
    justify-content: space-between;
    min-height: 1.8rem;
    margin-top: 0.05rem;
}

.dashboard-notification-open-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent-dark);
    font-size: 0.74rem;
    font-weight: 800;
    text-decoration: none;
}

.dashboard-notification-open-link:hover {
    color: #b10e60;
}

.dashboard-notification-actions .notification-ack-menu {
    margin-left: auto;
}

.dashboard-notification-actions .notification-ack-trigger {
    width: 1.85rem;
    height: 1.85rem;
    border-color: rgba(107, 66, 178, 0.14);
    background: rgba(107, 66, 178, 0.07);
}

.dashboard-notification-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem;
    border-radius: 12px;
    color: var(--accent-dark);
    background: rgba(107, 66, 178, 0.07);
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
}

.dashboard-notification-more:hover {
    background: rgba(107, 66, 178, 0.12);
}

.dashboard-notification-readonly {
    padding: 0.5rem 0.62rem;
    border-radius: 12px;
    color: #6f5913;
    background: rgba(252, 209, 29, 0.13);
    font-size: 0.72rem;
    line-height: 1.35;
}

.dashboard-notification-empty,
.dashboard-notification-state {
    flex: 1 1 auto;
    min-height: 11rem;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.45rem;
    padding: 1.2rem;
    border: 1px dashed rgba(107, 66, 178, 0.2);
    border-radius: 18px;
    text-align: center;
    background: rgba(255, 255, 255, 0.48);
}

.dashboard-notification-empty h3,
.dashboard-notification-empty p,
.dashboard-notification-state h3,
.dashboard-notification-state p {
    margin: 0;
}

.dashboard-notification-empty h3,
.dashboard-notification-state h3 {
    font-size: 1rem;
}

.dashboard-notification-empty p,
.dashboard-notification-state p {
    max-width: 25rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.dashboard-notification-empty-icon,
.dashboard-notification-state-icon {
    width: 3.4rem;
    height: 3.4rem;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--accent-dark);
    background: rgba(107, 66, 178, 0.1);
    font-size: 1.35rem;
    font-weight: 850;
}

.dashboard-notification-empty-icon svg {
    width: 1.7rem;
    height: 1.7rem;
    fill: currentColor;
}

.reminder-item p {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.45;
}

.reminder-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.reminder-item-head-spacer,
.notification-feed-meta-spacer {
    flex: 1 1 auto;
    min-width: 0.5rem;
}

.reminder-item-date {
    white-space: nowrap;
}

.calendar-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 247, 248, 0.92)),
        linear-gradient(120deg, rgba(53, 201, 188, 0.08), rgba(251, 40, 155, 0.06));
}

.calendar-nav {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.calendar-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(18, 18, 18, 0.08);
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.calendar-nav-button:hover {
    transform: translateY(-1px);
    background: rgba(18, 18, 18, 0.12);
}

.calendar-nav-button-arrow {
    width: 3rem;
    padding: 0.7rem;
    font-size: 1.1rem;
    line-height: 1;
}

.calendar-nav-button-pin {
    width: 3rem;
    padding: 0.7rem;
    background: rgba(252, 209, 29, 0.18);
}

.calendar-nav-icon {
    width: 1.1rem;
    height: 1.1rem;
    fill: currentColor;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.55rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 0.15rem;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 0.32rem;
    padding: 0.55rem 0.35rem;
    border-radius: 18px;
    background: rgba(18, 18, 18, 0.05);
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.calendar-day:hover {
    transform: translateY(-2px);
    background: rgba(107, 66, 178, 0.08);
    box-shadow: 0 10px 20px rgba(31, 36, 48, 0.08);
}

.calendar-day-empty {
    background: transparent;
}

.calendar-day-today {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    box-shadow: 0 10px 20px rgba(107, 66, 178, 0.2);
}

.calendar-day-selected {
    outline: 2px solid rgba(53, 201, 188, 0.82);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(53, 201, 188, 0.14);
}

.calendar-day-markers {
    display: flex;
    gap: 0.22rem;
    flex-wrap: wrap;
    justify-content: center;
}

.calendar-event-dot {
    width: 0.52rem;
    height: 0.52rem;
    border-radius: 999px;
    background: rgba(18, 18, 18, 0.24);
}

.calendar-event-dot-accent {
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
}

.calendar-event-dot-info {
    background: #4d90fe;
}

.calendar-event-dot-success {
    background: #39c998;
}

.calendar-event-dot-warning {
    background: #f2a33a;
}

.calendar-event-dot-danger {
    background: #d44343;
}

.calendar-event-dot-muted {
    background: #7b7e8b;
}

.calendar-day-count {
    font-size: 0.72rem;
    color: var(--muted);
}

.calendar-grid-detailed .calendar-day {
    aspect-ratio: auto;
    min-height: 7.2rem;
    justify-items: stretch;
}

.calendar-day-detail {
    justify-items: stretch;
    align-content: flex-start;
}

.calendar-day-event-stack {
    display: grid;
    gap: 0.32rem;
}

.calendar-day-event {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.28rem 0.42rem;
    border-radius: 12px;
    font-size: 0.74rem;
    line-height: 1.25;
    background: rgba(18, 18, 18, 0.05);
}

.calendar-day-event span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day-event-accent {
    background: rgba(251, 40, 155, 0.12);
}

.calendar-day-event-info {
    background: rgba(77, 144, 254, 0.12);
}

.calendar-day-event-success {
    background: rgba(57, 201, 152, 0.12);
}

.calendar-day-event-warning {
    background: rgba(242, 163, 58, 0.14);
}

.calendar-day-event-danger {
    background: rgba(212, 67, 67, 0.12);
}

.calendar-day-event-muted {
    background: rgba(123, 126, 139, 0.12);
}

.back-link {
    display: inline-flex;
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: var(--accent-dark);
}

.breadcrumb-nav {
    margin-bottom: 0.8rem;
}

.breadcrumb-help-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.breadcrumb-help-row .breadcrumb-nav {
    min-width: 0;
    margin-bottom: 0;
}

.page-help-trigger {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1;
    cursor: help;
}

.page-help-trigger:hover,
.page-help-trigger:focus-visible {
    border-color: var(--brand-pink);
    background: var(--brand-pink);
    color: #fff;
    outline: none;
}

.page-guide-dialog {
    width: min(980px, calc(100% - 2rem));
    max-width: 980px;
    max-height: min(88vh, 960px);
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    overflow: visible;
}

.page-guide-dialog::backdrop {
    background: rgba(4, 4, 8, 0.76);
    backdrop-filter: blur(10px);
}

.page-guide-card {
    width: 100%;
    max-height: min(88vh, 960px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem;
    padding: clamp(1rem, 2.5vw, 1.6rem);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 30px;
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0, rgba(251, 40, 155, 0.14), transparent 38%),
        linear-gradient(150deg, rgba(18, 15, 25, 0.99), rgba(28, 23, 38, 0.98));
    color: #f7f3ff;
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.48);
}

.page-guide-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.page-guide-header h2,
.page-guide-section h3,
.page-guide-example h4 {
    margin: 0;
    color: #fff;
}

.page-guide-header p {
    max-width: 72ch;
    margin: 0;
    color: rgba(247, 243, 255, 0.74);
    line-height: 1.55;
}

.page-guide-close {
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 1.45rem;
    cursor: pointer;
}

.page-guide-close:hover,
.page-guide-close:focus-visible {
    border-color: var(--brand-pink);
    background: var(--brand-pink);
    outline: none;
}

.page-guide-scroll {
    min-width: 0;
    min-height: 0;
    display: grid;
    gap: 1rem;
    padding-right: 0.3rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.page-guide-section {
    min-width: 0;
    padding: clamp(1rem, 2vw, 1.3rem);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.055);
}

.page-guide-section h3 {
    margin-bottom: 0.75rem;
    font-size: 1.08rem;
}

.page-guide-section-intro {
    margin: -0.3rem 0 0.9rem;
    color: rgba(247, 243, 255, 0.68);
    line-height: 1.5;
}

.page-guide-purpose p {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.65;
}

.page-guide-capabilities .page-guide-notes {
    margin-bottom: 0;
}

.page-guide-steps,
.page-guide-notes {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding-left: 1.35rem;
}

.page-guide-tasks {
    display: grid;
    gap: 0.7rem;
}

.page-guide-task {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    overflow: hidden;
}

.page-guide-task summary {
    position: relative;
    padding: 0.9rem 2.8rem 0.9rem 1rem;
    color: #fff;
    font-weight: 800;
    line-height: 1.35;
    cursor: pointer;
    list-style: none;
}

.page-guide-task summary::-webkit-details-marker {
    display: none;
}

.page-guide-task summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 1rem;
    translate: 0 -50%;
    color: #ffc9ea;
    font-size: 1.35rem;
}

.page-guide-task[open] summary::after {
    content: "−";
}

.page-guide-task .page-guide-steps {
    margin: 0 1rem 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.page-guide-steps li,
.page-guide-notes li,
.page-guide-access p {
    color: rgba(247, 243, 255, 0.88);
    line-height: 1.55;
}

.page-guide-steps li::marker {
    color: #e051b2;
    font-weight: 900;
}

.page-guide-examples {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.page-guide-example {
    min-width: 0;
    padding: 0.9rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
}

.page-guide-example h4 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.page-guide-example code {
    display: block;
    max-width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    background: rgba(5, 5, 8, 0.48);
    color: #ffc9ea;
    font-size: 0.84rem;
    line-height: 1.45;
}

.page-guide-example p,
.page-guide-access p {
    margin: 0.55rem 0 0;
}

.page-guide-example p {
    color: rgba(247, 243, 255, 0.68);
    font-size: 0.9rem;
    line-height: 1.45;
}

.page-guide-important {
    border-color: rgba(244, 178, 74, 0.28);
    background: rgba(244, 178, 74, 0.08);
}

.page-guide-access {
    border-color: rgba(139, 104, 208, 0.34);
    background: rgba(107, 66, 178, 0.12);
}

@media (max-width: 720px) {
    .page-guide-dialog {
        width: min(100% - 1rem, 980px);
        max-height: 94vh;
    }

    .page-guide-card {
        max-height: 94vh;
        border-radius: 22px;
    }

    .page-guide-examples {
        grid-template-columns: 1fr;
    }
}

.page-context-fallback {
    padding-bottom: 0;
}

.page-context-fallback + main.shell,
.page-context-fallback + .shell {
    padding-top: 1rem;
}

.portal-page-context {
    padding-bottom: 0;
}

.portal-page-context + .portal-shell {
    padding-top: 1.25rem;
}

.portal-page-context .breadcrumb-link,
.portal-page-context .breadcrumb-current {
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.breadcrumb-link,
.breadcrumb-current {
    font-size: 0.92rem;
    font-weight: 700;
}

.breadcrumb-link {
    color: var(--accent-dark);
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-current {
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.42);
    font-weight: 700;
}

.content-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.page-header-hero {
    padding: 2rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.page-header-hero h1,
.page-header-hero h2,
.page-header-hero h3 {
    color: #fff;
}

.page-header-hero p {
    color: rgba(255, 255, 255, 0.78);
    max-width: 52rem;
}

.page-header-hero .back-link,
.page-header-hero .breadcrumb-link,
.page-header-hero .breadcrumb-current {
    color: var(--highlight-yellow);
}

.page-header-hero .breadcrumb-separator {
    color: rgba(252, 209, 29, 0.48);
}

.catalog-toolbar,
.catalog-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.catalog-toolbar-end {
    justify-content: flex-end;
}

.toolbar-form {
    margin: 0;
}

.toolbar-form-inline {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.strategy-status-form {
    margin: 0;
}

.strategy-inline-status-select {
    min-width: 10rem;
    width: 100%;
}

.strategies-table {
    min-width: 78rem;
}

.strategies-table .strategies-actions {
    width: 1%;
    min-width: 15rem;
}

.strategies-table .strategies-actions .button-row {
    flex-wrap: nowrap;
}

.strategies-table .strategies-actions .button {
    overflow-wrap: normal;
    white-space: nowrap;
    word-break: normal;
}

.toolbar-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
}

.toolbar-month-input {
    min-width: 11rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.realization-control-card {
    display: grid;
    gap: 1.35rem;
}

.realization-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.realization-summary-card {
    min-height: 8.2rem;
}

.realization-summary-card-alert {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 250, 0.94)),
        linear-gradient(135deg, rgba(251, 40, 110, 0.08), rgba(255, 190, 92, 0.08));
}

.realization-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.82fr);
    gap: 1rem;
    align-items: start;
}

.realization-title-block {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.realization-title-block h2 {
    margin: 0;
}

.realization-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    color: var(--muted);
    font-weight: 700;
}

.realization-meta-row > span:not(.realization-mode-badge) {
    display: inline-flex;
    align-items: center;
    min-height: 2.05rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(31, 36, 48, 0.06);
}

.realization-mode-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2.05rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(53, 201, 188, 0.14);
    color: #126a62;
    font-weight: 900;
}

.realization-mode-history {
    background: rgba(79, 53, 129, 0.12);
    color: var(--primary-dark);
}

.realization-period-panel {
    display: grid;
    gap: 0.8rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 249, 0.82)),
        rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.realization-period-forms {
    display: grid;
    gap: 0.7rem;
}

.realization-period-form {
    display: grid;
    grid-template-columns: 6.75rem minmax(10rem, 1fr) max-content;
    gap: 0.6rem;
    align-items: center;
    min-width: 0;
}

.realization-period-form-primary {
    padding: 0.15rem 0;
}

.realization-period-form-secondary {
    grid-template-columns: 7.4rem minmax(10rem, 1fr) max-content;
    padding-top: 0.2rem;
}

.realization-period-form .button,
.realization-customer-link {
    white-space: nowrap;
}

.realization-customer-link {
    justify-self: start;
}

.realization-month-input {
    width: 100%;
    min-width: 0;
}

.realization-week-picker {
    position: relative;
    min-width: 0;
}

.realization-week-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    text-align: left;
    font-weight: 700;
}

.realization-week-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(79, 53, 129, 0.08);
    color: var(--primary-dark);
    flex-shrink: 0;
}

.realization-week-trigger-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.realization-week-popover {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    z-index: 30;
    width: min(34rem, 88vw);
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 249, 0.95)),
        rgba(255, 255, 255, 0.94);
    box-shadow: 0 26px 54px rgba(31, 36, 48, 0.16);
}

.realization-week-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.realization-week-popover-head strong {
    font-size: 1rem;
}

.realization-week-nav {
    flex-wrap: nowrap;
}

.realization-week-index-heading {
    border-radius: 999px;
    background: rgba(31, 36, 48, 0.06);
    padding: 0.35rem 0;
}

.realization-week-months {
    min-width: 0;
}

.realization-week-grid {
    display: grid;
    grid-template-columns: 2.6rem repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
}

.realization-week-grid-body {
    align-items: stretch;
}

.realization-week-number {
    border: none;
    border-radius: 16px;
    background: rgba(31, 36, 48, 0.06);
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.realization-week-number:hover,
.realization-week-number:focus-visible {
    background: rgba(53, 201, 188, 0.14);
    box-shadow: 0 10px 20px rgba(31, 36, 48, 0.08);
    transform: translateY(-1px);
}

.realization-week-number.is-selected {
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    color: #fff;
    box-shadow: 0 12px 24px rgba(107, 66, 178, 0.2);
}

.realization-week-day {
    border: none;
    cursor: pointer;
}

.realization-week-day.calendar-day-today {
    color: var(--ink);
    background: linear-gradient(135deg, rgba(251, 40, 155, 0.82), rgba(107, 66, 178, 0.72));
    box-shadow:
        0 10px 20px rgba(107, 66, 178, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.realization-week-day.calendar-day-today:hover,
.realization-week-day.calendar-day-today:focus-visible {
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(255, 214, 102, 0.9), rgba(251, 40, 155, 0.34)),
        linear-gradient(135deg, rgba(251, 40, 155, 0.82), rgba(107, 66, 178, 0.72));
    box-shadow:
        0 14px 26px rgba(107, 66, 178, 0.22),
        inset 0 0 0 2px rgba(53, 201, 188, 0.5),
        inset 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.realization-week-day-muted {
    opacity: 0.46;
}

.realization-week-day-selected {
    background: rgba(53, 201, 188, 0.14);
    box-shadow: inset 0 0 0 2px rgba(53, 201, 188, 0.32);
}

.realization-week-day-selected.calendar-day-today {
    color: var(--ink);
    position: relative;
    background:
        radial-gradient(circle at top right, rgba(252, 209, 29, 0.42), transparent 42%),
        linear-gradient(135deg, rgba(255, 222, 89, 0.56), rgba(53, 201, 188, 0.26));
    box-shadow:
        inset 0 0 0 2px rgba(53, 201, 188, 0.42),
        inset 0 0 0 4px rgba(255, 255, 255, 0.5),
        0 10px 24px rgba(31, 36, 48, 0.12);
    font-weight: 900;
}

.realization-week-day-selected.calendar-day-today::after {
    content: "";
    position: absolute;
    top: 0.42rem;
    right: 0.42rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--brand-pink);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.realization-week-day:focus-visible,
.realization-week-number:focus-visible,
.realization-week-trigger:focus-visible {
    outline: 2px solid rgba(53, 201, 188, 0.82);
    outline-offset: 2px;
}

.realization-period-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 3rem;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(31, 36, 48, 0.72) 50%),
        linear-gradient(135deg, rgba(31, 36, 48, 0.72) 50%, transparent 50%);
    background-position:
        calc(100% - 1.2rem) calc(50% - 0.12rem),
        calc(100% - 0.85rem) calc(50% - 0.12rem);
    background-size: 0.45rem 0.45rem, 0.45rem 0.45rem;
    background-repeat: no-repeat;
}

.realization-period-select::-ms-expand {
    display: none;
}

.realization-history-panel {
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 18px;
    background: rgba(31, 36, 48, 0.035);
    overflow: hidden;
}

.realization-history-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.78rem 0.9rem;
}

.realization-history-summary::-webkit-details-marker {
    display: none;
}

.realization-history-summary::after {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: rgba(79, 53, 129, 0.1);
    color: var(--primary-dark);
    font-weight: 900;
    flex-shrink: 0;
}

.realization-history-panel[open] .realization-history-summary::after {
    content: "-";
}

.realization-history-summary-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.realization-history-summary-copy strong {
    color: var(--ink);
    font-size: 0.92rem;
}

.realization-history-summary-copy span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.realization-history-body {
    padding: 0 0.9rem 0.9rem;
    border-top: 1px solid rgba(31, 36, 48, 0.06);
}

.realization-period-actions {
    display: flex;
    justify-content: flex-start;
}

.realization-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(23rem, 0.84fr);
    gap: 1.15rem;
    align-items: start;
}

.realization-workspace-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.realization-filter-panel {
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.realization-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.realization-panel-head h3 {
    margin: 0.15rem 0 0;
    color: var(--ink);
    font-size: 1.15rem;
}

.realization-panel-head p {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.realization-filter-form {
    display: grid;
    gap: 0.95rem;
}

.realization-split-form {
    padding: 1.25rem;
    border: 1px solid rgba(146, 58, 190, 0.24);
    border-top: 4px solid var(--primary);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(251, 40, 155, 0.08), rgba(79, 53, 129, 0.07)),
        rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 42px rgba(58, 36, 96, 0.12);
}

.realization-split-head {
    border-bottom-color: rgba(79, 53, 129, 0.14);
}

.realization-split-head h3 {
    color: var(--primary-dark);
}

.realization-split-form .realization-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.realization-split-form .form-field-wide {
    grid-column: 1 / -1;
}

.realization-status-guide {
    margin-top: 0.75rem;
}

.realization-status-guide-title {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    cursor: pointer;
}

.realization-status-guide-title::-webkit-details-marker {
    display: none;
}

.realization-status-guide-title::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: rgba(79, 53, 129, 0.1);
    color: var(--primary-dark);
    flex-shrink: 0;
}

.realization-status-guide[open] .realization-status-guide-title::after {
    content: "−";
}

.realization-status-guide-list {
    margin: 0.7rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.35rem;
}

.realization-status-guide-list li {
    line-height: 1.45;
}

.realization-split-form .realization-filter-actions {
    padding-top: 1rem;
    border-top: 1px solid rgba(79, 53, 129, 0.12);
}

.realization-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 18rem));
    gap: 1rem 1.25rem;
    justify-content: flex-start;
}

.realization-filter-query-field {
    grid-column: 1 / -1;
}

.filter-actions {
    align-self: end;
}

.realization-filter-actions {
    margin-top: 0.15rem;
}

.settings-module-visibility-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.settings-control-shell {
    display: grid;
    gap: 1.1rem;
}

.settings-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.settings-overview-grid > article {
    display: grid;
    align-content: center;
    min-height: 6.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(24, 18, 43, 0.07);
}

.settings-overview-grid span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.settings-overview-grid strong {
    margin-top: 0.25rem;
    color: var(--accent-dark);
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}

.settings-overview-grid p {
    margin: 0.18rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.settings-section-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.settings-section-nav a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title count"
        "copy count";
    align-items: center;
    gap: 0.15rem 0.75rem;
    min-height: 4.4rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.settings-section-nav a > span {
    grid-area: title;
    font-weight: 850;
}

.settings-section-nav a > small {
    grid-area: copy;
    color: rgba(255, 255, 255, 0.57);
    font-size: 0.74rem;
}

.settings-section-nav a > strong {
    grid-area: count;
    display: inline-grid;
    min-width: 2rem;
    min-height: 2rem;
    place-items: center;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(251, 40, 155, 0.19);
    color: #fff;
}

.settings-section-nav a:hover,
.settings-section-nav a:focus-visible {
    border-color: rgba(251, 40, 155, 0.48);
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.settings-section-nav a:focus-visible {
    outline: 3px solid rgba(251, 40, 155, 0.28);
    outline-offset: 3px;
}

.settings-search-toolbar {
    display: grid;
    grid-template-columns: minmax(15rem, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
    padding: 0.8rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
}

.settings-search-toolbar > label {
    display: grid;
    gap: 0.35rem;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.settings-search-toolbar .button-row {
    flex-wrap: nowrap;
}

.settings-search-empty {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 1.5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--muted);
    text-align: center;
}

.settings-search-empty[hidden] {
    display: none;
}

.settings-search-empty strong {
    color: var(--ink);
}

.settings-section-block {
    display: grid;
    gap: 0.9rem;
    scroll-margin-top: 6rem;
}

.settings-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0.25rem;
}

.settings-section-head h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.35rem, 2vw, 2rem);
    letter-spacing: 0;
}

.settings-info-panel {
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(79, 53, 129, 0.14);
    border-left: 4px solid var(--primary);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(251, 40, 155, 0.07), rgba(79, 53, 129, 0.06)),
        rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.settings-info-panel h3 {
    margin: 0 0 0.45rem;
    color: var(--primary-dark);
}

.settings-info-panel p {
    margin: 0;
    max-width: 72rem;
    color: var(--muted);
}

.settings-info-panel p + p {
    margin-top: 0.55rem;
}

.settings-health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.2rem;
}

.settings-health-card,
.settings-history-item {
    padding: 1rem;
    border: 1px solid var(--v16-border);
    border-radius: 16px;
    background: var(--v16-surface);
    color: var(--v16-text);
}

.settings-health-card-ready {
    border-left: 3px solid var(--brand-mint);
}

.settings-health-card-warning {
    border-left: 3px solid var(--brand-yellow);
}

.settings-health-card-error {
    border-left: 3px solid var(--brand-pink);
}

.settings-health-card-head,
.settings-history-item > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.settings-health-card p,
.settings-history-item p,
.settings-history-item span {
    margin: 0.6rem 0 0;
    color: var(--v16-text-soft);
    line-height: 1.5;
}

.settings-history-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.settings-history-item span {
    margin: 0;
    text-align: right;
}

.settings-lock-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.settings-lock-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    padding: 1.15rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.settings-lock-panel-head {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.09);
}

.settings-lock-panel-head h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.settings-lock-panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.settings-lock-form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

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

.settings-lock-form .form-field-wide {
    grid-column: 1 / -1;
}

.settings-lock-actions {
    margin-top: auto;
    padding-top: 0.15rem;
}

.settings-accordion {
    display: grid;
    gap: 0.7rem;
}

.settings-section-actions {
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.settings-accordion-item {
    padding: 0;
    overflow: hidden;
}

.settings-accordion-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.1rem;
    text-align: left;
    cursor: pointer;
}

.settings-accordion-trigger:focus-visible {
    outline: 3px solid rgba(251, 40, 155, 0.22);
    outline-offset: -3px;
}

.settings-accordion-copy {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.settings-accordion-title {
    font-size: clamp(1.05rem, 1.5vw, 1.28rem);
    font-weight: 800;
    color: var(--ink);
}

.settings-accordion-text {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.settings-accordion-icon {
    position: relative;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(107, 66, 178, 0.12);
    flex-shrink: 0;
    transition: transform 0.18s ease, background 0.18s ease;
}

.settings-accordion-icon::before,
.settings-accordion-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.9rem;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-dark);
    transform: translate(-50%, -50%);
}

.settings-accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.settings-accordion-item.is-open .settings-accordion-icon {
    transform: rotate(180deg);
    background: rgba(251, 40, 155, 0.14);
}

.settings-accordion-item.is-open .settings-accordion-icon::after {
    opacity: 0;
}

.settings-accordion-panel {
    padding: 0 1.1rem 1.1rem;
    border-top: 1px solid rgba(18, 18, 18, 0.08);
}

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

.settings-accordion-panel .form-field:first-child,
.settings-accordion-panel .permission-checkbox-grid:first-child,
.settings-accordion-panel .settings-module-visibility-grid:first-child {
    margin-top: 1.2rem;
}

.month-table-section + .month-table-section {
    margin-top: 1.5rem;
}

.realization-results-card {
    margin-top: 1.6rem;
    overflow: hidden;
}

.realization-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.realization-board-title {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
}

.realization-board-title h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.6vw, 2rem);
}

.realization-board-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.realization-board-guidance {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    max-width: 27rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(53, 201, 188, 0.2);
    border-radius: 16px;
    background: rgba(53, 201, 188, 0.08);
    color: #126a62;
}

.realization-board-guidance-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(53, 201, 188, 0.18);
    font-weight: 950;
    flex-shrink: 0;
}

.realization-board-guidance > span:last-child {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.realization-board-guidance strong {
    color: #126a62;
}

.realization-board-guidance small {
    color: #3e746f;
    line-height: 1.35;
}

.realization-bulk-form {
    display: grid;
    gap: 0.85rem;
}

.realization-bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-left: 4px solid var(--brand-pink);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(251, 40, 155, 0.08), rgba(53, 201, 188, 0.06)),
        rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 28px rgba(58, 36, 96, 0.08);
}

.realization-bulk-summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex-wrap: wrap;
}

.realization-selected-count {
    display: inline-flex;
    align-items: center;
    min-height: 2.15rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 900;
    white-space: nowrap;
}

.realization-bulk-controls {
    display: grid;
    gap: 0.45rem;
    min-width: min(100%, 28rem);
}

.realization-bulk-controls .toolbar-label {
    justify-self: end;
    white-space: nowrap;
}

.realization-bulk-action-row {
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) max-content;
    gap: 0.6rem;
    align-items: center;
}

.realization-bulk-controls .inline-status-select {
    min-width: 11rem;
}

.realization-bulk-controls .button {
    min-height: 3.2rem;
}

.realization-bulk-controls .button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    box-shadow: none;
}

.realization-table-wrap {
    max-height: min(58rem, 74vh);
    padding: 0.55rem;
    overflow: auto;
    border: 1px solid rgba(31, 36, 48, 0.09);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(238, 237, 241, 0.94), rgba(247, 247, 249, 0.9)),
        rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 66, 178, 0.42) rgba(31, 36, 48, 0.05);
}

.realization-data-table {
    min-width: 76rem;
    border-collapse: separate;
    border-spacing: 0 0.45rem;
}

.realization-data-table th {
    position: sticky;
    top: -0.55rem;
    z-index: 4;
    padding-top: 0.85rem;
    padding-bottom: 0.7rem;
    border-bottom: 0;
    background: rgba(242, 241, 245, 0.97);
    white-space: nowrap;
}

.realization-data-table td {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-top: 1px solid rgba(31, 36, 48, 0.07);
    border-bottom: 1px solid rgba(31, 36, 48, 0.07);
    background: rgba(255, 255, 255, 0.9);
    vertical-align: middle;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.realization-data-table tbody tr:hover > td {
    border-color: rgba(107, 66, 178, 0.15);
    background: rgba(255, 255, 255, 0.99);
}

.realization-data-table tbody td:first-child {
    border-left: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 14px 0 0 14px;
}

.realization-data-table tbody td:last-child {
    border-right: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 0 14px 14px 0;
}

.realization-data-table th.realization-select-cell,
.realization-data-table td.realization-select-cell {
    position: sticky;
    left: 0;
}

.realization-data-table th.realization-select-cell {
    z-index: 7;
}

.realization-data-table td.realization-select-cell {
    z-index: 3;
}

.realization-data-table thead th:nth-child(2),
.realization-data-table td.realization-primary-cell {
    position: sticky;
    left: 3.45rem;
}

.realization-data-table thead th:nth-child(2) {
    z-index: 6;
}

.realization-data-table td.realization-primary-cell {
    z-index: 2;
    box-shadow: 12px 0 18px -18px rgba(31, 36, 48, 0.52);
}

.realization-work-row-accent > td:first-child {
    box-shadow: inset 4px 0 0 rgba(116, 63, 224, 0.82);
}

.realization-work-row-info > td:first-child {
    box-shadow: inset 4px 0 0 rgba(74, 144, 226, 0.84);
}

.realization-work-row-warning > td:first-child {
    box-shadow: inset 4px 0 0 rgba(242, 163, 58, 0.9);
}

.realization-work-row-success > td:first-child {
    box-shadow: inset 4px 0 0 rgba(57, 201, 152, 0.9);
}

.realization-work-row-danger > td:first-child {
    box-shadow: inset 4px 0 0 rgba(223, 54, 101, 0.9);
}

.realization-row-copy {
    background: transparent;
}

.realization-row-copy > td {
    background:
        linear-gradient(90deg, rgba(53, 201, 188, 0.08), rgba(255, 255, 255, 0.92) 32%),
        rgba(255, 255, 255, 0.92);
}

.realization-row-copy > td:first-child {
    box-shadow: inset 4px 0 0 rgba(53, 201, 188, 0.9);
}

.realization-service-cell {
    white-space: nowrap;
}

.realization-service-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    max-width: 13rem;
    padding: 0.38rem 0.62rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 999px;
    background: rgba(31, 36, 48, 0.045);
    white-space: normal;
    line-height: 1.3;
}

.realization-service-dot {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    box-shadow: 0 0 0 3px rgba(107, 66, 178, 0.1);
    flex-shrink: 0;
}

.realization-copy-icon {
    position: relative;
    display: inline-flex;
    width: 1.15rem;
    height: 1.15rem;
    margin-left: 0.45rem;
    vertical-align: -0.18rem;
}

.realization-copy-icon::before,
.realization-copy-icon::after {
    content: "";
    position: absolute;
    width: 0.72rem;
    height: 0.72rem;
    border: 2px solid #178b80;
    border-radius: 0.22rem;
    background: rgba(255, 255, 255, 0.88);
}

.realization-copy-icon::before {
    left: 0.07rem;
    top: 0.32rem;
    opacity: 0.68;
}

.realization-copy-icon::after {
    left: 0.34rem;
    top: 0.06rem;
}

.realization-copy-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 1.45rem;
    margin-bottom: 0.35rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(53, 201, 188, 0.32);
    background: rgba(53, 201, 188, 0.13);
    color: #176a63;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.realization-action-heading,
.realization-action-cell {
    width: 4.25rem;
    text-align: center;
}

.realization-trash-button {
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid rgba(154, 22, 64, 0.18);
    border-radius: 999px;
    background: rgba(223, 54, 101, 0.08);
    color: #8a1a43;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.realization-trash-button:hover,
.realization-trash-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(154, 22, 64, 0.32);
    background: rgba(223, 54, 101, 0.14);
    box-shadow: 0 10px 24px rgba(154, 22, 64, 0.14);
}

.realization-trash-icon {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    flex-shrink: 0;
}

.realization-select-cell {
    width: 3rem;
    text-align: center;
}

.realization-row-checkbox {
    margin: 0 auto;
}

.realization-selection-placeholder {
    color: var(--muted);
    font-weight: 800;
}

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

.realization-inline-select {
    width: auto;
    max-width: 100%;
    min-height: 2.55rem;
    padding: 0.5rem 2.15rem 0.5rem 0.78rem;
    border-radius: 13px;
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.2;
    cursor: pointer;
}

.realization-inline-select:focus {
    transform: none;
}

.realization-inline-text {
    width: 100%;
    min-height: 2.55rem;
    padding: 0.5rem 0.78rem;
    border-radius: 13px;
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.2;
}

.realization-inline-text:focus {
    transform: none;
}

.realization-inline-scope-input {
    border-color: rgba(53, 201, 188, 0.22);
    background-color: rgba(53, 201, 188, 0.1);
    color: #126a62;
}

.realization-inline-assignee-select {
    min-width: 11rem;
    max-width: 13rem;
    border-color: rgba(31, 36, 48, 0.12);
    background-color: rgba(255, 255, 255, 0.86);
    color: var(--ink);
}

.realization-inline-portal-select {
    min-width: 10rem;
    border-color: rgba(53, 201, 188, 0.25);
    background-color: rgba(53, 201, 188, 0.1);
    color: #126a62;
}

.realization-inline-status-select {
    min-width: 7rem;
    border-width: 0;
}

.realization-inline-status-accent {
    color: #5a2cad;
    background-color: rgba(116, 63, 224, 0.18);
}

.realization-inline-status-success {
    color: #0f5f3d;
    background-color: rgba(57, 201, 152, 0.18);
}

.realization-inline-status-warning {
    color: #8a5a00;
    background-color: rgba(255, 190, 92, 0.22);
}

.realization-inline-status-danger {
    color: #8f123d;
    background-color: rgba(251, 40, 110, 0.16);
}

.realization-inline-status-info {
    color: #114e9a;
    background-color: rgba(74, 144, 226, 0.18);
}

.realization-blocked-reason {
    display: inline-block;
    max-width: 18rem;
    color: #8f123d;
    line-height: 1.45;
    cursor: help;
}

.realization-inline-status-muted {
    color: #3f4650;
    background-color: rgba(31, 36, 48, 0.1);
}

.automation-builder-page .content-card {
    overflow: visible;
}

.automation-builder-section {
    padding: 1.15rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
}

.automation-builder-section-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
}

.automation-builder-section-head h2,
.automation-builder-section-head p {
    margin: 0;
}

.automation-builder-section-head p {
    margin-top: 0.25rem;
    color: var(--muted);
}

.automation-builder-step,
.automation-builder-row-number {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(116, 63, 224, 0.2);
}

.automation-condition-match {
    max-width: 32rem;
}

.automation-builder-rows {
    display: grid;
    gap: 0.8rem;
}

.automation-builder-row {
    display: grid;
    grid-template-columns: auto repeat(3, minmax(0, 1fr)) auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.9rem;
    border: 1px solid rgba(107, 66, 178, 0.14);
    border-radius: 16px;
    background: rgba(247, 246, 250, 0.88);
}

.automation-action-row {
    grid-template-columns: auto minmax(12rem, 0.8fr) minmax(14rem, 1fr) minmax(16rem, 1.4fr) auto;
}

.automation-builder-row-number {
    width: 1.75rem;
    height: 1.75rem;
    margin-top: 1.85rem;
    font-size: 0.78rem;
}

.automation-builder-row .form-field {
    min-width: 0;
}

.automation-row-remove {
    align-self: end;
    margin-bottom: 0.05rem;
}

.automation-add-row {
    justify-self: start;
}

.automation-builder-review {
    background:
        linear-gradient(135deg, rgba(53, 201, 188, 0.08), rgba(116, 63, 224, 0.08)),
        rgba(255, 255, 255, 0.76);
}

.automation-rule-card {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.automation-rule-summary,
.automation-rule-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.automation-rule-summary > div {
    display: grid;
    gap: 0.2rem;
}

.automation-rule-actions .compact-inline-form {
    flex: 1 1 28rem;
}

.automation-rule-actions .compact-inline-form .form-input {
    flex: 1 1 18rem;
}

@media (max-width: 980px) {
    .automation-builder-row,
    .automation-action-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .automation-builder-row-number {
        grid-row: 1 / span 4;
    }

    .automation-builder-row .form-field,
    .automation-builder-row .automation-row-remove {
        grid-column: 2;
    }

    .automation-row-remove {
        justify-self: start;
    }
}

.realization-primary-cell {
    min-width: 15rem;
}

.realization-customer-identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
}

.realization-customer-avatar {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(107, 66, 178, 0.14);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(251, 40, 155, 0.13), rgba(107, 66, 178, 0.13)),
        rgba(255, 255, 255, 0.84);
    color: var(--primary-dark);
    font-weight: 950;
}

.realization-customer-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.realization-customer-copy strong {
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.realization-customer-copy .table-link {
    width: fit-content;
    font-size: 0.78rem;
    font-weight: 800;
}

.realization-scope-heading,
.realization-scope-cell {
    min-width: 14rem;
}

.realization-scope-cell {
    width: 18rem;
}

.realization-primary-cell strong,
.realization-service-cell {
    color: var(--ink);
}

.realization-service-cell,
.realization-assignee-cell {
    font-weight: 700;
}

.realization-scope-pill {
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 18rem;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(53, 201, 188, 0.22);
    border-radius: 999px;
    background: rgba(53, 201, 188, 0.1);
    color: #126a62;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
}

.realization-date-cell {
    color: var(--muted);
    font-size: 0.92rem;
    white-space: nowrap;
}

.realization-date-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.34rem 0.58rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 10px;
    background: rgba(31, 36, 48, 0.045);
    color: #535a66;
    font-weight: 750;
}

.realization-date-badge-due {
    border-color: rgba(242, 163, 58, 0.18);
    background: rgba(242, 163, 58, 0.09);
    color: #7d520b;
}

.realization-date-badge-complete {
    border-color: rgba(57, 201, 152, 0.2);
    background: rgba(57, 201, 152, 0.1);
    color: #176044;
}

.realization-empty-value {
    color: rgba(97, 103, 116, 0.58);
    font-weight: 800;
}

.realization-outcome-cell {
    min-width: 10rem;
}

.realization-action-cell .catalog-actions {
    justify-content: flex-end;
}

.inline-status-form {
    display: grid;
    gap: 0.6rem;
}

.inline-status-select {
    min-width: 10rem;
}

.status-pill-muted {
    color: #3f4650;
    background: rgba(31, 36, 48, 0.12);
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.push-settings-card {
    display: grid;
    grid-column: 1 / -1;
    gap: 1rem;
}

.push-status-panel {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(53, 201, 188, 0.08), rgba(251, 40, 155, 0.05)),
        rgba(255, 255, 255, 0.7);
}

.push-status-panel strong,
.push-status-panel p {
    margin: 0;
}

.push-status-panel .status-pill {
    justify-self: start;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.managed-user-form-help-row {
    margin-top: -0.35rem;
    gap: 0;
}

.button-row {
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.invoice-action-workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.invoice-action-group {
    display: grid;
    align-content: start;
    gap: 0.85rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(107, 66, 178, 0.05), rgba(53, 201, 188, 0.04)),
        rgba(255, 255, 255, 0.58);
}

.invoice-action-group-ksef {
    grid-column: 1 / -1;
}

.invoice-action-group-head {
    display: grid;
    gap: 0.2rem;
}

.invoice-action-group-head h2,
.invoice-action-group-head p {
    margin: 0;
}

.invoice-action-group-head h2 {
    font-size: 1rem;
}

.invoice-action-group-head p {
    color: var(--muted);
    font-size: 0.84rem;
}

.business-metric-grid article strong.invoice-payment-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: start;
    width: fit-content;
    padding: 0.48rem 0.72rem;
    border-radius: 999px;
    font-size: 0.9rem;
    line-height: 1.2;
}

.business-metric-grid article strong.invoice-payment-indicator > span {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    color: inherit;
    background: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
}

.invoice-payment-indicator-success {
    color: #0f5f3d;
    background: #c9f2df;
}

.invoice-payment-indicator-warning {
    color: #8a4900;
    background: #ffd39b;
}

.invoice-payment-indicator-danger {
    color: #8a1130;
    background: #ffc4d1;
}

.invoice-payment-indicator-neutral {
    color: #47505f;
    background: #e3e6eb;
}

.invoice-action-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-width: 0;
}

.invoice-action-row > form {
    margin: 0;
}

.invoice-action-row .button {
    min-height: 3rem;
}

.invoice-email-form {
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
}

.invoice-email-form .form-input,
.invoice-email-form .button {
    min-height: 3rem;
}

@media (max-width: 1040px) {
    .invoice-action-workspace {
        grid-template-columns: 1fr;
    }

    .invoice-action-group-ksef {
        grid-column: auto;
    }
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.form-help {
    font-size: 0.84rem;
    color: var(--muted);
}

.date-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.date-picker {
    position: relative;
}

.date-picker-source {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.date-picker-native {
    position: static;
    width: 100%;
    height: auto;
    padding: 0.85rem 1rem;
    margin: 0;
    opacity: 1;
    pointer-events: auto;
}

.date-picker-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
}

.date-picker-display {
    width: 100%;
    cursor: pointer;
}

.customer-date-nav {
    margin-bottom: 0.85rem;
}

.customer-date-grid-head {
    margin-bottom: 0.55rem;
}

.customer-date-day {
    width: 100%;
    border: none;
    cursor: pointer;
}

.customer-date-day-empty {
    pointer-events: none;
}

.multi-picker {
    display: grid;
    gap: 0.85rem;
}

.multi-picker-source {
    display: none;
}

.multi-picker-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 0.9rem;
}

.multi-picker-select {
    min-height: 0;
    width: 100%;
}

.multi-picker-controls .button {
    margin-top: 0.95rem;
}

.multi-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-height: 4rem;
    padding: 0.9rem;
    border: 1px solid rgba(31, 36, 48, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.multi-picker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem 0.55rem 0.95rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(107, 66, 178, 0.14), rgba(251, 40, 155, 0.12));
    border: 1px solid rgba(107, 66, 178, 0.14);
}

.multi-picker-item-label {
    font-weight: 700;
    color: var(--ink);
}

.multi-picker-remove {
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    background: linear-gradient(135deg, #7a001f, #c2185b);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.multi-picker-empty {
    margin: 0;
    color: var(--muted);
}

.link-preview-card {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.link-preview-head {
    display: grid;
    gap: 0.2rem;
}

.link-preview-head strong {
    font-size: 0.94rem;
}

.link-preview-head span,
.link-preview-empty {
    color: var(--muted);
    font-size: 0.9rem;
}

.link-preview-body {
    display: grid;
    gap: 0.55rem;
}

.link-preview-entry {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(31, 36, 48, 0.08);
    color: var(--ink);
}

.link-preview-empty {
    margin: 0;
}

.inline-link {
    color: var(--brand-purple);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.14em;
    word-break: break-word;
}

.inline-link:hover {
    color: var(--brand-pink);
}

.form-input-multiselect {
    min-height: 15rem;
    padding: 0.75rem;
}

.form-input-multiselect option {
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 3.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(31, 36, 48, 0.14);
    border-radius: 16px;
    background: var(--panel-strong);
}

.checkbox-field-tall {
    min-height: 3.75rem;
    width: 100%;
}

.form-checkbox {
    width: 1.1rem;
    height: 1.1rem;
}

.private-file-clear-control {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.private-file-clear-control input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--brand-pink);
}

.private-file-clear-control label {
    margin: 0;
    cursor: pointer;
}

.info-list {
    display: grid;
    gap: 0.85rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(18, 18, 18, 0.05);
}

.info-item span {
    color: var(--muted);
}

.info-item strong {
    text-align: right;
}

.table-helper {
    font-size: 0.84rem;
    color: var(--muted);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-actions form {
    margin: 0;
}

.access-control-shell {
    display: grid;
    gap: 1.15rem;
}

.access-control-header {
    align-items: flex-end;
}

.access-control-primary-actions {
    flex: 0 0 auto;
}

.access-control-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.access-control-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.35rem;
    padding: 0.7rem 0.9rem 0.7rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.86);
    font-weight: 800;
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.access-control-nav a:hover,
.access-control-nav a:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(251, 40, 155, 0.48);
    background: rgba(255, 255, 255, 0.16);
    outline: none;
}

.access-control-nav a strong {
    display: inline-grid;
    min-width: 2rem;
    min-height: 2rem;
    place-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(251, 40, 155, 0.19);
    color: #fff;
}

.access-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.access-summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "value label"
        "value copy";
    align-items: center;
    column-gap: 0.9rem;
    min-height: 6.8rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 250, 0.95)),
        linear-gradient(135deg, rgba(53, 201, 188, 0.07), rgba(251, 40, 155, 0.06));
    box-shadow: 0 14px 34px rgba(24, 18, 43, 0.07);
}

.access-summary-card > span {
    grid-area: label;
    align-self: end;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.access-summary-card > strong {
    grid-area: value;
    color: var(--accent-dark);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1;
}

.access-summary-card p {
    grid-area: copy;
    align-self: start;
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.access-rank-note {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 16, 24, 0.88);
    color: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.access-rank-note-icon {
    display: inline-grid;
    flex: 0 0 2.35rem;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-weight: 900;
}

.access-rank-note p {
    margin: 0.18rem 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.86rem;
    line-height: 1.45;
}

.access-control-section {
    display: grid;
    gap: 1rem;
    scroll-margin-top: 1rem;
}

.access-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.access-section-head h2,
.access-section-head p {
    margin: 0;
}

.access-section-head h2 {
    margin-top: 0.2rem;
}

.access-section-head p {
    margin-top: 0.35rem;
    color: var(--muted);
    line-height: 1.5;
}

.access-list-toolbar {
    display: grid;
    grid-template-columns: minmax(15rem, 1fr) auto auto;
    align-items: end;
    gap: 0.75rem;
    padding: 0.8rem;
    border-radius: 16px;
    border: 1px solid rgba(31, 36, 48, 0.09);
    background: rgba(246, 247, 250, 0.88);
}

.access-search-field {
    display: grid;
    gap: 0.35rem;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.access-search-field .form-input {
    min-height: 3rem;
}

.access-manageable-filter {
    min-height: 3rem;
    margin: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    background: var(--panel-strong);
}

.access-visible-count {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.2rem;
    min-width: 4rem;
    min-height: 3rem;
    padding: 0.68rem;
    border-radius: 12px;
    background: rgba(107, 66, 178, 0.1);
    color: var(--muted);
}

.access-visible-count strong {
    color: var(--accent-dark);
    font-size: 1.15rem;
}

.access-account-list {
    display: grid;
    gap: 0.75rem;
}

.access-account-card,
.access-group-card {
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 9px 24px rgba(24, 18, 43, 0.055);
}

.access-account-card[hidden],
.access-group-card[hidden] {
    display: none;
}

.access-account-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem 0.75rem;
}

.access-avatar {
    display: inline-grid;
    width: 2.7rem;
    height: 2.7rem;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(107, 66, 178, 0.14), rgba(251, 40, 155, 0.16));
    color: var(--accent-dark);
    font-size: 1.05rem;
    font-weight: 900;
}

.access-account-identity,
.access-group-card-head > div:first-child {
    min-width: 0;
}

.access-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.access-title-line h3 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 1.05rem;
}

.access-account-identity p,
.access-group-card-head p {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.22rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.access-account-identity small {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
}

.access-rank-badge {
    display: grid;
    justify-items: center;
    min-width: 4rem;
    padding: 0.55rem 0.7rem;
    border-radius: 13px;
    background: rgba(107, 66, 178, 0.09);
}

.access-rank-badge span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.access-rank-badge strong {
    color: var(--accent-dark);
    font-size: 1.15rem;
}

.access-account-facts {
    display: grid;
    grid-template-columns: minmax(13rem, 1.5fr) repeat(3, minmax(8rem, 0.65fr));
    gap: 0.55rem;
    padding: 0 1rem 0.8rem;
}

.access-account-facts > div,
.access-group-metrics > div {
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border-radius: 12px;
    background: rgba(246, 247, 250, 0.86);
}

.access-account-facts > div > span,
.access-group-metrics span,
.access-scope-line > span {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.access-account-facts > div > strong {
    color: var(--ink);
    font-size: 0.84rem;
}

.access-state-success {
    color: #0f6d4c !important;
}

.access-state-muted {
    color: var(--muted) !important;
}

.access-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 0;
}

.access-chip-list-compact .status-pill {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
}

.access-card-details {
    border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.access-card-details > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.75rem;
    padding: 0.6rem 1rem;
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 850;
    cursor: pointer;
    list-style: none;
}

.access-card-details > summary::-webkit-details-marker {
    display: none;
}

.access-card-details[open] > summary {
    background: rgba(107, 66, 178, 0.055);
}

.access-detail-body {
    padding: 0 1rem 0.85rem;
}

.access-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 3.4rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid rgba(31, 36, 48, 0.08);
    background: rgba(249, 249, 251, 0.9);
}

.access-card-footer .inline-actions {
    justify-content: flex-end;
}

.access-protected-note {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.access-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0.75rem;
}

.access-group-card {
    display: grid;
}

.access-group-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem 0.7rem;
}

.access-group-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0 1rem 0.7rem;
}

.access-group-metrics > div {
    display: grid;
    justify-items: center;
    text-align: center;
}

.access-group-metrics strong {
    color: var(--ink);
    font-size: 1.2rem;
}

.access-group-metrics span {
    margin: 0.1rem 0 0;
}

.access-scope-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 1rem 0.8rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(53, 201, 188, 0.08);
}

.access-scope-line > span {
    margin: 0;
}

.access-scope-line strong {
    color: var(--ink);
    font-size: 0.82rem;
    text-align: right;
}

.access-group-detail-body {
    display: grid;
    gap: 0.9rem;
    padding-top: 0.3rem;
}

.access-group-detail-body section {
    display: grid;
    gap: 0.5rem;
}

.access-group-detail-body h4 {
    margin: 0;
    color: var(--ink);
    font-size: 0.82rem;
}

.access-power-sections {
    display: grid;
    gap: 0.65rem;
}

.access-power-sections > div {
    display: grid;
    gap: 0.35rem;
    padding: 0.65rem;
    border-radius: 12px;
    background: rgba(246, 247, 250, 0.88);
}

.access-power-sections > div > strong {
    color: var(--muted);
    font-size: 0.76rem;
}

.access-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 2rem 1rem;
    border-radius: 16px;
    background: rgba(246, 247, 250, 0.86);
    color: var(--muted);
    text-align: center;
}

.access-empty-state[hidden] {
    display: none;
}

.access-empty-state strong {
    color: var(--ink);
}

.customer-overview-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.customer-overview-card {
    min-height: 8.2rem;
}

.customer-list-card {
    overflow: hidden;
}

.customer-list-head {
    margin-bottom: 0;
}

.customer-same-check {
    width: 1.8rem;
    height: 1.8rem;
    justify-content: center;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    cursor: help;
}

.customer-search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 1.1rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 249, 0.92)),
        linear-gradient(135deg, rgba(53, 201, 188, 0.06), rgba(251, 40, 155, 0.05));
}

.customer-search-panel.customer-search-form {
    margin-bottom: 0;
}

.customer-search-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.customer-search-heading h3 {
    margin: 0.18rem 0 0;
    color: var(--ink);
    font-size: 1.15rem;
}

.customer-search-grid {
    display: grid;
    grid-template-columns: minmax(18rem, 1.4fr) repeat(2, minmax(12rem, 0.65fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

.customer-search-actions {
    flex-wrap: nowrap;
    align-items: stretch;
}

.customer-search-context {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
}

.customer-record-list {
    display: grid;
    gap: 0.9rem;
}

.customer-record-card {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
    border: 1px solid rgba(31, 36, 48, 0.09);
    border-left: 4px solid rgba(107, 66, 178, 0.72);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 249, 0.88)),
        rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 32px rgba(58, 36, 96, 0.07);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.customer-record-card:hover {
    transform: translateY(-1px);
    border-color: rgba(107, 66, 178, 0.22);
    border-left-color: var(--brand-pink);
    box-shadow: 0 18px 38px rgba(58, 36, 96, 0.1);
}

.customer-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.customer-record-title {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.customer-record-name-row,
.customer-record-badges,
.customer-record-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.customer-record-name-row h3 {
    margin: 0;
    font-size: 1.2rem;
}

.customer-record-actions {
    justify-content: flex-end;
    flex-shrink: 0;
}

.customer-record-facts {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr 0.8fr 1.2fr;
    gap: 0.7rem;
}

.customer-record-fact {
    display: grid;
    align-content: start;
    gap: 0.28rem;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.68);
}

.customer-record-fact > span:first-child,
.customer-record-details-grid span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.customer-record-fact strong,
.customer-record-fact small {
    overflow-wrap: anywhere;
}

.customer-record-fact strong {
    color: var(--ink);
    line-height: 1.35;
}

.customer-record-fact small {
    color: var(--muted);
    line-height: 1.4;
}

.customer-record-fact .status-pill {
    width: fit-content;
    margin-top: 0.15rem;
}

.customer-record-details {
    border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.customer-record-details > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding-top: 0.85rem;
    color: var(--primary-dark);
    font-weight: 850;
    cursor: pointer;
}

.customer-record-details > summary::-webkit-details-marker {
    display: none;
}

.customer-record-details > summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: rgba(107, 66, 178, 0.1);
    flex-shrink: 0;
}

.customer-record-details[open] > summary::after {
    content: "−";
}

.customer-record-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    padding-top: 0.8rem;
}

.customer-record-details-grid > div {
    display: grid;
    align-content: start;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.8rem;
    border-radius: 14px;
    background: rgba(31, 36, 48, 0.04);
}

.customer-record-details-grid strong {
    overflow-wrap: anywhere;
    color: var(--ink);
    line-height: 1.45;
}

.customer-primary-cell,
.customer-contact-cell {
    display: table-cell;
}

.customer-primary-cell > strong,
.customer-contact-cell > strong,
.customer-contact-cell > span {
    display: block;
}

.customer-primary-cell > * + *,
.customer-contact-cell > * + * {
    margin-top: 0.35rem;
}

.customer-contract-pill {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(107, 66, 178, 0.11);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.customer-muted-value,
.customer-contact-cell span {
    color: var(--muted);
    line-height: 1.45;
}

.customer-row-actions {
    flex-direction: column;
    align-items: stretch;
}

.customer-row-actions .button {
    justify-content: center;
}

.permission-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.permission-editor-form {
    display: grid;
    gap: 1.25rem;
}

.permission-identity-card,
.permission-map-card {
    display: grid;
    gap: 1.25rem;
}

.permission-section-heading > div {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.permission-section-heading h2,
.permission-section-heading p {
    margin: 0;
}

.permission-section-heading p {
    margin-top: 0.25rem;
    color: var(--muted);
    line-height: 1.5;
}

.permission-step {
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 2.2rem;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-weight: 850;
    box-shadow: 0 8px 20px rgba(107, 66, 178, 0.22);
}

.permission-identity-grid {
    grid-template-columns: minmax(0, 2fr) minmax(12rem, 0.75fr);
    align-items: start;
}

.permission-toolbar {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto auto;
    align-items: end;
    gap: 0.8rem;
    padding: 0.9rem;
    border-radius: 14px;
    background: var(--panel-strong);
    border: 1px solid rgba(31, 36, 48, 0.09);
}

.permission-search-field {
    display: grid;
    gap: 0.35rem;
    color: var(--ink);
    font-weight: 750;
}

.permission-search-field > span {
    font-size: 0.82rem;
}

.permission-enabled-filter {
    min-height: 3.15rem;
    margin: 0;
    padding: 0.65rem 0.85rem;
    background: var(--panel-strong);
    border: 1px solid rgba(31, 36, 48, 0.11);
}

.permission-toolbar-actions {
    flex-wrap: nowrap;
    align-self: end;
}

.permission-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.permission-category-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.45rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(107, 66, 178, 0.16);
    background: rgba(107, 66, 178, 0.08);
    color: var(--accent-dark);
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
}

.permission-category-nav a:hover,
.permission-category-nav a:focus-visible {
    background: rgba(107, 66, 178, 0.15);
    outline: none;
}

.permission-dependency-note {
    margin: 0;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    font-size: 0.88rem;
}

.permission-category-stack {
    display: grid;
    gap: 0.75rem;
}

.permission-category {
    overflow: clip;
    border-radius: 16px;
    border: 1px solid rgba(31, 36, 48, 0.12);
    background: var(--panel-strong);
}

.permission-category > summary,
.permission-action-disclosure > summary {
    list-style: none;
    cursor: pointer;
}

.permission-category > summary::-webkit-details-marker,
.permission-action-disclosure > summary::-webkit-details-marker {
    display: none;
}

.permission-category > summary {
    min-height: 3.8rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: var(--panel-strong);
}

.permission-category[open] > summary {
    border-bottom: 1px solid rgba(31, 36, 48, 0.09);
}

.permission-category-title {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 850;
}

.permission-category-count,
.permission-action-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    min-height: 1.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(107, 66, 178, 0.1);
    color: var(--accent-dark);
    font-size: 0.76rem;
    font-weight: 850;
}

.permission-summary-chevron {
    width: 0.65rem;
    height: 0.65rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

details[open] > summary > .permission-summary-chevron {
    transform: rotate(225deg);
}

.permission-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem;
}

.permission-module-card {
    display: grid;
    align-content: start;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--panel-strong);
    border: 1px solid rgba(31, 36, 48, 0.1);
    box-shadow: 0 5px 14px rgba(24, 18, 43, 0.04);
}

.permission-module-card[hidden],
.permission-category[hidden],
.permission-category-nav a[hidden] {
    display: none;
}

.permission-module-card-static {
    background: rgba(248, 252, 251, 0.96);
}

.permission-module-toggle,
.permission-action-item label {
    cursor: pointer;
}

.permission-module-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem;
    padding: 0.15rem;
}

.permission-module-toggle > input {
    margin-top: 0.2rem;
}

.permission-module-toggle-copy {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.permission-module-toggle-copy strong,
.permission-action-item strong {
    color: var(--ink);
    line-height: 1.35;
}

.permission-module-toggle-copy small,
.permission-action-item small {
    color: var(--muted);
    line-height: 1.4;
}

.permission-static-head > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.permission-static-head h3 {
    margin: 0;
    font-size: 1rem;
}

.permission-module-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(53, 201, 188, 0.14);
    color: #0f6d65;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.permission-module-card-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.86rem;
}

.permission-action-disclosure {
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(31, 36, 48, 0.08);
    background: var(--panel-strong);
}

.permission-action-disclosure > summary {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.65rem;
    padding: 0.55rem 0.7rem;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.permission-action-disclosure[open] > summary {
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.permission-action-list {
    display: grid;
    gap: 0.5rem;
    padding: 0.6rem;
}

.permission-action-item {
    display: grid;
    gap: 0.3rem;
}

.permission-action-item label {
    min-height: 3rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.7rem;
    padding: 0.65rem;
    border-radius: 9px;
    background: var(--panel-strong);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.permission-action-item label > input {
    margin-top: 0.18rem;
}

.permission-action-item label > span {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.permission-action-item label:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.57;
    background: var(--bg-soft);
}

.permission-empty-state {
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--panel-strong);
    color: var(--muted);
    text-align: center;
}

.permission-save-bar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    background: rgba(24, 20, 31, 0.94);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
}

.permission-save-bar p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
}

.permission-save-bar .button-row {
    flex-wrap: nowrap;
}

.inline-note {
    margin-top: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(251, 40, 155, 0.09), rgba(53, 201, 188, 0.08), rgba(107, 66, 178, 0.08));
    color: var(--muted);
}

.inline-note-warning {
    background: rgba(242, 163, 58, 0.16);
    color: #7b4504;
}

.inline-note-success {
    background: rgba(57, 201, 152, 0.16);
    color: #0f5f3d;
}

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

.customer-search-form {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.customer-search-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.customer-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.customer-search-input {
    flex: 1 1 24rem;
    min-width: min(100%, 20rem);
}

.table-link {
    color: var(--accent-dark);
}

.table-link:hover {
    color: var(--brand-pink);
}

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

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.95rem 0.9rem;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.data-table-split th:not(:last-child),
.data-table-split td:not(:last-child) {
    border-right: 1px solid var(--line);
}

.customer-table-wrap {
    max-height: min(52rem, 72vh);
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    scrollbar-width: thin;
}

.customer-table-wrap .data-table {
    width: 100%;
    min-width: 1720px;
    table-layout: fixed;
}

.customer-table-wrap .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255, 254, 251, 0.98);
    box-shadow: inset 0 -1px 0 rgba(31, 36, 48, 0.08);
}

.customer-data-table tbody tr {
    transition: background 0.16s ease;
}

.customer-data-table tbody tr:hover {
    background: rgba(53, 201, 188, 0.05);
}

.customer-data-table td {
    vertical-align: top;
    overflow-wrap: break-word;
}

.customer-data-table th {
    overflow-wrap: normal;
    white-space: nowrap;
}

.customer-data-table th:nth-child(1),
.customer-data-table td:nth-child(1) {
    width: 12%;
}

.customer-data-table th:nth-child(2),
.customer-data-table th:nth-child(3),
.customer-data-table th:nth-child(4),
.customer-data-table td:nth-child(2),
.customer-data-table td:nth-child(3),
.customer-data-table td:nth-child(4) {
    width: 10%;
}

.customer-data-table th:nth-child(5),
.customer-data-table td:nth-child(5) {
    width: 9%;
}

.customer-data-table th:nth-child(6),
.customer-data-table td:nth-child(6) {
    width: 16%;
}

.customer-data-table th:nth-child(7),
.customer-data-table td:nth-child(7),
.customer-data-table th:nth-child(10),
.customer-data-table td:nth-child(10) {
    width: 8%;
}

.customer-data-table th:nth-child(8),
.customer-data-table th:nth-child(9),
.customer-data-table td:nth-child(8) {
    width: 6%;
    white-space: nowrap;
}

.customer-data-table td:nth-child(9) {
    width: 6%;
    white-space: nowrap;
}

.customer-data-table th:nth-child(11),
.customer-data-table td:nth-child(11) {
    width: 15%;
    white-space: nowrap;
}

.customer-legal-identity-section {
    padding: 1.25rem;
    border: 1px solid rgba(107, 66, 178, 0.18);
    border-radius: 20px;
    background: rgba(107, 66, 178, 0.035);
}

.customer-data-form {
    display: grid;
    gap: 1.25rem;
}

.customer-form-section {
    display: grid;
    gap: 1.15rem;
    padding: 1.25rem;
    border: 1px solid rgba(31, 36, 48, 0.09);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(107, 66, 178, 0.035), rgba(53, 201, 188, 0.025)),
        rgba(255, 255, 255, 0.5);
}

.customer-form-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.customer-form-section-head > div:first-child {
    min-width: 0;
}

.customer-form-section-head h3 {
    margin-top: 0.35rem;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.customer-form-section-head p {
    max-width: 52rem;
    margin: 0.4rem 0 0;
    color: var(--muted);
}

.customer-form-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    min-height: 1.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(107, 66, 178, 0.12);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.customer-form-catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.customer-legal-subsection {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(107, 66, 178, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
}

.customer-legal-subsection h4 {
    margin: 0;
    color: var(--accent-dark);
    font-size: 1rem;
}

.customer-form-actions {
    padding-top: 0.25rem;
}

.comparison-difference td {
    background: rgba(255, 211, 155, 0.28);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(31, 36, 48, 0.08);
    font-size: 0.84rem;
    font-weight: 700;
}

.status-pill-success {
    color: #0f5f3d;
    background: #c9f2df;
}

.status-pill-accent {
    color: #4e2f8e;
    background: #e4d8fb;
}

.status-pill-warning {
    color: #8a4900;
    background: #ffd39b;
}

.status-pill-danger {
    color: #8a1130;
    background: #ffc4d1;
}

.status-pill-info {
    color: #114e9a;
    background: #c7defd;
}

.customer-deletion-alert {
    border-color: rgba(184, 20, 68, 0.38);
    background: linear-gradient(135deg, rgba(255, 224, 232, 0.96), rgba(255, 246, 238, 0.96));
}

.data-table tr.customer-profile-pending-deletion > td {
    background: rgba(255, 231, 236, 0.52);
}

.data-table tr.customer-profile-pending-deletion > td:first-child {
    box-shadow: inset 4px 0 0 #b81444;
}

.portal-account-list,
.portal-account-summary {
    display: grid;
    justify-items: start;
}

.portal-account-list {
    gap: 0.65rem;
}

.portal-account-summary {
    gap: 0.35rem;
}

.status-pill-neutral {
    color: #47505f;
    background: #e3e6eb;
}

.portal-item-list .status-pill {
    width: fit-content;
    color: inherit;
}

.portal-item-list .status-pill-info {
    color: #114e9a;
}

.portal-item-list .status-pill-accent {
    color: #4e2f8e;
}

.portal-item-list .status-pill-warning {
    color: #8a4900;
}

.portal-item-list .status-pill-success {
    color: #0f5f3d;
}

.portal-item-list .status-pill-neutral {
    color: #47505f;
}

.notifications-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(20rem, 0.95fr);
    gap: 1.5rem;
    align-items: start;
}

.notifications-main,
.notifications-side {
    min-width: 0;
}

.notification-feed {
    display: grid;
    gap: 0.6rem;
}

.notification-feed-item {
    display: grid;
    gap: 0.32rem;
    padding: 0.68rem 0.8rem;
    border-radius: 14px;
    border-left: 3px solid var(--notification-custom-color, rgba(107, 66, 178, 0.38));
    background: var(--notification-custom-color-soft, rgba(18, 18, 18, 0.04));
    position: relative;
}

.notification-feed-item-info {
    border-left-color: rgba(69, 130, 236, 0.68);
}

.notification-feed-item-warning {
    border-left-color: rgba(242, 163, 58, 0.75);
}

.notification-feed-item-danger {
    border-left-color: rgba(212, 67, 67, 0.74);
}

.notification-feed-item-accent {
    border-left-color: rgba(251, 40, 155, 0.72);
}

.notification-feed-meta,
.notification-feed-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.notification-feed-actions-right {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.notification-feed-item strong {
    font-size: 0.96rem;
    line-height: 1.25;
}

.notification-feed-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.notification-feed-item .status-pill {
    padding: 0.24rem 0.55rem;
    font-size: 0.74rem;
}

.notification-feed-item .table-helper,
.notification-feed-item .table-link {
    font-size: 0.8rem;
}

.notification-ack-menu {
    position: relative;
}

.content-card:has(.notification-ack-menu[open]) {
    position: relative;
    z-index: 40;
}

.notification-feed-item:has(.notification-ack-menu[open]) {
    z-index: 45;
}

.notification-ack-menu[open] {
    z-index: 50;
}

.notification-ack-trigger {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    border: 1px solid rgba(18, 18, 18, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent-dark);
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.notification-ack-trigger::-webkit-details-marker {
    display: none;
}

.notification-ack-popover {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 60;
    min-width: 10rem;
    display: grid;
    gap: 0.35rem;
    padding: 0.45rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.notification-ack-option {
    width: 100%;
    justify-content: flex-start;
    white-space: nowrap;
}

.notification-pager {
    justify-content: space-between;
}

.empty-state {
    padding: 2rem 0.5rem 0.5rem;
    max-width: 42rem;
}

.catalog-grid,
.catalog-manage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.catalog-column {
    min-width: 0;
}

.catalog-column-card {
    padding: 1.5rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.03), rgba(18, 18, 18, 0.06));
}

.catalog-column-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.catalog-column-head p {
    margin: 0.4rem 0 0;
}

.catalog-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.catalog-item {
    padding: 1.25rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(18, 18, 18, 0.06);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

.catalog-item-inactive {
    opacity: 0.72;
}

.catalog-item-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.catalog-item-title {
    min-width: 0;
}

.catalog-item-name {
    display: block;
    font-size: 1.08rem;
}

.catalog-item p {
    margin: 0.9rem 0 0;
}

.catalog-item .catalog-actions {
    margin-top: 1rem;
}

.catalog-item .catalog-actions form {
    display: inline-flex;
    margin: 0;
}

.catalog-table {
    margin-top: 1.25rem;
}

.catalog-table-wrap {
    max-height: min(44rem, 70vh);
    overflow-y: auto;
    padding-right: 0.2rem;
    scrollbar-width: thin;
}

.catalog-table td {
    vertical-align: top;
}

.catalog-table td:nth-child(1) {
    width: 72px;
}

.catalog-table td:nth-child(2) {
    min-width: 160px;
}

.catalog-table td:nth-child(4) {
    min-width: 120px;
}

.catalog-table td:last-child {
    min-width: 148px;
}

.catalog-table .catalog-actions form {
    display: inline-flex;
    margin: 0;
}

.catalog-dialog {
    width: min(1080px, calc(100% - 2rem));
    border: none;
    border-radius: 28px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
}

.catalog-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}

.document-preview-dialog {
    width: min(1180px, calc(100% - 2rem));
    height: min(88dvh, 920px);
    max-width: 1180px;
    max-height: 920px;
    padding: 0;
    border: 1px solid var(--v16-border);
    border-radius: 18px;
    overflow: hidden;
    background: var(--v16-surface);
    color: var(--v16-text);
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48);
}

.document-preview-dialog::backdrop {
    background: rgba(5, 5, 8, 0.78);
    backdrop-filter: blur(8px);
}

.document-preview-dialog-card {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.document-preview-dialog-head,
.document-preview-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--v16-surface-raised);
}

.document-preview-dialog-head {
    border-bottom: 1px solid var(--v16-border);
}

.document-preview-dialog-head h2 {
    margin: 0;
    color: var(--v16-text);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.document-preview-dialog .realization-status-dialog-close {
    border-color: var(--v16-border);
    background: var(--v16-surface);
    color: var(--v16-text);
}

.document-preview-dialog-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--v16-border);
}

.document-preview-dialog-actions [data-document-preview-view-only-note] {
    margin-right: auto;
}

.document-preview-dialog-body {
    min-height: 0;
    padding: 0.75rem;
    background: #d9dce2;
}

.document-preview-dialog-body iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: 10px;
    background: #fff;
}

.document-preview-dialog-body[data-pdf-preview="true"] {
    padding: 0;
    overflow: hidden;
}

.document-preview-dialog-body[data-pdf-preview="true"] iframe {
    height: calc(100% + 56px);
    transform: translateY(-56px);
}

@media (max-width: 640px) {
    .document-preview-dialog {
        width: calc(100% - 0.75rem);
        height: calc(100dvh - 0.75rem);
        max-height: none;
        border-radius: 14px;
    }

    .document-preview-dialog-head,
    .document-preview-dialog-actions {
        padding: 0.8rem;
    }

    .document-preview-dialog-actions .button {
        flex: 1 1 0;
    }

    .document-preview-dialog-body {
        padding: 0.35rem;
    }
}

.realization-status-dialog {
    width: min(42rem, calc(100% - 2rem));
}

.realization-status-dialog-close {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(31, 36, 48, 0.12);
    border-radius: 999px;
    background: rgba(107, 66, 178, 0.08);
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.realization-status-dialog-close:hover,
.realization-status-dialog-close:focus-visible {
    background: rgba(107, 66, 178, 0.14);
    border-color: rgba(107, 66, 178, 0.22);
    transform: translateY(-1px);
}

.catalog-dialog-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.preview-dialog {
    width: min(1180px, calc(100% - 2rem));
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

.preview-summary-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.preview-summary-item {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(107, 66, 178, 0.08), rgba(53, 201, 188, 0.06), rgba(252, 209, 29, 0.08));
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.preview-summary-item span,
.preview-label {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.preview-section {
    display: grid;
    gap: 0.9rem;
    padding: 1.25rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.03), rgba(18, 18, 18, 0.06));
}

.preview-section-wide {
    grid-column: 1 / -1;
}

.preview-section h3 {
    font-size: 1.15rem;
}

.preview-field {
    display: grid;
    gap: 0.45rem;
}

.preview-field-wide {
    grid-column: 1 / -1;
}

.preview-value {
    min-height: 3rem;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(31, 36, 48, 0.08);
    color: var(--ink);
}

.preview-text-block {
    line-height: 1.6;
    white-space: normal;
}

.preview-links-block {
    display: grid;
    gap: 0.55rem;
}

.customer-service-lifecycle-section {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.customer-same-identity-summary {
    display: grid;
    gap: 1rem;
    margin-top: 1.75rem;
    padding: 1.25rem;
    border: 1px solid rgba(53, 201, 188, 0.24);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(53, 201, 188, 0.1), rgba(107, 66, 178, 0.08));
}

.customer-same-identity-summary h2,
.same-customer-current h2 {
    margin-top: 0.35rem;
}

.same-customer-summary-links,
.same-customer-candidate-state {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.same-customer-current,
.same-customer-record-card,
.same-customer-candidate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.same-customer-current {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.same-customer-safety-note {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(252, 209, 29, 0.28);
    border-radius: 18px;
    background: rgba(252, 209, 29, 0.1);
}

.same-customer-safety-note p {
    margin: 0.35rem 0 0;
}

.same-customer-record-grid,
.same-customer-candidate-list {
    display: grid;
    gap: 0.75rem;
}

.same-customer-record-card,
.same-customer-candidate {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.same-customer-record-card > div,
.same-customer-candidate-copy {
    display: grid;
    gap: 0.2rem;
}

.same-customer-record-card span,
.same-customer-candidate-copy span,
.same-customer-candidate-copy small {
    color: var(--muted);
}

.same-customer-candidate {
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.same-customer-candidate:hover,
.same-customer-candidate:focus-within {
    transform: translateY(-1px);
    border-color: rgba(251, 40, 155, 0.3);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.same-customer-candidate > .form-checkbox {
    flex: 0 0 auto;
}

.same-customer-candidate-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.same-customer-candidate-state {
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .same-customer-current,
    .same-customer-record-card,
    .same-customer-candidate {
        align-items: flex-start;
        flex-direction: column;
    }

    .same-customer-candidate-state {
        justify-content: flex-start;
    }
}

.customer-service-lifecycle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

.customer-service-lifecycle-card {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.03), rgba(18, 18, 18, 0.06));
}

.customer-service-lifecycle-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.customer-service-lifecycle-periods {
    display: grid;
    gap: 0.45rem;
}

.customer-service-lifecycle-period {
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(31, 36, 48, 0.08);
    color: var(--muted);
}

.delete-summary {
    margin: 1.25rem 0;
}

.chat-launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    min-width: 0;
    flex-shrink: 0;
}

.chat-launcher:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
}

.chat-launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.chat-launcher-svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: currentColor;
}

.chat-launcher-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.chat-launcher-copy strong {
    color: #fff;
    font-size: 0.92rem;
}

.chat-launcher-copy span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.77rem;
}

.chat-launcher-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    height: 1.9rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-pink), #ff6b5d);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    flex-shrink: 0;
}

.chat-launcher-count[hidden] {
    display: none !important;
}

.site-header-actions > form {
    flex: 0 0 auto;
}

.site-header-actions > form .button {
    padding: 0.85rem 1.15rem;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
}

.vault-toolbar {
    align-items: end;
}

.vault-toolbar-actions {
    margin: 0;
}

.vault-password-field {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.vault-password-field .form-input {
    flex: 1 1 auto;
    min-width: 0;
}

.vault-password-toggle {
    flex: 0 0 auto;
}

.vault-table {
    min-width: 1160px;
    table-layout: fixed;
}

.vault-col-entry {
    width: 20%;
}

.vault-col-website {
    width: 8%;
}

.vault-col-credential {
    width: 11%;
}

.vault-col-notes {
    width: 8%;
}

.vault-col-groups {
    width: 18%;
}

.vault-col-actions {
    width: 13%;
}

.vault-table code {
    font-size: 0.92rem;
}

.vault-history-table {
    min-width: 1180px;
}

.vault-history-table form {
    margin: 0;
}

.vault-history-table .vault-credentials-grid {
    min-width: 13rem;
}

.vault-secret {
    display: grid;
    gap: 0.65rem;
    align-items: start;
}

.vault-credentials-cell {
    min-width: 0;
}

.vault-website-cell,
.vault-notes-cell {
    word-break: break-word;
}

.vault-website-link {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

.vault-credentials-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(8.5rem, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.vault-credentials-action {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
}

.vault-secret-value {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 16px;
    background: rgba(31, 36, 48, 0.06);
    border: 1px solid rgba(31, 36, 48, 0.1);
    color: var(--ink);
    word-break: break-all;
}

.vault-dialog-error {
    margin: 0;
}

@media (max-width: 640px) {
    .vault-credentials-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .vault-credentials-action {
        justify-content: stretch;
    }

    .vault-credentials-action .button {
        width: 100%;
    }
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(20rem, 25rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.chat-sidebar,
.chat-main {
    min-width: 0;
}

.chat-section-title {
    margin: 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.chat-thread-list {
    display: grid;
    gap: 0.7rem;
}

.chat-thread-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    background: rgba(18, 18, 18, 0.04);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.chat-thread-card:hover {
    transform: translateY(-1px);
    border-color: rgba(107, 66, 178, 0.24);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.07);
}

.chat-thread-card.is-selected {
    border-color: rgba(251, 40, 155, 0.3);
    background: linear-gradient(135deg, rgba(251, 40, 155, 0.1), rgba(107, 66, 178, 0.08));
}

.chat-thread-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.chat-thread-copy strong {
    color: var(--ink);
}

.chat-thread-copy span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.chat-room-create-form {
    padding-top: 1rem;
    border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.chat-announcement-recipient-select {
    min-height: 12rem;
}

.chat-message-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: min(60vh, 38rem);
    overflow-y: auto;
    padding-right: 0.35rem;
}

.chat-pinned-panel {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 1.05rem;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(251, 40, 155, 0.08), rgba(107, 66, 178, 0.06), rgba(53, 201, 188, 0.06));
    border: 1px solid rgba(107, 66, 178, 0.12);
}

.chat-pinned-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.chat-pinned-head h3 {
    margin: 0;
    font-size: 1rem;
}

.chat-pinned-head p {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
}

.chat-pinned-list {
    display: grid;
    gap: 0.65rem;
}

.chat-pinned-item {
    display: grid;
    gap: 0.2rem;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.chat-pinned-item:hover {
    transform: translateY(-1px);
    border-color: rgba(251, 40, 155, 0.22);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.chat-pinned-item strong {
    color: #000;
}

.chat-pinned-item span,
.chat-pinned-item small {
    color: rgba(0, 0, 0, 0.72);
    line-height: 1.4;
    word-break: break-word;
}

.chat-message-card {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    width: fit-content;
    min-width: min(14rem, 100%);
    max-width: min(78%, 42rem);
    margin-right: auto;
    padding: 0.95rem 1rem;
    border-radius: 22px 22px 22px 10px;
    background: rgba(18, 18, 18, 0.05);
    border: 1px solid rgba(31, 36, 48, 0.08);
    color: #000;
}

.chat-message-card.is-pinned {
    border-color: rgba(107, 66, 178, 0.18);
    box-shadow: inset 0 0 0 1px rgba(107, 66, 178, 0.05);
}

.chat-message-card.is-scroll-target {
    animation: chat-message-focus 1.2s ease;
}

.chat-message-card.is-own {
    margin-right: 0;
    margin-left: auto;
    border-radius: 22px 22px 10px 22px;
    background: linear-gradient(135deg, rgba(251, 40, 155, 0.08), rgba(107, 66, 178, 0.08));
    border-color: rgba(251, 40, 155, 0.12);
    text-align: right;
}

.chat-message-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chat-message-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.chat-message-body {
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
    color: #000;
}

.chat-message-body br {
    display: block;
    content: "";
    margin-top: 0.2rem;
}

.chat-message-body .inline-link {
    color: #000;
}

.chat-message-body .inline-link:hover {
    color: var(--brand-pink);
}

.chat-message-preview-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.2rem;
}

.chat-rich-preview {
    display: block;
    width: min(100%, 32rem);
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    background: rgba(255, 255, 255, 0.94);
    color: #000;
    text-align: left;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.chat-external-media-placeholder {
    display: grid;
    gap: 0.65rem;
    padding: 0.9rem;
}

.chat-external-media-placeholder p {
    margin: 0;
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.86rem;
    line-height: 1.45;
}

.chat-external-media-placeholder .button-row {
    margin-top: 0.1rem;
}

.chat-rich-preview-media img,
.chat-rich-preview-media video {
    display: block;
    width: 100%;
    max-height: 24rem;
    background: #000;
}

.chat-rich-preview-media img {
    object-fit: cover;
}

.chat-rich-preview-media video {
    object-fit: contain;
}

.chat-rich-preview-embed {
    aspect-ratio: 16 / 9;
    background: #000;
}

.chat-rich-preview-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.chat-link-card {
    display: grid;
    gap: 0.3rem;
    padding: 0.85rem 0.95rem;
}

.chat-link-card strong {
    color: #000;
    font-size: 0.98rem;
}

.chat-link-card span {
    color: var(--accent-dark);
    font-size: 0.88rem;
    font-weight: 700;
}

.chat-link-card small {
    color: rgba(0, 0, 0, 0.7);
    line-height: 1.4;
    word-break: break-word;
}

.chat-link-card:hover {
    border-color: rgba(251, 40, 155, 0.24);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1);
}

.chat-message-card strong {
    color: #000;
}

.chat-message-card .table-helper {
    color: rgba(0, 0, 0, 0.68);
}

.chat-message-pin-button,
.chat-message-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: rgba(122, 0, 31, 0.12);
    color: #7a001f;
    cursor: pointer;
    transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.chat-message-pin-button {
    background: rgba(107, 66, 178, 0.12);
    color: #5d3fa5;
}

.chat-message-pin-button:hover {
    transform: translateY(-1px);
    background: rgba(107, 66, 178, 0.2);
    color: #4e2f8e;
}

.chat-message-delete-button:hover {
    transform: translateY(-1px);
    background: rgba(194, 24, 91, 0.18);
    color: #a80f4c;
}

.chat-message-pin-button svg,
.chat-message-delete-button svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

@keyframes chat-message-focus {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 40, 155, 0);
        transform: translateY(0);
    }
    20% {
        box-shadow: 0 0 0 4px rgba(251, 40, 155, 0.18);
        transform: translateY(-1px);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(251, 40, 155, 0);
        transform: translateY(0);
    }
}

.chat-room-manage-grid {
    align-items: stretch;
}

.chat-room-manage-grid .form-field {
    display: grid;
    grid-template-rows: auto minmax(14rem, auto) auto auto;
    gap: 0.65rem;
    min-width: 0;
}

.chat-room-manage-grid .form-field:first-child {
    grid-template-rows: auto auto auto auto;
    align-content: start;
}

.chat-room-manage-panel {
    display: flex;
    min-height: 14rem;
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid rgba(31, 36, 48, 0.08);
    background: rgba(18, 18, 18, 0.04);
}

.chat-room-manage-panel-name {
    align-items: flex-start;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.chat-room-manage-panel-members {
    align-items: stretch;
}

.chat-room-manage-panel input,
.chat-room-manage-panel select {
    width: 100%;
    margin: 0;
}

.chat-room-manage-panel-members select {
    height: 100%;
    min-height: 12rem;
}

@media (max-width: 960px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }

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

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

    .dashboard-sidebar {
        padding-top: 0;
    }

    .dashboard-notifications-card {
        min-height: auto;
        max-height: none;
    }

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

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

    .topbar {
        flex-direction: column;
    }

    .site-header-row {
        justify-items: start;
        gap: 0.85rem;
    }

    .site-header-actions {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-end;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: thin;
    }

    .profile-grid,
    .form-grid,
    .customer-form-catalog-grid,
    .settings-lock-panels,
    .settings-lock-form-grid,
    .realization-overview,
    .realization-period-forms,
    .realization-workspace-grid,
    .settings-module-visibility-grid,
    .settings-health-grid,
    .date-status-grid,
    .access-summary-grid,
    .customer-overview-grid,
    .customer-search-panel,
    .customer-search-grid,
    .customer-record-facts,
    .customer-record-details-grid,
    .permission-identity-grid,
    .permission-category-grid,
    .permission-checkbox-grid,
    .filter-grid,
    .catalog-grid,
    .catalog-manage-grid {
        grid-template-columns: 1fr;
    }

    .realization-board-head {
        align-items: stretch;
        flex-direction: column;
    }

    .realization-board-guidance {
        width: 100%;
        max-width: none;
    }

    .permission-toolbar {
        grid-template-columns: 1fr auto;
    }

    .permission-search-field {
        grid-column: 1 / -1;
    }

    .customer-form-section-head {
        flex-direction: column;
    }

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

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

    .audit-filter-grid,
    .audit-event-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

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

    .access-group-grid {
        grid-template-columns: 1fr;
    }

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

    .access-list-toolbar {
        grid-template-columns: minmax(14rem, 1fr) auto;
    }

    .access-visible-count {
        grid-column: 2;
    }

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

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

    .customer-search-context {
        justify-content: flex-start;
    }

    .content-card-head {
        flex-direction: column;
    }

    .content-card-head > * {
        min-width: 0;
    }

    .settings-accordion-trigger {
        align-items: flex-start;
        padding: 1.35rem 1.35rem 1.2rem;
    }

    .settings-accordion-panel {
        padding: 0 1.35rem 1.35rem;
    }

    .settings-lock-panel {
        padding: 1rem;
    }

    .settings-lock-form .form-field-wide {
        grid-column: auto;
    }

    .realization-panel-actions,
    .realization-month-toolbar {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .realization-week-popover {
        width: min(30rem, 84vw);
    }

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

    .realization-bulk-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .realization-bulk-summary {
        justify-content: space-between;
    }

    .realization-bulk-controls {
        min-width: 0;
    }

    .realization-bulk-controls .toolbar-label {
        justify-self: start;
        width: 100%;
    }

    .realization-bulk-action-row {
        grid-template-columns: 1fr;
    }

    .realization-customer-link {
        justify-self: stretch;
        width: 100%;
    }

    .realization-filter-grid {
        grid-template-columns: 1fr;
    }

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

    .realization-split-form .realization-filter-grid {
        grid-template-columns: 1fr;
    }

    .realization-split-form .form-field-wide {
        grid-column: auto;
    }

    .calendar-grid-detailed .calendar-day {
        min-height: 6rem;
    }

    .preview-summary-bar,
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .calendar-nav {
        width: 100%;
    }

    .user-badge {
        min-width: 0;
    }

    .release-modal-card {
        max-height: min(88vh, 920px);
        padding: 1.25rem;
    }

    .release-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-message-card {
        max-width: 92%;
    }

    .chat-room-manage-grid .form-field {
        grid-template-rows: auto minmax(10rem, auto) auto auto;
    }

    .chat-room-manage-panel {
        min-height: 10rem;
    }
}

@media (max-width: 640px) {
    .shell,
    .auth-layout {
        width: min(100% - 1rem, 100%);
    }

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

    .access-summary-grid {
        grid-template-columns: 1fr;
    }

    .settings-overview-grid,
    .settings-section-nav,
    .settings-search-toolbar,
    .audit-summary-grid,
    .audit-filter-grid,
    .audit-event-facts {
        grid-template-columns: 1fr;
    }

    .settings-search-toolbar .button-row,
    .settings-search-toolbar .button {
        width: 100%;
    }

    .settings-search-toolbar .button-row {
        align-items: stretch;
        flex-direction: column;
    }

    .audit-filter-heading,
    .audit-stream-heading,
    .audit-event-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .audit-event-action {
        justify-content: flex-start;
    }

    .audit-filter-actions,
    .audit-filter-actions .button,
    .audit-pagination .button {
        width: 100%;
    }

    .audit-filter-actions,
    .audit-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .access-control-header,
    .access-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .access-control-primary-actions,
    .access-control-primary-actions .button,
    .access-section-head > .button {
        width: 100%;
    }

    .access-control-primary-actions {
        flex-direction: column;
    }

    .access-control-nav,
    .access-list-toolbar,
    .access-account-facts {
        grid-template-columns: 1fr;
    }

    .access-visible-count {
        grid-column: auto;
    }

    .access-rank-note {
        align-items: flex-start;
    }

    .access-account-main {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .access-account-main > .access-rank-badge {
        grid-column: 1 / -1;
        grid-template-columns: auto auto;
        justify-content: space-between;
        justify-items: start;
    }

    .access-card-footer,
    .access-card-footer .inline-actions,
    .access-card-footer .inline-actions form,
    .access-card-footer .button {
        width: 100%;
    }

    .access-card-footer .inline-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .access-scope-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .access-scope-line strong {
        text-align: left;
    }

    .realization-summary-grid {
        grid-template-columns: 1fr;
    }

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

    .customer-search-heading,
    .customer-record-head {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-search-actions,
    .customer-record-actions,
    .customer-record-actions .button {
        width: 100%;
    }

    .customer-search-actions,
    .customer-record-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-record-facts,
    .customer-record-details-grid {
        grid-template-columns: 1fr;
    }

    .permission-toolbar {
        grid-template-columns: 1fr;
    }

    .permission-search-field {
        grid-column: auto;
    }

    .permission-toolbar-actions,
    .permission-toolbar-actions .button,
    .permission-save-bar .button-row,
    .permission-save-bar .button {
        width: 100%;
    }

    .permission-save-bar {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .permission-save-bar .button-row {
        flex-direction: column;
    }

    .permission-category-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scrollbar-width: thin;
    }

    .site-brand-mark {
        width: 100%;
        max-width: min(100%, 32rem);
    }

    .site-brand-mark-text {
        font-size: 0.92rem;
    }

    .site-version-trigger {
        font-size: 0.74rem;
    }

    .site-license-trigger {
        font-size: 0.72rem;
    }

    .release-modal-backdrop {
        padding: 0.75rem;
    }

    .release-modal-card {
        border-radius: 24px;
        padding: 1rem;
    }

    .release-entry {
        padding: 1rem;
    }

    .calendar-grid {
        gap: 0.4rem;
    }

    .calendar-nav {
        flex-direction: column;
    }

    .catalog-dialog {
        width: calc(100% - 1rem);
        padding: 1rem;
        border-radius: 22px;
    }

    .calendar-nav-button {
        width: 100%;
    }

    .site-header-row,
    .language-switch {
        position: static;
        width: min(100% - 1rem, 100%);
        margin: 1rem auto 0;
        transform: none;
    }

    .site-brand-mark {
        grid-column: 1;
        grid-row: 1;
        justify-content: center;
        max-width: none;
    }

    .site-header-actions {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        justify-content: flex-start;
    }

    .site-header-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .has-global-header-actions main.shell,
    .has-global-header-actions .business-breadcrumb-shell {
        padding-top: 2rem;
    }

    .has-global-header-actions .business-breadcrumb-shell + main.shell,
    .has-global-header-actions .business-breadcrumb-shell + .shell {
        padding-top: 0;
    }

    .language-switch-form {
        justify-content: space-between;
        border-radius: 22px;
    }

    .auth-card,
    .topbar,
    .page-header,
    .hero-panel,
    .content-card,
    .module-card {
        border-radius: 22px;
        padding: 1.2rem;
    }

    .content-card-head {
        align-items: stretch;
    }

    .button-row,
    .catalog-toolbar,
    .catalog-actions,
    .customer-search-row,
    .topbar-actions,
    .notification-feed-actions,
    .notification-feed-actions-right {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .button-row .button,
    .catalog-toolbar .button,
    .catalog-actions .button,
    .customer-search-row .button,
    .topbar-actions .button,
    .notification-feed-actions .button {
        width: 100%;
    }

    .settings-accordion-item {
        padding: 0;
    }

    .settings-section-nav {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding: 0.65rem;
    }

    .settings-section-nav a {
        min-height: 2.75rem;
        padding: 0.65rem 0.8rem;
    }

    .realization-period-panel,
    .realization-filter-panel,
    .realization-split-form {
        border-radius: 18px;
        padding: 1rem;
    }

    .realization-results-card {
        padding: 1rem;
    }

    .realization-board-guidance {
        align-items: flex-start;
    }

    .realization-data-table td.realization-primary-cell {
        position: static;
        box-shadow: none;
    }

    .realization-data-table thead th:nth-child(2) {
        left: auto;
    }

    .realization-month-input {
        width: 100%;
        min-width: 0;
    }

    .realization-week-popover {
        position: fixed;
        left: 50%;
        right: auto;
        top: 50%;
        width: min(34rem, calc(100vw - 1.5rem));
        max-height: calc(100vh - 1.5rem);
        overflow: auto;
        transform: translate(-50%, -50%);
    }

    .realization-week-grid {
        grid-template-columns: 2.3rem repeat(7, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .realization-week-day,
    .realization-week-number {
        min-height: 2.7rem;
        border-radius: 14px;
        padding: 0.45rem 0.2rem;
    }

    .settings-accordion-trigger {
        padding: 1.2rem;
        gap: 0.9rem;
    }

    .settings-accordion-panel {
        padding: 0 1.2rem 1.2rem;
    }

    h1 {
        font-size: 2.15rem;
    }
}

/* Unified employee and customer login gateway */
.auth-body .site-header-row {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(251, 40, 155, 0.08), rgba(107, 66, 178, 0.08)),
        rgba(5, 5, 8, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    pointer-events: auto;
}

.auth-body .site-brand-mark {
    width: auto;
    max-width: min(100%, 34rem);
    justify-self: center;
    padding: 0.2rem 0.45rem 0.2rem 0.2rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-body .site-header-actions {
    display: none;
}

.auth-login-layout {
    grid-template-rows: auto minmax(0, auto);
    align-content: center;
    align-items: stretch;
}

.auth-login-form-card {
    padding: clamp(1.6rem, 3.5vw, 2.5rem);
}

.auth-login-form-card .section-head {
    padding-bottom: 1.35rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.auth-credential-form {
    gap: 1.05rem;
    margin-top: 1.4rem;
    padding: clamp(1rem, 2.5vw, 1.35rem);
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(251, 40, 155, 0.035), rgba(107, 66, 178, 0.045)),
        rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.auth-credential-field {
    gap: 0.5rem;
}

.auth-credential-field label {
    color: #2e2935;
    font-size: 0.84rem;
    font-weight: 850;
    letter-spacing: 0.025em;
}

.auth-credential-field .form-input {
    min-height: 3.55rem;
    border-color: rgba(31, 36, 48, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 22px rgba(28, 18, 42, 0.055);
}

.auth-credential-field .form-input:hover {
    border-color: rgba(107, 66, 178, 0.28);
}

.auth-credential-field .form-input:focus {
    border-color: rgba(107, 66, 178, 0.54);
    box-shadow: 0 0 0 4px rgba(107, 66, 178, 0.11), 0 12px 28px rgba(28, 18, 42, 0.08);
}

.auth-login-submit {
    justify-content: space-between;
    min-height: 3.5rem;
    margin-top: 0.25rem;
    border-radius: 16px;
    padding-inline: 1.25rem;
}

.auth-login-form-card .auth-links {
    display: flex;
    justify-content: center;
    margin-top: 1.1rem;
    font-size: 0.9rem;
}

.auth-login-layout > .auth-login-controls {
    grid-column: 1 / -1;
    grid-row: 1;
}

.auth-login-layout > .auth-card-accent {
    grid-column: 1;
    grid-row: 2;
}

.auth-login-layout > .auth-card-form {
    grid-column: 2;
    grid-row: 2;
}

.auth-login-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    width: min(32rem, 100%);
    justify-self: center;
    padding: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(5, 5, 8, 0.86);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
}

.auth-login-controls {
    display: grid;
    justify-items: center;
    gap: 0.7rem;
}

.auth-login-language-switch {
    position: fixed;
    top: 6.75rem;
    left: max(1rem, calc((100vw - 1400px) / 2));
    z-index: 30;
    justify-self: start;
}

.auth-login-switcher-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
    transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-login-switcher-option:hover,
.auth-login-switcher-option:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.auth-login-switcher-option.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    box-shadow: 0 10px 24px rgba(107, 66, 178, 0.34);
    transform: translateY(-1px);
}

/* Shared CMS and customer-portal sign-in verification */
.auth-verification-layout {
    align-items: stretch;
}

.auth-verification-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

.auth-verification-head .eyebrow {
    gap: 0.55rem;
}

.auth-verification-step {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    box-shadow: 0 8px 18px rgba(107, 66, 178, 0.25);
    font-size: 0.78rem;
    letter-spacing: 0;
}

.auth-verification-methods {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.4rem;
}

.auth-verification-method-form {
    min-width: 0;
}

.auth-verification-method {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.95rem;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 20px;
    color: var(--ink);
    background:
        linear-gradient(145deg, rgba(251, 40, 155, 0.025), rgba(107, 66, 178, 0.06)),
        var(--panel-strong);
    box-shadow: 0 12px 28px rgba(28, 18, 42, 0.07);
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.auth-verification-method:hover,
.auth-verification-method:focus-visible {
    border-color: rgba(107, 66, 178, 0.38);
    background-color: var(--panel-strong);
    box-shadow: 0 18px 36px rgba(60, 37, 92, 0.14);
    transform: translateY(-2px);
    outline: none;
}

.auth-verification-method:focus-visible {
    box-shadow: 0 0 0 4px rgba(107, 66, 178, 0.12), 0 18px 36px rgba(60, 37, 92, 0.14);
}

.auth-verification-method-icon,
.auth-verification-delivery-icon {
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(145deg, var(--brand-pink), var(--brand-purple));
    box-shadow: 0 10px 22px rgba(107, 66, 178, 0.24);
}

.auth-verification-method-icon {
    width: 3rem;
    height: 3rem;
}

.auth-verification-method-icon svg,
.auth-verification-delivery-icon svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: currentColor;
}

.auth-verification-method-copy {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.auth-verification-method-copy strong {
    color: #2e2935;
    font-size: 1rem;
    font-weight: 850;
}

.auth-verification-method-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-verification-method-arrow {
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--brand-purple);
    background: rgba(107, 66, 178, 0.09);
    font-size: 1.15rem;
    font-weight: 850;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.auth-verification-method:hover .auth-verification-method-arrow,
.auth-verification-method:focus-visible .auth-verification-method-arrow {
    color: #fff;
    background: var(--brand-purple);
    transform: translateX(2px);
}

.auth-verification-form {
    margin-top: 1.4rem;
}

.auth-verification-delivery {
    display: grid;
    grid-template-columns: auto minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(107, 66, 178, 0.1);
    border-radius: 16px;
    background: rgba(107, 66, 178, 0.055);
    color: var(--muted);
    font-size: 0.82rem;
}

.auth-verification-delivery-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 12px;
}

.auth-verification-delivery-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.auth-verification-delivery strong {
    min-width: 0;
    overflow: hidden;
    color: #2e2935;
    font-size: 0.87rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-code-input {
    min-height: 4rem !important;
    padding-inline: 1.2rem !important;
    font-size: clamp(1.35rem, 4vw, 1.75rem) !important;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    letter-spacing: 0.38em;
    text-align: center;
    text-indent: 0.38em;
}

.auth-code-input::placeholder {
    font-size: 0.92rem;
    font-weight: 650;
    letter-spacing: 0;
    text-indent: 0;
}

.auth-verification-remember,
.auth-verification-trust-note {
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.auth-verification-remember .checkbox-field {
    align-items: center;
    margin: 0;
}

.auth-verification-trust-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.7rem;
}

.auth-verification-trust-icon {
    width: 1.8rem;
    height: 1.8rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(145deg, #1f9d7a, #167158);
    box-shadow: 0 7px 16px rgba(31, 157, 122, 0.2);
    font-size: 0.82rem;
    font-weight: 900;
}

.auth-verification-trust-note p {
    margin: 0;
    color: #4d4855;
    font-size: 0.84rem;
    line-height: 1.45;
}

.auth-verification-resend {
    margin-top: 0.75rem;
}

.auth-verification-resend .button-secondary {
    min-height: 3rem;
    border: 1px solid rgba(107, 66, 178, 0.13);
    border-radius: 16px;
    color: var(--brand-purple);
    background: rgba(107, 66, 178, 0.065);
    box-shadow: none;
}

.auth-verification-resend .button-secondary:hover,
.auth-verification-resend .button-secondary:focus-visible {
    color: #fff;
    background: var(--brand-purple);
    box-shadow: 0 10px 22px rgba(107, 66, 178, 0.22);
}

@media (max-width: 960px) {
    .auth-login-layout > .auth-card-accent {
        grid-column: 1;
        grid-row: 2;
    }

    .auth-login-layout > .auth-card-form {
        grid-column: 1;
        grid-row: 3;
    }
}

@media (max-width: 640px) {
    .auth-body .site-header-row {
        width: min(100% - 1rem, 1400px);
        margin-top: 0.5rem;
        padding: 0.65rem;
        border-radius: 22px;
    }

    .auth-body .site-brand-mark {
        width: auto;
        max-width: calc(100% - 7rem);
    }

    .auth-body .site-brand-mark-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .auth-login-switcher {
        width: 100%;
    }

    .auth-login-language-switch {
        position: fixed;
        top: 6.25rem;
        left: 0.5rem;
    }

    .auth-verification-method {
        gap: 0.75rem;
        padding: 0.85rem;
    }

    .auth-verification-method-icon {
        width: 2.7rem;
        height: 2.7rem;
        border-radius: 14px;
    }

    .auth-verification-delivery {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .auth-verification-delivery strong {
        grid-column: 2;
        text-align: left;
    }

}

/* Unified non-dashboard workspace visual system */
.app-body:not(.dashboard-body) main.shell,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) {
    --workspace-card-border: rgba(31, 36, 48, 0.1);
    --workspace-card-shadow: 0 18px 44px rgba(28, 19, 45, 0.12);
    --workspace-soft-panel: rgba(31, 36, 48, 0.045);
    --workspace-row-background: rgba(255, 255, 255, 0.9);
}

.app-body:not(.dashboard-body) main.shell > .page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.4rem 0.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.app-body:not(.dashboard-body) main.shell > .page-header > div:first-child {
    min-width: 0;
}

.app-body:not(.dashboard-body) main.shell > .page-header > .button-row,
.app-body:not(.dashboard-body) main.shell > .page-header > .catalog-toolbar,
.app-body:not(.dashboard-body) main.shell > .page-header > form {
    justify-content: flex-end;
    flex: 0 1 auto;
}

.app-body:not(.dashboard-body) main.shell > .content-card:not(.settings-accordion-item),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) > .content-card,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) > article.content-card,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) > section > .content-card {
    border-color: var(--workspace-card-border);
    box-shadow:
        inset 0 4px 0 rgba(107, 66, 178, 0.16),
        var(--workspace-card-shadow);
}

.app-body:not(.dashboard-body) main.shell > .content-card:nth-of-type(3n + 2):not(.settings-accordion-item),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) > .content-card:nth-of-type(3n + 2) {
    box-shadow:
        inset 0 4px 0 rgba(53, 201, 188, 0.22),
        var(--workspace-card-shadow);
}

.app-body:not(.dashboard-body) main.shell > .content-card:nth-of-type(3n + 3):not(.settings-accordion-item),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) > .content-card:nth-of-type(3n + 3) {
    box-shadow:
        inset 0 4px 0 rgba(251, 40, 155, 0.16),
        var(--workspace-card-shadow);
}

.app-body:not(.dashboard-body) main.shell .content-card > .content-card-head,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > .content-card-head {
    align-items: flex-start;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.app-body:not(.dashboard-body) main.shell .content-card > .content-card-head h2,
.app-body:not(.dashboard-body) main.shell .content-card > .content-card-head h3,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > .content-card-head h2,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > .content-card-head h3 {
    margin-top: 0;
}

.app-body:not(.dashboard-body) main.shell .content-card > h2:first-child,
.app-body:not(.dashboard-body) main.shell .content-card > h3:first-child,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > h2:first-child,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > h3:first-child {
    margin-top: 0;
}

.app-body:not(.dashboard-body) main.shell .content-card.stack-lg > article:not([class]),
.app-body:not(.dashboard-body) main.shell .content-card.stack-md > article:not([class]),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card.stack-lg > article:not([class]),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card.stack-md > article:not([class]) {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-left: 4px solid rgba(107, 66, 178, 0.5);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 250, 0.88)),
        var(--workspace-row-background);
    box-shadow: 0 10px 24px rgba(28, 19, 45, 0.06);
}

.app-body:not(.dashboard-body) main.shell .content-card.stack-lg > article:not([class]) > small,
.app-body:not(.dashboard-body) main.shell .content-card.stack-md > article:not([class]) > small,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card.stack-lg > article:not([class]) > small,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card.stack-md > article:not([class]) > small {
    display: block;
    color: var(--muted);
    line-height: 1.4;
}

.app-body:not(.dashboard-body) main.shell .content-card.stack-lg > article:not([class]) > p,
.app-body:not(.dashboard-body) main.shell .content-card.stack-md > article:not([class]) > p,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card.stack-lg > article:not([class]) > p,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card.stack-md > article:not([class]) > p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.app-body:not(.dashboard-body) main.shell .business-metric-grid article {
    position: relative;
    overflow: hidden;
    min-height: 7rem;
    align-content: center;
    border-color: rgba(31, 36, 48, 0.08);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(107, 66, 178, 0.1), transparent 45%),
        rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 28px rgba(28, 19, 45, 0.07);
}

.app-body:not(.dashboard-body) main.shell .business-metric-grid article:nth-child(3n + 2) {
    background:
        radial-gradient(circle at top right, rgba(53, 201, 188, 0.13), transparent 45%),
        rgba(255, 255, 255, 0.82);
}

.app-body:not(.dashboard-body) main.shell .business-metric-grid article:nth-child(3n + 3) {
    background:
        radial-gradient(circle at top right, rgba(251, 40, 155, 0.1), transparent 45%),
        rgba(255, 255, 255, 0.82);
}

.app-body:not(.dashboard-body) main.shell .detail-list,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.app-body:not(.dashboard-body) main.shell .detail-list > div,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .detail-list > div {
    display: grid;
    align-content: start;
    gap: 0.28rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 14px;
    background: var(--workspace-soft-panel);
}

.app-body:not(.dashboard-body) main.shell .detail-list dt,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .detail-list dt {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.app-body:not(.dashboard-body) main.shell .detail-list dd,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.45;
}

.app-body:not(.dashboard-body) main.shell .table-wrap:not(.realization-table-wrap),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .table-wrap {
    padding: 0.45rem;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(239, 238, 242, 0.9), rgba(248, 248, 249, 0.86)),
        rgba(255, 255, 255, 0.7);
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 66, 178, 0.4) rgba(31, 36, 48, 0.05);
}

.app-body:not(.dashboard-body) main.shell .data-table:not(.realization-data-table),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .data-table {
    border-collapse: separate;
    border-spacing: 0 0.4rem;
}

.app-body:not(.dashboard-body) main.shell .data-table:not(.realization-data-table) th,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .data-table th {
    padding-top: 0.7rem;
    padding-bottom: 0.55rem;
    border-bottom: 0;
    white-space: nowrap;
}

.app-body:not(.dashboard-body) main.shell .data-table:not(.realization-data-table) td,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .data-table td {
    border-top: 1px solid rgba(31, 36, 48, 0.07);
    border-bottom: 1px solid rgba(31, 36, 48, 0.07);
    background: var(--workspace-row-background);
    vertical-align: middle;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.app-body:not(.dashboard-body) main.shell .data-table:not(.realization-data-table) tbody tr:hover > td,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .data-table tbody tr:hover > td {
    border-color: rgba(107, 66, 178, 0.16);
    background: rgba(255, 255, 255, 0.99);
}

.app-body:not(.dashboard-body) main.shell .data-table:not(.realization-data-table) td:first-child,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .data-table td:first-child {
    border-left: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 13px 0 0 13px;
}

.app-body:not(.dashboard-body) main.shell .data-table:not(.realization-data-table) td:last-child,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .data-table td:last-child {
    border-right: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 0 13px 13px 0;
}

.app-body:not(.dashboard-body) main.shell .data-table:not(.realization-data-table) td:only-child,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .data-table td:only-child {
    border-radius: 13px;
}

.app-body:not(.dashboard-body) main.shell .content-card > .toolbar-form:not(.realization-period-form),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > .toolbar-form {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    border: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 16px;
    background: var(--workspace-soft-panel);
}

.app-body:not(.dashboard-body) main.shell .content-card > form.stack-lg > .form-grid:not(.customer-form-grid),
.app-body:not(.dashboard-body) main.shell .content-card > form.stack-md > .form-grid:not(.customer-form-grid),
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > form.stack-lg > .form-grid,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > form.stack-md > .form-grid {
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(107, 66, 178, 0.035), rgba(53, 201, 188, 0.025)),
        var(--workspace-soft-panel);
}

.app-body:not(.dashboard-body) main.shell .content-card > form.stack-lg > .form-field,
.app-body:not(.dashboard-body) main.shell .content-card > form.stack-md > .form-field,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > form.stack-lg > .form-field,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > form.stack-md > .form-field {
    padding: 1rem;
    border: 1px solid rgba(31, 36, 48, 0.07);
    border-radius: 18px;
    background: var(--workspace-soft-panel);
}

.app-body:not(.dashboard-body) main.shell .content-card > form.stack-lg > .button-row,
.app-body:not(.dashboard-body) main.shell .content-card > form.stack-md > .button-row,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > form.stack-lg > .button-row,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > form.stack-md > .button-row {
    padding-top: 1rem;
    border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.app-body:not(.dashboard-body) main.shell .empty-state,
.portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .empty-state {
    max-width: none;
    padding: 1.6rem;
    border: 1px dashed rgba(107, 66, 178, 0.25);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(107, 66, 178, 0.06), rgba(53, 201, 188, 0.05)),
        rgba(255, 255, 255, 0.54);
    text-align: center;
}

@media (max-width: 960px) {
    .app-body:not(.dashboard-body) main.shell > .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .app-body:not(.dashboard-body) main.shell > .page-header > .button-row,
    .app-body:not(.dashboard-body) main.shell > .page-header > .catalog-toolbar,
    .app-body:not(.dashboard-body) main.shell > .page-header > form {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .invoice-action-row,
    .invoice-email-form {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .invoice-action-row > form,
    .invoice-action-row > .button,
    .invoice-action-row form .button {
        width: 100%;
    }

    .app-body:not(.dashboard-body) main.shell .detail-list,
    .portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .detail-list {
        grid-template-columns: 1fr;
    }

    .app-body:not(.dashboard-body) main.shell .content-card > .toolbar-form:not(.realization-period-form),
    .portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > .toolbar-form,
    .app-body:not(.dashboard-body) main.shell .content-card > .toolbar-form:not(.realization-period-form) .button,
    .portal-body main.portal-shell:not(:has(.portal-dashboard-grid)) .content-card > .toolbar-form .button {
        width: 100%;
    }
}
/* Contract Centre: guided editor with a wide, genuinely live document preview. */
.contract-builder-page {
    width: min(1680px, calc(100% - 2rem));
}

.contract-builder-header {
    margin-bottom: 0;
}

.contract-builder-steps {
    position: sticky;
    top: 1rem;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
    padding: .65rem;
    border: 1px solid rgba(117, 69, 166, .18);
    border-radius: 1.35rem;
    background: rgba(244, 241, 246, .94);
    box-shadow: 0 14px 38px rgba(29, 11, 35, .13);
    backdrop-filter: blur(18px);
}

.contract-builder-steps a {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: .05rem .65rem;
    align-items: center;
    min-width: 0;
    padding: .7rem;
    border: 1px solid transparent;
    border-radius: .95rem;
    color: #55505c;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.contract-builder-steps a:hover,
.contract-builder-steps a:focus-visible,
.contract-builder-steps a.is-active {
    border-color: rgba(117, 69, 166, .22);
    background: rgba(255, 255, 255, .94);
    color: #231b29;
    transform: translateY(-1px);
}

.contract-builder-steps a > span {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .7rem;
    background: linear-gradient(135deg, #6d43ac, #d62d92);
    color: white;
    font-weight: 900;
}

.contract-builder-steps strong,
.contract-builder-steps small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contract-builder-steps small {
    color: #77717e;
    font-size: .72rem;
}

.contract-builder {
    display: grid;
    grid-template-columns: minmax(540px, .95fr) minmax(560px, 1.05fr);
    gap: 1.25rem;
    align-items: start;
}

.contract-editor,
.contract-preview-panel {
    min-width: 0;
}

.contract-preview-panel {
    position: sticky;
    top: 1rem;
    width: 100%;
    min-height: 0;
    max-width: none;
    resize: none;
    overflow: visible;
}

.contract-preview-card {
    display: grid;
    gap: .8rem;
    padding: 1rem;
    border-color: rgba(53, 201, 188, .28);
    box-shadow: 0 24px 60px rgba(18, 12, 24, .2);
}

.contract-preview-toolbar,
.contract-step-heading,
.contract-step-heading-main,
.contract-formset-heading,
.contract-formset-heading > div {
    display: flex;
    align-items: center;
}

.contract-preview-toolbar,
.contract-formset-heading {
    justify-content: space-between;
    gap: 1rem;
}

.contract-preview-toolbar h2 {
    margin: .1rem 0 0;
}

.contract-preview-state {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    width: fit-content;
    min-height: 2rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: rgba(42, 143, 102, .1);
    color: #216b51;
    font-size: .82rem;
    font-weight: 800;
}

.contract-live-dot {
    width: .58rem;
    height: .58rem;
    border-radius: 50%;
    background: #2b9c6a;
    box-shadow: 0 0 0 .23rem rgba(43, 156, 106, .13);
}

.contract-preview-state[data-state="loading"] .contract-live-dot,
.contract-preview-state[data-state="waiting"] .contract-live-dot {
    background: #d28a25;
    box-shadow: 0 0 0 .23rem rgba(210, 138, 37, .13);
    animation: contract-preview-pulse 1s ease-in-out infinite;
}

.contract-preview-state[data-state="incomplete"] {
    background: rgba(210, 138, 37, .12);
    color: #855514;
}

.contract-preview-state[data-state="failed"] {
    background: rgba(171, 38, 80, .1);
    color: #8f2046;
}

@keyframes contract-preview-pulse {
    50% {
        opacity: .35;
        transform: scale(.82);
    }
}

.contract-preview-frame {
    width: 100%;
    min-height: 78vh;
    border: 1px solid rgba(80, 68, 100, .22);
    border-radius: .85rem;
    background: white;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.contract-step-card {
    padding: clamp(1rem, 2vw, 1.6rem);
    border-color: rgba(116, 68, 162, .14);
    scroll-margin-top: 8rem;
}

.contract-step-heading,
.contract-step-heading-main {
    gap: .9rem;
}

.contract-step-heading {
    align-items: flex-start;
}

.contract-step-heading-main {
    min-width: 0;
}

.contract-step-heading h2 {
    margin: .15rem 0 .25rem;
}

.contract-step-number,
.contract-row-number {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: .85rem;
    background: linear-gradient(135deg, #6d43ac, #d62d92);
    color: white;
    font-weight: 900;
}

.contract-step-number {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.05rem;
}

.contract-row-number {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .6rem;
    font-size: .78rem;
}

.contract-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.contract-subsection {
    display: grid;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid rgba(74, 67, 82, .1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .46);
}

.contract-subsection h3 {
    margin: 0;
    font-size: 1rem;
}

.contract-formset-row,
.contract-version-card {
    padding: 1.1rem;
    border: 1px solid rgba(80, 68, 100, .16);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .58);
}

.contract-formset-row {
    display: grid;
    gap: 1rem;
    box-shadow: 0 9px 22px rgba(42, 25, 50, .06);
}

.contract-formset-heading > div {
    gap: .65rem;
}

.contract-formset-heading small {
    color: #74707a;
}

.field-requirement {
    display: inline-flex;
    margin-left: .35rem;
    padding: .15rem .42rem;
    border-radius: 999px;
    background: rgba(85, 77, 91, .08);
    color: #6f6874;
    font-size: .65rem;
    font-weight: 850;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.field-requirement-required {
    background: rgba(177, 31, 82, .1);
    color: #9e1e4e;
}

.form-field-error {
    padding: .75rem;
    border: 1px solid rgba(181, 31, 80, .35);
    border-radius: .85rem;
    background: rgba(181, 31, 80, .055);
}

.form-field-error .form-input,
.form-field-error input,
.form-field-error select,
.form-field-error textarea {
    border-color: #b51f50;
    box-shadow: 0 0 0 3px rgba(181, 31, 80, .1);
}

.contract-error-summary {
    display: grid;
    gap: .9rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(181, 31, 80, .32);
    border-radius: 1.1rem;
    background: rgba(255, 244, 248, .96);
    color: #701a3a;
    box-shadow: 0 14px 34px rgba(96, 22, 51, .12);
    scroll-margin-top: 8rem;
}

.contract-error-summary > div {
    display: flex;
    gap: .8rem;
    align-items: flex-start;
}

.contract-error-summary h2,
.contract-error-summary p {
    margin: 0;
}

.contract-error-summary ul {
    display: grid;
    gap: .45rem;
    margin: 0;
    padding-left: 1.2rem;
}

.contract-error-summary a {
    color: inherit;
    text-decoration-thickness: .08em;
    text-underline-offset: .16em;
}

.contract-error-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #ad1d4e;
    color: #fff;
    font-weight: 950;
}

.contract-version-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.contract-version-card .table-wrap,
.contract-version-card .compact-inline-form {
    flex: 1 0 100%;
}

.sales-contract-table {
    min-width: 1320px;
}

.sales-contract-table td {
    overflow-wrap: normal;
    word-break: normal;
}

.sales-contract-cell-stack,
.sales-contract-status-stack {
    display: grid;
    justify-items: start;
    gap: 0.35rem;
}

.sales-contract-cell-stack small {
    display: block;
    color: var(--muted);
    line-height: 1.35;
}

.sales-contract-number {
    min-width: 10.5rem;
}

.sales-contract-customer {
    min-width: 15rem;
}

.sales-contract-status-stack {
    min-width: 13rem;
}

.sales-contract-table .status-pill,
.sales-contract-table .button {
    overflow-wrap: normal;
    word-break: normal;
}

.sales-contract-table .portal-visibility-pill,
.sales-contract-table td:last-child .button {
    gap: 0.35rem;
    white-space: nowrap;
}

.sales-contract-table .signed-copy-review-indicator {
    max-width: 17rem;
    white-space: normal;
    line-height: 1.25;
}

.sales-contract-table tr.contract-signature-pending-row > td {
    background: rgba(255, 246, 224, 0.98);
}

.sales-contract-table tr.contract-signature-pending-row > td:first-child {
    box-shadow: inset 4px 0 0 #e59b2d;
}

.sales-contract-table tr.contract-lifecycle-expiring > td {
    background: color-mix(in srgb, #e59b2d 12%, var(--v16-surface));
}

.sales-contract-table tr.contract-lifecycle-expiring > td:first-child {
    box-shadow: inset 4px 0 0 #e59b2d;
}

.sales-contract-table tr.contract-lifecycle-expired > td {
    background: color-mix(in srgb, #e05270 12%, var(--v16-surface));
}

.sales-contract-table tr.contract-lifecycle-expired > td:first-child {
    box-shadow: inset 4px 0 0 #e05270;
}

.sales-contract-table tr.contract-lifecycle-archived > td {
    background: var(--v16-surface-soft);
    color: var(--v16-muted);
}

.sticky-save-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    border-radius: 1rem;
    background: rgba(236, 233, 239, .96);
    box-shadow: 0 12px 30px rgba(28, 10, 35, .18);
}

.sticky-save-bar > div:first-child {
    display: grid;
    gap: .15rem;
}

.sticky-save-bar small {
    color: #6d6671;
}

.form-delete-field {
    align-self: end;
}

.contract-preview-expanded .contract-editor,
.contract-preview-expanded .contract-builder-steps {
    display: none;
}

.contract-preview-expanded .contract-builder {
    grid-template-columns: minmax(0, 1fr);
}

.contract-preview-expanded .contract-preview-panel {
    position: static;
}

.contract-preview-expanded .contract-preview-frame {
    min-height: calc(100vh - 14rem);
}

@media (max-width: 1500px) {
    .contract-builder {
        grid-template-columns: 1fr;
    }

    .contract-preview-panel {
        position: static;
    }

    .contract-preview-frame {
        min-height: 75vh;
    }
}

@media (max-width: 900px) {
    .contract-builder-steps {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contract-builder-steps a:last-child {
        grid-column: 1 / -1;
    }

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

    .contract-step-heading,
    .contract-step-heading-main,
    .contract-preview-toolbar,
    .contract-formset-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .contract-builder-page {
        width: min(100% - 1rem, 100%);
    }

    .contract-builder-steps {
        grid-template-columns: 1fr;
    }

    .contract-builder-steps a:last-child {
        grid-column: auto;
    }

    .contract-preview-toolbar .button,
    .contract-step-heading .button,
    .sticky-save-bar .button-row,
    .sticky-save-bar .button {
        width: 100%;
    }
}

html[data-theme="light"] :is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-v16-brand-panel,
html[data-theme="light"] :is(.auth-body, .portal-auth-body) .portal-reset-visual {
    border-color: var(--v16-border) !important;
    background:
        radial-gradient(circle at 100% 0, rgba(217, 75, 143, 0.11), transparent 34%),
        radial-gradient(circle at 0 100%, rgba(57, 170, 164, 0.09), transparent 38%),
        #f7f9fc !important;
}

html[data-theme="light"] :is(.auth-body, .portal-auth-body) .auth-v16-brand-head > span,
html[data-theme="light"] :is(.auth-body, .portal-auth-body) .auth-v16-brand-copy h1,
html[data-theme="light"] :is(.auth-body, .portal-auth-body) .portal-reset-visual :is(h1, h2, h3, strong, span) {
    color: var(--v16-text) !important;
}

html[data-theme="light"] :is(.auth-body, .portal-auth-body) .auth-v16-brand-copy .eyebrow,
html[data-theme="light"] :is(.auth-body, .portal-auth-body) .auth-v16-brand-copy p,
html[data-theme="light"] :is(.auth-body, .portal-auth-body) .portal-reset-visual p {
    color: var(--v16-muted) !important;
}

/* Prominent company branding across login, reset, and two-factor screens. */
:is(.auth-body, .portal-auth-body) .auth-v16-brand-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-logo {
    width: clamp(13rem, 18vw, 19rem);
    height: auto;
    max-height: none;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.28));
}

@media (max-width: 600px) {
    :is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-card-form {
        padding-top: 5.25rem;
    }
}

/* Exact v16 outlined icon system for both application shells and dashboards. */
.app-sidebar-link-icon {
    display: grid;
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 1.15rem;
    place-items: center;
    color: color-mix(in srgb, var(--sidebar-accent) 68%, var(--v16-muted));
}

.app-sidebar-link:is(:hover, :focus-visible, .is-active) .app-sidebar-link-icon {
    color: color-mix(in srgb, var(--sidebar-accent) 82%, var(--v16-text));
}

.app-sidebar-link-icon svg,
.dashboard-kpi-icon svg,
.dashboard-category-icon svg,
.dashboard-selected-workspace-icon svg,
.module-card-icon svg,
.portal-summary-icon svg,
.portal-overview-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-kpi-label {
    display: block;
    padding-right: 3.4rem;
    color: var(--v16-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-kpi-icon,
.portal-summary-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 11px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--dashboard-kpi-accent, var(--portal-accent)) 38%, var(--v16-border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--dashboard-kpi-accent, var(--portal-accent)) 10%, var(--v16-surface-raised));
    color: color-mix(in srgb, var(--dashboard-kpi-accent, var(--portal-accent)) 72%, var(--v16-text));
}

.dashboard-category-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-category-icon,
.dashboard-selected-workspace-icon,
.module-card-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 10px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--dashboard-category-accent, var(--dashboard-workspace-accent, var(--module-accent))) 46%, var(--v16-border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--dashboard-category-accent, var(--dashboard-workspace-accent, var(--module-accent))) 12%, var(--v16-surface-raised));
    color: color-mix(in srgb, var(--dashboard-category-accent, var(--dashboard-workspace-accent, var(--module-accent))) 76%, var(--v16-text));
}

.dashboard-category-count {
    display: block;
    max-width: 9rem;
    padding: 0.28rem 0.52rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--dashboard-category-accent) 8%, var(--v16-surface-raised));
    text-align: right;
}

.dashboard-category-card h3 {
    margin-top: 12px;
}

.dashboard-selected-workspace-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.9rem;
}

.dashboard-selected-workspace-icon {
    --dashboard-category-accent: var(--dashboard-workspace-accent);
}

.has-app-sidebar .dashboard-workspace-module-grid > .module-card {
    position: relative;
}

.module-card-icon {
    --dashboard-category-accent: var(--module-accent);
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    padding: 8px;
    border-radius: 10px;
}

.has-app-sidebar .dashboard-workspace-module-grid > .module-card > .module-state {
    position: absolute;
    top: 20px;
    right: 18px;
    max-width: calc(100% - 5.5rem);
    text-align: right;
}

.portal-body .portal-overview-summary > div {
    position: relative;
}

.portal-body .portal-overview-summary > div > .portal-summary-icon {
    --dashboard-kpi-accent: var(--portal-accent);
    display: grid;
    width: 42px;
    height: 42px;
    padding: 11px;
    color: color-mix(in srgb, var(--portal-accent) 72%, var(--v16-text)) !important;
}

.portal-body .portal-overview-icon {
    width: 2.6rem;
    height: 2.6rem;
    min-height: 2.6rem;
    padding: 0.7rem;
}

@media (max-width: 600px) {
    .dashboard-selected-workspace-title {
        align-items: flex-start;
    }

    .dashboard-kpi-icon,
    .portal-summary-icon {
        top: 16px;
        right: 16px;
    }
}

:is(.auth-body, .portal-auth-body) .portal-reset-brand-logo {
    width: clamp(15rem, 21vw, 20rem);
    max-height: none;
}

.auth-mobile-brand {
    display: none;
}

@media (max-width: 1100px) {
    .auth-mobile-brand {
        display: flex;
        align-items: center;
        flex-direction: column;
        gap: 0.65rem;
        margin: 0 auto 1.5rem;
        color: var(--v16-muted);
        font-size: 0.72rem;
        font-weight: 850;
        letter-spacing: 0.12em;
        text-align: center;
        text-transform: uppercase;
    }

    .auth-mobile-brand img {
        display: block;
        width: clamp(11rem, 42vw, 15rem);
        height: auto;
        max-height: none;
        object-fit: contain;
        filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.22));
    }
}

@media (max-width: 600px) {
    .auth-mobile-brand {
        margin-bottom: 1.15rem;
    }

    .auth-mobile-brand img {
        width: min(12rem, 56vw);
    }
}

@media (max-width: 640px) {
    .dashboard-notifications-head {
        align-items: center;
    }

    .dashboard-notifications-icon {
        width: 2.45rem;
        min-width: 2.45rem;
        height: 2.45rem;
        border-radius: 13px;
    }

    .dashboard-notifications-title .eyebrow,
    .dashboard-notifications-title p {
        display: none;
    }

    .dashboard-notifications-open {
        min-width: 2.6rem;
        width: 2.6rem;
        height: 2.6rem;
        justify-content: center;
        padding: 0;
        border-radius: 999px;
    }

    .dashboard-notifications-open span:first-child {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .dashboard-notification-summary-item {
        padding-inline: 0.45rem;
    }

    .dashboard-notification-summary-item span {
        font-size: 0.62rem;
    }

    .dashboard-notification-item {
        grid-template-columns: 2.75rem minmax(0, 1fr);
        gap: 0.58rem;
        padding: 0.6rem;
    }

    .dashboard-notification-date {
        min-height: 2.75rem;
    }
}

/* 2.0.11 responsive hardening for shared CMS and portal workspaces. */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

img,
video,
canvas,
iframe {
    max-width: 100%;
}

form,
fieldset,
.shell > *,
.portal-shell > *,
.page-header > *,
.content-card > *,
.content-card-head > *,
.topbar > *,
.catalog-toolbar > *,
.toolbar-form-inline > *,
.button-row > *,
.form-grid > *,
.filter-grid > * {
    min-width: 0;
}

input,
select,
textarea,
.form-input {
    max-width: 100%;
}

h1,
h2,
h3,
.status-pill,
.breadcrumb-link,
.breadcrumb-current,
.button {
    overflow-wrap: anywhere;
}

.status-pill {
    max-width: 100%;
    white-space: normal;
}

.reminder-template-table .reminder-template-state,
.reminder-template-table .reminder-template-actions {
    width: 1%;
    min-width: max-content;
    white-space: nowrap;
}

.reminder-template-table .reminder-template-state .status-pill,
.reminder-template-table .reminder-template-actions .button {
    overflow-wrap: normal;
    white-space: nowrap;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

@media (max-width: 768px) {
    .compact-inline-form,
    .toolbar-month-input,
    .inline-status-select {
        width: 100%;
        min-width: 0;
    }

    .realization-primary-cell,
    .realization-scope-heading,
    .realization-scope-cell,
    .realization-outcome-cell {
        width: auto;
        max-width: 100%;
        min-width: 0;
    }

    .profile-grid,
    .form-grid,
    .business-form-grid,
    .business-metric-grid,
    .business-visibility-columns,
    .portal-document-grid,
    .portal-dashboard-grid,
    .portal-two-column,
    .portal-account-primary-grid,
    .date-status-grid,
    .filter-grid,
    .customer-form-catalog-grid,
    .invoice-action-workspace,
    .preview-summary-bar,
    .preview-grid,
    .catalog-manage-grid,
    .notifications-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-field-wide,
    .invoice-action-group-ksef,
    .push-settings-card {
        grid-column: auto;
    }

    .page-header,
    .content-card-head,
    .customer-service-lifecycle-head,
    .catalog-column-head,
    .catalog-item-head,
    .sticky-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-form-inline,
    .catalog-toolbar,
    .catalog-actions,
    .button-row,
    .topbar-actions,
    .customer-search-row {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .table-wrap .data-table:has(tr > :nth-child(3)) {
        min-width: 36rem;
    }

    .table-wrap .data-table:has(tr > :nth-child(5)) {
        min-width: 52rem;
    }

    .table-wrap .data-table:has(tr > :nth-child(8)) {
        min-width: 68rem;
    }

    .release-dialog,
    .page-guide-dialog,
    .catalog-dialog {
        width: calc(100% - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .release-modal-card,
    .page-guide-card {
        max-height: calc(100dvh - 1rem);
    }
}

@media (max-width: 430px) {
    .shell,
    .portal-shell,
    .auth-layout,
    .site-header-row,
    .language-switch {
        width: calc(100% - 1rem);
    }

    .content-card,
    .module-card,
    .page-header,
    .topbar,
    .auth-card,
    .hero-panel {
        padding: 1rem;
        border-radius: 20px;
    }

    .button-row,
    .catalog-toolbar,
    .catalog-actions,
    .toolbar-form-inline,
    .customer-search-row,
    .topbar-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .button-row > *,
    .button-row .button,
    .catalog-toolbar > *,
    .catalog-toolbar .button,
    .catalog-actions > *,
    .catalog-actions .button,
    .toolbar-form-inline > *,
    .toolbar-form-inline .button,
    .customer-search-row > *,
    .customer-search-row .button,
    .topbar-actions > *,
    .topbar-actions .button {
        width: 100%;
    }

    .release-modal-head,
    .page-guide-header {
        gap: 0.75rem;
    }
}

/* Guided SLA profile builder: editable rules without exposing JSON storage. */
.sla-builder-form {
    width: min(1180px, 100%);
    margin-inline: auto;
}

.sla-builder-section {
    overflow: visible !important;
}

.sla-preset-row,
.sla-target-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: start;
}

.sla-preset-row .button {
    min-height: 3rem;
    white-space: nowrap;
}

.sla-target-grid {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--v16-border);
    border-radius: 14px;
    background: var(--v16-surface-soft);
}

.sla-target-head,
.sla-target-row {
    display: grid;
    grid-template-columns: minmax(8rem, 0.7fr) repeat(2, minmax(15rem, 1fr));
    gap: 0.85rem;
    align-items: center;
    padding: 0.85rem 1rem;
}

.sla-target-head {
    border-bottom: 1px solid var(--v16-border);
    background: var(--v16-surface-raised);
    color: var(--v16-muted);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sla-target-row + .sla-target-row {
    border-top: 1px solid var(--v16-border);
}

.sla-target-row > strong {
    color: var(--v16-text);
}

.sla-target-control {
    grid-template-columns: minmax(5rem, 0.7fr) minmax(7rem, 1fr);
}

.sla-target-control .field-error {
    grid-column: 1 / -1;
}

.sla-workday-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.55rem;
}

.sla-workday-grid .checkbox-field {
    min-width: 0;
    min-height: 3rem;
    justify-content: center;
    padding: 0.65rem;
}

.sla-availability-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 900px) {
    .sla-target-head {
        display: none;
    }

    .sla-target-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .sla-target-row > strong {
        padding-bottom: 0.25rem;
        border-bottom: 1px solid var(--v16-border);
    }

    .sla-target-control::before {
        grid-column: 1 / -1;
        color: var(--v16-muted);
        font-size: 0.72rem;
        font-weight: 850;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        content: attr(data-label);
    }

    .sla-workday-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .sla-preset-row,
    .sla-target-control,
    .sla-availability-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sla-preset-row .button {
        width: 100%;
    }

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

/* 2.1.0 v16 full application-shell redesign and complete theme audit. */
html[data-theme="dark"] {
    --v16-canvas: #080b10;
    --v16-sidebar: #0d1117;
    --v16-surface: #11171f;
    --v16-surface-raised: #151c25;
    --v16-surface-soft: #0f151d;
    --v16-border: #2a3542;
    --v16-border-strong: #394655;
    --v16-text: #f4f6f8;
    --v16-text-soft: #c5ccd5;
    --v16-muted: #98a4b2;
    --v16-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
    --bg: var(--v16-canvas);
    --bg-soft: var(--v16-surface-soft);
    --panel: var(--v16-surface);
    --panel-strong: var(--v16-surface-raised);
    --ink: var(--v16-text);
    --muted: var(--v16-muted);
    --line: var(--v16-border);
    --shadow: var(--v16-shadow);
}

html[data-theme="light"] {
    --v16-canvas: #eef2f6;
    --v16-sidebar: #ffffff;
    --v16-surface: #ffffff;
    --v16-surface-raised: #f7f9fb;
    --v16-surface-soft: #edf1f5;
    --v16-border: #d7dfe7;
    --v16-border-strong: #c3ced9;
    --v16-text: #171b22;
    --v16-text-soft: #35414e;
    --v16-muted: #647180;
    --v16-shadow: 0 14px 36px rgba(30, 44, 60, 0.075);
    --bg: var(--v16-canvas);
    --bg-soft: var(--v16-surface-soft);
    --panel: var(--v16-surface);
    --panel-strong: var(--v16-surface-raised);
    --ink: var(--v16-text);
    --muted: var(--v16-muted);
    --line: var(--v16-border);
    --shadow: var(--v16-shadow);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell-main,
html[data-theme="dark"] .portal-body {
    background: var(--v16-canvas) !important;
    color: var(--v16-text);
}

html[data-theme="light"] body,
html[data-theme="light"] .app-shell-main,
html[data-theme="light"] .portal-body {
    background: var(--v16-canvas) !important;
    color: var(--v16-text);
}

.has-app-sidebar > .background-glow {
    display: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--v16-canvas);
}

.app-shell-main {
    position: relative;
    min-width: 0;
    min-height: 100vh;
    isolation: isolate;
}

.app-shell-main::before,
.app-shell-main::after {
    position: fixed;
    z-index: -1;
    width: 34rem;
    height: 34rem;
    border-radius: 50%;
    content: "";
    pointer-events: none;
    filter: blur(2px);
}

.app-shell-main::before {
    top: 4rem;
    right: -16rem;
    background: radial-gradient(circle, rgba(217, 75, 143, 0.07), transparent 68%);
}

.app-shell-main::after {
    bottom: -18rem;
    left: 12%;
    background: radial-gradient(circle, rgba(57, 170, 164, 0.055), transparent 68%);
}

.app-sidebar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 292px;
    height: 100vh;
    overflow: hidden;
    border-right: 1px solid var(--v16-border);
    background: var(--v16-sidebar);
    color: var(--v16-text);
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 1rem;
    padding: 1.15rem 0.55rem 1.25rem;
    border-bottom: 1px solid var(--v16-border);
    color: var(--v16-text);
    text-decoration: none;
}

.app-sidebar-brand img {
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    object-fit: contain;
}

.app-sidebar-brand span,
.app-sidebar-user-copy {
    display: grid;
    min-width: 0;
}

.app-sidebar-brand strong {
    color: var(--v16-text);
    font-size: 0.92rem;
    letter-spacing: 0.1em;
}

.app-sidebar-brand small,
.app-sidebar-user small {
    overflow: hidden;
    color: var(--v16-muted);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-sidebar-nav {
    overflow-y: auto;
    padding: 0.5rem 0.8rem 1.25rem;
    scrollbar-color: var(--v16-border-strong) transparent;
    scrollbar-width: thin;
}

.app-sidebar-group {
    --sidebar-accent: var(--brand-mint);
    margin-top: 1.05rem;
    padding-left: 0.6rem;
    border-left: 2px solid color-mix(in srgb, var(--sidebar-accent) 78%, var(--v16-border));
}

.app-sidebar-group-workspace,
.app-sidebar-group-customers_sales { --sidebar-accent: var(--brand-pink); }
.app-sidebar-group-delivery_support { --sidebar-accent: var(--brand-mint); }
.app-sidebar-group-finance_people { --sidebar-accent: var(--brand-yellow); }
.app-sidebar-group-communication_account { --sidebar-accent: var(--brand-purple); }
.app-sidebar-group-analytics_audit { --sidebar-accent: #8f76bd; }
.app-sidebar-group-system_administration { --sidebar-accent: #82909f; }

.app-sidebar-group h2 {
    margin: 0 0 0.4rem;
    color: color-mix(in srgb, var(--sidebar-accent) 80%, var(--v16-text));
    font-size: 0.67rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    line-height: 1.35;
    text-transform: uppercase;
}

.app-sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.45rem;
    margin: 0.12rem 0;
    padding: 0.58rem 0.7rem;
    border-radius: 9px;
    color: var(--v16-muted);
    font-size: 0.82rem;
    font-weight: 680;
    line-height: 1.25;
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.app-sidebar-link:hover,
.app-sidebar-link:focus-visible,
.app-sidebar-link.is-active {
    color: var(--v16-text);
    background: var(--v16-surface-raised);
    outline: none;
}

.app-sidebar-link:hover {
    transform: translateX(2px);
}

.app-sidebar-link-label {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}

.app-sidebar-link-label > span:first-child {
    min-width: 0;
}

.module-new-badge {
    display: inline-flex;
    min-height: 1.35rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0.16rem 0.48rem;
    border: 1px solid color-mix(in srgb, var(--brand-pink) 78%, #ffffff);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    color: #ffffff !important;
    box-shadow: 0 5px 14px color-mix(in srgb, var(--brand-pink) 24%, transparent);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-sidebar-link.is-active {
    box-shadow: inset 3px 0 0 var(--sidebar-accent);
}

.app-sidebar-link-marker {
    width: 0.38rem;
    height: 0.38rem;
    flex: 0 0 0.38rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--sidebar-accent) 70%, var(--v16-muted));
}

.app-sidebar-link-icon {
    width: 0.85rem;
    color: var(--sidebar-accent);
    font-size: 1rem;
    text-align: center;
}

.app-sidebar-meta-links {
    padding-top: 0.85rem;
    border-top: 1px solid var(--v16-border);
}

.app-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 0.85rem;
    padding: 0.95rem 0.45rem 1rem;
    border-top: 1px solid var(--v16-border);
}

.app-sidebar-avatar {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--brand-pink) 50%, var(--v16-border));
    border-radius: 10px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--brand-pink) 20%, var(--v16-surface-raised)), color-mix(in srgb, var(--brand-purple) 18%, var(--v16-surface)));
    color: var(--v16-text);
    font-weight: 850;
}

.app-sidebar-user-copy strong {
    overflow: hidden;
    color: var(--v16-text);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar-toggle,
.app-sidebar-backdrop {
    display: none;
}

.has-app-sidebar .site-header-row {
    position: sticky;
    top: 0;
    left: auto;
    z-index: 60;
    display: flex;
    width: 100%;
    min-height: 72px;
    transform: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem clamp(1rem, 2.4vw, 2rem);
    border: 0;
    border-bottom: 1px solid var(--v16-border);
    border-radius: 0;
    background: color-mix(in srgb, var(--v16-canvas) 94%, transparent) !important;
    box-shadow: none;
    backdrop-filter: blur(14px);
    pointer-events: auto;
}

.has-app-sidebar .site-header-row::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-pink), var(--brand-yellow), var(--brand-mint), var(--brand-purple));
    content: "";
}

.has-app-sidebar .site-brand-mark {
    display: none;
}

.app-top-context {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.55rem;
    color: var(--v16-muted);
    font-size: 0.84rem;
}

.app-top-context a {
    color: color-mix(in srgb, var(--brand-mint) 72%, var(--v16-text));
    font-weight: 760;
    text-decoration: none;
}

.app-top-context a:hover,
.app-top-context a:focus-visible {
    color: var(--brand-mint);
}

.app-top-context strong {
    overflow: hidden;
    color: var(--v16-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.has-app-sidebar .site-header-actions {
    display: flex;
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
    grid-column: auto;
    grid-row: auto;
    justify-self: auto;
    pointer-events: auto;
}

.has-app-sidebar .chat-launcher {
    min-width: 2.65rem;
    min-height: 2.65rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--v16-border);
    border-radius: 10px;
    background: var(--v16-surface) !important;
    color: var(--v16-text);
    box-shadow: none;
}

.has-app-sidebar .chat-launcher-copy > span {
    display: none;
}

.has-app-sidebar .chat-launcher-copy strong {
    color: var(--v16-text);
    font-size: 0.78rem;
}

.has-app-sidebar .chat-launcher-icon {
    width: 1.15rem;
    height: 1.15rem;
    color: color-mix(in srgb, var(--brand-mint) 76%, var(--v16-text));
}

.header-notifications {
    position: relative;
    min-width: 0;
}

.header-notifications-trigger {
    width: auto;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.header-notifications.is-open .header-notifications-trigger {
    border-color: color-mix(in srgb, var(--brand-pink) 54%, var(--v16-border));
    background: color-mix(in srgb, var(--brand-pink) 8%, var(--v16-surface-raised)) !important;
}

.header-notifications-dropdown {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 0;
    z-index: 100;
    width: min(29rem, calc(100vw - 1.5rem));
    max-height: min(42rem, calc(100vh - 6rem));
    overflow: hidden;
    border: 1px solid var(--v16-border);
    border-top: 3px solid var(--brand-pink);
    border-radius: 16px;
    background: var(--v16-surface-raised);
    color: var(--v16-text);
    box-shadow: 0 24px 68px rgba(0, 0, 0, 0.34);
}

.header-notifications-dropdown[hidden] {
    display: none;
}

.header-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid var(--v16-border);
    background: color-mix(in srgb, var(--brand-pink) 5%, var(--v16-surface));
}

.header-notifications-head :is(.eyebrow, h2) {
    margin: 0;
}

.header-notifications-head .eyebrow {
    color: color-mix(in srgb, var(--brand-pink) 78%, var(--v16-text));
}

.header-notifications-head h2 {
    margin-top: 0.2rem;
    color: var(--v16-text);
    font-size: 1.15rem;
}

.header-notifications-close {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    padding: 0;
    place-items: center;
    border: 1px solid var(--v16-border);
    border-radius: 10px;
    background: var(--v16-surface-raised);
    color: var(--v16-text);
    font: inherit;
    font-size: 1.35rem;
    cursor: pointer;
}

.header-notifications-close:is(:hover, :focus-visible) {
    border-color: color-mix(in srgb, var(--brand-mint) 55%, var(--v16-border));
    background: color-mix(in srgb, var(--brand-mint) 8%, var(--v16-surface-raised));
    outline: none;
}

.header-notifications-content {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(min(42rem, 100dvh - 6rem) - 4.6rem);
    overflow: hidden;
    padding: 0.85rem;
}

[data-header-notification-panel] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-height: 0;
    overflow: hidden;
}

.header-notification-scopes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem;
    border: 1px solid var(--v16-border);
    border-radius: 11px;
    background: var(--v16-surface);
}

.header-notification-scopes button {
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--v16-muted);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
}

.header-notification-scopes button[aria-selected="true"] {
    border-color: color-mix(in srgb, var(--brand-pink) 45%, var(--v16-border));
    background: color-mix(in srgb, var(--brand-pink) 10%, var(--v16-surface-raised));
    color: var(--v16-text);
}

.header-notification-scopes button:focus-visible {
    outline: 2px solid var(--brand-mint);
    outline-offset: 1px;
}

[data-header-notification-panel][hidden] {
    display: none;
}

.header-notification-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.header-notification-summary > span {
    display: grid;
    gap: 0.12rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--v16-border);
    border-radius: 11px;
    background: var(--v16-surface);
}

.header-notification-summary > span.has-important-items {
    border-color: color-mix(in srgb, var(--brand-yellow) 48%, var(--v16-border));
    background: color-mix(in srgb, var(--brand-yellow) 8%, var(--v16-surface));
}

.header-notification-summary small {
    color: var(--v16-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.header-notification-summary strong {
    color: var(--v16-text);
    font-size: 1rem;
}

.header-notification-list {
    display: grid;
    gap: 0.5rem;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.header-notification-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.3rem;
    padding: 0;
    border: 1px solid var(--v16-border);
    border-left: 3px solid var(--header-notification-color, color-mix(in srgb, var(--brand-purple) 70%, var(--v16-border)));
    border-radius: 11px;
    background: var(--header-notification-soft, var(--v16-surface));
    color: var(--v16-text);
}

.header-notification-item:has(.header-notification-item-body:is(:hover, :focus-visible)) {
    border-color: color-mix(in srgb, var(--brand-mint) 48%, var(--v16-border));
    background: color-mix(in srgb, var(--brand-mint) 7%, var(--v16-surface-raised));
}

.header-notification-item-body {
    display: grid;
    min-width: 0;
    gap: 0.3rem;
    padding: 0.72rem 0 0.72rem 0.78rem;
    color: inherit;
    text-decoration: none;
}

.header-notification-item-body:focus-visible {
    outline: none;
}

.header-notification-item-head {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.header-notification-item-head time,
.header-notification-meta,
.header-notification-remaining {
    color: var(--v16-muted);
    font-size: 0.72rem;
}

.header-notification-item-body > strong {
    overflow: hidden;
    color: var(--v16-text);
    font-size: 0.82rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-notification-dismiss-form {
    align-self: start;
    margin: 0;
    padding: 0.48rem 0.48rem 0 0;
}

.header-notification-dismiss {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--v16-muted);
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.header-notification-dismiss:is(:hover, :focus-visible) {
    border-color: color-mix(in srgb, var(--brand-pink) 50%, var(--v16-border));
    background: color-mix(in srgb, var(--brand-pink) 10%, var(--v16-surface-raised));
    color: var(--v16-text);
    outline: none;
}

.header-notification-meta {
    overflow: hidden;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-notification-remaining {
    margin: 0.7rem 0 0;
    text-align: center;
}

.header-notification-empty {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    padding: 1.35rem 0.8rem;
    text-align: center;
}

.header-notification-empty > span {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand-mint) 14%, var(--v16-surface));
    color: color-mix(in srgb, var(--brand-mint) 72%, var(--v16-text));
    font-weight: 900;
}

.header-notification-empty svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-notification-empty :is(strong, p) {
    margin: 0;
}

.header-notification-empty strong {
    color: var(--v16-text);
}

.header-notification-empty p {
    color: var(--v16-muted);
    font-size: 0.76rem;
}

.header-notification-view-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
    padding: 0.72rem 0.82rem;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--brand-pink), var(--brand-purple));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
}

.header-notification-view-all:is(:hover, :focus-visible) {
    color: #fff;
    box-shadow: 0 10px 26px color-mix(in srgb, var(--brand-purple) 28%, transparent);
    outline: 2px solid color-mix(in srgb, var(--brand-mint) 70%, transparent);
    outline-offset: 2px;
}

@media (max-width: 1100px) {
    .has-app-sidebar .site-header-actions {
        overflow: visible;
    }
}

@media (max-width: 720px) {
    .header-notifications-dropdown {
        position: fixed;
        top: 4.75rem;
        right: 0.65rem;
        left: 0.65rem;
        width: auto;
        max-height: calc(100dvh - 5.5rem);
    }

    .header-notifications-content {
        height: calc(100dvh - 10.1rem);
    }
}

.has-app-sidebar .user-badge {
    min-width: 0;
    max-width: 12rem;
    padding: 0.48rem 0.7rem;
    border: 1px solid var(--v16-border);
    border-radius: 10px;
    background: var(--v16-surface);
}

.has-app-sidebar .user-badge strong,
.has-app-sidebar .user-badge span {
    color: var(--v16-text);
    font-size: 0.75rem;
}

.has-app-sidebar .user-badge span {
    color: var(--v16-muted);
}

.has-app-sidebar .site-header-actions > form .button,
.has-app-sidebar .theme-toggle {
    min-height: 2.65rem;
    border-radius: 10px;
}

.has-app-sidebar .language-switch {
    position: fixed;
    inset: auto 1rem 1rem auto;
    z-index: 58;
    margin: 0;
}

.has-app-sidebar .language-switch-form {
    border: 1px solid var(--v16-border);
    border-radius: 12px;
    background: var(--v16-surface);
    box-shadow: var(--v16-shadow);
}

.app-sidebar-language-form {
    display: grid;
    gap: 0.35rem;
    margin: 0 1rem 0.75rem;
    padding: 0.7rem;
    border: 1px solid var(--v16-border);
    border-radius: 12px;
    background: var(--v16-surface-raised);
}

.app-sidebar-language-label {
    color: var(--v16-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-sidebar-language-form .language-select {
    width: 100%;
    min-height: 2.3rem;
    border-color: var(--v16-border);
    background: var(--v16-surface);
    color: var(--v16-text);
}

.has-app-sidebar .shell,
.has-app-sidebar .shell-spacious,
.has-app-sidebar .business-breadcrumb-shell {
    width: min(1500px, calc(100% - clamp(2rem, 5vw, 5.25rem)));
    margin-inline: auto;
}

.has-app-sidebar .shell,
.has-app-sidebar.has-global-header-actions main.shell,
.has-app-sidebar.has-global-header-actions .business-breadcrumb-shell {
    padding-top: clamp(2rem, 3vw, 2.6rem);
    padding-bottom: 4.5rem;
}

.has-app-sidebar .business-breadcrumb-shell {
    padding-bottom: 0;
}

.has-app-sidebar .business-breadcrumb-shell + .shell,
.has-app-sidebar.has-global-header-actions .business-breadcrumb-shell + main.shell,
.has-app-sidebar.has-global-header-actions .business-breadcrumb-shell + .shell {
    padding-top: 1rem;
}

.has-app-sidebar :is(.topbar, .page-header) {
    position: relative;
    margin-bottom: 1.75rem;
    padding: 0 0 1.6rem;
    border-bottom: 1px solid var(--v16-border);
    background: transparent !important;
    color: var(--v16-text);
}

.has-app-sidebar :is(.topbar, .page-header)::after {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 6rem;
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand-pink), var(--brand-yellow), var(--brand-mint), var(--brand-purple));
    content: "";
}

.has-app-sidebar :is(.topbar, .page-header) h1 {
    margin-top: 0.35rem;
    color: var(--v16-text) !important;
    font-size: clamp(2rem, 3.3vw, 2.8rem);
    letter-spacing: -0.035em;
}

.has-app-sidebar :is(.topbar, .page-header) :is(p, .lead) {
    color: var(--v16-muted) !important;
}

.has-app-sidebar .breadcrumb-help-row,
.has-app-sidebar .breadcrumb-nav {
    color: var(--v16-muted);
}

.has-app-sidebar .breadcrumb-link {
    color: color-mix(in srgb, var(--brand-mint) 70%, var(--v16-text));
}

.has-app-sidebar .breadcrumb-current {
    color: var(--v16-text);
}

/* V16 uses low-radius graphite/white work surfaces instead of floating glass cards. */
:is(.has-app-sidebar, .portal-body) :is(
    .content-card,
    .module-card,
    .access-summary-card,
    .customer-record-card,
    .customer-search-panel,
    .realization-control-card,
    .realization-filter-panel,
    .realization-bulk-panel,
    .realization-split-panel,
    .table-wrap,
    .catalog-dialog,
    .release-modal-card,
    .page-guide-card,
    .session-expiry-card,
    .portal-overview-card,
    .portal-account-card,
    .portal-reset-panel,
    .portal-contact-confirmation,
    .portal-consent-document,
    .form-draft-panel,
    .activation-step
) {
    border-color: var(--v16-border) !important;
    border-radius: 15px;
    background: var(--v16-surface) !important;
    color: var(--v16-text);
    box-shadow: var(--v16-shadow);
    backdrop-filter: none;
}

.has-app-sidebar .content-card,
.portal-body .content-card {
    overflow: clip;
}

.has-app-sidebar .content-card > .content-card-head,
.portal-body .content-card > .content-card-head {
    border-bottom-color: var(--v16-border);
    background: var(--v16-surface-raised);
}

.has-app-sidebar :is(.content-card, .module-card, .access-summary-card) :is(h2, h3, h4, strong),
.portal-body :is(.content-card, .portal-overview-card, .portal-account-card) :is(h2, h3, h4, strong) {
    color: var(--v16-text);
}

.has-app-sidebar :is(.content-card, .module-card, .access-summary-card) :is(p, small, dd),
.portal-body :is(.content-card, .portal-overview-card, .portal-account-card) :is(p, small, dd) {
    color: var(--v16-muted);
}

.dashboard-workflow-hero {
    position: relative;
    display: flex;
    overflow: hidden;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 0 1.25rem;
    padding: clamp(1.4rem, 2.7vw, 2rem);
    border: 1px solid var(--v16-border);
    border-radius: 17px;
    background:
        radial-gradient(circle at 96% 0, rgba(217, 75, 143, 0.16), transparent 30%),
        radial-gradient(circle at 70% 100%, rgba(117, 87, 166, 0.1), transparent 38%),
        var(--v16-surface);
    box-shadow: var(--v16-shadow);
}

.dashboard-workflow-hero::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-pink), var(--brand-yellow), var(--brand-mint), var(--brand-purple));
    content: "";
}

.dashboard-workflow-hero h2 {
    max-width: 34rem;
    color: var(--v16-text);
    font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.dashboard-workflow-hero p {
    max-width: 48rem;
    margin: 0.3rem 0 0;
    color: var(--v16-muted);
}

.has-app-sidebar .dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

.has-app-sidebar .dashboard-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.has-app-sidebar .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.has-app-sidebar .module-card {
    --module-accent: var(--brand-mint);
    position: relative;
    min-height: 190px;
    overflow: hidden;
    padding: 1.25rem;
    border-color: color-mix(in srgb, var(--module-accent) 43%, var(--v16-border)) !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--module-accent) 16%, transparent), transparent 44%),
        linear-gradient(180deg, color-mix(in srgb, var(--module-accent) 6%, var(--v16-surface)), var(--v16-surface)) !important;
    box-shadow: inset 0 4px 0 color-mix(in srgb, var(--module-accent) 92%, transparent), var(--v16-shadow);
}

.has-app-sidebar .module-grid > .module-card:nth-child(8n + 1) { --module-accent: var(--brand-mint); }
.has-app-sidebar .module-grid > .module-card:nth-child(8n + 2) { --module-accent: var(--brand-yellow); }
.has-app-sidebar .module-grid > .module-card:nth-child(8n + 3) { --module-accent: var(--brand-pink); }
.has-app-sidebar .module-grid > .module-card:nth-child(8n + 4) { --module-accent: var(--brand-purple); }
.has-app-sidebar .module-grid > .module-card:nth-child(8n + 5) { --module-accent: var(--brand-mint); }
.has-app-sidebar .module-grid > .module-card:nth-child(8n + 6) { --module-accent: var(--brand-yellow); }
.has-app-sidebar .module-grid > .module-card:nth-child(8n + 7) { --module-accent: var(--brand-pink); }
.has-app-sidebar .module-grid > .module-card:nth-child(8n + 8) { --module-accent: var(--brand-purple); }

.has-app-sidebar .module-card[href*="cooperation"] {
    --module-accent: var(--brand-pink);
}

.has-app-sidebar .module-card::before {
    position: absolute;
    top: 1rem;
    bottom: 1rem;
    left: 0;
    width: 4px;
    border-radius: 0 5px 5px 0;
    background: var(--module-accent);
    content: "";
}

.has-app-sidebar .module-card :is(h3, .module-state) {
    color: color-mix(in srgb, var(--module-accent) 48%, var(--v16-text));
}

.module-card-title-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.55rem;
}

.module-card-title-row > span:first-child {
    min-width: 0;
}

.has-app-sidebar .module-card p {
    color: var(--v16-muted);
}

.has-app-sidebar .module-card .module-link {
    color: color-mix(in srgb, var(--module-accent) 75%, var(--v16-text));
}

.has-app-sidebar .module-card-active:hover,
.has-app-sidebar .module-card-active:focus-visible {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--module-accent) 68%, var(--v16-border)) !important;
    box-shadow: inset 0 4px 0 var(--module-accent), 0 20px 42px color-mix(in srgb, var(--module-accent) 10%, transparent);
}

.has-app-sidebar .dashboard-category-preview span {
    border-color: color-mix(in srgb, var(--module-accent) 34%, var(--v16-border));
    background: color-mix(in srgb, var(--module-accent) 10%, var(--v16-surface-raised));
    color: var(--v16-text-soft);
}

.has-app-sidebar .dashboard-notifications-card,
.has-app-sidebar .calendar-card {
    min-height: 0;
    max-height: none;
    border-top: 4px solid var(--brand-purple) !important;
}

.has-app-sidebar .calendar-card {
    border-top-color: var(--brand-yellow) !important;
}

/* Dense operational screens use the same clear panels, filters, and tables. */
.has-app-sidebar :is(.customer-search-panel, .realization-filter-panel, .toolbar-form) {
    border-top: 3px solid var(--brand-mint) !important;
}

.has-app-sidebar :is(.realization-summary-grid, .customer-summary-grid, .cooperation-summary-grid) {
    gap: 0.85rem;
}

.has-app-sidebar .access-summary-card {
    --summary-accent: var(--brand-mint);
    min-height: 8.4rem;
    border-top: 4px solid var(--summary-accent) !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--summary-accent) 13%, transparent), transparent 45%),
        var(--v16-surface) !important;
}

.has-app-sidebar .access-summary-card:nth-child(4n + 1) { --summary-accent: var(--brand-pink); }
.has-app-sidebar .access-summary-card:nth-child(4n + 2) { --summary-accent: var(--brand-mint); }
.has-app-sidebar .access-summary-card:nth-child(4n + 3) { --summary-accent: var(--brand-yellow); }
.has-app-sidebar .access-summary-card:nth-child(4n) { --summary-accent: var(--brand-purple); }

.has-app-sidebar .access-summary-card > strong {
    color: var(--v16-text);
    font-size: clamp(1.8rem, 3vw, 2.35rem);
}

.has-app-sidebar .customer-record-card {
    position: relative;
    border-left: 4px solid var(--brand-pink) !important;
}

.has-app-sidebar .customer-record-card:nth-child(4n + 2) { border-left-color: var(--brand-mint) !important; }
.has-app-sidebar .customer-record-card:nth-child(4n + 3) { border-left-color: var(--brand-yellow) !important; }
.has-app-sidebar .customer-record-card:nth-child(4n) { border-left-color: var(--brand-purple) !important; }

.has-app-sidebar :is(.customer-record-facts, .customer-record-details-grid) {
    border-color: var(--v16-border);
    background: var(--v16-border) !important;
}

.has-app-sidebar :is(.customer-record-fact, .customer-record-details-grid > div) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-soft) !important;
    color: var(--v16-text);
}

:is(.has-app-sidebar, .portal-body) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .form-input) {
    border-color: var(--v16-border-strong) !important;
    border-radius: 9px;
    background: var(--v16-surface-soft) !important;
    color: var(--v16-text) !important;
    caret-color: var(--v16-text);
    box-shadow: none;
    -webkit-text-fill-color: var(--v16-text);
    opacity: 1;
}

:is(.has-app-sidebar, .portal-body) :is(input, textarea)::placeholder {
    color: var(--v16-muted) !important;
    opacity: 1;
}

:is(.has-app-sidebar, .portal-body) :is(input, select, textarea, .form-input):focus {
    border-color: var(--brand-mint) !important;
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-mint) 16%, transparent) !important;
    transform: none;
}

:is(.has-app-sidebar, .portal-body) :is(input, select, textarea):disabled {
    background: var(--v16-surface-raised) !important;
    color: var(--v16-muted) !important;
    -webkit-text-fill-color: var(--v16-muted);
    opacity: 1;
}

:is(.has-app-sidebar, .portal-body) :is(label, legend, .form-label) {
    color: var(--v16-text-soft) !important;
}

:is(.has-app-sidebar, .portal-body) :is(.help-text, .form-help, .field-help, .muted) {
    color: var(--v16-muted) !important;
}

.has-app-sidebar :is(.table-wrap, .realization-table-wrap) {
    overflow: auto;
    border: 1px solid var(--v16-border) !important;
    border-radius: 14px;
    background: var(--v16-surface) !important;
    box-shadow: none;
}

.has-app-sidebar :is(.data-table, .realization-data-table) {
    background: var(--v16-surface) !important;
    color: var(--v16-text-soft) !important;
}

.has-app-sidebar :is(.data-table, .realization-data-table) th {
    border-color: var(--v16-border) !important;
    background:
        linear-gradient(90deg, rgba(217, 75, 143, 0.045), rgba(57, 170, 164, 0.025)),
        var(--v16-surface-raised) !important;
    color: var(--v16-muted) !important;
    font-size: 0.7rem;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

.has-app-sidebar :is(.data-table, .realization-data-table) td {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text-soft) !important;
}

.has-app-sidebar :is(.data-table, .realization-data-table) tbody tr:hover td {
    background: color-mix(in srgb, var(--brand-mint) 6%, var(--v16-surface)) !important;
}

.has-app-sidebar :is(.data-table, .realization-data-table) td :is(strong, a:not(.button)) {
    color: var(--v16-text) !important;
}

.button {
    border-radius: 10px;
}

:is(.has-app-sidebar, .portal-body) .button-primary {
    border: 1px solid color-mix(in srgb, var(--brand-pink) 55%, var(--brand-purple));
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple));
    color: #ffffff !important;
}

:is(.has-app-sidebar, .portal-body) :is(.button-secondary, .button-muted) {
    border: 1px solid var(--v16-border-strong);
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
    box-shadow: none;
}

:is(.has-app-sidebar, .portal-body) :is(.button-secondary, .button-muted):hover,
:is(.has-app-sidebar, .portal-body) :is(.button-secondary, .button-muted):focus-visible {
    border-color: color-mix(in srgb, var(--brand-mint) 55%, var(--v16-border));
    background: color-mix(in srgb, var(--brand-mint) 8%, var(--v16-surface-raised)) !important;
}

:is(.has-app-sidebar, .portal-body) :is(.status-pill, .status-badge, .pill) {
    border-color: var(--v16-border-strong);
}

/* Customer portal: the same v16 system with a portal-specific branded hero. */
.portal-body .portal-header {
    top: 0;
    width: 100%;
    min-height: 76px;
    margin: 0;
    padding: 0.65rem clamp(1rem, 3vw, 2.25rem);
    border: 0;
    border-bottom: 1px solid var(--v16-border);
    border-radius: 0;
    background: color-mix(in srgb, var(--v16-canvas) 94%, transparent) !important;
    box-shadow: none;
    backdrop-filter: blur(14px);
}

.portal-body .portal-header::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-pink), var(--brand-yellow), var(--brand-mint), var(--brand-purple));
    content: "";
}

.portal-body .portal-brand,
.portal-body .portal-user,
.portal-body .portal-user > span {
    color: var(--v16-text);
}

.portal-body .portal-nav {
    border-color: var(--v16-border);
    background: var(--v16-surface-soft);
}

.portal-body .portal-nav a {
    color: var(--v16-muted);
}

.portal-body .portal-nav a:hover,
.portal-body .portal-nav a:focus-visible,
.portal-body .portal-nav a.is-active {
    background: var(--v16-surface);
    color: var(--v16-text);
    box-shadow: inset 0 -3px 0 var(--brand-pink);
}

.portal-body .portal-shell {
    width: min(1360px, calc(100% - clamp(2rem, 6vw, 6rem)));
    padding-top: clamp(2rem, 4vw, 3.5rem);
}

.portal-body .portal-page-head :is(h1, h2, h3) {
    color: var(--v16-text) !important;
}

.portal-body .portal-page-head p {
    color: var(--v16-muted) !important;
}

.portal-body .portal-dashboard-grid > .content-card,
.portal-body .portal-overview-card {
    --portal-accent: var(--brand-mint);
    position: relative;
    border-color: color-mix(in srgb, var(--portal-accent) 42%, var(--v16-border)) !important;
    border-top: 4px solid var(--portal-accent) !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--portal-accent) 15%, transparent), transparent 44%),
        var(--v16-surface) !important;
}

.portal-body .portal-dashboard-grid > :nth-child(4n + 1),
.portal-body .portal-overview-grid > :nth-child(4n + 1) { --portal-accent: var(--brand-mint); }
.portal-body .portal-dashboard-grid > :nth-child(4n + 2),
.portal-body .portal-overview-grid > :nth-child(4n + 2) { --portal-accent: var(--brand-pink); }
.portal-body .portal-dashboard-grid > :nth-child(4n + 3),
.portal-body .portal-overview-grid > :nth-child(4n + 3) { --portal-accent: var(--brand-yellow); }
.portal-body .portal-dashboard-grid > :nth-child(4n),
.portal-body .portal-overview-grid > :nth-child(4n) { --portal-accent: var(--brand-purple); }

/* Auth screens are an intentional two-panel v16 stage in both themes. */
.auth-body {
    background: var(--v16-canvas) !important;
    color: var(--v16-text);
}

.auth-body .site-header-row {
    top: 1rem;
}

.auth-body .site-brand-mark {
    border: 1px solid var(--v16-border);
    border-radius: 13px;
    background: var(--v16-surface) !important;
    box-shadow: var(--v16-shadow);
}

.auth-body :is(.site-brand-name-link, .site-brand-mark-text) {
    color: var(--v16-text);
}

.auth-body .auth-layout {
    width: min(1180px, calc(100% - 2rem));
    gap: 0;
    padding-top: 7.5rem;
}

.auth-body .auth-card {
    min-height: 35rem;
    border-color: var(--v16-border) !important;
    border-radius: 0;
    background: var(--v16-surface) !important;
    color: var(--v16-text);
    box-shadow: var(--v16-shadow);
}

.auth-body .auth-card:first-child {
    border-radius: 18px 0 0 18px;
}

.auth-body .auth-card:last-child {
    border-radius: 0 18px 18px 0;
}

.auth-body .auth-brand-logo {
    padding: clamp(2rem, 5vw, 4.5rem);
    object-fit: contain;
    background:
        radial-gradient(circle at 20% 16%, rgba(217, 75, 143, 0.16), transparent 34%),
        radial-gradient(circle at 82% 82%, rgba(57, 170, 164, 0.12), transparent 36%),
        var(--v16-sidebar) !important;
}

.auth-body .auth-card-form :is(h1, h2, h3, strong, label) {
    color: var(--v16-text) !important;
}

.auth-body .auth-card-form :is(p, small, .auth-help, .auth-footer) {
    color: var(--v16-muted) !important;
}

/* Explicit light-theme cleanup: no legacy black/graphite work surfaces survive. */
html[data-theme="light"] :is(
    .app-shell,
    .app-shell-main,
    .app-sidebar,
    .site-header-row,
    .portal-header,
    .portal-nav,
    .auth-body,
    .auth-layout,
    .auth-card,
    .auth-card-form,
    .auth-credential-form,
    .content-card,
    .module-card,
    .access-summary-card,
    .customer-record-card,
    .customer-record-head,
    .customer-record-details,
    .customer-record-fact,
    .customer-record-details-grid > div,
    .customer-search-panel,
    .realization-control-card,
    .realization-filter-panel,
    .realization-bulk-panel,
    .realization-split-panel,
    .table-wrap,
    .data-table,
    .realization-data-table,
    .catalog-dialog,
    .release-modal-card,
    .release-entry,
    .page-guide-card,
    .session-expiry-card,
    .portal-overview-card,
    .portal-account-card,
    .portal-reset-panel,
    .portal-contact-confirmation,
    .portal-consent-document,
    .notification-card,
    .calendar-card,
    .widget-card,
    .form-draft-panel,
    .activation-step,
    .cooperation-module-grid > *,
    details,
    summary,
    pre,
    code
) {
    border-color: var(--v16-border) !important;
    background-color: var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

html[data-theme="light"] :is(
    .content-card-head,
    .customer-record-facts,
    .realization-lock-banner,
    .toolbar-form,
    .filter-panel,
    .notification-toolbar,
    .calendar-grid,
    .release-modal-head,
    .release-modal-actions,
    .page-guide-header,
    .page-guide-footer,
    .form-draft-available
) {
    border-color: var(--v16-border) !important;
    background-color: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

html[data-theme="light"] :is(
    h1, h2, h3, h4, h5, h6,
    p, li, dt, dd, label, legend, summary,
    .eyebrow, .lead, .module-state, .module-link,
    .customer-record-title, .customer-record-title a,
    .notification-title, .calendar-weekday,
    .release-entry, .page-guide-card,
    .breadcrumb-current, .table-link
) {
    text-shadow: none;
}

html[data-theme="light"] :is(
    h1, h2, h3, h4, h5, h6,
    dt, label, legend, summary,
    .customer-record-title, .customer-record-title a,
    .notification-title, .release-entry h3,
    .page-guide-card strong, .table-link
) {
    color: var(--v16-text) !important;
}

html[data-theme="light"] :is(
    p, dd, small, .muted, .help-text, .form-help,
    .content-card-head p, .customer-record-fact span,
    .customer-record-details span, .notification-meta,
    .release-entry p, .page-guide-card p
) {
    color: var(--v16-muted) !important;
}

html[data-theme="light"] :is(.global-loading-overlay, dialog::backdrop) {
    background: rgba(38, 48, 60, 0.34) !important;
}

html[data-theme="light"] .global-loading-card {
    border-color: var(--v16-border);
    background: #ffffff;
    color: var(--v16-text);
}

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

    .app-sidebar {
        width: 264px;
    }

    .has-app-sidebar .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-105%);
        width: min(21rem, calc(100vw - 3rem));
        box-shadow: 18px 0 56px rgba(0, 0, 0, 0.3);
        transition: transform 0.2s ease;
    }

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

    .app-sidebar-toggle {
        display: grid;
        width: 2.65rem;
        height: 2.65rem;
        flex: 0 0 2.65rem;
        place-items: center;
        border: 1px solid var(--v16-border);
        border-radius: 10px;
        background: var(--v16-surface);
        color: var(--v16-text);
        cursor: pointer;
        font-size: 1.15rem;
    }

    .app-sidebar-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 65;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(4, 7, 11, 0.62);
        backdrop-filter: blur(3px);
    }

    .app-sidebar-open {
        overflow: hidden;
    }

    .has-app-sidebar .site-header-row {
        gap: 0.7rem;
    }

    .app-top-context {
        flex: 1;
    }

    .has-app-sidebar .user-badge,
    .has-app-sidebar .chat-launcher-copy {
        display: none;
    }

    .dashboard-workflow-hero {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .has-app-sidebar .site-header-row {
        min-height: 64px;
        padding: 0.55rem 0.75rem;
    }

    .app-top-context .app-top-context-category,
    .app-top-context .app-top-context-category + span,
    .app-top-context[data-has-module-parent] .app-top-context-root,
    .app-top-context[data-has-module-parent] .app-top-context-root + span {
        display: none;
    }

    .has-app-sidebar .site-header-actions {
        gap: 0.35rem;
    }

    .has-app-sidebar .chat-launcher:not(.chat-launcher-bell),
    .has-app-sidebar .site-header-actions > form {
        display: none;
    }

    .has-app-sidebar .shell,
    .has-app-sidebar .shell-spacious,
    .has-app-sidebar .business-breadcrumb-shell,
    .portal-body .portal-shell {
        width: min(100% - 1.5rem, 100%);
    }

    .has-app-sidebar .module-grid,
    .has-app-sidebar .dashboard-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .has-app-sidebar .module-card {
        min-height: 0;
    }

    .portal-body .portal-header {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .portal-body .portal-nav {
        order: 3;
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .auth-body .auth-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .auth-body .auth-card {
        min-height: 0;
    }

    .auth-body .auth-card:first-child {
        min-height: 15rem;
        border-radius: 18px 18px 0 0;
    }

    .auth-body .auth-card:last-child {
        border-radius: 0 0 18px 18px;
    }
}

/* 2.1.0 Duo-Creative v16 application theme. Dark remains the default. */
html {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #050507;
    --bg-soft: #0b0b0e;
    --panel: rgba(24, 24, 29, 0.96);
    --panel-strong: #1d1d23;
    --ink: #f5f6f8;
    --muted: #a8adb8;
    --line: rgba(255, 255, 255, 0.12);
    --shadow: 0 22px 58px rgba(0, 0, 0, 0.42);
}

html[data-theme="light"] {
    --bg: #edf1f5;
    --bg-soft: #f5f7fa;
    --panel: rgba(255, 255, 255, 0.97);
    --panel-strong: #ffffff;
    --ink: #171b22;
    --muted: #626d7a;
    --line: rgba(34, 44, 56, 0.14);
    --shadow: 0 18px 46px rgba(33, 46, 61, 0.12);
}

body,
.portal-body {
    transition: color 0.18s ease, background-color 0.18s ease;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .portal-body {
    background:
        radial-gradient(circle at 12% 10%, rgba(251, 40, 155, 0.12), transparent 25rem),
        radial-gradient(circle at 88% 18%, rgba(53, 201, 188, 0.08), transparent 25rem),
        radial-gradient(circle at 70% 88%, rgba(107, 66, 178, 0.1), transparent 28rem),
        #050507;
    color: var(--ink);
}

html[data-theme="light"] body,
html[data-theme="light"] .portal-body {
    background:
        radial-gradient(circle at 8% 8%, rgba(251, 40, 155, 0.08), transparent 26rem),
        radial-gradient(circle at 92% 14%, rgba(53, 201, 188, 0.07), transparent 24rem),
        #edf1f5;
    color: var(--ink);
}

.theme-toggle {
    display: inline-grid;
    width: 2.85rem;
    min-width: 2.85rem;
    height: 2.85rem;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(20, 20, 25, 0.9);
    color: var(--brand-yellow);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 1.15rem;
    transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(252, 209, 29, 0.55);
    outline: none;
}

.portal-theme-toggle {
    flex: 0 0 2.85rem;
}

.auth-body .site-header-actions {
    position: absolute;
    right: 0.85rem;
    display: flex;
    width: auto;
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(34, 44, 56, 0.16);
    background: #ffffff;
    color: var(--brand-purple);
    box-shadow: 0 8px 24px rgba(33, 46, 61, 0.1);
}

/* Shared graphite surfaces and readable controls. */
html[data-theme="dark"] :is(
    .auth-card-form,
    .content-card,
    .module-card,
    .access-summary-card,
    .customer-record-card,
    .customer-search-panel,
    .customer-record-facts,
    .customer-record-details-grid > div,
    .realization-control-card,
    .realization-filter-panel,
    .realization-bulk-panel,
    .realization-split-panel,
    .table-wrap,
    .catalog-dialog,
    .release-modal-card,
    .page-guide-card,
    .session-expiry-card,
    .portal-overview-card,
    .portal-account-card,
    .portal-reset-panel,
    .portal-contact-confirmation,
    .portal-consent-document
) {
    border-color: rgba(255, 255, 255, 0.11) !important;
    background: linear-gradient(180deg, rgba(29, 29, 35, 0.98), rgba(20, 20, 25, 0.98)) !important;
    color: var(--ink);
    box-shadow: var(--shadow);
}

html[data-theme="light"] :is(
    .auth-card-form,
    .content-card,
    .module-card,
    .access-summary-card,
    .customer-record-card,
    .customer-search-panel,
    .customer-record-facts,
    .customer-record-details-grid > div,
    .realization-control-card,
    .realization-filter-panel,
    .realization-bulk-panel,
    .realization-split-panel,
    .table-wrap,
    .catalog-dialog,
    .release-modal-card,
    .page-guide-card,
    .session-expiry-card,
    .portal-overview-card,
    .portal-account-card,
    .portal-reset-panel,
    .portal-contact-confirmation,
    .portal-consent-document
) {
    border-color: rgba(34, 44, 56, 0.13) !important;
    background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
    color: var(--ink);
    box-shadow: var(--shadow);
}

html[data-theme="dark"] :is(.form-input, input, select, textarea) {
    border-color: rgba(255, 255, 255, 0.16) !important;
    background-color: #111116 !important;
    color: #f6f7f9 !important;
}

html[data-theme="dark"] :is(input, textarea)::placeholder {
    color: #858b98;
    opacity: 1;
}

html[data-theme="light"] :is(.form-input, input, select, textarea) {
    border-color: rgba(34, 44, 56, 0.16) !important;
    background-color: #ffffff !important;
    color: #1c2430 !important;
}

html[data-theme="light"] :is(input, textarea)::placeholder {
    color: #7b8694;
    opacity: 1;
}

html[data-theme="dark"] :is(h1, h2, h3, h4, label, legend, .table-link, .access-summary-card > span) {
    color: #f5f6f8;
}

html[data-theme="light"] :is(h1, h2, h3, h4, label, legend, .table-link, .access-summary-card > span) {
    color: #171b22;
}

html[data-theme="dark"] :is(.data-table, .data-table td, .realization-data-table td) {
    color: #e6e8ec;
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(19, 19, 24, 0.94);
}

html[data-theme="dark"] :is(.data-table th, .realization-data-table th) {
    color: #b7bcc6;
    border-color: rgba(255, 255, 255, 0.12);
    background: #25252c;
}

html[data-theme="light"] :is(.data-table, .data-table td, .realization-data-table td) {
    color: #28323e;
    border-color: rgba(34, 44, 56, 0.11);
    background-color: #ffffff;
}

html[data-theme="light"] :is(.data-table th, .realization-data-table th) {
    color: #596675;
    border-color: rgba(34, 44, 56, 0.13);
    background: #f0f3f7;
}

html[data-theme="light"] :is(.page-header, .topbar) :is(h1, h2, h3),
html[data-theme="light"] .page-header :is(h1, h2, h3) {
    color: #171b22 !important;
}

html[data-theme="light"] :is(.page-header, .topbar) p {
    color: #626d7a !important;
}

html[data-theme="light"] :is(.breadcrumb-link, .breadcrumb-current) {
    color: #344050;
}

html[data-theme="light"] .breadcrumb-separator {
    color: #8993a0;
}

/* Intentional brand-color distribution across neighboring workspaces. */
.module-grid > .module-card:nth-child(4n + 1),
.access-summary-card:nth-child(4n + 1),
.portal-dashboard-grid > .content-card:nth-child(4n + 1),
.portal-overview-grid > .portal-overview-card:nth-child(4n + 1) {
    --surface-accent: var(--brand-pink);
}

.module-grid > .module-card:nth-child(4n + 2),
.access-summary-card:nth-child(4n + 2),
.portal-dashboard-grid > .content-card:nth-child(4n + 2),
.portal-overview-grid > .portal-overview-card:nth-child(4n + 2) {
    --surface-accent: var(--brand-mint);
}

.module-grid > .module-card:nth-child(4n + 3),
.access-summary-card:nth-child(4n + 3),
.portal-dashboard-grid > .content-card:nth-child(4n + 3),
.portal-overview-grid > .portal-overview-card:nth-child(4n + 3) {
    --surface-accent: var(--brand-yellow);
}

.module-grid > .module-card:nth-child(4n),
.access-summary-card:nth-child(4n),
.portal-dashboard-grid > .content-card:nth-child(4n),
.portal-overview-grid > .portal-overview-card:nth-child(4n) {
    --surface-accent: var(--brand-purple);
}

:is(.module-card, .access-summary-card, .portal-dashboard-grid > .content-card, .portal-overview-card) {
    border-top: 3px solid var(--surface-accent, var(--brand-pink)) !important;
}

.module-card[href*="cooperation"] {
    border-color: rgba(251, 40, 155, 0.58) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(251, 40, 155, 0.2), transparent 45%),
        linear-gradient(180deg, rgba(34, 24, 34, 0.98), rgba(20, 20, 25, 0.98)) !important;
}

html[data-theme="light"] .module-card[href*="cooperation"] {
    background:
        radial-gradient(circle at 100% 0%, rgba(251, 40, 155, 0.11), transparent 45%),
        linear-gradient(180deg, #ffffff, #faf7fb) !important;
}

html[data-theme="dark"] :is(.site-header-row, .portal-header) {
    border-color: rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(120deg, rgba(251, 40, 155, 0.07), rgba(53, 201, 188, 0.045), rgba(107, 66, 178, 0.07)),
        rgba(8, 8, 11, 0.94);
}

html[data-theme="light"] :is(.site-header-row, .portal-header) {
    border-color: rgba(34, 44, 56, 0.14);
    background:
        linear-gradient(120deg, rgba(251, 40, 155, 0.045), rgba(53, 201, 188, 0.035), rgba(107, 66, 178, 0.045)),
        rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] :is(.portal-brand, .portal-user > span, .site-brand-name-link) {
    color: #171b22;
}

html[data-theme="light"] .portal-nav {
    border-color: rgba(34, 44, 56, 0.12);
    background: #eef2f6;
}

html[data-theme="light"] .portal-nav a {
    color: #53606e;
}

html[data-theme="light"] .portal-nav a:is(:hover, :focus-visible, .is-active) {
    color: var(--brand-purple);
    background: #ffffff;
}

html[data-theme="dark"] :is(.auth-credential-form, .portal-reset-form) {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(12, 12, 16, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .auth-credential-field label {
    color: #e9ebef;
}

.auth-brand-logo {
    object-fit: contain;
    padding: clamp(1.5rem, 6vw, 4.5rem);
    background:
        radial-gradient(circle at 22% 18%, rgba(251, 40, 155, 0.13), transparent 34%),
        radial-gradient(circle at 80% 78%, rgba(53, 201, 188, 0.1), transparent 36%),
        #07070a;
}

html[data-theme="light"] .auth-brand-logo {
    background:
        radial-gradient(circle at 22% 18%, rgba(251, 40, 155, 0.09), transparent 34%),
        radial-gradient(circle at 80% 78%, rgba(53, 201, 188, 0.08), transparent 36%),
        #f5f7fa;
}

@media (max-width: 760px) {
    .portal-header {
        gap: 0.65rem;
    }

    .portal-theme-toggle {
        margin-left: auto;
    }
}

.interactive-summary-card {
    position: relative;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.interactive-summary-card:hover,
.interactive-summary-card:focus-visible,
.interactive-summary-card.is-selected {
    z-index: 8;
    transform: translateY(-2px);
    border-color: var(--surface-accent, var(--brand-pink)) !important;
    outline: none;
}

.interactive-summary-card.is-selected {
    box-shadow: inset 0 0 0 1px var(--surface-accent, var(--brand-pink)), var(--shadow);
}

.summary-hover-panel {
    position: absolute;
    top: calc(100% + 0.65rem);
    left: 0;
    z-index: 40;
    display: none;
    width: min(24rem, 82vw);
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 15px;
    background: #16161b;
    color: #f5f6f8;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.44);
}

.interactive-summary-card:hover .summary-hover-panel,
.interactive-summary-card:focus-visible .summary-hover-panel {
    display: grid;
    gap: 0.4rem;
}

.summary-hover-panel b {
    margin-bottom: 0.2rem;
    color: #ffffff;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-hover-item {
    display: block;
    padding: 0.35rem 0.45rem;
    border-left: 3px solid var(--brand-purple);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.055);
    color: #dfe2e7;
    line-height: 1.35;
}

.summary-status-active { border-left-color: var(--brand-mint); }
.summary-status-pending_start { border-left-color: var(--brand-yellow); }
.summary-status-under_observation { border-left-color: var(--brand-purple); }
.summary-status-ended { border-left-color: var(--brand-pink); }

html[data-theme="light"] .summary-hover-panel {
    border-color: rgba(34, 44, 56, 0.16);
    background: #ffffff;
    color: #1b2430;
    box-shadow: 0 18px 42px rgba(33, 46, 61, 0.18);
}

html[data-theme="light"] .summary-hover-panel b {
    color: #171b22;
}

html[data-theme="light"] .summary-hover-item {
    background: #f3f6f9;
    color: #354150;
}

/* 2.0.12 mobile dashboard and strategy-list repairs. */
.session-expiry-dialog {
    width: min(32rem, calc(100% - 2rem));
    padding: 0;
    border: 0;
    border-radius: 24px;
    color: var(--ink);
    background: transparent;
}

.session-expiry-dialog::backdrop {
    background: rgba(16, 12, 24, 0.7);
}

.session-expiry-card {
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid rgba(107, 66, 178, 0.2);
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: 0 24px 70px rgba(18, 18, 18, 0.25);
}

.session-expiry-card h2,
.session-expiry-card p {
    margin-bottom: 0;
}

.session-expiry-countdown {
    color: var(--accent-dark);
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 800;
    text-align: center;
}

.form-draft-panel {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid rgba(107, 66, 178, 0.18);
    border-radius: 18px;
    background: rgba(107, 66, 178, 0.055);
}

.form-draft-panel p {
    margin: 0.2rem 0 0;
}

.form-draft-available {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(107, 66, 178, 0.14);
}

@media (max-width: 768px) {
    .dashboard-shell,
    .dashboard-layout,
    .dashboard-main,
    .dashboard-sidebar,
    .dashboard-sidebar > *,
    .dashboard-shell .module-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .dashboard-layout,
    .dashboard-shell .module-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-shell .module-card {
        min-height: 0;
    }

    .dashboard-shell .dashboard-notifications-card {
        min-height: 0;
        max-height: none;
    }

    .dashboard-shell .calendar-card .content-card-head {
        align-items: center;
        flex-direction: row;
    }

    .dashboard-shell .calendar-nav {
        width: auto;
        flex: 0 0 auto;
        flex-flow: row nowrap;
    }

    .dashboard-shell .calendar-nav-button {
        width: 3rem;
        min-width: 3rem;
    }

    .dashboard-shell .calendar-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: clamp(0.2rem, 1.5vw, 0.4rem);
    }

    .dashboard-shell .calendar-day {
        min-width: 0;
        padding-inline: 0.15rem;
        border-radius: 12px;
    }

    .dashboard-shell h1,
    .dashboard-shell h2,
    .dashboard-shell h3,
    .dashboard-shell .button,
    .dashboard-shell .breadcrumb-link,
    .dashboard-shell .breadcrumb-current {
        overflow-wrap: normal;
        word-break: normal;
    }

    .strategies-table-wrap {
        overflow: visible;
    }

    .strategies-table-wrap .data-table.strategies-table,
    .strategies-table-wrap .data-table.strategies-table:has(tr > :nth-child(8)) {
        min-width: 0;
    }

    .strategies-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .strategies-table,
    .strategies-table tbody,
    .strategies-table tr,
    .strategies-table td {
        display: block;
        width: 100%;
    }

    .strategies-table tbody {
        display: grid;
        gap: 1rem;
    }

    .strategies-table tr {
        overflow: hidden;
        border: 1px solid rgba(107, 66, 178, 0.14);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.82);
    }

    .strategies-table td {
        display: grid;
        grid-template-columns: minmax(6.5rem, 35%) minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.75rem 0.9rem;
        border-bottom: 1px solid rgba(31, 36, 48, 0.07);
        overflow-wrap: break-word;
    }

    .strategies-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.75rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .strategies-table td:last-child {
        border-bottom: 0;
    }

    .strategies-table .strategies-actions {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        min-width: 0;
    }

    .strategies-table .strategies-actions::before {
        display: none;
    }

    .strategies-table .button-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .strategies-table .button {
        width: 100%;
        overflow-wrap: normal;
        word-break: normal;
    }

    .strategies-table .strategies-empty-row td {
        display: block;
    }

    .strategies-table .strategies-empty-row td::before {
        display: none;
    }
}

@media (max-width: 430px) {
    .dashboard-shell .topbar,
    .dashboard-shell .content-card,
    .dashboard-shell .module-card {
        padding: 1rem;
    }

    .dashboard-shell .calendar-card .content-card-head {
        gap: 0.6rem;
    }

    .dashboard-shell .calendar-nav {
        gap: 0.3rem;
    }

    .dashboard-shell .calendar-nav-button {
        width: 2.55rem;
        min-width: 2.55rem;
        height: 2.55rem;
        padding: 0.55rem;
    }

    .dashboard-shell .calendar-weekday {
        font-size: 0.62rem;
        letter-spacing: 0;
    }

    .strategies-table .button-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Final theme boundary: legacy components must resolve to the selected palette. */
html[data-theme="light"] :is(
    .portal-reset-visual,
    .cms-reset-visual,
    .portal-overview-hero,
    .portal-account-hero
) {
    border-color: var(--v16-border) !important;
    background:
        radial-gradient(circle at 16% 8%, rgba(217, 75, 143, 0.13), transparent 28%),
        radial-gradient(circle at 86% 88%, rgba(57, 170, 164, 0.14), transparent 31%),
        var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

html[data-theme="light"] :is(
    .portal-reset-visual,
    .cms-reset-visual,
    .portal-overview-hero,
    .portal-account-hero
) :is(h1, h2, h3, strong) {
    color: var(--v16-text) !important;
}

html[data-theme="light"] :is(
    .portal-reset-visual,
    .cms-reset-visual,
    .portal-overview-hero,
    .portal-account-hero
) :is(p, li, small, span) {
    color: var(--v16-muted) !important;
}

html[data-theme="light"] :is(
    .release-modal-card,
    .page-guide-card,
    .notification-ack-popover,
    .access-rank-note,
    .permission-save-bar,
    .auth-login-switcher
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
    box-shadow: var(--v16-shadow);
}

html[data-theme="light"] :is(
    .release-modal-card,
    .page-guide-card,
    .notification-ack-popover,
    .access-rank-note,
    .permission-save-bar,
    .auth-login-switcher
) :is(h1, h2, h3, h4, strong, label, button:not(.button-primary)) {
    color: var(--v16-text) !important;
}

html[data-theme="light"] :is(
    .release-modal-card,
    .page-guide-card,
    .notification-ack-popover,
    .access-rank-note,
    .permission-save-bar,
    .auth-login-switcher
) :is(p, li, small, span) {
    color: var(--v16-muted) !important;
}

html[data-theme="light"] :is(.page-guide-example code, .chat-rich-preview-media img, .chat-rich-preview-media video, .chat-rich-preview-embed) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-soft) !important;
    color: var(--v16-text) !important;
}

html[data-theme="light"] .language-select,
html[data-theme="light"] .language-switch-form {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

html[data-theme="light"] .language-label {
    color: var(--v16-text-soft) !important;
}

html[data-theme="light"] .strategies-table tr,
html[data-theme="light"] .strategies-table td {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

/* 2.1.0 v16 fidelity pass: one breadcrumb, exact dashboard hierarchy, and strict theme surfaces. */
.app-top-context-cluster {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
}

.app-top-context-cluster .page-help-trigger {
    width: 1.9rem;
    min-width: 1.9rem;
    height: 1.9rem;
    border-color: var(--v16-border-strong);
    background: var(--v16-surface-raised);
    color: var(--v16-text);
    box-shadow: none;
}

/* Employee breadcrumbs and their guide control live only in the sticky top bar. */
.has-app-sidebar main :is(.breadcrumb-nav, .breadcrumb-help-row) {
    display: none !important;
}

.has-app-sidebar .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
}

.has-app-sidebar .app-sidebar {
    width: 300px;
}

.has-app-sidebar :is(.shell, .shell-spacious) {
    width: min(1500px, 100%);
    padding-right: 42px;
    padding-left: 42px;
}

.has-app-sidebar .dashboard-shell {
    display: grid;
    width: 100%;
    max-width: none;
    margin: 0;
    gap: 22px;
    padding-top: 38px !important;
    padding-bottom: 72px !important;
}

.has-app-sidebar .dashboard-page-head {
    margin: 0;
    padding-bottom: 25px;
}

.has-app-sidebar .dashboard-page-head h1 {
    margin: 7px 0 8px;
    font-size: clamp(2.35rem, 4vw, 2.75rem);
}

.has-app-sidebar .dashboard-page-head .dashboard-lead {
    max-width: 880px;
    margin: 0;
    font-size: 1rem;
}

.has-app-sidebar .dashboard-workflow-hero {
    min-height: 0;
    margin: 0;
    padding: 28px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 95% 0, rgba(217, 75, 143, 0.14), transparent 26%),
        var(--v16-surface) !important;
}

.has-app-sidebar .dashboard-workflow-hero h2 {
    margin: 7px 0;
    font-size: 1.56rem;
}

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

/* 2.3.0: permission-aware, per-user dashboard widgets and fixed announcements. */
.dashboard-announcements,
.dashboard-user-widget-card {
    border: 1px solid var(--v16-border) !important;
    border-radius: 17px;
    background: var(--v16-surface) !important;
    color: var(--v16-text);
    box-shadow: var(--v16-shadow);
}

.dashboard-announcements {
    overflow: hidden;
    padding: 0;
    border-top: 4px solid var(--brand-pink) !important;
}

.dashboard-announcements-head,
.dashboard-widget-section-head,
.dashboard-user-widget-head,
.dashboard-widget-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-announcements-head,
.dashboard-user-widget-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--v16-border);
    background: var(--v16-surface-raised);
}

.dashboard-announcements-head h2,
.dashboard-widget-section-head h2,
.dashboard-user-widget-head h2,
.dashboard-widget-picker-head h2 {
    margin: 0.15rem 0 0;
    color: var(--v16-text);
}

.dashboard-announcements-head p,
.dashboard-widget-section-head p,
.dashboard-user-widget-head p,
.dashboard-widget-picker-head p {
    margin: 0.3rem 0 0;
    color: var(--v16-muted);
}

.dashboard-announcement-list {
    display: grid;
    max-height: 20rem;
    overflow-y: auto;
}

.dashboard-announcement {
    padding: 16px 20px;
    border-bottom: 1px solid var(--v16-border);
    border-left: 4px solid var(--brand-purple);
}

.dashboard-announcement:last-child {
    border-bottom: 0;
}

.dashboard-announcement-high { border-left-color: var(--brand-yellow); }
.dashboard-announcement-urgent { border-left-color: var(--brand-pink); }

.dashboard-announcement-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.8rem;
    color: var(--v16-muted);
    font-size: 0.78rem;
}

.dashboard-announcement p {
    margin: 0.65rem 0 0;
    color: var(--v16-text);
    overflow-wrap: anywhere;
}

.dashboard-widget-section {
    display: grid;
    gap: 14px;
}

.dashboard-widget-section-head {
    align-items: center;
}

.dashboard-widget-grid {
    --dashboard-grid-gap: 14px;
    --dashboard-grid-unit: clamp(4.5rem, 7vw, 7.5rem);
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-auto-flow: dense;
    grid-auto-rows: var(--dashboard-grid-unit);
    gap: var(--dashboard-grid-gap);
    align-items: stretch;
}

.dashboard-widget-slot {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.dashboard-widget-slot[data-dashboard-widget-width="1"] { grid-column: span 1; }
.dashboard-widget-slot[data-dashboard-widget-width="2"] { grid-column: span 2; }
.dashboard-widget-slot[data-dashboard-widget-width="3"] { grid-column: span 3; }
.dashboard-widget-slot[data-dashboard-widget-width="4"] { grid-column: span 4; }
.dashboard-widget-slot[data-dashboard-widget-width="5"] { grid-column: span 5; }
.dashboard-widget-slot[data-dashboard-widget-width="6"] { grid-column: span 6; }
.dashboard-widget-slot[data-dashboard-widget-width="7"] { grid-column: span 7; }
.dashboard-widget-slot[data-dashboard-widget-width="8"] { grid-column: span 8; }
.dashboard-widget-slot[data-dashboard-widget-width="9"] { grid-column: span 9; }
.dashboard-widget-slot[data-dashboard-widget-width="10"] { grid-column: span 10; }
.dashboard-widget-slot[data-dashboard-widget-height="1"] { grid-row: span 1; }
.dashboard-widget-slot[data-dashboard-widget-height="2"] { grid-row: span 2; }
.dashboard-widget-slot[data-dashboard-widget-height="3"] { grid-row: span 3; }
.dashboard-widget-slot[data-dashboard-widget-height="4"] { grid-row: span 4; }
.dashboard-widget-slot[data-dashboard-widget-height="5"] { grid-row: span 5; }
.dashboard-widget-slot[data-dashboard-widget-height="6"] { grid-row: span 6; }
.dashboard-widget-slot[data-dashboard-widget-height="7"] { grid-row: span 7; }
.dashboard-widget-slot[data-dashboard-widget-height="8"] { grid-row: span 8; }
.dashboard-widget-slot[data-dashboard-widget-height="9"] { grid-row: span 9; }
.dashboard-widget-slot[data-dashboard-widget-height="10"] { grid-row: span 10; }
.dashboard-widget-slot[data-dashboard-widget-height="11"] { grid-row: span 11; }
.dashboard-widget-slot[data-dashboard-widget-height="12"] { grid-row: span 12; }
.dashboard-widget-slot[data-dashboard-widget-height="13"] { grid-row: span 13; }
.dashboard-widget-slot[data-dashboard-widget-height="14"] { grid-row: span 14; }
.dashboard-widget-slot[data-dashboard-widget-height="15"] { grid-row: span 15; }
.dashboard-widget-slot[data-dashboard-widget-height="16"] { grid-row: span 16; }
.dashboard-widget-slot[data-dashboard-widget-height="17"] { grid-row: span 17; }
.dashboard-widget-slot[data-dashboard-widget-height="18"] { grid-row: span 18; }
.dashboard-widget-slot[data-dashboard-widget-height="19"] { grid-row: span 19; }
.dashboard-widget-slot[data-dashboard-widget-height="20"] { grid-row: span 20; }
.dashboard-widget-slot[data-dashboard-widget-height="21"] { grid-row: span 21; }
.dashboard-widget-slot[data-dashboard-widget-height="22"] { grid-row: span 22; }
.dashboard-widget-slot[data-dashboard-widget-height="23"] { grid-row: span 23; }
.dashboard-widget-slot[data-dashboard-widget-height="24"] { grid-row: span 24; }

.dashboard-widget-slot > :not(.dashboard-widget-live-controls, .dashboard-widget-resize-handle) {
    height: 100%;
    min-height: 0;
    overflow: auto;
}

.dashboard-widget-live-controls {
    position: absolute;
    z-index: 4;
    top: 0.65rem;
    right: 0.65rem;
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem;
    border: 1px solid var(--v16-border-strong);
    border-radius: 12px;
    background: color-mix(in srgb, var(--v16-surface) 94%, transparent);
    box-shadow: var(--v16-shadow);
}

.dashboard-widget-drag-handle,
.dashboard-widget-remove {
    display: inline-grid;
    height: 2.2rem;
    padding: 0;
    border: 1px solid var(--v16-border);
    border-radius: 9px;
    place-items: center;
    background: var(--v16-surface-raised);
    color: var(--v16-text);
    cursor: grab;
    font: inherit;
    font-weight: 850;
}

.dashboard-widget-drag-handle {
    width: auto;
    min-width: 5.25rem;
    grid-auto-flow: column;
    gap: 0.45rem;
    padding: 0 0.65rem;
    border-color: color-mix(in srgb, var(--brand-purple) 58%, var(--v16-border));
    background: color-mix(in srgb, var(--brand-purple) 13%, var(--v16-surface-raised));
    touch-action: none;
}

.dashboard-widget-drag-icon {
    width: 0.75rem;
    height: 1.125rem;
    fill: currentcolor;
}

.dashboard-widget-drag-handle span {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.dashboard-widget-remove {
    width: 2.2rem;
    cursor: pointer;
    font-size: 1.35rem;
}

.dashboard-widget-resize-handle {
    position: absolute;
    z-index: 5;
    right: 0.25rem;
    bottom: 0.25rem;
    display: none;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 0;
    border-right: 3px solid var(--brand-pink);
    border-bottom: 3px solid var(--brand-pink);
    border-radius: 0 0 10px;
    background: transparent;
    cursor: nwse-resize;
}

.dashboard-widget-resize-handle::before,
.dashboard-widget-resize-handle::after {
    position: absolute;
    right: 0.35rem;
    bottom: 0.35rem;
    width: 0.65rem;
    height: 0.65rem;
    border-right: 2px solid var(--brand-pink);
    border-bottom: 2px solid var(--brand-pink);
    content: "";
}

.dashboard-widget-resize-handle::after {
    right: 0.75rem;
    bottom: 0.75rem;
}

.dashboard-widget-drag-handle:hover,
.dashboard-widget-drag-handle:focus-visible,
.dashboard-widget-remove:hover,
.dashboard-widget-remove:focus-visible {
    border-color: var(--brand-pink);
    color: var(--brand-pink);
}

.dashboard-widget-editing .dashboard-widget-slot {
    outline: 2px dashed color-mix(in srgb, var(--brand-purple) 64%, var(--v16-border));
    outline-offset: -2px;
    cursor: grab;
}

.dashboard-widget-editing .dashboard-widget-live-controls {
    display: flex;
}

.dashboard-widget-editing .dashboard-widget-resize-handle {
    display: block;
}

.dashboard-widget-editing .dashboard-widget-slot > :not(.dashboard-widget-live-controls, .dashboard-widget-resize-handle) {
    pointer-events: none;
    user-select: none;
}

.dashboard-widget-slot.is-dragging {
    opacity: 0.46;
    cursor: grabbing;
}

.dashboard-widget-slot.is-resizing {
    z-index: 3;
    outline-color: var(--brand-pink);
}

.dashboard-user-widget-card {
    overflow: hidden;
    padding: 0;
    border-top: 4px solid var(--brand-mint) !important;
}

.dashboard-widget-slot:nth-child(4n + 2) .dashboard-user-widget-card { border-top-color: var(--brand-yellow) !important; }
.dashboard-widget-slot:nth-child(4n + 3) .dashboard-user-widget-card { border-top-color: var(--brand-purple) !important; }
.dashboard-widget-slot:nth-child(4n) .dashboard-user-widget-card { border-top-color: var(--brand-pink) !important; }

.dashboard-widget-slot .dashboard-workflow-hero {
    margin: 0;
    padding: 22px;
}

.dashboard-company-overview-widget .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--v16-border);
}

.dashboard-company-overview-widget .dashboard-kpi {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.dashboard-widget-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 1px;
    background: var(--v16-border);
}

.dashboard-widget-metric {
    display: grid;
    gap: 0.25rem;
    min-height: 7rem;
    align-content: center;
    padding: 18px;
    background: var(--v16-surface);
    color: var(--v16-text);
    text-decoration: none;
}

.dashboard-widget-metric:hover,
.dashboard-widget-metric:focus-visible {
    background: var(--v16-surface-raised);
}

.dashboard-widget-metric strong {
    font-size: clamp(1.65rem, 3vw, 2.2rem);
}

.dashboard-widget-metric span {
    color: var(--v16-muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.dashboard-widget-bars {
    display: grid;
    gap: 0.85rem;
    padding: 18px 20px;
}

.dashboard-widget-bar > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.3rem;
    color: var(--v16-text-soft);
    font-size: 0.8rem;
}

.dashboard-widget-bar-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.dashboard-widget-bar-link:hover span,
.dashboard-widget-bar-link:focus-visible span {
    color: var(--brand-pink);
}

.dashboard-widget-bar progress {
    width: 100%;
    height: 0.55rem;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: var(--v16-surface-soft);
}

.dashboard-widget-bar progress::-webkit-progress-bar { background: var(--v16-surface-soft); }
.dashboard-widget-bar progress::-webkit-progress-value { background: linear-gradient(90deg, var(--brand-purple), var(--brand-pink)); }
.dashboard-widget-bar progress::-moz-progress-bar { background: linear-gradient(90deg, var(--brand-purple), var(--brand-pink)); }

.dashboard-chart-wrap {
    display: grid;
    min-height: 0;
    gap: 0.65rem;
    padding: 16px 18px 18px;
}

.dashboard-chart {
    display: block;
    width: 100%;
    min-width: 24rem;
    height: auto;
    overflow: visible;
}

.dashboard-chart-gridline,
.dashboard-chart-axis {
    stroke: var(--v16-border);
    stroke-width: 1;
}

.dashboard-chart-axis {
    stroke: var(--v16-border-strong);
}

.dashboard-chart-axis-label,
.dashboard-chart-point-label {
    fill: var(--v16-muted);
    font-size: 10px;
    font-weight: 750;
}

.dashboard-chart-bar {
    transition: opacity 140ms ease;
}

.dashboard-chart-bar:hover {
    opacity: 0.76;
}

.dashboard-chart-bar-pink,
.dashboard-chart-key-pink { fill: var(--brand-pink); background: var(--brand-pink); }
.dashboard-chart-bar-purple,
.dashboard-chart-key-purple { fill: var(--brand-purple); background: var(--brand-purple); }
.dashboard-chart-bar-mint,
.dashboard-chart-key-mint { fill: var(--brand-mint); background: var(--brand-mint); }
.dashboard-chart-bar-yellow,
.dashboard-chart-key-yellow { fill: var(--brand-yellow); background: var(--brand-yellow); }

.dashboard-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 1rem;
    color: var(--v16-text-soft);
    font-size: 0.75rem;
    font-weight: 750;
}

.dashboard-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dashboard-chart-key {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 3px;
}

/* Sales centre, proposal builder, and customer decision workspace */
.sales-centre,
.proposal-builder,
.lead-workspace {
    display: grid;
    gap: 1rem;
}

.sales-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.35rem;
    overflow-x: auto;
    border: 1px solid var(--v16-border);
    border-radius: 14px;
    background: var(--v16-surface);
}

.sales-tabs a {
    flex: 0 0 auto;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    color: var(--v16-text-soft);
    font-weight: 800;
    text-decoration: none;
}

.sales-tabs a:hover,
.sales-tabs a:focus-visible,
.sales-tabs a.is-active {
    color: var(--v16-text);
    background: var(--v16-surface-soft);
}

.sales-tabs a.is-active {
    box-shadow: inset 0 -2px 0 var(--brand-pink);
}

.sales-filter-bar {
    display: grid;
    grid-template-columns: minmax(13rem, 2fr) repeat(4, minmax(9rem, 1fr));
    gap: 0.8rem;
    padding: 1rem;
}

.sales-filter-bar label,
.sales-period-selector label {
    display: grid;
    gap: 0.35rem;
    color: var(--v16-text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.sales-kpi-grid,
.lead-action-summary {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.sales-analytics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.app-body:not(.dashboard-body) main.shell .sales-analytics-grid > article {
    min-height: 9rem;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: stretch;
    gap: 0.9rem;
    padding: 1.1rem 1.2rem;
}

.sales-analytics-grid > article > span {
    max-width: 24rem;
    line-height: 1.4;
}

.sales-analytics-grid > article > strong {
    align-self: end;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.sales-kpi-grid .needs-attention {
    box-shadow: inset 0 3px 0 var(--brand-pink);
}

.sales-pipeline-scroll {
    overflow-x: auto;
    padding-bottom: 0.4rem;
}

.sales-pipeline-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(15rem, 1fr));
    gap: 0.8rem;
    min-width: 78rem;
}

.sales-pipeline-column {
    min-height: 24rem;
    padding: 0.75rem;
    border: 1px solid var(--v16-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--v16-surface) 86%, transparent);
}

.sales-pipeline-column > header,
.proposal-customer-variant > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.sales-pipeline-column > header h2 {
    margin: 0;
    font-size: 0.95rem;
}

.sales-pipeline-column > header > span {
    min-width: 1.7rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: var(--v16-surface-soft);
    text-align: center;
    font-weight: 850;
}

.sales-pipeline-cards {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.sales-pipeline-card {
    display: grid;
    gap: 0.3rem;
    padding: 0.8rem;
    border: 1px solid var(--v16-border);
    border-radius: 11px;
    color: inherit;
    background: var(--v16-surface-soft);
    text-decoration: none;
}

.sales-pipeline-card:hover,
.sales-pipeline-card:focus-visible {
    border-color: var(--brand-pink);
    transform: translateY(-1px);
}

.sales-pipeline-card span,
.sales-pipeline-card small {
    color: var(--v16-text-soft);
}

.sales-period-selector {
    display: flex;
    justify-content: flex-end;
}

.sales-period-selector label {
    min-width: 13rem;
}

.sales-analytics-layout,
.lead-workspace-layout,
.proposal-decision-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sales-analytics-bar {
    display: grid;
    gap: 0.35rem;
}

.sales-analytics-bar > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.sales-analytics-bar progress {
    width: 100%;
    accent-color: var(--brand-pink);
}

.sales-status {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--v16-border-strong);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 850;
}

.sales-status-won,
.sales-status-accepted,
.sales-status-converted { color: var(--brand-mint); }
.sales-status-lost,
.sales-status-rejected,
.sales-status-expired { color: var(--brand-pink); }
.sales-status-review,
.sales-status-sent,
.sales-status-viewed,
.sales-status-changes { color: var(--brand-yellow); }

.sales-structured-form,
.proposal-builder-variants,
.proposal-customer-variants {
    display: grid;
    gap: 1rem;
}

.proposal-workflow-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-top: 3px solid var(--brand-pink);
}

.proposal-builder-editor {
    border: 1px solid var(--v16-border);
    border-radius: 10px;
    background: var(--v16-surface-soft);
}

.proposal-builder-editor > summary {
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 850;
}

.proposal-builder-editor > form {
    padding: 0 1rem 1rem;
}

.proposal-total {
    display: grid;
    min-width: 12rem;
    gap: 0.2rem;
    text-align: right;
}

.proposal-total span,
.proposal-total small {
    color: var(--v16-text-soft);
    font-size: 0.75rem;
}

.proposal-compact-actions {
    gap: 0.35rem;
}

.proposal-compact-actions .button {
    padding: 0.45rem 0.65rem;
}

.proposal-move-item-form {
    display: flex;
    gap: 0.35rem;
}

.proposal-customer-variant {
    padding: 1rem;
    border: 1px solid var(--v16-border);
    border-radius: 12px;
    background: var(--v16-surface-soft);
}

.proposal-variant-choice {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem;
    border: 1px solid var(--v16-border);
    border-radius: 10px;
}

.proposal-variant-choice span {
    display: grid;
}

.sales-version-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.sales-version-list a {
    display: grid;
    gap: 0.15rem;
    min-width: 8rem;
    padding: 0.7rem;
    border: 1px solid var(--v16-border);
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}

.sales-version-list a.is-current {
    border-color: var(--brand-pink);
    box-shadow: inset 0 2px 0 var(--brand-pink);
}

.sales-activity-timeline article {
    display: grid;
    grid-template-columns: 0.75rem 1fr;
    gap: 0.8rem;
}

.sales-activity-timeline article > span {
    width: 0.65rem;
    height: 0.65rem;
    margin-top: 0.3rem;
    border-radius: 50%;
    background: var(--brand-purple);
}

@media (max-width: 1100px) {
    .sales-filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sales-analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .sales-filter-bar,
    .sales-analytics-layout,
    .lead-workspace-layout,
    .proposal-decision-grid { grid-template-columns: 1fr; }
    .proposal-workflow-bar,
    .proposal-customer-variant > header { align-items: stretch; flex-direction: column; }
    .proposal-total { text-align: left; }
    .proposal-compact-actions { align-items: stretch; }
    .proposal-move-item-form { width: 100%; }
}

@media (max-width: 430px) {
    .sales-filter-bar { grid-template-columns: 1fr; }
    .sales-analytics-grid { grid-template-columns: 1fr; }
    .app-body:not(.dashboard-body) main.shell .sales-analytics-grid > article { min-height: 7.5rem; }
    .sales-tabs { margin-inline: -0.4rem; }
    .proposal-move-item-form { flex-direction: column; }
}

.dashboard-health-body {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(8rem, 0.8fr) minmax(12rem, 1.2fr);
    align-items: center;
    gap: 1rem;
    padding: 18px;
}

.dashboard-health-score {
    position: relative;
    display: grid;
    width: min(100%, 10rem);
    margin: 0 auto;
    place-items: center;
}

.dashboard-health-score svg {
    display: block;
    width: 100%;
    transform: rotate(-90deg);
}

.dashboard-health-score circle {
    fill: none;
    stroke-width: 4;
}

.dashboard-health-score-track {
    stroke: var(--v16-surface-soft);
}

.dashboard-health-score-value {
    stroke: var(--brand-mint);
    stroke-linecap: round;
}

.dashboard-health-widget-warning .dashboard-health-score-value {
    stroke: var(--brand-yellow);
}

.dashboard-health-score > span {
    position: absolute;
    display: grid;
    place-items: center;
    text-align: center;
}

.dashboard-health-score strong {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.dashboard-health-score small {
    max-width: 7rem;
    color: var(--v16-muted);
    font-size: 0.68rem;
}

.dashboard-health-signals {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-health-signals li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--v16-border);
    color: var(--v16-text-soft);
    font-size: 0.75rem;
}

.dashboard-health-signals li:last-child {
    border-bottom: 0;
}

.dashboard-health-signals li::before {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--brand-mint);
    content: "";
}

.dashboard-health-signals li.needs-attention::before {
    background: var(--brand-yellow);
}

.dashboard-health-signals li span {
    flex: 1;
}

.dashboard-health-signals strong {
    color: var(--v16-text);
    text-align: right;
}

.dashboard-status-list {
    display: grid;
    min-height: 0;
    overflow: auto;
    border-top: 1px solid var(--v16-border);
}

.dashboard-status-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 1rem;
    border-bottom: 1px solid var(--v16-border);
    color: var(--v16-text);
    text-decoration: none;
}

.dashboard-status-row:is(a):is(:hover, :focus-visible) {
    background: var(--v16-surface-soft);
    outline: none;
}

.dashboard-status-marker {
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 50%;
    background: var(--v16-muted);
}

.dashboard-status-marker-success { background: var(--brand-mint); }
.dashboard-status-marker-warning { background: var(--brand-yellow); }
.dashboard-status-marker-danger { background: var(--brand-pink); }

.dashboard-status-copy {
    display: grid;
    min-width: 0;
    gap: 0.12rem;
}

.dashboard-status-copy strong,
.dashboard-status-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-status-copy strong {
    font-size: 0.78rem;
}

.dashboard-status-copy small {
    color: var(--v16-muted);
    font-size: 0.68rem;
}

.dashboard-status-value {
    color: var(--v16-text-soft);
    font-size: 0.7rem;
    font-weight: 800;
    text-align: right;
}

.dashboard-widget-empty {
    padding: 22px;
}

.dashboard-widget-toolbelt {
    position: fixed;
    z-index: 70;
    left: calc(50% + 150px);
    bottom: 1rem;
    display: block;
    width: min(42rem, calc(100vw - 2rem));
    margin: 0;
    padding: 0.5rem;
    border: 1px solid var(--v16-border-strong);
    border-radius: 16px;
    background: color-mix(in srgb, var(--v16-surface) 96%, transparent);
    color: var(--v16-text);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
    transform: translateX(-50%);
    transition: opacity 140ms ease, transform 140ms ease;
    backdrop-filter: blur(14px);
}

.dashboard-widget-toolbelt[hidden],
.dashboard-widget-picker[hidden] {
    display: none !important;
}

.dashboard-widget-toolbelt.is-passive {
    pointer-events: none;
    opacity: 0.16;
    transform: translateX(-50%) translateY(0.35rem);
}

.dashboard-widget-toolbelt-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.dashboard-widget-toolbelt-close,
.dashboard-widget-picker-close {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid var(--v16-border);
    border-radius: 9px;
    background: var(--v16-surface-raised);
    color: var(--v16-text);
    cursor: pointer;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
}

.dashboard-widget-toolbelt-close:is(:hover, :focus-visible),
.dashboard-widget-picker-close:is(:hover, :focus-visible) {
    border-color: var(--brand-pink);
    color: var(--brand-pink);
}

.dashboard-widget-picker {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.65rem);
    left: 0;
    max-height: min(32rem, calc(100vh - 7rem));
    overflow: hidden;
    border: 1px solid var(--v16-border-strong);
    border-radius: 16px;
    background: var(--v16-surface);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.dashboard-widget-picker-head {
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--v16-border);
    background: var(--v16-surface-raised);
}

.dashboard-widget-editor {
    display: grid;
    max-height: min(26rem, calc(100vh - 12rem));
    overflow-y: auto;
}

.dashboard-widget-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 12px 16px;
    border-bottom: 1px solid var(--v16-border);
}

.dashboard-widget-editor-toggle {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 0.75rem;
}

.dashboard-widget-editor-toggle span {
    display: grid;
    gap: 0.2rem;
}

.dashboard-widget-editor-toggle small {
    color: var(--v16-muted);
}

.dashboard-widget-editor-size {
    min-width: 3.6rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--v16-border);
    border-radius: 9px;
    background: var(--v16-surface-raised);
    color: var(--v16-text-soft);
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-widget-editor-order {
    display: flex;
    gap: 0.35rem;
}

@media (max-width: 620px) {
    .dashboard-widget-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
    }
    .dashboard-widget-slot {
        grid-column: span 1;
        grid-row: auto;
    }
    .dashboard-widget-slot > :not(.dashboard-widget-live-controls, .dashboard-widget-resize-handle) { height: auto; }
    .dashboard-widget-resize-handle { display: none !important; }
    .dashboard-widget-section-head,
    .dashboard-announcements-head,
    .dashboard-user-widget-head { align-items: stretch; flex-direction: column; }
    .dashboard-widget-editor-row { grid-template-columns: minmax(0, 1fr); }
    .dashboard-widget-editor-order { justify-content: flex-end; }
    .dashboard-chart-wrap { overflow-x: auto; }
    .dashboard-health-body { grid-template-columns: minmax(0, 1fr); }
    .dashboard-widget-toolbelt {
        left: 50%;
        bottom: 0.5rem;
        width: calc(100vw - 1rem);
    }
    .dashboard-widget-toolbelt-actions {
        overflow-x: auto;
        justify-content: flex-start;
    }
    .dashboard-widget-picker {
        max-height: calc(100vh - 5rem);
        border-radius: 16px 16px 0 0;
    }
    .dashboard-widget-editor {
        max-height: calc(100vh - 10rem);
    }
}

@media (min-width: 621px) and (max-width: 1100px) {
    .dashboard-widget-toolbelt {
        left: 50%;
    }
}

.dashboard-kpi {
    --dashboard-kpi-accent: var(--brand-pink);
    position: relative;
    min-height: 140px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--v16-border);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--dashboard-kpi-accent) 10%, transparent), transparent 42%),
        var(--v16-surface);
    color: var(--v16-text);
    box-shadow: var(--v16-shadow);
}

.dashboard-kpi::before {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--dashboard-kpi-accent);
    content: "";
}

.dashboard-kpi-mint { --dashboard-kpi-accent: var(--brand-mint); }
.dashboard-kpi-yellow { --dashboard-kpi-accent: var(--brand-yellow); }
.dashboard-kpi-purple { --dashboard-kpi-accent: var(--brand-purple); }

.dashboard-kpi > span {
    display: block;
    color: var(--v16-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-kpi > strong {
    display: block;
    margin-top: 20px;
    color: var(--v16-text);
    font-size: clamp(1.65rem, 2.7vw, 2rem);
    line-height: 1.15;
}

.dashboard-kpi > small {
    display: block;
    margin-top: 4px;
    color: var(--v16-muted);
    font-size: 0.75rem;
}

.dashboard-category-section {
    display: grid;
    gap: 14px;
}

.dashboard-section-title {
    margin: 0;
    color: var(--v16-text);
    font-size: 1.1rem;
}

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

.dashboard-category-card {
    --dashboard-category-accent: var(--brand-pink);
    position: relative;
    display: flex;
    min-height: 185px;
    overflow: hidden;
    flex-direction: column;
    padding: 20px;
    border: 1px solid color-mix(in srgb, var(--dashboard-category-accent) 45%, var(--v16-border));
    border-radius: 17px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--dashboard-category-accent) 12%, transparent), transparent 38%),
        var(--v16-surface);
    color: var(--v16-text);
    box-shadow: inset 0 3px 0 color-mix(in srgb, var(--dashboard-category-accent) 75%, transparent);
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-category-card-delivery_support,
.dashboard-category-card-system_administration { --dashboard-category-accent: var(--brand-mint); }
.dashboard-category-card-finance_people { --dashboard-category-accent: var(--brand-yellow); }
.dashboard-category-card-communication_account { --dashboard-category-accent: var(--brand-purple); }
.dashboard-category-card-analytics_audit { --dashboard-category-accent: var(--brand-pink); }

.dashboard-category-card:hover,
.dashboard-category-card:focus-visible,
.dashboard-category-card.is-active {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--dashboard-category-accent) 72%, var(--v16-border));
    outline: none;
    box-shadow:
        inset 0 4px 0 var(--dashboard-category-accent),
        0 16px 36px color-mix(in srgb, var(--dashboard-category-accent) 10%, transparent);
}

.dashboard-category-count {
    color: color-mix(in srgb, var(--dashboard-category-accent) 78%, var(--v16-text));
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-category-card h3 {
    margin: 18px 0 7px;
    color: var(--v16-text) !important;
    font-size: 1.08rem;
}

.dashboard-category-card p {
    margin: 0 0 2.25rem;
    color: var(--v16-muted) !important;
    font-size: 0.82rem;
}

.dashboard-category-link {
    position: absolute;
    bottom: 16px;
    color: color-mix(in srgb, var(--dashboard-category-accent) 70%, var(--v16-text));
    font-size: 0.78rem;
    font-weight: 750;
}

.dashboard-selected-workspace {
    --dashboard-workspace-accent: var(--brand-pink);
    overflow: hidden;
    border: 1px solid var(--v16-border);
    border-radius: 17px;
    background: var(--v16-surface);
    box-shadow:
        inset 0 4px 0 var(--dashboard-workspace-accent),
        var(--v16-shadow);
}

.dashboard-selected-workspace-delivery_support,
.dashboard-selected-workspace-system_administration { --dashboard-workspace-accent: var(--brand-mint); }
.dashboard-selected-workspace-finance_people { --dashboard-workspace-accent: var(--brand-yellow); }
.dashboard-selected-workspace-communication_account { --dashboard-workspace-accent: var(--brand-purple); }
.dashboard-selected-workspace-analytics_audit { --dashboard-workspace-accent: var(--brand-pink); }

.dashboard-selected-workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 18px 20px;
    border-bottom: 1px solid var(--v16-border);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--dashboard-workspace-accent) 15%, transparent), transparent 72%),
        var(--v16-surface-raised);
}

.dashboard-selected-workspace-head h2 {
    margin: 0.15rem 0 0;
    color: color-mix(in srgb, var(--dashboard-workspace-accent) 38%, var(--v16-text)) !important;
    font-size: 1.25rem;
}

.dashboard-selected-workspace-head p,
.dashboard-selected-workspace-meta {
    margin: 0.25rem 0 0;
    color: var(--v16-muted) !important;
    font-size: 0.78rem;
}

.has-app-sidebar .dashboard-workspace-module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
}

.has-app-sidebar .dashboard-workspace-module-grid > .module-card {
    min-height: 142px;
    padding: 18px;
    border-width: 0 1px 1px 0 !important;
    border-radius: 0;
    box-shadow: inset 0 4px 0 color-mix(in srgb, var(--module-accent) 92%, transparent);
}

.has-app-sidebar .dashboard-workspace-module-grid > .module-card::before {
    top: 16px;
    bottom: 16px;
}

.has-app-sidebar .dashboard-workspace-module-grid > .module-card h3 {
    margin: 0;
}

.has-app-sidebar .dashboard-workspace-module-grid > .module-card p {
    font-size: 0.78rem;
}

.has-app-sidebar .dashboard-workspace-module-grid > .module-card-featured {
    --module-accent: var(--brand-pink);
}

.has-app-sidebar .dashboard-layout {
    margin-top: 0;
}

.has-app-sidebar .dashboard-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* Split assignment is a v16 operational panel, never a pale legacy card in dark mode. */
html[data-theme="dark"] .has-app-sidebar .realization-split-form {
    border-color: color-mix(in srgb, var(--brand-pink) 46%, var(--v16-border)) !important;
    border-top: 4px solid var(--brand-pink) !important;
    background:
        radial-gradient(circle at 100% 0, rgba(217, 75, 143, 0.14), transparent 42%),
        var(--v16-surface) !important;
    color: var(--v16-text) !important;
    box-shadow: var(--v16-shadow);
}

html[data-theme="light"] .has-app-sidebar .realization-split-form {
    border-color: color-mix(in srgb, var(--brand-pink) 38%, var(--v16-border)) !important;
    border-top: 4px solid var(--brand-pink) !important;
    background:
        radial-gradient(circle at 100% 0, rgba(217, 75, 143, 0.09), transparent 42%),
        var(--v16-surface) !important;
    color: var(--v16-text) !important;
    box-shadow: var(--v16-shadow);
}

.has-app-sidebar .realization-split-form :is(h3, label, strong) {
    color: var(--v16-text) !important;
}

.has-app-sidebar .realization-split-form :is(p, small) {
    color: var(--v16-muted) !important;
}

.has-app-sidebar .realization-split-form :is(.realization-panel-head, .realization-filter-actions) {
    border-color: var(--v16-border) !important;
}

html[data-theme="dark"] .has-app-sidebar .realization-split-selection-note {
    border-color: color-mix(in srgb, var(--brand-yellow) 42%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-yellow) 11%, var(--v16-surface-raised)) !important;
    color: #ead88f !important;
}

html[data-theme="light"] .has-app-sidebar .realization-split-selection-note {
    border-color: #dbc875 !important;
    background: #fff8dc !important;
    color: #715300 !important;
}

/* Wipe legacy background images as well as colors on light operational surfaces. */
html[data-theme="light"] .has-app-sidebar :is(
    .realization-control-card,
    .realization-filter-panel,
    .realization-results-card,
    .realization-bulk-toolbar,
    .realization-period-panel,
    .customer-search-panel,
    .customer-record-card,
    .filter-panel,
    .toolbar-form
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

html[data-theme="light"] .has-app-sidebar :is(
    .realization-board-guidance,
    .realization-status-guide,
    .realization-lock-banner,
    .customer-record-facts,
    .customer-record-details-grid > div
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

/* Theme-safe inventory for legacy cards that previously carried unscoped white fills. */
:is(.has-app-sidebar, .portal-body) :is(
    .global-loading-card,
    .portal-overview-summary > div,
    .portal-manager-card,
    .portal-consent-row,
    .request-thread article,
    .strategy-preview-copy,
    .license-file-view,
    .audit-log-payload,
    .audit-summary-grid > article,
    .audit-filter-disclosure,
    .audit-result-count,
    .audit-event-card,
    .audit-empty-state,
    .notifications-overview-card,
    .vault-entry-card,
    .dashboard-notification-summary-item,
    .dashboard-notification-item,
    .dashboard-notification-empty,
    .dashboard-notification-state,
    .page-guide-section,
    .page-guide-task,
    .page-guide-example,
    .realization-period-panel,
    .realization-week-popover,
    .settings-overview-grid > article,
    .settings-section-nav,
    .settings-search-toolbar,
    .settings-search-empty,
    .settings-info-panel,
    .settings-lock-panel,
    .automation-builder-section,
    .automation-builder-review,
    .automation-rule-card,
    .push-status-panel,
    .invoice-action-group,
    .multi-picker-list,
    .link-preview-card,
    .link-preview-entry,
    .access-control-nav,
    .access-manageable-filter,
    .access-account-card,
    .access-group-card,
    .permission-enabled-filter,
    .permission-category,
    .permission-module-card,
    .customer-form-section,
    .customer-legal-subsection,
    .catalog-item,
    .preview-value,
    .same-customer-record-card,
    .same-customer-candidate,
    .customer-service-lifecycle-period,
    .chat-pinned-item,
    .chat-rich-preview,
    .auth-verification-method,
    .auth-verification-remember,
    .auth-verification-trust-note,
    .contract-subsection,
    .contract-formset-row,
    .contract-version-card
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
    box-shadow: none;
}

:is(.has-app-sidebar, .portal-body) :is(
    .strategy-preview-copy,
    .license-file-view,
    .audit-log-payload,
    .audit-summary-grid > article,
    .audit-filter-disclosure,
    .audit-result-count,
    .audit-event-card,
    .audit-empty-state,
    .notifications-overview-card,
    .vault-entry-card,
    .page-guide-section,
    .page-guide-task,
    .page-guide-example,
    .settings-overview-grid > article,
    .settings-search-toolbar,
    .settings-search-empty,
    .settings-info-panel,
    .settings-lock-panel,
    .automation-builder-section,
    .automation-builder-review,
    .automation-rule-card,
    .push-status-panel,
    .invoice-action-group,
    .access-account-card,
    .access-group-card,
    .permission-module-card,
    .customer-form-section,
    .customer-legal-subsection,
    .catalog-item,
    .preview-value,
    .same-customer-record-card,
    .same-customer-candidate,
    .contract-subsection,
    .contract-formset-row,
    .contract-version-card
) :is(h1, h2, h3, h4, strong, label, summary) {
    color: var(--v16-text) !important;
}

:is(.has-app-sidebar, .portal-body) :is(
    .strategy-preview-copy,
    .license-file-view,
    .audit-event-card,
    .notifications-overview-card,
    .vault-entry-card,
    .page-guide-section,
    .settings-info-panel,
    .settings-lock-panel,
    .automation-rule-card,
    .access-account-card,
    .access-group-card,
    .permission-module-card,
    .customer-form-section,
    .contract-subsection,
    .contract-version-card
) :is(p, small, dd) {
    color: var(--v16-muted) !important;
}

@media (max-width: 1280px) {
    .has-app-sidebar .app-shell {
        grid-template-columns: 264px minmax(0, 1fr);
    }

    .has-app-sidebar .app-sidebar {
        width: 264px;
    }

    .dashboard-kpi-grid,
    .dashboard-category-grid,
    .has-app-sidebar .dashboard-workspace-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .has-app-sidebar .app-shell {
        display: block;
    }

    .has-app-sidebar .app-sidebar {
        width: min(21rem, calc(100vw - 3rem));
    }

    .has-app-sidebar :is(.shell, .shell-spacious) {
        padding-right: 24px;
        padding-left: 24px;
    }
}

@media (max-width: 760px) {
    .app-top-context-cluster {
        flex: 1;
    }

    .app-top-context-cluster .app-top-context {
        flex: 1;
    }

    .has-app-sidebar :is(.shell, .shell-spacious) {
        width: 100%;
        padding-right: 12px;
        padding-left: 12px;
    }

    .has-app-sidebar .dashboard-shell {
        gap: 16px;
        padding-top: 24px !important;
        padding-bottom: 56px !important;
    }

    .dashboard-kpi-grid,
    .dashboard-category-grid,
    .has-app-sidebar .dashboard-workspace-module-grid,
    .has-app-sidebar .dashboard-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-selected-workspace-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .has-app-sidebar .dashboard-workspace-module-grid > .module-card {
        border-right: 0 !important;
    }
}

/* 2.1.0 v16 completion: interactive KPIs, sealed Realizacje rows, auth, and portal. */
.dashboard-kpi-link {
    cursor: pointer;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-kpi-link:hover,
.dashboard-kpi-link:focus-visible {
    z-index: 1;
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--dashboard-kpi-accent) 74%, var(--v16-border));
    outline: none;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dashboard-kpi-accent) 42%, transparent), var(--v16-shadow);
}

.dashboard-kpi::before {
    pointer-events: none;
}

/* A grid row can end before column four; paint the row itself so no white legacy gap is exposed. */
.has-app-sidebar .realization-page .realization-data-table tbody tr {
    background: var(--v16-surface) !important;
}

/* v16 authentication stage shared by employee CMS and the customer portal. */
:is(.auth-body, .portal-body) .auth-v16-brand-panel {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 3.25rem);
    isolation: isolate;
    border-color: color-mix(in srgb, var(--brand-purple) 45%, var(--v16-border)) !important;
    background:
        radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--brand-pink) 24%, transparent), transparent 34%),
        radial-gradient(circle at 88% 86%, color-mix(in srgb, var(--brand-mint) 20%, transparent), transparent 38%),
        linear-gradient(145deg, color-mix(in srgb, var(--brand-purple) 11%, var(--v16-surface)), var(--v16-surface)) !important;
    color: var(--v16-text) !important;
}

:is(.auth-body, .portal-body) .auth-v16-brand-panel::before {
    position: absolute;
    z-index: -1;
    top: 24%;
    right: -8rem;
    width: 22rem;
    height: 22rem;
    border: 1px solid color-mix(in srgb, var(--brand-purple) 34%, transparent);
    border-radius: 50%;
    box-shadow:
        0 0 0 3rem color-mix(in srgb, var(--brand-pink) 5%, transparent),
        0 0 0 6rem color-mix(in srgb, var(--brand-mint) 4%, transparent);
    content: "";
}

.auth-v16-brand-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--v16-text-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

:is(.auth-body, .portal-body) .auth-v16-brand-logo {
    width: clamp(8.5rem, 15vw, 11.5rem);
    max-height: 5.25rem;
    object-fit: contain;
    padding: 0.75rem 1rem;
    border: 1px solid color-mix(in srgb, var(--brand-mint) 34%, var(--v16-border));
    border-radius: 14px;
    background: #08090c;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.auth-v16-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 29rem;
    padding: clamp(3rem, 9vh, 7rem) 0 2rem;
}

.auth-v16-brand-copy h1 {
    max-width: 10ch;
    margin: 0.75rem 0 1rem;
    color: var(--v16-text) !important;
    font-size: clamp(2.35rem, 5vw, 4.6rem);
    line-height: 0.96;
    letter-spacing: -0.055em;
}

.auth-v16-brand-copy p {
    max-width: 34rem;
    margin: 0;
    color: var(--v16-muted) !important;
    font-size: clamp(0.96rem, 1.5vw, 1.08rem);
    line-height: 1.65;
}

.auth-v16-brand-spectrum {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    height: 0.45rem;
}

.auth-v16-brand-spectrum span {
    border-radius: 999px;
    background: var(--brand-pink);
}

.auth-v16-brand-spectrum span:nth-child(2) { background: var(--brand-yellow); }
.auth-v16-brand-spectrum span:nth-child(3) { background: var(--brand-mint); }
.auth-v16-brand-spectrum span:nth-child(4) { background: var(--brand-purple); }

:is(.auth-body, .portal-body) .auth-card-form {
    position: relative;
    border-top: 4px solid var(--brand-pink) !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--brand-pink) 8%, transparent), transparent 36%),
        var(--v16-surface) !important;
}

:is(.auth-body, .portal-body) .auth-card-form :is(h1, h2, h3, label, strong) {
    color: var(--v16-text) !important;
}

:is(.auth-body, .portal-body) .auth-card-form :is(p, small, .form-help, .auth-help, .auth-footer) {
    color: var(--v16-muted) !important;
}

:is(.auth-body, .portal-body) .auth-login-controls {
    border: 1px solid var(--v16-border);
    background: color-mix(in srgb, var(--v16-surface) 94%, transparent);
    box-shadow: var(--v16-shadow);
}

/* Password setup/reset pages use the same two-panel v16 composition. */
:is(.auth-body, .portal-body) .portal-reset-card {
    overflow: hidden;
    border: 1px solid var(--v16-border) !important;
    border-radius: 20px;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
    box-shadow: var(--v16-shadow);
}

:is(.auth-body, .portal-body) .portal-reset-visual {
    position: relative;
    border-color: color-mix(in srgb, var(--brand-purple) 42%, var(--v16-border)) !important;
    background:
        radial-gradient(circle at 16% 12%, color-mix(in srgb, var(--brand-pink) 23%, transparent), transparent 31%),
        radial-gradient(circle at 88% 88%, color-mix(in srgb, var(--brand-mint) 21%, transparent), transparent 34%),
        linear-gradient(145deg, color-mix(in srgb, var(--brand-purple) 10%, var(--v16-surface)), var(--v16-surface)) !important;
    color: var(--v16-text) !important;
}

:is(.auth-body, .portal-body) .portal-reset-visual::after {
    right: 1.5rem;
    bottom: 1.5rem;
    left: 1.5rem;
    width: auto;
    height: 0.45rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-pink) 0 25%, var(--brand-yellow) 25% 50%, var(--brand-mint) 50% 75%, var(--brand-purple) 75%);
    box-shadow: none;
}

:is(.auth-body, .portal-body) .portal-reset-visual :is(h1, h2, h3, strong, span) {
    color: var(--v16-text) !important;
}

:is(.auth-body, .portal-body) .portal-reset-visual p {
    color: var(--v16-muted) !important;
}

:is(.auth-body, .portal-body) .portal-reset-panel {
    border-color: var(--v16-border) !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--brand-purple) 7%, transparent), transparent 34%),
        var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

:is(.auth-body, .portal-body) .portal-reset-panel :is(h1, h2, h3, label, strong) {
    color: var(--v16-text) !important;
}

:is(.auth-body, .portal-body) .portal-reset-panel :is(p, small, .portal-reset-back) {
    color: var(--v16-muted) !important;
}

/* Customer portal v16: a spectrum hero and intentionally alternating module accents. */
.portal-body .portal-overview-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--brand-mint) 48%, var(--v16-border)) !important;
    border-top: 4px solid var(--brand-mint) !important;
    background:
        radial-gradient(circle at 10% 0, color-mix(in srgb, var(--brand-mint) 18%, transparent), transparent 34%),
        radial-gradient(circle at 88% 10%, color-mix(in srgb, var(--brand-pink) 17%, transparent), transparent 31%),
        radial-gradient(circle at 72% 100%, color-mix(in srgb, var(--brand-purple) 13%, transparent), transparent 34%),
        var(--v16-surface) !important;
    color: var(--v16-text) !important;
    box-shadow: var(--v16-shadow);
}

.portal-body .portal-overview-hero::after {
    position: absolute;
    right: clamp(1rem, 3vw, 2rem);
    bottom: 0;
    width: min(26rem, 46%);
    height: 0.35rem;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--brand-pink), var(--brand-yellow), var(--brand-mint), var(--brand-purple));
    content: "";
    pointer-events: none;
}

.portal-body .portal-overview-summary > div {
    --portal-accent: var(--brand-pink);
    border: 1px solid color-mix(in srgb, var(--portal-accent) 38%, var(--v16-border)) !important;
    border-top: 3px solid var(--portal-accent) !important;
    background: color-mix(in srgb, var(--portal-accent) 6%, var(--v16-surface)) !important;
}

.portal-body .portal-overview-summary > div:nth-child(2) { --portal-accent: var(--brand-yellow); }
.portal-body .portal-overview-summary > div:nth-child(3) { --portal-accent: var(--brand-mint); }
.portal-body .portal-overview-summary > div:nth-child(4) { --portal-accent: var(--brand-purple); }

.portal-body .portal-overview-summary > div strong {
    color: var(--v16-text) !important;
}

.portal-body .portal-overview-summary > div span {
    color: var(--v16-muted) !important;
}

.portal-body .portal-overview-grid > .portal-overview-card {
    --portal-accent: var(--brand-mint);
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--portal-accent) 46%, var(--v16-border)) !important;
    border-top: 4px solid var(--portal-accent) !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--portal-accent) 18%, transparent), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--portal-accent) 4%, var(--v16-surface)), var(--v16-surface)) !important;
    color: var(--v16-text) !important;
    box-shadow: var(--v16-shadow);
}

.portal-body .portal-overview-grid > .portal-overview-card:nth-child(4n + 1) { --portal-accent: var(--brand-mint); }
.portal-body .portal-overview-grid > .portal-overview-card:nth-child(4n + 2) { --portal-accent: var(--brand-pink); }
.portal-body .portal-overview-grid > .portal-overview-card:nth-child(4n + 3) { --portal-accent: var(--brand-yellow); }
.portal-body .portal-overview-grid > .portal-overview-card:nth-child(4n) { --portal-accent: var(--brand-purple); }

.portal-body .portal-overview-icon {
    border: 1px solid color-mix(in srgb, var(--portal-accent) 52%, var(--v16-border));
    background: color-mix(in srgb, var(--portal-accent) 14%, var(--v16-surface-raised)) !important;
    color: color-mix(in srgb, var(--portal-accent) 72%, var(--v16-text)) !important;
}

.portal-body .portal-overview-card :is(h2, h3, strong) {
    color: var(--v16-text) !important;
}

.portal-body .portal-overview-card :is(p, li, small, .portal-item-list span) {
    color: var(--v16-muted) !important;
}

.portal-body .portal-overview-link {
    color: color-mix(in srgb, var(--portal-accent) 72%, var(--v16-text)) !important;
}

.portal-body .portal-overview-link:hover,
.portal-body .portal-overview-link:focus-visible {
    color: var(--v16-text) !important;
}

/* Carry the portal accent rhythm onto detail workspaces without changing their structure. */
.portal-body main.portal-shell > .content-card {
    --portal-accent: var(--brand-mint);
    border-color: color-mix(in srgb, var(--portal-accent) 36%, var(--v16-border)) !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--portal-accent) 8%, transparent), transparent 34%),
        var(--v16-surface) !important;
    box-shadow: inset 0 3px 0 var(--portal-accent), var(--v16-shadow);
}

.portal-body main.portal-shell > .content-card:nth-child(4n + 2) { --portal-accent: var(--brand-pink); }
.portal-body main.portal-shell > .content-card:nth-child(4n + 3) { --portal-accent: var(--brand-yellow); }
.portal-body main.portal-shell > .content-card:nth-child(4n) { --portal-accent: var(--brand-purple); }

html[data-theme="light"] :is(.auth-body, .portal-body) :is(.auth-v16-brand-panel, .portal-reset-visual) {
    border-color: color-mix(in srgb, var(--brand-purple) 32%, var(--v16-border)) !important;
    background:
        radial-gradient(circle at 12% 12%, rgba(217, 75, 143, 0.13), transparent 34%),
        radial-gradient(circle at 88% 86%, rgba(57, 170, 164, 0.12), transparent 38%),
        linear-gradient(145deg, #ffffff, #f3f5fa) !important;
    color: var(--v16-text) !important;
}

html[data-theme="light"] .portal-body :is(.portal-overview-hero, .portal-overview-card, main.portal-shell > .content-card) {
    color: var(--v16-text) !important;
}

:is(.auth-body, .portal-body) .portal-reset-lock-mark {
    color: color-mix(in srgb, var(--brand-purple) 68%, var(--v16-text));
}

:is(.auth-body, .portal-body) .portal-reset-lock-mark svg {
    stroke: currentColor;
}

.auth-body > .language-switch {
    inset: 7.25rem auto auto clamp(1rem, 4.4vw, 4.25rem);
}

@media (max-width: 820px) {
    :is(.auth-body, .portal-body) .auth-v16-brand-panel {
        min-height: 22rem;
        padding: 1.5rem;
        border-radius: 18px 18px 0 0 !important;
    }

    :is(.auth-body, .portal-body) .auth-card-form {
        min-height: 0;
        border-radius: 0 0 18px 18px !important;
    }

    .auth-v16-brand-copy {
        padding: 2.5rem 0 1.5rem;
    }

    .auth-v16-brand-copy h1 {
        font-size: clamp(2.2rem, 12vw, 3.5rem);
    }
}

@media (max-width: 520px) {
    :is(.auth-body, .portal-body) .auth-v16-brand-panel {
        min-height: 18rem;
    }

    :is(.auth-body, .portal-body) .auth-v16-brand-logo {
        width: 8.25rem;
    }

    .auth-v16-brand-head > span {
        font-size: 0.64rem;
    }

    .portal-body .portal-overview-hero::after {
        width: calc(100% - 2rem);
    }

    :is(.auth-body, .portal-body) .auth-login-controls {
        justify-items: stretch;
    }

    :is(.auth-body, .portal-body) .auth-login-language-switch {
        position: static;
        justify-self: start;
        margin-bottom: 0.25rem;
    }
}

/* Authoritative v16 portal shell: the customer product shares the CMS app frame. */
.has-portal-sidebar .portal-app-shell {
    grid-template-columns: 320px minmax(0, 1fr);
}

.has-portal-sidebar .portal-app-sidebar {
    width: 320px;
}

.portal-app-sidebar .app-sidebar-brand {
    min-height: 92px;
    padding-block: 1.3rem;
}

.portal-app-sidebar .app-sidebar-brand img {
    width: 3.2rem;
    height: 3.2rem;
    flex-basis: 3.2rem;
}

.portal-app-sidebar .app-sidebar-brand strong {
    font-size: 1rem;
}

.portal-app-sidebar .app-sidebar-brand small {
    margin-top: 0.2rem;
    font-size: 0.75rem;
}

.portal-app-sidebar .app-sidebar-nav {
    padding: 0.65rem 1rem 1.35rem;
}

.portal-app-sidebar .app-sidebar-group {
    margin-top: 1.25rem;
}

.portal-app-sidebar .app-sidebar-group h2 {
    margin-bottom: 0.55rem;
    font-size: 0.72rem;
}

.portal-app-sidebar .app-sidebar-link {
    min-height: 3rem;
    margin-block: 0.18rem;
    padding: 0.7rem 0.8rem;
    border-radius: 11px;
    font-size: 0.9rem;
}

.portal-app-sidebar .app-sidebar-link-icon {
    width: 1.15rem;
    flex: 0 0 1.15rem;
    font-size: 1.05rem;
}

.portal-app-sidebar .app-sidebar-group-workspace {
    --sidebar-accent: var(--brand-pink);
}

.portal-app-sidebar .portal-sidebar-group-delivery {
    --sidebar-accent: var(--brand-mint);
}

.portal-app-sidebar .portal-sidebar-group-account {
    --sidebar-accent: var(--brand-purple);
}

.portal-sidebar-bottom {
    display: grid;
    gap: 0.5rem;
    border-top: 1px solid var(--v16-border);
}

.portal-sidebar-language {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    margin: 0.8rem 1rem 0;
    padding: 0.55rem;
    border: 1px solid var(--v16-border);
    border-radius: 11px;
    background: var(--v16-surface-raised) !important;
    box-shadow: none !important;
}

.portal-sidebar-language .language-label {
    color: var(--v16-muted) !important;
    font-size: 0.72rem;
}

.portal-sidebar-language .language-select {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

.portal-sidebar-bottom .app-sidebar-user {
    margin-top: 0;
    border-top: 0;
}

.has-portal-sidebar .portal-app-topbar {
    min-height: 84px;
    padding-inline: clamp(1rem, 2.5vw, 2.4rem);
}

.has-portal-sidebar .portal-app-topbar .app-top-context {
    font-size: 0.88rem;
}

.has-portal-sidebar .portal-top-actions {
    gap: 0.55rem;
}

.has-portal-sidebar .portal-shell {
    width: min(1500px, 100%);
    margin-inline: auto;
    padding: 42px 44px 80px;
}

.has-portal-sidebar .portal-overview-shell {
    display: block;
}

.has-portal-sidebar .portal-overview-hero {
    margin-bottom: 18px;
    padding: 30px;
    border-radius: 20px;
}

.has-portal-sidebar .portal-overview-hero h1 {
    font-size: clamp(2.25rem, 4vw, 3.4rem);
}

.has-portal-sidebar .portal-overview-hero p {
    font-size: 0.94rem;
    line-height: 1.65;
}

.has-portal-sidebar .portal-overview-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.has-portal-sidebar .portal-overview-summary > div {
    min-height: 126px;
    align-content: center;
    padding: 20px;
    border-radius: 17px;
}

.has-portal-sidebar .portal-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.has-portal-sidebar .portal-overview-card,
.has-portal-sidebar .portal-overview-card-wide {
    grid-column: auto;
    min-height: 270px;
    padding: 22px;
    border-radius: 17px;
}

.has-portal-sidebar .portal-overview-card::before {
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 0;
    width: 4px;
    border-radius: 0 5px 5px 0;
    background: var(--portal-accent);
    content: "";
    pointer-events: none;
}

.has-portal-sidebar .portal-overview-card-head h2 {
    font-size: 1.25rem;
}

.has-portal-sidebar .portal-overview-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--portal-accent) 64%, var(--v16-border)) !important;
}

.portal-auth-theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 80;
}

@media (max-width: 1320px) {
    .has-portal-sidebar .portal-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .has-portal-sidebar .portal-app-shell {
        display: block;
    }

    .has-portal-sidebar .portal-app-sidebar {
        width: min(320px, calc(100vw - 3rem));
    }

    .has-portal-sidebar .portal-shell {
        padding-inline: 24px;
    }
}

@media (max-width: 760px) {
    .has-portal-sidebar .portal-app-topbar {
        min-height: 68px;
        padding-inline: 14px;
    }

    .has-portal-sidebar .portal-company-badge {
        display: none;
    }

    .has-portal-sidebar .portal-shell {
        width: 100%;
        padding: 22px 14px 48px;
    }

    .has-portal-sidebar .portal-overview-summary,
    .has-portal-sidebar .portal-overview-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .has-portal-sidebar .portal-overview-summary > div {
        min-height: 106px;
    }

    .has-portal-sidebar .portal-overview-card {
        min-height: 240px;
    }
}

/* Authoritative v16 authentication stage. */
:is(.auth-body, .portal-auth-body) {
    min-height: 100vh;
    min-height: 100svh;
    background: var(--v16-canvas) !important;
}

:is(.auth-body, .portal-auth-body) > .background-glow {
    display: none;
}

:is(.auth-body, .portal-auth-body) .site-header-row {
    position: fixed;
    z-index: 80;
    inset: 1.25rem 1.25rem auto auto;
    display: block;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
}

:is(.auth-body, .portal-auth-body) .site-header-row :is(.site-header-spacer, .site-brand-mark) {
    display: none;
}

:is(.auth-body, .portal-auth-body) .site-header-actions {
    position: static;
    display: flex;
}

:is(.auth-body, .portal-auth-body) .theme-toggle::before,
:is(.auth-body, .portal-auth-body) .theme-toggle::after {
    display: none;
}

:is(.auth-body, .portal-auth-body) .auth-login-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(540px, 1.1fr);
    grid-template-rows: minmax(100vh, auto);
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 0;
    gap: 0;
    align-items: stretch;
}

:is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-v16-brand-panel {
    grid-column: 1;
    grid-row: 1;
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(2rem, 4vw, 3.5rem);
    border: 0 !important;
    border-right: 1px solid var(--v16-border) !important;
    border-radius: 0 !important;
    background:
        radial-gradient(circle at 100% 0, rgba(217, 75, 143, 0.11), transparent 34%),
        #07090d !important;
    box-shadow: none;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-head {
    align-items: center;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-logo {
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 3.25rem;
    padding: 0.3rem;
    border-radius: 13px;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-head > span {
    color: #f2f4f7;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-copy {
    max-width: 35rem;
    padding: 2rem 0;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-copy .eyebrow {
    color: #b6bac3 !important;
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: none;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-copy .eyebrow span {
    color: var(--brand-mint);
    text-shadow: 0 0 12px color-mix(in srgb, var(--brand-mint) 70%, transparent);
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-copy h1 {
    max-width: 11ch;
    margin: 1.35rem 0 1.15rem;
    color: #f7f8fa !important;
    font-size: clamp(3.2rem, 4.8vw, 4.7rem);
    line-height: 0.93;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-copy p {
    max-width: 37rem;
    color: #a8adb8 !important;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-spectrum {
    grid-template-columns: repeat(4, 2.65rem);
    height: 0.32rem;
}

:is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-card-form {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: center;
    width: min(560px, calc(100% - 3rem));
    min-height: 0;
    padding: clamp(2rem, 4vw, 2.65rem);
    border: 1px solid var(--v16-border) !important;
    border-top: 3px solid transparent !important;
    border-radius: 24px !important;
    background:
        linear-gradient(var(--v16-surface), var(--v16-surface)) padding-box,
        linear-gradient(90deg, var(--brand-pink), var(--brand-yellow), var(--brand-mint), var(--brand-purple)) border-box !important;
    box-shadow: 0 28px 75px rgba(0, 0, 0, 0.34);
}

:is(.auth-body, .portal-auth-body) .auth-login-form-card > .auth-login-switcher {
    width: 100%;
    margin-bottom: 1.9rem;
    border-radius: 13px;
    background: color-mix(in srgb, var(--v16-canvas) 82%, transparent);
    box-shadow: none;
}

:is(.auth-body, .portal-auth-body) .auth-login-switcher-option {
    border-radius: 10px;
    color: var(--v16-muted);
}

:is(.auth-body, .portal-auth-body) .auth-login-switcher-option.is-active {
    color: var(--v16-text);
    background: var(--v16-surface-raised);
    box-shadow: inset 0 -2px 0 var(--brand-pink);
    transform: none;
}

:is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-login-controls {
    position: fixed;
    z-index: 81;
    inset: 1.25rem 6.25rem auto auto;
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

:is(.auth-body, .portal-auth-body) .auth-login-language-switch {
    position: static;
    padding: 0.25rem 0.35rem;
    border: 1px solid var(--v16-border);
    border-radius: 12px;
    background: var(--v16-surface);
}

:is(.auth-body, .portal-auth-body) .auth-login-language-switch .language-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

:is(.auth-body, .portal-auth-body) .auth-login-language-switch .language-select {
    min-width: 7.25rem;
    border: 0 !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

:is(.auth-body, .portal-auth-body) > :is(.language-switch, .portal-auth-language-switch) {
    position: fixed;
    z-index: 81;
    inset: 1.25rem 6.25rem auto auto;
    width: auto;
    padding: 0.25rem 0.35rem;
    border: 1px solid var(--v16-border);
    border-radius: 12px;
    background: var(--v16-surface);
    box-shadow: none;
}

:is(.auth-body, .portal-auth-body) > :is(.language-switch, .portal-auth-language-switch) .language-select {
    min-width: 7.25rem;
    border: 0 !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

.portal-overview-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 14px;
}

.portal-overview-section-head h2 {
    margin: 0;
    color: var(--v16-text);
    font-size: 1rem;
}

.portal-overview-section-head span {
    color: var(--v16-muted);
    font-size: 0.82rem;
}

:is(.auth-body, .portal-auth-body) .portal-reset-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 0;
}

:is(.auth-body, .portal-auth-body) .portal-reset-card {
    grid-template-columns: minmax(360px, 0.9fr) minmax(540px, 1.1fr);
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
}

:is(.auth-body, .portal-auth-body) .portal-reset-visual {
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(2rem, 4vw, 3.5rem);
    border: 0 !important;
    border-right: 1px solid var(--v16-border) !important;
    border-radius: 0;
    background:
        radial-gradient(circle at 100% 0, rgba(217, 75, 143, 0.11), transparent 34%),
        #07090d !important;
}

:is(.auth-body, .portal-auth-body) .portal-reset-panel {
    width: min(560px, calc(100% - 3rem));
    min-height: 0;
    margin: auto;
    padding: clamp(2rem, 4vw, 2.65rem);
    border: 1px solid var(--v16-border) !important;
    border-top: 3px solid var(--brand-purple) !important;
    border-radius: 24px;
    box-shadow: var(--v16-shadow);
}

:is(.auth-body, .portal-auth-body) .portal-reset-back {
    position: static;
    align-self: flex-start;
    margin-bottom: 1.35rem;
}

:is(.auth-body, .portal-auth-body) .portal-reset-heading h1 {
    font-size: clamp(2.3rem, 4vw, 3.15rem);
}

@media (max-width: 1100px) {
    :is(.auth-body, .portal-auth-body) .auth-login-layout,
    :is(.auth-body, .portal-auth-body) .portal-reset-card {
        grid-template-columns: minmax(0, 1fr);
    }

    :is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-v16-brand-panel,
    :is(.auth-body, .portal-auth-body) .portal-reset-visual {
        display: none;
    }

    :is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-card-form {
        grid-column: 1;
    }
}

@media (max-width: 600px) {
    :is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-card-form,
    :is(.auth-body, .portal-auth-body) .portal-reset-panel {
        width: min(100% - 1.25rem, 560px);
        padding: 1.35rem;
        border-radius: 18px !important;
    }

    :is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-login-controls {
        top: 0.65rem;
        right: 4.4rem;
    }


    :is(.auth-body, .portal-auth-body) > :is(.language-switch, .portal-auth-language-switch) {
        top: 0.65rem;
        right: 4.4rem;
    }

    :is(.auth-body, .portal-auth-body) .site-header-row {
        top: 0.65rem;
        right: 0.65rem;
    }

    :is(.auth-body, .portal-auth-body) .auth-login-language-switch .language-select {
        min-width: 5.8rem;
    }

    .portal-overview-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Keep the official logo visually dominant after the final v16 auth overrides. */
:is(.auth-body, .portal-auth-body) .auth-v16-brand-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-logo {
    width: clamp(13rem, 18vw, 19rem);
    height: auto;
    max-height: none;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.28));
}

@media (max-width: 600px) {
    :is(.auth-body, .portal-auth-body) .auth-login-layout > .auth-card-form {
        padding-top: 5.25rem;
    }
}

/* 2.1.0 final cross-application contrast and interaction boundary. */
html[data-theme="light"] {
    --brand-pink: #c00069;
    --v16-canvas: #e1e7ec;
    --v16-sidebar: #eef2f5;
    --v16-surface: #f7f9fa;
    --v16-surface-raised: #e9eef2;
    --v16-surface-soft: #e4e9ee;
    --v16-border: #c5ced7;
    --v16-border-strong: #aebac6;
    --v16-text: #111820;
    --v16-text-soft: #2d3945;
    --v16-muted: #536171;
}

/* Shared record rows must never retain the old white-only workspace gradient. */
:is(.has-app-sidebar, .portal-body) main :is(.content-card.stack-lg, .content-card.stack-md) > article:not([class]) {
    border-color: var(--v16-border) !important;
    border-left-color: color-mix(in srgb, var(--brand-purple) 58%, var(--v16-border)) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
    box-shadow: none;
}

:is(.has-app-sidebar, .portal-body) main :is(.content-card.stack-lg, .content-card.stack-md) > article:not([class]) :is(strong, a) {
    color: var(--v16-text) !important;
}

:is(.has-app-sidebar, .portal-body) main :is(.content-card.stack-lg, .content-card.stack-md) > article:not([class]) :is(p, small) {
    color: var(--v16-muted) !important;
}

/* Audit stream descendants had separate light-only fills beneath the parent card. */
.has-app-sidebar :is(
    .audit-event-head,
    .audit-event-facts > div,
    .audit-event-details,
    .audit-event-details .audit-log-details > summary,
    .audit-filter-disclosure[open] > summary
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

.has-app-sidebar :is(.audit-event-head, .audit-event-facts, .audit-event-details) :is(strong, summary) {
    color: var(--v16-text) !important;
}

.has-app-sidebar :is(.audit-event-head, .audit-event-facts, .audit-event-details) :is(span, small, time) {
    color: var(--v16-muted) !important;
}

.has-app-sidebar :is(.audit-result-count, .audit-pagination) {
    color: var(--v16-muted) !important;
}

/* Settings section shortcuts use the same readable cards in both themes. */
.has-app-sidebar .settings-section-nav a {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

.has-app-sidebar .settings-section-nav a > small {
    color: var(--v16-muted) !important;
}

.has-app-sidebar .settings-section-nav a > strong {
    background: color-mix(in srgb, var(--brand-pink) 18%, var(--v16-surface)) !important;
    color: var(--v16-text) !important;
}

.has-app-sidebar .access-control-nav a {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

.has-app-sidebar .access-control-nav a > span {
    color: var(--v16-text) !important;
}

.has-app-sidebar .access-control-nav a > strong {
    background: color-mix(in srgb, var(--brand-pink) 18%, var(--v16-surface)) !important;
    color: var(--v16-text) !important;
}

html[data-theme="dark"] .status-pill-accent {
    border-color: color-mix(in srgb, var(--brand-purple) 52%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-purple) 28%, var(--v16-surface-raised)) !important;
    color: #e8dcff !important;
}

html[data-theme="light"] .status-pill-accent {
    border-color: color-mix(in srgb, var(--brand-purple) 42%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-purple) 14%, var(--v16-surface-raised)) !important;
    color: #402461 !important;
}

/* Semantic pills use theme-native surfaces instead of retaining pale legacy fills. */
html[data-theme="dark"] :is(.status-pill-success, .status-pill-warning, .status-pill-danger, .status-pill-info, .status-pill-neutral, .status-pill-muted) {
    border-color: var(--v16-border-strong) !important;
    background: var(--v16-surface-raised) !important;
}

html[data-theme="dark"] .status-pill-success {
    color: #9ce5c6 !important;
    background: color-mix(in srgb, #39c998 16%, var(--v16-surface-raised)) !important;
}

html[data-theme="dark"] .status-pill-warning {
    color: #ffd28c !important;
    background: color-mix(in srgb, #f2a33a 17%, var(--v16-surface-raised)) !important;
}

html[data-theme="dark"] .status-pill-danger {
    color: #ffb7c6 !important;
    background: color-mix(in srgb, #e03562 17%, var(--v16-surface-raised)) !important;
}

html[data-theme="dark"] .status-pill-info {
    color: #a9d3ff !important;
    background: color-mix(in srgb, #428bf0 17%, var(--v16-surface-raised)) !important;
}

html[data-theme="dark"] :is(.status-pill-neutral, .status-pill-muted) {
    color: var(--v16-text-soft) !important;
    background: color-mix(in srgb, var(--v16-muted) 12%, var(--v16-surface-raised)) !important;
}

html[data-theme="light"] .status-pill-danger {
    color: #731027 !important;
}

/* Realization dates, empty values, and chat avatars must follow the active canvas. */
html[data-theme="dark"] .realization-date-badge {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text-soft) !important;
}

html[data-theme="dark"] .realization-date-badge-due {
    border-color: color-mix(in srgb, #f2a33a 42%, var(--v16-border)) !important;
    background: color-mix(in srgb, #f2a33a 12%, var(--v16-surface-raised)) !important;
    color: #ffd28c !important;
}

html[data-theme="dark"] .realization-date-badge-complete {
    border-color: color-mix(in srgb, #39c998 42%, var(--v16-border)) !important;
    background: color-mix(in srgb, #39c998 12%, var(--v16-surface-raised)) !important;
    color: #9ce5c6 !important;
}

html[data-theme="dark"] .realization-empty-value {
    color: var(--v16-muted) !important;
}

html[data-theme="dark"] .chat-thread-avatar {
    color: #e8dcff !important;
}

html[data-theme="dark"] .chat-thread-avatar-announcement {
    color: #ffe58a !important;
}

html[data-theme="dark"] .chat-thread-avatar-room {
    color: #8ce6dc !important;
}

.app-sidebar:not(.portal-app-sidebar) .app-sidebar-brand {
    align-items: center;
    flex-direction: column;
    gap: 0.7rem;
    padding-block: 1.25rem;
    text-align: center;
}

.app-sidebar:not(.portal-app-sidebar) .app-sidebar-brand img {
    width: min(10.5rem, 90%);
    height: auto;
    flex: none;
}

.app-sidebar-system-name {
    display: block !important;
    max-width: 14rem;
    color: var(--v16-text-soft) !important;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    line-height: 1.45;
    text-align: center;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-head {
    width: min(100%, 26rem);
    align-items: center;
    text-align: center;
}

:is(.auth-body, .portal-auth-body) .auth-v16-brand-head > span,
:is(.auth-body, .portal-auth-body) .auth-mobile-brand > span {
    width: 100%;
    color: var(--v16-text-soft) !important;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    line-height: 1.45;
    text-align: center;
}

:is(.app-body, .portal-body) .business-metric-grid > article {
    --metric-accent: var(--brand-purple);
    border: 1px solid color-mix(in srgb, var(--metric-accent) 34%, var(--v16-border)) !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--metric-accent) 10%, transparent), transparent 46%),
        var(--v16-surface) !important;
    color: var(--v16-text) !important;
    box-shadow: var(--v16-shadow);
}

:is(.app-body, .portal-body) .business-metric-grid > article:nth-child(3n + 2) { --metric-accent: var(--brand-mint); }
:is(.app-body, .portal-body) .business-metric-grid > article:nth-child(3n + 3) { --metric-accent: var(--brand-pink); }
:is(.app-body, .portal-body) .business-metric-grid > article :is(strong, b) { color: var(--v16-text) !important; }
:is(.app-body, .portal-body) .business-metric-grid > article :is(span, small, p) { color: var(--v16-muted) !important; }

:is(.app-body, .portal-body) .business-metric-grid.sales-analytics-grid > article {
    border-color: var(--v16-border) !important;
    box-shadow:
        inset 0 3px 0 color-mix(in srgb, var(--metric-accent) 82%, transparent),
        var(--v16-shadow);
}

[data-dashboard-category-panel][hidden] {
    display: none !important;
}

.strategy-rich-text-editor {
    display: grid;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--v16-border);
    border-radius: 13px;
    background: var(--v16-surface-soft);
}

.strategy-rich-text-toolbar {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.65rem;
    border-bottom: 1px solid var(--v16-border);
    background: var(--v16-surface-raised);
}

.strategy-rich-text-button,
.strategy-rich-text-colour {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--v16-border-strong);
    border-radius: 9px;
    background: var(--v16-surface);
    color: var(--v16-text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 750;
}

.strategy-rich-text-button {
    min-width: 2.35rem;
    cursor: pointer;
}

.strategy-rich-text-button:nth-child(2) { text-decoration: underline; }

.strategy-rich-text-button:is(:hover, :focus-visible),
.strategy-rich-text-colour:focus-within {
    border-color: var(--brand-mint);
    outline: none;
}

.strategy-rich-text-colour input {
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
}

.strategy-rich-text-surface {
    min-height: 17rem;
    padding: 1rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
    line-height: 1.65;
    white-space: pre-wrap;
}

.strategy-rich-text-surface:focus {
    outline: 2px solid color-mix(in srgb, var(--brand-mint) 72%, transparent);
    outline-offset: -2px;
}

.strategy-rich-text-output {
    color: var(--v16-text);
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.strategy-rich-text-output :is(p, div) {
    margin: 0 0 0.85rem;
    color: inherit;
}

@media (max-width: 600px) {
    .strategy-rich-text-colour {
        flex: 1 1 9rem;
    }

    .strategy-rich-text-surface {
        min-height: 13rem;
    }
}

/* Access Control and chat used legacy light-only sub-surfaces inside dark cards. */
:is(.has-app-sidebar, .portal-body) :is(.access-account-card, .access-group-card) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface) !important;
    color: var(--v16-text) !important;
}

:is(.has-app-sidebar, .portal-body) :is(
    .access-account-facts > div,
    .access-group-metrics > div,
    .access-card-footer,
    .access-card-details[open] > summary
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

:is(.has-app-sidebar, .portal-body) :is(
    .access-account-facts,
    .access-group-metrics,
    .access-card-details,
    .access-card-footer
) :is(h1, h2, h3, h4, strong, summary) {
    color: var(--v16-text) !important;
}

:is(.has-app-sidebar, .portal-body) :is(
    .access-account-facts,
    .access-group-metrics,
    .access-card-details,
    .access-card-footer
) :is(span, small, p) {
    color: var(--v16-muted) !important;
}

.has-app-sidebar .chat-page :is(
    .chat-thread-card,
    .chat-message-card,
    .chat-pinned-item,
    .chat-rich-preview,
    .chat-room-manage-panel,
    .chat-compose-form
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

.has-app-sidebar .chat-page .chat-message-card.is-own,
.has-app-sidebar .chat-page .chat-thread-card.is-selected {
    border-color: color-mix(in srgb, var(--brand-purple) 48%, var(--v16-border)) !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand-purple) 13%, var(--v16-surface)), color-mix(in srgb, var(--brand-pink) 9%, var(--v16-surface))) !important;
}

.has-app-sidebar .chat-page :is(
    .chat-thread-copy,
    .chat-message-card,
    .chat-message-body,
    .chat-pinned-item,
    .chat-rich-preview,
    .chat-room-manage-panel
) :is(h1, h2, h3, h4, strong, b, .inline-link) {
    color: var(--v16-text) !important;
}

.has-app-sidebar .chat-page :is(
    .chat-thread-copy,
    .chat-message-card,
    .chat-message-body,
    .chat-pinned-item,
    .chat-rich-preview,
    .chat-room-manage-panel
) :is(span, small, p, time, .table-helper) {
    color: var(--v16-muted) !important;
}

.has-app-sidebar .chat-page .chat-message-body {
    color: var(--v16-text) !important;
}

.has-app-sidebar .access-control-shell :is(
    .access-list-toolbar,
    .access-manageable-filter,
    .access-visible-count
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

.has-app-sidebar .access-control-shell :is(.access-search-field, .access-visible-count strong) {
    color: var(--v16-text) !important;
}

/* Final semantic contrast boundary: these selectors intentionally follow all legacy modules. */
html[data-theme="light"] .app-top-context a {
    color: #176c65 !important;
}

:is(.has-app-sidebar, .portal-body) .access-power-sections > div {
    border: 1px solid var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
}

:is(.has-app-sidebar, .portal-body) .access-power-sections > div > strong,
:is(.has-app-sidebar, .portal-body) .access-rank-badge > span {
    color: var(--v16-text-soft) !important;
}

:is(.has-app-sidebar, .portal-body) .realization-empty-value {
    color: var(--v16-muted) !important;
    opacity: 1;
}

html[data-theme="dark"] .realization-copy-badge {
    border-color: color-mix(in srgb, var(--brand-mint) 45%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-mint) 14%, var(--v16-surface-raised)) !important;
    color: #9ce5dc !important;
}

html[data-theme="dark"] :is(.has-app-sidebar, .portal-body) .status-pill-success {
    color: #9ce5c6 !important;
    background: color-mix(in srgb, #39c998 16%, var(--v16-surface-raised)) !important;
}

html[data-theme="dark"] :is(.has-app-sidebar, .portal-body) .status-pill-warning {
    color: #ffd28c !important;
    background: color-mix(in srgb, #f2a33a 17%, var(--v16-surface-raised)) !important;
}

html[data-theme="dark"] :is(.has-app-sidebar, .portal-body) .status-pill-danger {
    color: #ffb7c6 !important;
    background: color-mix(in srgb, #e03562 17%, var(--v16-surface-raised)) !important;
}

html[data-theme="dark"] :is(.has-app-sidebar, .portal-body) .status-pill-info {
    color: #a9d3ff !important;
    background: color-mix(in srgb, #428bf0 17%, var(--v16-surface-raised)) !important;
}

html[data-theme="dark"] :is(.has-app-sidebar, .portal-body) :is(.status-pill-neutral, .status-pill-muted) {
    color: var(--v16-text-soft) !important;
    background: color-mix(in srgb, var(--v16-muted) 12%, var(--v16-surface-raised)) !important;
}

html[data-theme="light"] :is(.has-app-sidebar, .portal-body) .status-pill-danger {
    color: #731027 !important;
}

/* Chat copy rules are intentionally broad; semantic badges remain semantic inside them. */
html[data-theme="dark"] body.has-app-sidebar .chat-page .status-pill.status-pill-success { color: #9ce5c6 !important; }
html[data-theme="dark"] body.has-app-sidebar .chat-page .status-pill.status-pill-warning { color: #ffd28c !important; }
html[data-theme="dark"] body.has-app-sidebar .chat-page .status-pill.status-pill-danger { color: #ffb7c6 !important; }
html[data-theme="dark"] body.has-app-sidebar .chat-page .status-pill.status-pill-info { color: #a9d3ff !important; }
html[data-theme="dark"] body.has-app-sidebar .chat-page .status-pill:is(.status-pill-neutral, .status-pill-muted) { color: var(--v16-text-soft) !important; }
html[data-theme="light"] body.has-app-sidebar .chat-page .status-pill.status-pill-danger { color: #731027 !important; }

/* 2.1.0 QA follow-up: consistent controls, status surfaces, tooltips, and mobile session actions. */
.has-global-tooltips [data-tooltip]:not([data-tooltip=""])::before,
.has-global-tooltips [data-tooltip]:not([data-tooltip=""])::after {
    display: none !important;
}

.global-tooltip {
    position: fixed;
    z-index: 10000;
    width: max-content;
    max-width: min(22rem, calc(100vw - 1.25rem));
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 11px;
    background: #111318;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
    pointer-events: none;
}

.global-tooltip[hidden] {
    display: none !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"],
:is(.has-app-sidebar, .portal-body, .auth-body) input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    display: inline-grid;
    width: 1.15rem !important;
    height: 1.15rem !important;
    min-width: 1.15rem;
    min-height: 1.15rem;
    flex: 0 0 1.15rem;
    place-content: center;
    margin: 0;
    padding: 0 !important;
    border: 1px solid var(--v16-border-strong) !important;
    border-radius: 0.3rem;
    background: var(--v16-surface-soft) !important;
    color: #ffffff;
    cursor: pointer;
    box-shadow: inset 0 1px 2px color-mix(in srgb, #000000 9%, transparent);
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="radio"] {
    border-radius: 50%;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]::before,
:is(.has-app-sidebar, .portal-body, .auth-body) input[type="radio"]::before {
    width: 0.63rem;
    height: 0.63rem;
    background: currentColor;
    content: "";
    transform: scale(0);
    transition: transform 0.12s ease-in-out;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]::before {
    clip-path: polygon(14% 44%, 0 59%, 39% 100%, 100% 20%, 83% 5%, 38% 71%);
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="radio"]::before {
    border-radius: 50%;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]:checked,
:is(.has-app-sidebar, .portal-body, .auth-body) input[type="radio"]:checked {
    border-color: color-mix(in srgb, var(--brand-pink) 62%, var(--brand-purple)) !important;
    background: linear-gradient(135deg, var(--brand-pink), var(--brand-purple)) !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]:checked::before,
:is(.has-app-sidebar, .portal-body, .auth-body) input[type="radio"]:checked::before {
    transform: scale(1);
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]:focus-visible,
:is(.has-app-sidebar, .portal-body, .auth-body) input[type="radio"]:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand-mint) 48%, transparent);
    outline-offset: 2px;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]:disabled,
:is(.has-app-sidebar, .portal-body, .auth-body) input[type="radio"]:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

:is(.has-app-sidebar, .portal-body) :is(
    .checkbox-field,
    div.choice-checkbox label,
    .checkbox-row,
    .portal-consent-choice,
    .auth-verification-remember
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text-soft) !important;
    box-shadow: none !important;
}

:is(.has-app-sidebar, .portal-body) :is(.checkbox-field, div.choice-checkbox label):is(:hover, :focus-within) {
    border-color: color-mix(in srgb, var(--brand-mint) 55%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-mint) 7%, var(--v16-surface-raised)) !important;
}

.activation-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.activation-review-grid .checkbox-field {
    width: 100%;
    justify-content: flex-start;
}

.activation-review-grid .form-field-choice-group {
    grid-column: 1 / -1;
}

.activation-review-grid div.choice-checkbox {
    margin-top: 0.4rem;
}

.app-sidebar-bottom,
.portal-sidebar-bottom {
    min-width: 0;
    border-top: 1px solid var(--v16-border);
    background: var(--v16-sidebar);
}

.app-sidebar-bottom .app-sidebar-user,
.portal-sidebar-bottom .app-sidebar-user {
    padding-bottom: 0.6rem;
    border-top: 0;
}

.cooperation-summary-grid {
    display: grid;
    gap: 0.85rem;
}

.cooperation-summary-grid .summary-card {
    --summary-accent: var(--brand-pink);
    display: grid;
    align-content: space-between;
    gap: 0.65rem;
    min-height: 8.4rem;
    padding: 1.15rem;
    border: 1px solid color-mix(in srgb, var(--summary-accent) 38%, var(--v16-border));
    border-top: 4px solid var(--summary-accent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--summary-accent) 6%, var(--v16-surface));
    color: var(--v16-text);
    box-shadow: var(--v16-shadow);
}

.cooperation-summary-grid .summary-card:nth-child(2) { --summary-accent: var(--brand-mint); }
.cooperation-summary-grid .summary-card:nth-child(3) { --summary-accent: var(--brand-yellow); }
.cooperation-summary-grid .summary-card > span { color: var(--v16-muted); font-weight: 800; }
.cooperation-summary-grid .summary-card > strong { color: var(--v16-text); font-size: 2rem; }
.cooperation-summary-grid .summary-card > a { color: color-mix(in srgb, var(--summary-accent) 72%, var(--v16-text)); font-weight: 800; }

.cooperation-shell .filters-row {
    display: grid;
    grid-template-columns: minmax(15rem, 2fr) minmax(12rem, 1fr) auto;
    align-items: end;
    gap: 0.8rem;
}

.cooperation-shell .filters-row > label {
    display: grid;
    min-width: 0;
    gap: 0.35rem;
}

.cooperation-shell .filters-row > .button {
    min-height: 2.9rem;
    white-space: nowrap;
}

/* A realization's lifecycle fills both its cells and any unused final grid slot. */
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-accent,
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-accent > td {
    background: color-mix(in srgb, var(--brand-purple) 7%, var(--v16-surface)) !important;
}
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-info,
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-info > td {
    background: color-mix(in srgb, #428bf0 8%, var(--v16-surface)) !important;
}
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-warning,
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-warning > td {
    background: color-mix(in srgb, #f2a33a 9%, var(--v16-surface)) !important;
}
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-success,
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-success > td {
    background: color-mix(in srgb, #39c998 8%, var(--v16-surface)) !important;
}
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-danger,
.has-app-sidebar .realization-page .realization-data-table tbody tr.realization-work-row-danger > td {
    background: color-mix(in srgb, #e03562 8%, var(--v16-surface)) !important;
}

.has-app-sidebar .realization-page select.realization-inline-status-select:has(option[value="new"]:checked) {
    border-color: color-mix(in srgb, var(--brand-purple) 48%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-purple) 17%, var(--v16-surface-raised)) !important;
    color: color-mix(in srgb, var(--brand-purple) 75%, var(--v16-text)) !important;
    -webkit-text-fill-color: currentColor;
}
.has-app-sidebar .realization-page select.realization-inline-status-select:has(option[value="in_progress"]:checked) {
    border-color: color-mix(in srgb, #f2a33a 54%, var(--v16-border)) !important;
    background: color-mix(in srgb, #f2a33a 18%, var(--v16-surface-raised)) !important;
    color: color-mix(in srgb, #9a5c00 72%, var(--v16-text)) !important;
    -webkit-text-fill-color: currentColor;
}
.has-app-sidebar .realization-page select.realization-inline-status-select:has(option[value="waiting"]:checked) {
    border-color: color-mix(in srgb, #428bf0 52%, var(--v16-border)) !important;
    background: color-mix(in srgb, #428bf0 16%, var(--v16-surface-raised)) !important;
    color: color-mix(in srgb, #1769bf 72%, var(--v16-text)) !important;
    -webkit-text-fill-color: currentColor;
}
.has-app-sidebar .realization-page select.realization-inline-status-select:has(option[value="done"]:checked) {
    border-color: color-mix(in srgb, #39c998 54%, var(--v16-border)) !important;
    background: color-mix(in srgb, #39c998 17%, var(--v16-surface-raised)) !important;
    color: color-mix(in srgb, #087149 72%, var(--v16-text)) !important;
    -webkit-text-fill-color: currentColor;
}
.has-app-sidebar .realization-page select.realization-inline-status-select:has(option[value="blocked"]:checked) {
    border-color: color-mix(in srgb, #e03562 54%, var(--v16-border)) !important;
    background: color-mix(in srgb, #e03562 16%, var(--v16-surface-raised)) !important;
    color: color-mix(in srgb, #a20d37 74%, var(--v16-text)) !important;
    -webkit-text-fill-color: currentColor;
}

/* Dashboard subpanels use one theme surface instead of old text-sized pale patches. */
:is(.has-app-sidebar, .portal-body) :is(
    .dashboard-notification-summary-item,
    .dashboard-notification-item,
    .dashboard-notification-empty,
    .dashboard-calendar-day,
    .dashboard-calendar-grid,
    .calendar-grid,
    .calendar-day
) {
    border-color: var(--v16-border) !important;
    background-color: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
    box-shadow: none !important;
}

/* Reset forms keep the dark field on the field itself, not on a larger form rectangle. */
html[data-theme="dark"] :is(.auth-body, .portal-auth-body) .portal-reset-form {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

:is(.auth-body, .portal-auth-body) .portal-reset-card > .auth-v16-brand-panel {
    min-height: 100vh;
    min-height: 100svh;
    border: 0 !important;
    border-right: 1px solid var(--v16-border) !important;
    border-radius: 0 !important;
}

@media (max-width: 1100px) {
    :is(.auth-body, .portal-auth-body) .portal-reset-card > .auth-v16-brand-panel {
        display: none;
    }
}

@media (max-width: 760px) {
    .activation-review-grid,
    .cooperation-shell .filters-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .activation-review-grid .form-field-choice-group {
        grid-column: auto;
    }

    .app-sidebar-bottom,
    .portal-sidebar-bottom {
        position: sticky;
        bottom: 0;
        z-index: 2;
    }

}

@media (max-width: 600px) {
    :is(.auth-body, .portal-auth-body) > :is(.language-switch, .portal-auth-language-switch) {
        right: 4.75rem;
        max-width: calc(100vw - 5.7rem);
    }

    :is(.auth-body, .portal-auth-body) > :is(.language-switch, .portal-auth-language-switch) .language-select {
        min-width: 0;
        width: 5.6rem;
    }
}

html[data-theme="dark"] .has-app-sidebar .access-avatar {
    border-color: color-mix(in srgb, var(--brand-purple) 58%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-purple) 30%, var(--v16-surface-raised)) !important;
    color: #f4ecff !important;
}

html[data-theme="light"] .has-app-sidebar .access-avatar {
    color: #432064 !important;
}

html[data-theme="dark"] .has-app-sidebar .realization-mode-badge {
    border-color: color-mix(in srgb, var(--brand-mint) 52%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-mint) 17%, var(--v16-surface-raised)) !important;
    color: #a8eee7 !important;
}

html[data-theme="light"] .has-app-sidebar .realization-mode-badge {
    color: #0c625b !important;
}

/* 2.1.0 exhaustive form-surface boundary.
 * Keep this after legacy module rules: Django widgets, generated formsets and
 * native browser controls must all inherit the active v16 theme. */
html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

:is(.has-app-sidebar, .portal-body, .auth-body) form :is(
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]),
    select,
    textarea
) {
    border-color: var(--v16-border-strong) !important;
    background-color: var(--v16-surface-soft) !important;
    background-image: none;
    color: var(--v16-text) !important;
    -webkit-text-fill-color: var(--v16-text);
}

html[data-theme="light"] :is(.has-app-sidebar, .portal-body, .auth-body) form :is(
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]),
    select,
    textarea
) {
    background-color: color-mix(in srgb, var(--v16-surface-soft) 78%, var(--v16-border)) !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) form :is(input, select, textarea)::placeholder {
    color: var(--v16-muted) !important;
    opacity: 1;
    -webkit-text-fill-color: var(--v16-muted);
}

:is(.has-app-sidebar, .portal-body, .auth-body) form :is(input, select, textarea):disabled {
    color: var(--v16-muted) !important;
    -webkit-text-fill-color: var(--v16-muted);
    opacity: 0.72;
}

:is(.has-app-sidebar, .portal-body, .auth-body) form :is(select option, select optgroup) {
    background: var(--v16-surface-raised);
    color: var(--v16-text);
}

:is(.has-app-sidebar, .portal-body, .auth-body) form input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    border: 1px solid var(--v16-border-strong);
    border-radius: 9px;
    background: var(--v16-surface-raised);
    color: var(--v16-text);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

:is(.has-app-sidebar, .portal-body, .auth-body) form :is(
    label.checkbox-field,
    label.checkbox-row,
    label.portal-consent-choice,
    label.auth-verification-remember,
    label:has(> input[type="checkbox"]),
    label:has(> input[type="radio"]),
    div.choice-checkbox label,
    .private-file-clear-control
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text-soft) !important;
    box-shadow: none !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) form :is(
    label.checkbox-field,
    label.checkbox-row,
    label.portal-consent-choice,
    label.auth-verification-remember,
    label:has(> input[type="checkbox"]),
    label:has(> input[type="radio"]),
    div.choice-checkbox label
):is(:hover, :focus-within) {
    border-color: color-mix(in srgb, var(--brand-mint) 55%, var(--v16-border)) !important;
    background: color-mix(in srgb, var(--brand-mint) 7%, var(--v16-surface-raised)) !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) form :is(.errorlist, .form-errors, .field-error) {
    color: color-mix(in srgb, #ff6f91 82%, var(--v16-text)) !important;
}

.has-app-sidebar form :is(
    .permission-toolbar,
    .permission-category,
    .permission-category > summary,
    .permission-action-disclosure,
    .permission-action-disclosure > summary,
    .permission-action-item label,
    .permission-empty-state
) {
    border-color: var(--v16-border) !important;
    background: var(--v16-surface-raised) !important;
    color: var(--v16-text) !important;
    box-shadow: none !important;
}

.has-app-sidebar form :is(
    .permission-category-title,
    .permission-action-disclosure > summary,
    .permission-module-toggle-copy strong,
    .permission-action-item strong
) {
    color: var(--v16-text) !important;
}

.has-app-sidebar form :is(
    .permission-search-field > span,
    .permission-module-toggle-copy small,
    .permission-action-item small
) {
    color: var(--v16-muted) !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) form input:-webkit-autofill,
:is(.has-app-sidebar, .portal-body, .auth-body) form input:-webkit-autofill:hover,
:is(.has-app-sidebar, .portal-body, .auth-body) form input:-webkit-autofill:focus {
    border-color: var(--v16-border-strong) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--v16-surface-soft) inset !important;
    -webkit-text-fill-color: var(--v16-text) !important;
    caret-color: var(--v16-text);
}

@media (max-width: 430px) {
    :is(.has-app-sidebar, .portal-body, .auth-body) form :is(
        input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
        select,
        textarea,
        label.checkbox-field,
        label.checkbox-row,
        div.choice-checkbox label
    ) {
        min-width: 0;
        max-width: 100%;
    }
}

/* 2.1.5 portal onboarding document contrast boundary. */
.portal-body .portal-consent-document-content {
    background: #ffffff !important;
    color: #1c2430 !important;
    -webkit-text-fill-color: #1c2430;
    color-scheme: light;
}

/* 2.1.6 two-factor trusted-device control boundary. */
:is(.auth-body, .portal-auth-body) :is(
    .auth-verification-remember,
    .auth-verification-trust-note
) {
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* 2.2.1 application-wide theme-aware checkbox boundary. */
html[data-theme="dark"] :is(.has-app-sidebar, .portal-body, .auth-body) {
    --app-checkbox-surface: #15121d;
    --app-checkbox-hover: #211a2c;
}

html[data-theme="light"] :is(.has-app-sidebar, .portal-body, .auth-body) {
    --app-checkbox-surface: #e9e7ee;
    --app-checkbox-hover: #dfdbe8;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    border-color: var(--v16-border-strong) !important;
    background-color: var(--app-checkbox-surface) !important;
    background-image: none !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 0.72rem 0.72rem !important;
    color-scheme: inherit;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--brand-mint) 58%, var(--v16-border-strong)) !important;
    background-color: var(--app-checkbox-hover) !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]:checked,
:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]:checked:hover {
    border-color: color-mix(in srgb, var(--brand-pink) 62%, var(--brand-purple)) !important;
    background-color: var(--brand-purple) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m3 8 3 3 7-7'/%3E%3C/svg%3E") !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) :is(
    .form-field-error,
    .field-error
) input[type="checkbox"] {
    border-color: #e03562 !important;
}

:is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"]:disabled {
    background-color: color-mix(in srgb, var(--app-checkbox-surface) 70%, var(--v16-muted)) !important;
}

@media (forced-colors: active) {
    :is(.has-app-sidebar, .portal-body, .auth-body) input[type="checkbox"] {
        appearance: auto;
        -webkit-appearance: auto;
        border: initial !important;
        background: Canvas !important;
        color: CanvasText;
        forced-color-adjust: auto;
    }
}

/* 2.2.13 existing-contract intake layout and viewer boundary. */
.imported-contract-status-panel {
    padding: clamp(1rem, 2vw, 1.35rem);
    border: 1px solid var(--v16-border);
    border-radius: var(--v16-radius-lg);
    background: var(--v16-surface-soft);
}

.imported-contract-status-panel :is(h2, p) {
    margin: 0;
}

.imported-contract-status-form {
    padding-top: 1rem;
    border-top: 1px solid var(--v16-border);
}

.imported-contract-status-form .form-help {
    line-height: 1.5;
}

.contract-intake-shell .contract-preview-empty {
    display: grid;
    min-height: min(68vh, 44rem);
    place-items: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-color: var(--v16-border-strong);
    background: var(--v16-surface-soft);
    color: var(--v16-text);
}

.contract-intake-shell .contract-preview-empty p {
    max-width: 34rem;
    margin: 0;
    color: inherit;
    font-weight: 700;
    line-height: 1.6;
}

.contract-intake-form-grid {
    align-items: start;
    gap: 1rem 1.15rem;
}

.contract-intake-form-field {
    align-content: start;
    min-width: 0;
}

.contract-intake-form-field-long {
    grid-column: 1 / -1;
}

.contract-intake-form-field-long textarea {
    min-height: 7.5rem;
    resize: vertical;
}

.contract-intake-form-field[data-contract-field="services_and_prices"] textarea {
    min-height: 10rem;
}

.match-review {
    display: grid;
    min-width: 0;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--v16-border);
    border-radius: var(--v16-radius-lg);
    background: var(--v16-surface-soft);
}

.match-review h2,
.match-review p {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.match-review-results,
.match-review-candidates,
.match-review-form,
.match-review-actions {
    display: grid;
    min-width: 0;
    gap: 0.75rem;
}

.match-review-alert {
    min-width: 0;
    margin: 0;
}

.match-review-candidates {
    margin-top: 0.55rem;
    gap: 0.35rem;
}

.match-review-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    margin: 0;
    white-space: normal;
}

.match-review-choice input {
    margin-top: 0.18rem;
}

.match-review-choice span,
.match-review-actions small {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.match-review-actions {
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
}

.contract-import-table {
    min-width: 58rem;
    table-layout: fixed;
}

.contract-import-table th,
.contract-import-table td {
    padding: 1rem 1.15rem !important;
}

.contract-import-table th:nth-child(1) { width: 25%; }
.contract-import-table th:nth-child(2) { width: 19%; }
.contract-import-table th:nth-child(3) { width: 20%; }
.contract-import-table th:nth-child(4) { width: 18%; }
.contract-import-table th:nth-child(5) { width: 18%; }

.contract-import-table td {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.contract-import-table td:first-child {
    display: grid;
    align-content: center;
    gap: 0.35rem;
}

.contract-import-file {
    color: var(--v16-muted);
}

.contract-import-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.contract-import-actions .inline-form,
.contract-import-actions .button {
    margin: 0;
}

@media (max-width: 768px) {
    .contract-intake-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .contract-intake-form-field-long {
        grid-column: auto;
    }

    .match-review-actions {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .match-review-actions .button {
        width: 100%;
    }

    .contract-import-table-wrap {
        overflow: visible !important;
    }

    .contract-import-table {
        display: block;
        min-width: 0 !important;
    }

    .contract-import-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .contract-import-table tbody,
    .contract-import-table tr,
    .contract-import-table td {
        display: grid;
        width: 100%;
        min-width: 0;
    }

    .contract-import-table tbody {
        gap: 0.85rem;
    }

    .contract-import-table tr {
        gap: 0;
        overflow: hidden;
        border: 1px solid var(--v16-border);
        border-radius: var(--v16-radius-lg);
        background: var(--v16-surface-raised);
    }

    .contract-import-table td,
    .contract-import-table td:first-child,
    .contract-import-table td:last-child {
        grid-template-columns: minmax(7.5rem, 0.42fr) minmax(0, 1fr);
        align-items: start;
        gap: 0.75rem;
        padding: 0.85rem 1rem !important;
        border: 0 !important;
        border-bottom: 1px solid var(--v16-border) !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .contract-import-table td::before {
        content: attr(data-label);
        color: var(--v16-muted);
        font-size: 0.75rem;
        font-weight: 850;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .contract-import-table td:last-child {
        border-bottom: 0 !important;
    }

    .contract-import-table td:first-child > * {
        grid-column: 2;
    }

    .contract-import-table td:first-child::before {
        grid-column: 1;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 430px) {
    .match-review {
        padding: 1rem;
    }

    .contract-import-table td,
    .contract-import-table td:first-child,
    .contract-import-table td:last-child {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.3rem;
    }

    .contract-import-table td:first-child > *,
    .contract-import-table td:first-child::before {
        grid-column: 1;
        grid-row: auto;
    }

    .contract-import-actions,
    .contract-import-actions .inline-form,
    .contract-import-actions .button {
        width: 100%;
    }
}

:is(.has-app-sidebar, .portal-body) :is(tr, article):target {
    scroll-margin-top: 7rem;
    outline: 3px solid color-mix(in srgb, var(--brand-mint) 72%, transparent);
    outline-offset: -3px;
}

/* 2.2.8 online-payment indicators retain semantic contrast after metric-card rules. */
html[data-theme="light"] .invoice-payment-indicator-success {
    --invoice-payment-color: #0f5f3d;
    --invoice-payment-background: #c9f2df;
    --invoice-payment-border: #70b798;
    --invoice-payment-icon-background: rgba(255, 255, 255, 0.58);
}

html[data-theme="light"] .invoice-payment-indicator-warning {
    --invoice-payment-color: #7a3f00;
    --invoice-payment-background: #ffd39b;
    --invoice-payment-border: #c78c43;
    --invoice-payment-icon-background: rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] .invoice-payment-indicator-danger {
    --invoice-payment-color: #8a1130;
    --invoice-payment-background: #ffc4d1;
    --invoice-payment-border: #cf7188;
    --invoice-payment-icon-background: rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] .invoice-payment-indicator-neutral {
    --invoice-payment-color: #384150;
    --invoice-payment-background: #e3e6eb;
    --invoice-payment-border: #9ba3af;
    --invoice-payment-icon-background: rgba(255, 255, 255, 0.65);
}

html[data-theme="dark"] .invoice-payment-indicator-success {
    --invoice-payment-color: #9ce5c6;
    --invoice-payment-background: color-mix(in srgb, #39c998 16%, var(--v16-surface-raised));
    --invoice-payment-border: color-mix(in srgb, #39c998 52%, var(--v16-border));
    --invoice-payment-icon-background: color-mix(in srgb, #39c998 20%, var(--v16-surface));
}

html[data-theme="dark"] .invoice-payment-indicator-warning {
    --invoice-payment-color: #ffd28c;
    --invoice-payment-background: color-mix(in srgb, #f2a33a 17%, var(--v16-surface-raised));
    --invoice-payment-border: color-mix(in srgb, #f2a33a 52%, var(--v16-border));
    --invoice-payment-icon-background: color-mix(in srgb, #f2a33a 21%, var(--v16-surface));
}

html[data-theme="dark"] .invoice-payment-indicator-danger {
    --invoice-payment-color: #ffb7c6;
    --invoice-payment-background: color-mix(in srgb, #e03562 17%, var(--v16-surface-raised));
    --invoice-payment-border: color-mix(in srgb, #e03562 54%, var(--v16-border));
    --invoice-payment-icon-background: color-mix(in srgb, #e03562 21%, var(--v16-surface));
}

html[data-theme="dark"] .invoice-payment-indicator-neutral {
    --invoice-payment-color: var(--v16-text-soft);
    --invoice-payment-background: color-mix(in srgb, var(--v16-muted) 12%, var(--v16-surface-raised));
    --invoice-payment-border: var(--v16-border-strong);
    --invoice-payment-icon-background: color-mix(in srgb, var(--v16-muted) 16%, var(--v16-surface));
}

:is(.app-body, .portal-body) .business-metric-grid > article strong.invoice-payment-indicator {
    border: 1px solid var(--invoice-payment-border) !important;
    background: var(--invoice-payment-background) !important;
    color: var(--invoice-payment-color) !important;
    cursor: help;
}

:is(.app-body, .portal-body) .business-metric-grid > article strong.invoice-payment-indicator > span {
    border: 1px solid color-mix(in srgb, var(--invoice-payment-color) 46%, transparent);
    background: var(--invoice-payment-icon-background) !important;
    color: inherit !important;
}

:is(.app-body, .portal-body) .business-metric-grid > article strong.invoice-payment-indicator:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--invoice-payment-color) 72%, transparent);
    outline-offset: 3px;
}

@media (forced-colors: active) {
    :is(.app-body, .portal-body) .business-metric-grid > article strong.invoice-payment-indicator,
    :is(.app-body, .portal-body) .business-metric-grid > article strong.invoice-payment-indicator > span {
        border-color: CanvasText !important;
        background: Canvas !important;
        color: CanvasText !important;
        forced-color-adjust: auto;
    }
}
