:root {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg-deep: #05070d;
    --bg-panel: rgba(16, 20, 31, 0.78);
    --bg-input: rgba(255, 255, 255, 0.055);
    --brand-logo-source: url("/assets/brand/supernova-logo-dark.svg");
    --page-background:
        radial-gradient(circle at 20% 15%, rgba(94, 76, 255, 0.18), transparent 34%),
        radial-gradient(circle at 82% 10%, rgba(0, 173, 255, 0.12), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(120, 35, 255, 0.12), transparent 38%),
        var(--bg-deep);

    --text-primary: #f5f7fb;
    --text-secondary: #aeb7c8;
    --text-muted: #7f899b;
    --text-on-accent: #080a12;

    --accent: #7f8cff;
    --accent-strong: #a7b0ff;
    --accent-glow: rgba(127, 140, 255, 0.28);

    --border: rgba(255, 255, 255, 0.12);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-accent-soft: rgba(167, 176, 255, 0.2);
    --surface-secondary: rgba(255, 255, 255, 0.045);
    --surface-subtle: rgba(255, 255, 255, 0.025);
    --surface-control-focus: rgba(255, 255, 255, 0.075);
    --surface-control-readonly: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.065);
    --surface-active: rgba(127, 140, 255, 0.16);
    --surface-selected: rgba(127, 140, 255, 0.08);
    --surface-overlay: rgba(15, 19, 30, 0.98);
    --overlay-backdrop: rgba(2, 4, 10, 0.72);

    --danger: #ff818f;
    --danger-accent: #ff8d9a;
    --danger-text: #ffd9de;
    --danger-border: rgba(255, 129, 143, 0.32);
    --danger-border-strong: rgba(255, 129, 143, 0.58);
    --danger-surface: rgba(255, 83, 104, 0.14);
    --danger-surface-hover: rgba(255, 83, 104, 0.23);
    --danger-focus: rgba(255, 83, 104, 0.16);

    --info: #78cfff;
    --info-text: #d0efff;
    --info-border: rgba(80, 190, 255, 0.25);
    --info-surface: rgba(42, 159, 224, 0.14);
    --success: #73e0aa;
    --success-text: #c9f7df;
    --success-border: rgba(91, 214, 151, 0.25);
    --success-surface: rgba(58, 185, 121, 0.14);
    --warning: #ffd078;
    --warning-text: #ffe8b8;
    --warning-border: rgba(255, 197, 92, 0.28);
    --warning-surface: rgba(224, 151, 42, 0.15);
    --disabled-opacity: 0.45;

    --shadow:
        0 30px 80px rgba(0, 0, 0, 0.48),
        0 0 80px rgba(77, 91, 255, 0.1);
    --shadow-overlay:
        0 22px 54px rgba(0, 0, 0, 0.48),
        0 0 34px rgba(127, 140, 255, 0.1);
    --topbar-background:
        linear-gradient(180deg, rgba(10, 13, 23, 0.92), rgba(7, 9, 16, 0.88));
    --toast-background:
        linear-gradient(180deg, rgba(27, 32, 48, 0.97), rgba(14, 18, 29, 0.97));
}

html[data-theme="light"] {
    color-scheme: light;

    --bg-deep: #f4f6ff;
    --bg-panel: rgba(255, 255, 255, 0.86);
    --bg-input: rgba(255, 255, 255, 0.78);
    --brand-logo-source: url("/assets/brand/supernova-logo-light.svg");
    --page-background:
        radial-gradient(circle at 18% 12%, rgba(100, 82, 235, 0.13), transparent 34%),
        radial-gradient(circle at 84% 8%, rgba(0, 151, 214, 0.1), transparent 29%),
        radial-gradient(circle at 50% 100%, rgba(118, 74, 220, 0.08), transparent 38%),
        var(--bg-deep);

    --text-primary: #171b2c;
    --text-secondary: #505b72;
    --text-muted: #737d91;
    --text-on-accent: #ffffff;

    --accent: #5966e8;
    --accent-strong: #4652d0;
    --accent-glow: rgba(75, 88, 218, 0.2);

    --border: rgba(37, 46, 78, 0.16);
    --border-subtle: rgba(37, 46, 78, 0.12);
    --border-hover: rgba(37, 46, 78, 0.26);
    --border-accent-soft: rgba(70, 82, 208, 0.24);
    --surface-secondary: rgba(74, 84, 125, 0.07);
    --surface-subtle: rgba(74, 84, 125, 0.045);
    --surface-control-focus: rgba(255, 255, 255, 0.96);
    --surface-control-readonly: rgba(74, 84, 125, 0.055);
    --surface-hover: rgba(70, 82, 150, 0.09);
    --surface-active: rgba(70, 82, 208, 0.13);
    --surface-selected: rgba(70, 82, 208, 0.09);
    --surface-overlay: rgba(255, 255, 255, 0.98);
    --overlay-backdrop: rgba(31, 37, 59, 0.34);

    --danger: #c9364b;
    --danger-accent: #b92f45;
    --danger-text: #8f2132;
    --danger-border: rgba(190, 45, 67, 0.3);
    --danger-border-strong: rgba(190, 45, 67, 0.5);
    --danger-surface: rgba(211, 53, 77, 0.1);
    --danger-surface-hover: rgba(211, 53, 77, 0.16);
    --danger-focus: rgba(211, 53, 77, 0.16);

    --info: #0879b5;
    --info-text: #075f8c;
    --info-border: rgba(8, 121, 181, 0.25);
    --info-surface: rgba(8, 121, 181, 0.09);
    --success: #137a4a;
    --success-text: #11663f;
    --success-border: rgba(19, 122, 74, 0.25);
    --success-surface: rgba(19, 122, 74, 0.09);
    --warning: #9a5b00;
    --warning-text: #7a4800;
    --warning-border: rgba(154, 91, 0, 0.28);
    --warning-surface: rgba(181, 108, 0, 0.1);
    --disabled-opacity: 0.48;

    --shadow:
        0 24px 64px rgba(40, 47, 78, 0.14),
        0 0 64px rgba(75, 88, 218, 0.08);
    --shadow-overlay:
        0 20px 50px rgba(40, 47, 78, 0.2),
        0 0 28px rgba(75, 88, 218, 0.08);
    --topbar-background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 248, 255, 0.9));
    --toast-background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 255, 0.98));
}

html[data-theme="dark"] {
    --surface-raised: rgba(255, 255, 255, 0.07);
    --surface-accent-soft: rgba(127, 140, 255, 0.14);
    --surface-accent-subtle: rgba(127, 140, 255, 0.065);
    --surface-accent-hover: rgba(127, 140, 255, 0.075);
    --surface-stripe: rgba(255, 255, 255, 0.022);
    --surface-elevated: linear-gradient(180deg, rgba(32, 37, 54, 0.96), rgba(18, 22, 34, 0.96));
    --surface-dialog: linear-gradient(180deg, rgba(31, 36, 53, 0.98), rgba(17, 21, 32, 0.98));
    --surface-footer: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(0, 0, 0, 0.08));
    --accent-line: rgba(167, 176, 255, 0.88);
    --danger-surface-subtle: rgba(255, 83, 104, 0.1);
    --info-surface-subtle: rgba(42, 159, 224, 0.1);
    --success-surface-subtle: rgba(58, 185, 121, 0.1);
    --warning-surface-subtle: rgba(224, 151, 42, 0.11);
    --entity-success-text: #8eebbd;
    --entity-success-border: rgba(107, 229, 174, 0.26);
    --entity-success-surface: rgba(59, 190, 128, 0.1);
    --entity-warning-text: #ffd27d;
    --entity-warning-border: rgba(255, 200, 92, 0.28);
    --entity-warning-surface: rgba(255, 174, 48, 0.1);
    --shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.44), 0 0 44px rgba(127, 140, 255, 0.12);
    --shadow-dialog: 0 34px 90px rgba(0, 0, 0, 0.56), 0 0 56px rgba(127, 140, 255, 0.12);
    --shadow-toast: 0 22px 60px rgba(0, 0, 0, 0.42), 0 0 42px var(--nova-toast-accent-soft);
}

html[data-theme="light"] {
    --surface-raised: rgba(70, 82, 150, 0.08);
    --surface-accent-soft: rgba(70, 82, 208, 0.11);
    --surface-accent-subtle: rgba(70, 82, 208, 0.065);
    --surface-accent-hover: rgba(70, 82, 208, 0.09);
    --surface-stripe: rgba(70, 82, 150, 0.035);
    --surface-elevated: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 255, 0.98));
    --surface-dialog: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 247, 253, 0.99));
    --surface-footer: linear-gradient(180deg, rgba(70, 82, 150, 0.025), rgba(70, 82, 150, 0.065));
    --accent-line: rgba(70, 82, 208, 0.68);
    --danger-surface-subtle: rgba(211, 53, 77, 0.075);
    --info-surface-subtle: rgba(8, 121, 181, 0.07);
    --success-surface-subtle: rgba(19, 122, 74, 0.07);
    --warning-surface-subtle: rgba(181, 108, 0, 0.075);
    --entity-success-text: var(--success-text);
    --entity-success-border: var(--success-border);
    --entity-success-surface: var(--success-surface);
    --entity-warning-text: var(--warning-text);
    --entity-warning-border: var(--warning-border);
    --entity-warning-surface: var(--warning-surface);
    --shadow-elevated: 0 20px 48px rgba(40, 47, 78, 0.16), 0 0 36px rgba(75, 88, 218, 0.07);
    --shadow-dialog: 0 28px 72px rgba(40, 47, 78, 0.24), 0 0 44px rgba(75, 88, 218, 0.08);
    --shadow-toast: 0 18px 48px rgba(40, 47, 78, 0.18), 0 0 34px var(--nova-toast-accent-soft);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text-primary);
    background: var(--page-background);
}

a {
    color: var(--accent-strong);
}

.app-shell {
    min-height: 100vh;
    padding: 32px;
}

.auth-shell {
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 440px);
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.brand {
    margin-bottom: 32px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.brand-mark::before {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow:
        0 0 10px var(--accent),
        0 0 24px var(--accent-glow);
    content: "";
}

.brand h1 {
    margin: 0;
    font-size: clamp(2.1rem, 7vw, 3.4rem);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.brand p {
    margin: 14px 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.form-grid {
    display: grid;
    gap: 20px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field label {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
}

.form-field input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    color: var(--text-primary);
    background: var(--bg-input);
    font: inherit;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.form-field input:focus {
    border-color: var(--accent);
    background: var(--surface-control-focus);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.button-primary {
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    color: var(--text-on-accent);
    background:
        linear-gradient(
            135deg,
            var(--accent-strong),
            var(--accent)
        );
    box-shadow: 0 12px 28px var(--accent-glow);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 150ms ease,
        box-shadow 150ms ease;
}

.button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px var(--accent-glow);
}

.button-primary:active {
    transform: translateY(0);
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid var(--danger-border);
    border-radius: 12px;
    color: var(--danger-text);
    background: var(--danger-surface-subtle);
}

.dashboard-card {
    max-width: 820px;
    margin: 80px auto;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.dashboard-card h1 {
    margin-top: 0;
}

.meta {
    color: var(--text-secondary);
}

.logout-link {
    display: inline-flex;
    margin-top: 18px;
}

@media (max-width: 600px) {
    .app-shell {
        padding: 18px;
    }

    .auth-card {
        padding: 28px 22px;
        border-radius: 20px;
    }
}

/* SuperNOVA UI: Button */

.nova-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    border: 1px solid transparent;
    border-radius: 14px;

    font: inherit;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;

    cursor: pointer;

    user-select: none;
    -webkit-user-select: none;

    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;

    -webkit-user-drag: none;
    user-drag: none;

    touch-action: manipulation;

    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease,
        opacity 150ms ease;
}

.nova-button * {
    user-select: none;
    -webkit-user-select: none;

    -webkit-touch-callout: none;
}

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

.nova-button:active:not(:disabled) {
    transform: translateY(0);
}

.nova-button:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px var(--accent-glow);
}

.nova-button:disabled {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
}

/* Sizes */

.nova-button--small {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 11px;
    font-size: 0.84rem;
}

.nova-button--medium {
    min-height: 52px;
    padding: 0 20px;
    font-size: 0.95rem;
}

.nova-button--large {
    min-height: 60px;
    padding: 0 26px;
    border-radius: 16px;
    font-size: 1rem;
}

/* Variants */

.nova-button--primary {
    color: var(--text-on-accent);
    background:
        linear-gradient(
            135deg,
            var(--accent-strong),
            var(--accent)
        );
    box-shadow:
        0 12px 28px var(--accent-glow);
}

.nova-button--primary:hover:not(:disabled) {
    box-shadow:
        0 16px 34px var(--accent-glow);
}

.nova-button--secondary {
    border-color: var(--border);
    color: var(--text-primary);
    background: var(--surface-raised);
}

.nova-button--secondary:hover:not(:disabled) {
    border-color: var(--border-hover);
    background: var(--border-subtle);
}

.nova-button--danger {
    border-color: var(--danger-border);
    color: var(--danger-text);
    background: var(--danger-focus);
}

.nova-button--danger:hover:not(:disabled) {
    border-color: var(--danger-border-strong);
    background: var(--danger-surface-hover);
}

.nova-button--ghost {
    color: var(--text-secondary);
    background: transparent;
}

.nova-button--ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.nova-button--full-width {
    width: 100%;
}

.nova-button__label {
    display: inline-flex;
    align-items: center;
}

/* SuperNOVA UI: Showcase */

.showcase-shell {
    width: min(100%, 1180px);
    margin: 0 auto;
}

.showcase-topbar__actions,
.showcase-topbar__navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.showcase-topbar__actions {
    gap: 14px;
}

.showcase-topbar__navigation {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.showcase-topbar .nova-button {
    white-space: nowrap;
}

.showcase-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    margin: 36px 0 40px;
}

.showcase-header h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.showcase-description {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.showcase-user {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-secondary);
    background: var(--surface-secondary);
}

.showcase-user span {
    font-size: 0.9rem;
}

.showcase-user a {
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.showcase-section {
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.showcase-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--border);
}

.showcase-section__header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.showcase-section__header p {
    margin: 8px 0 0;
    color: var(--text-secondary);
}

.showcase-group {
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
}

.showcase-group:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.showcase-group h3 {
    margin: 0 0 18px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.showcase-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.showcase-row--aligned {
    align-items: center;
}

.showcase-stack {
    display: grid;
    gap: 14px;
}

@media (max-width: 820px) {
    .showcase-topbar .nova-topbar__inner {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .showcase-topbar .nova-topbar__brand {
        justify-self: center;
    }

    .showcase-topbar .nova-topbar__actions,
    .showcase-topbar__actions,
    .showcase-topbar__navigation {
        justify-content: center;
    }

    .showcase-topbar__actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .showcase-header {
        flex-direction: column;
    }

    .showcase-user {
        width: 100%;
        justify-content: space-between;
    }

    .showcase-section {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .showcase-row {
        align-items: stretch;
        flex-direction: column;
    }

    .showcase-row .nova-button {
        width: 100%;
    }
}

.showcase-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

/* SuperNOVA UI: Page */

.nova-page {
    display: grid;
    gap: 28px;
    min-width: 0;
}

.nova-page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
}

.nova-page__heading {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.nova-page__eyebrow {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 760;
    letter-spacing: 0.14em;
}

.nova-page__title,
.nova-page__description {
    margin: 0;
}

.nova-page__description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.nova-page__actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.nova-page__content {
    display: grid;
    gap: 20px;
    min-width: 0;
}

@media (max-width: 720px) {
    .nova-page {
        gap: 22px;
    }

    .nova-page__header {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .nova-page__actions {
        justify-content: flex-start;
    }
}

/* SuperNOVA UI: Form */

.nova-form,
.nova-form__body {
    display: grid;
    gap: 20px;
}

.nova-form__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

@media (max-width: 720px) {
    .nova-form__actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .nova-form__actions .nova-button {
        width: 100%;
    }
}

/* SuperNOVA UI: Input */

.nova-field {
    display: grid;
    gap: 8px;
}

.nova-field__label {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 650;
}

.nova-field__required {
    color: var(--danger);
}

.nova-input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    color: var(--text-primary);
    background: var(--bg-input);
    font: inherit;

    transition:
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease,
        opacity 150ms ease;
}

.nova-input::placeholder {
    color: var(--text-muted);
}

.nova-input:hover:not(:disabled):not(:read-only) {
    border-color: var(--border-hover);
}

.nova-input:focus {
    border-color: var(--accent);
    background: var(--surface-control-focus);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.nova-input:disabled {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
}

.nova-input:read-only {
    color: var(--text-secondary);
    background: var(--surface-control-readonly);
}

.nova-input--invalid {
    border-color: var(--danger-border-strong);
}

.nova-input--invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-focus);
}

.nova-field__message {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.nova-field__message--error {
    color: var(--danger);
}

.showcase-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.showcase-section + .showcase-section {
    margin-top: 24px;
}

@media (max-width: 720px) {
    .showcase-form-grid {
        grid-template-columns: 1fr;
    }
}

/* SuperNOVA UI: Card */

.nova-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    color: var(--text-primary);
}

.nova-card--default {
    border: 1px solid var(--border-subtle);
    background: var(--surface-secondary);
}

.nova-card--outlined {
    border: 1px solid var(--border-hover);
    background: transparent;
}

.nova-card--elevated {
    border: 1px solid var(--border-accent-soft);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-elevated);
    transform: translateY(-2px);
}

.nova-card--elevated::before {
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background:
        linear-gradient(
            90deg,
            transparent,
            var(--accent-line),
            transparent
        );
    content: "";
}

.nova-card--subtle {
    border: 0;
    background: var(--surface-subtle);
}

.nova-card--padding-compact {
    padding: 14px 16px;
}

.nova-card--padding-normal {
    padding: 20px 22px;
}

.nova-card--padding-spacious {
    padding: 28px 30px;
}

.nova-card__header {
    margin-bottom: 14px;
}

.nova-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.nova-card__subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.nova-card__content {
    color: var(--text-secondary);
    line-height: 1.5;
}

.nova-card__content > :first-child {
    margin-top: 0;
}

.nova-card__content > :last-child {
    margin-bottom: 0;
}

.showcase-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

@media (max-width: 720px) {
    .showcase-card-grid {
        grid-template-columns: 1fr;
    }
}

/* SuperNOVA UI: Badge */

.nova-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    width: fit-content;

    border: 1px solid transparent;
    border-radius: 999px;

    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.nova-badge--small {
    min-height: 24px;
    padding: 0 9px;
    font-size: 0.72rem;
}

.nova-badge--medium {
    min-height: 30px;
    padding: 0 12px;
    font-size: 0.78rem;
}

.nova-badge--large {
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.84rem;
}

.nova-badge--neutral {
    border-color: var(--border-subtle);
    color: var(--text-secondary);
    background: var(--bg-input);
}

.nova-badge--primary {
    border-color: var(--border-accent-soft);
    color: var(--text-primary);
    background: var(--surface-accent-soft);
}

.nova-badge--success {
    border-color: var(--success-border);
    color: var(--success-text);
    background: var(--success-surface);
}

.nova-badge--warning {
    border-color: var(--warning-border);
    color: var(--warning-text);
    background: var(--warning-surface);
}

.nova-badge--danger {
    border-color: var(--danger-border);
    color: var(--danger-text);
    background: var(--danger-surface);
}

.nova-badge--info {
    border-color: var(--info-border);
    color: var(--info-text);
    background: var(--info-surface);
}

.nova-badge__dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;

    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.nova-badge__label {
    display: inline-flex;
    align-items: center;
}

/* SuperNOVA UI: Alert */

.nova-alert {
    --nova-alert-color: var(--info);
    --nova-alert-border: var(--info-border);
    --nova-alert-background: var(--info-surface-subtle);

    display: grid;
    grid-template-columns: 4px minmax(0, 1fr);
    gap: 16px;

    overflow: hidden;
    padding: 18px 20px;
    border: 1px solid var(--nova-alert-border);
    border-radius: 16px;

    color: var(--text-primary);
    background: var(--nova-alert-background);
}

.nova-alert__indicator {
    width: 4px;
    height: 100%;
    min-height: 42px;
    border-radius: 999px;
    background: var(--nova-alert-color);
    box-shadow: 0 0 18px var(--nova-alert-color);
}

.nova-alert__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.nova-alert--compact .nova-alert__body {
    min-height: 30px;
}

.nova-alert__title {
    margin: 0;
    color: var(--nova-alert-color);
    font-size: 0.95rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.nova-alert__content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.nova-alert__title + .nova-alert__content {
    margin-top: 5px;
}

.nova-alert__content > :first-child {
    margin-top: 0;
}

.nova-alert__content > :last-child {
    margin-bottom: 0;
}

.nova-alert--info {
    --nova-alert-color: var(--info);
    --nova-alert-border: var(--info-border);
    --nova-alert-background: var(--info-surface-subtle);
}

.nova-alert--success {
    --nova-alert-color: var(--success);
    --nova-alert-border: var(--success-border);
    --nova-alert-background: var(--success-surface-subtle);
}

.nova-alert--warning {
    --nova-alert-color: var(--warning);
    --nova-alert-border: var(--warning-border);
    --nova-alert-background: var(--warning-surface-subtle);
}

.nova-alert--danger {
    --nova-alert-color: var(--danger-accent);
    --nova-alert-border: var(--danger-border);
    --nova-alert-background: var(--danger-surface-subtle);
}

.nova-alert--compact {
    gap: 12px;
    padding: 10px 14px;
    border-radius: 13px;
}

.nova-alert--compact .nova-alert__indicator {
    min-height: 30px;
}

.nova-alert--compact .nova-alert__content {
    font-size: 0.84rem;
}

/* SuperNOVA UI: Select */

.nova-select-wrap {
    position: relative;
}

.nova-select {
    width: 100%;
    min-height: 52px;
    padding: 0 46px 0 16px;

    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;

    color: var(--text-primary);
    background: var(--bg-input);

    font: inherit;
    appearance: none;
    cursor: pointer;

    transition:
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease,
        opacity 150ms ease;
}

.nova-select:hover:not(:disabled) {
    border-color: var(--border-hover);
}

.nova-select:focus {
    border-color: var(--accent);
    background: var(--surface-control-focus);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.nova-select:disabled {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
}

.nova-select--invalid {
    border-color: var(--danger-border-strong);
}

.nova-select--invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-focus);
}

.nova-select-wrap__icon {
    position: absolute;
    top: 50%;
    right: 18px;

    width: 9px;
    height: 9px;

    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);

    pointer-events: none;
    transform:
        translateY(-65%)
        rotate(45deg);
}

.nova-select:focus + .nova-select-wrap__icon {
    border-color: var(--accent-strong);
}

/* SuperNOVA UI: Textarea */

.nova-textarea {
    width: 100%;
    min-height: 132px;
    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;

    color: var(--text-primary);
    background: var(--bg-input);

    font: inherit;
    line-height: 1.55;
    resize: vertical;

    transition:
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease,
        opacity 150ms ease;
}

.nova-textarea::placeholder {
    color: var(--text-muted);
}

.nova-textarea:hover:not(:disabled):not(:read-only) {
    border-color: var(--border-hover);
}

.nova-textarea:focus {
    border-color: var(--accent);
    background: var(--surface-control-focus);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.nova-textarea:disabled {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
}

.nova-textarea:read-only {
    color: var(--text-secondary);
    background: var(--surface-control-readonly);
}

.nova-textarea--invalid {
    border-color: var(--danger-border-strong);
}

.nova-textarea--invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-focus);
}

.nova-textarea--fixed {
    resize: none;
}

/* SuperNOVA UI: Checkbox */

.nova-checkbox-field {
    display: grid;
    gap: 7px;
}

.nova-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 11px;
    width: fit-content;

    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.nova-checkbox__input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.nova-checkbox__control {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 20px;
    height: 20px;
    margin-top: 1px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--bg-input);

    transition:
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease,
        opacity 150ms ease;
}

.nova-checkbox__mark {
    width: 9px;
    height: 5px;

    border-left: 2px solid var(--text-on-accent);
    border-bottom: 2px solid var(--text-on-accent);

    opacity: 0;
    transform:
        translateY(-1px)
        rotate(-45deg)
        scale(0.7);

    transition:
        opacity 120ms ease,
        transform 120ms ease;
}

.nova-checkbox__label {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.nova-checkbox:hover
.nova-checkbox__input:not(:disabled)
+ .nova-checkbox__control {
    border-color: var(--border-hover);
}

.nova-checkbox__input:focus-visible
+ .nova-checkbox__control {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.nova-checkbox__input:checked
+ .nova-checkbox__control {
    border-color: transparent;
    background:
        linear-gradient(
            135deg,
            var(--accent-strong),
            var(--accent)
        );
    box-shadow: 0 8px 18px var(--accent-glow);
}

.nova-checkbox__input:checked
+ .nova-checkbox__control
.nova-checkbox__mark {
    opacity: 1;
    transform:
        translateY(-1px)
        rotate(-45deg)
        scale(1);
}

.nova-checkbox__input:disabled
+ .nova-checkbox__control,
.nova-checkbox__input:disabled
~ .nova-checkbox__label {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
}

.nova-checkbox-field__message {
    margin: 0 0 0 31px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* SuperNOVA UI: Switch */

.nova-switch-field {
    display: grid;
    gap: 7px;
}

.nova-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;

    cursor: pointer;
    user-select: none;
}

.nova-switch__input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.nova-switch__control {
    position: relative;

    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;

    width: 44px;
    height: 24px;
    padding: 3px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-raised);

    transition:
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease,
        opacity 150ms ease;
}

.nova-switch__thumb {
    width: 16px;
    height: 16px;

    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);

    transform: translateX(0);

    transition:
        transform 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease;
}

.nova-switch__label {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.nova-switch:hover
.nova-switch__input:not(:disabled)
+ .nova-switch__control {
    border-color: var(--border-hover);
}

.nova-switch__input:focus-visible
+ .nova-switch__control {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.nova-switch__input:checked
+ .nova-switch__control {
    border-color: var(--border-accent-soft);
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    box-shadow: 0 8px 20px var(--accent-glow);
}

.nova-switch__input:checked
+ .nova-switch__control
.nova-switch__thumb {
    background: var(--text-on-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
    transform: translateX(20px);
}

.nova-switch__input:disabled
+ .nova-switch__control,
.nova-switch__input:disabled
~ .nova-switch__label {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
}

.nova-switch-field__message {
    margin: 0 0 0 56px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* SuperNOVA UI: Table */

.nova-table-wrap {
    width: 100%;
    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface-subtle);
}

.nova-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;

    color: var(--text-primary);
    font-size: 0.9rem;
}

.nova-table__caption {
    padding: 16px 18px;

    border-bottom: 1px solid var(--border);

    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 650;
    text-align: left;
}

.nova-table__heading {
    padding: 14px 16px;

    border-bottom: 1px solid var(--border);

    color: var(--text-muted);
    background: var(--surface-control-readonly);

    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.nova-table__row {
    transition:
        background 150ms ease,
        box-shadow 150ms ease;
}

.nova-table__row--interactive {
    cursor: pointer;
}

.nova-table__row--interactive:hover {
    background: var(--surface-accent-subtle);
}

.nova-table__row--interactive:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -3px;
    background: var(--surface-accent-hover);
}

.nova-table__row--interactive.nova-table__row--focus-restored:focus-visible {
    outline: none;
}

.nova-table__row + .nova-table__row .nova-table__cell {
    border-top: 1px solid var(--border-subtle);
}

.nova-table__cell {
    padding: 15px 16px;

    color: var(--text-secondary);
    vertical-align: middle;
}

.nova-table__cell:first-child {
    color: var(--text-primary);
    font-weight: 650;
}

.nova-table__cell--left {
    text-align: left;
}

.nova-table__cell--center {
    text-align: center;
}

.nova-table__cell--right {
    text-align: right;
}

.nova-table--hoverable
.nova-table__row:hover {
    background: var(--surface-accent-subtle);
}

.nova-table--striped
.nova-table__row:nth-child(even) {
    background: var(--surface-stripe);
}

.nova-table--striped.nova-table--hoverable
.nova-table__row:hover {
    background: var(--surface-accent-hover);
}

.nova-table--compact .nova-table__heading {
    padding: 10px 13px;
}

.nova-table--compact .nova-table__cell {
    padding: 10px 13px;
    font-size: 0.84rem;
}

.nova-table__empty {
    padding: 34px 18px;

    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 720px) {
    .nova-table {
        min-width: 680px;
    }
}

/* SuperNOVA UI: Dialog */

.nova-dialog-layer {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: none;
    place-items: center;

    padding: 24px;
}

.nova-dialog-layer:has(.nova-dialog--open) {
    display: grid;
}

.nova-dialog-backdrop {
    position: absolute;
    inset: 0;

    background: var(--overlay-backdrop);
    backdrop-filter: blur(10px);
}

.nova-dialog {
    position: relative;
    z-index: 1;

    width: min(100%, 620px);
    max-height: calc(100vh - 48px);

    border: 1px solid var(--border-accent-soft);
    border-radius: 22px;

    color: var(--text-primary);
    background: var(--surface-dialog);
    box-shadow: var(--shadow-dialog);
}

.nova-dialog__content {
    overflow: hidden;
    border-radius: inherit;
}

.nova-dialog::before {
    position: absolute;
    inset: 0 0 auto;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--accent-line),
            transparent
        );

    content: "";
}

.nova-dialog--small {
    width: min(100%, 420px);
}

.nova-dialog--medium {
    width: min(100%, 620px);
}

.nova-dialog--large {
    width: min(100%, 860px);
}

.nova-dialog--fullscreen {
    width: calc(100vw - 48px);
    height: calc(100vh - 48px);
}

.nova-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 26px 28px;

    border-bottom: 1px solid var(--border);
}

.nova-dialog__heading {
    min-width: 0;
}

.nova-dialog__title {
    margin: 0;

    font-size: 1.18rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.nova-dialog__description {
    margin: 7px 0 0;

    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.nova-dialog__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 36px;
    height: 36px;

    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--text-secondary);
    background: var(--surface-control-readonly);

    cursor: pointer;

    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease;
}

.nova-dialog__close:hover {
    border-color: var(--border-accent-soft);
    color: var(--text-primary);
    background: var(--surface-hover);
}

.nova-dialog__close:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.nova-dialog__close:active {
    transform: scale(0.96);
}

.nova-dialog__close-icon {
    width: 16px;
    height: 16px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.nova-dialog__body {
    overflow-y: auto;
    padding: 26px 28px;

    color: var(--text-secondary);
    line-height: 1.55;
}

.nova-dialog__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;

    padding: 18px 28px;

    border-top: 1px solid var(--border);
    border-bottom-right-radius: inherit;
    border-bottom-left-radius: inherit;

    background: var(--surface-footer);
}

.nova-table-record {
    display: grid;
    gap: 0;
    margin: 0;
}

.nova-table-record__field {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.nova-table-record__field:first-child {
    padding-top: 0;
}

.nova-table-record__field:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.nova-table-record__term {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nova-table-record__value {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text-primary);
}

@media (max-width: 720px) {
    .nova-dialog-layer {
        padding: 14px;
    }

    .nova-dialog {
        max-height: calc(100vh - 28px);
        border-radius: 18px;
    }

    .nova-dialog--fullscreen {
        width: calc(100vw - 28px);
        height: calc(100vh - 28px);
    }

    .nova-dialog__header,
    .nova-dialog__body,
    .nova-dialog__footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .nova-dialog__footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .nova-dialog__footer .nova-button {
        width: 100%;
    }

    .nova-table-record__field {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* SuperNOVA Component Showcase hero */

.showcase-header {
    position: relative;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    padding-top: 48px;
    text-align: center;
}

.showcase-header__brand {
    display: flex;
    align-items: center;
    flex-direction: column;

    width: min(100%, 980px);
    margin-inline: auto;
}

.brand-logo--showcase {
    display: block;

    width: 128px;
    height: 128px;
    margin: 0 0 30px;

    object-fit: contain;

    filter:
        drop-shadow(0 0 20px rgba(139, 92, 246, 0.24))
        drop-shadow(0 0 48px rgba(120, 35, 255, 0.12));
}

.showcase-header .brand-mark {
    justify-content: center;
    margin-bottom: 22px;
}

.showcase-header h1 {
    margin: 0;

    text-align: center;
}

.showcase-header .showcase-description {
    max-width: 760px;
    margin: 18px auto 0;

    text-align: center;
}

.showcase-user {
    position: absolute;
    top: 48px;
    right: 0;
}

@media (max-width: 900px) {
    .showcase-header {
        padding-top: 32px;
    }

    .showcase-user {
        position: static;
        margin-top: 28px;
    }

    .showcase-header {
        align-items: center;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .brand-logo--showcase {
        width: 104px;
        height: 104px;
        margin-bottom: 24px;
    }

    .showcase-header .brand-mark {
        margin-bottom: 18px;
    }

    .showcase-header .showcase-description {
        margin-top: 14px;
    }
}

/* SuperNOVA Login hero */

.auth-card .brand {
    display: flex;
    align-items: center;
    flex-direction: column;

    text-align: center;
}

.brand-logo--auth {
    display: block;

    width: 104px;
    height: 104px;
    margin: 0 auto 28px;

    object-fit: contain;

    filter:
        drop-shadow(0 0 20px rgba(139, 92, 246, 0.24))
        drop-shadow(0 0 48px rgba(120, 35, 255, 0.12));
}

.auth-card .brand-mark {
    justify-content: center;
}

.auth-card .brand h1 {
    text-align: center;
}

.auth-card .brand p {
    text-align: center;
}

@media (max-width: 720px) {
    .brand-logo--auth {
        width: 88px;
        height: 88px;
        margin-bottom: 22px;
    }
}

/* SuperNOVA UI: Entity Lookup */
.nova-entity-lookup{position:relative;display:grid;gap:8px;min-width:0}
.nova-entity-lookup__control{position:relative}
.nova-entity-lookup__input{width:100%;min-height:52px;padding:0 48px 0 46px;border:1px solid var(--border);border-radius:14px;outline:0;color:var(--text-primary);background:var(--bg-input);font:inherit;transition:border-color 150ms ease,background 150ms ease,box-shadow 150ms ease,opacity 150ms ease}
.nova-entity-lookup__input::placeholder{color:var(--text-muted)}
.nova-entity-lookup__input:hover:not(:disabled){border-color:var(--border-hover)}
.nova-entity-lookup__input:focus,.nova-entity-lookup--open .nova-entity-lookup__input,.nova-entity-lookup--results .nova-entity-lookup__input,.nova-entity-lookup--loading .nova-entity-lookup__input{border-color:var(--accent);background:var(--surface-control-focus);box-shadow:0 0 0 4px var(--accent-glow)}
.nova-entity-lookup--error .nova-entity-lookup__input{border-color:var(--danger-border-strong)}
.nova-entity-lookup--error .nova-entity-lookup__input:focus{border-color:var(--danger);box-shadow:0 0 0 4px var(--danger-focus)}
.nova-entity-lookup--disabled{opacity:.45}.nova-entity-lookup--disabled input,.nova-entity-lookup--disabled button{cursor:not-allowed}
.nova-entity-lookup__search{position:absolute;z-index:1;top:17px;left:18px;width:15px;height:15px;border:2px solid var(--text-muted);border-radius:50%;pointer-events:none}
.nova-entity-lookup__search::after{position:absolute;right:-5px;bottom:-3px;width:6px;height:2px;border-radius:2px;background:var(--text-muted);content:"";transform:rotate(45deg)}
.nova-entity-lookup__clear{position:absolute;top:9px;right:9px;display:none;width:34px;height:34px;padding:0;border:0;border-radius:10px;color:var(--text-secondary);background:transparent;font:inherit;font-size:1.35rem;cursor:pointer}
.nova-entity-lookup.has-value .nova-entity-lookup__clear,.nova-entity-lookup--selected .nova-entity-lookup__clear{display:block}
.nova-entity-lookup__clear:hover,.nova-entity-lookup__change:hover{color:var(--text-primary);background:var(--surface-hover)}
.nova-entity-lookup__clear:focus-visible,.nova-entity-lookup__change:focus-visible{outline:0;box-shadow:0 0 0 4px var(--accent-glow)}
.nova-entity-lookup__spinner{display:none;width:18px;height:18px;border:2px solid var(--border);border-top-color:var(--accent-strong);border-radius:50%;animation:nova-entity-spin 700ms linear infinite}
.nova-entity-lookup--loading .nova-entity-lookup__control>.nova-entity-lookup__spinner{position:absolute;top:17px;right:17px;display:block}.nova-entity-lookup--loading .nova-entity-lookup__clear{display:none}
@keyframes nova-entity-spin{to{transform:rotate(360deg)}}
.nova-entity-lookup__panel{position:absolute;z-index:20;top:calc(100% - 2px);right:0;left:0;overflow:hidden;max-height:320px;border:1px solid var(--border-accent-soft);border-radius:14px;background:var(--surface-overlay);box-shadow:var(--shadow-overlay);backdrop-filter:blur(24px)}
.nova-entity-lookup__panel[hidden]{display:none}.nova-entity-lookup__options{overflow-y:auto;max-height:318px;padding:6px}
.nova-entity-lookup__option{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0;padding:13px 12px;border-radius:10px;cursor:pointer;transition:background 150ms ease,color 150ms ease}
.nova-entity-lookup__option:hover{background:var(--surface-hover)}.nova-entity-lookup__option.is-active,.nova-entity-lookup__option[aria-selected=true]{background:var(--surface-active)}
.nova-entity-lookup__option-copy,.nova-entity-lookup__selection-copy{display:grid;gap:5px;min-width:0}
.nova-entity-lookup__option-copy strong,.nova-entity-lookup__selection-copy strong{overflow-wrap:anywhere;font-size:.92rem;line-height:1.35}
.nova-entity-lookup__option-copy>span,.nova-entity-lookup__selection-copy>span{overflow-wrap:anywhere;color:var(--text-muted);font-size:.8rem;line-height:1.4}
.nova-entity-lookup mark{border-radius:3px;color:var(--text-primary);background:var(--accent-glow)}
.nova-entity-lookup__status{flex:0 0 auto;padding:5px 8px;border:1px solid var(--border);border-radius:999px;color:var(--text-secondary);font-size:.7rem;font-weight:700}
.nova-entity-lookup__status--success{border-color:var(--entity-success-border);color:var(--entity-success-text);background:var(--entity-success-surface)}.nova-entity-lookup__status--warning{border-color:var(--entity-warning-border);color:var(--entity-warning-text);background:var(--entity-warning-surface)}
.nova-entity-lookup__loading,.nova-entity-lookup__empty,.nova-entity-lookup__error{display:none;align-items:center;gap:10px;padding:18px;color:var(--text-secondary);font-size:.86rem;line-height:1.45}
.nova-entity-lookup--loading .nova-entity-lookup__loading,.nova-entity-lookup--empty .nova-entity-lookup__empty,.nova-entity-lookup--error .nova-entity-lookup__error{display:flex}
.nova-entity-lookup--loading .nova-entity-lookup__loading .nova-entity-lookup__spinner{display:block}.nova-entity-lookup--loading .nova-entity-lookup__options,.nova-entity-lookup--empty .nova-entity-lookup__options,.nova-entity-lookup--error .nova-entity-lookup__options{display:none}.nova-entity-lookup__error{color:var(--danger)}
.nova-entity-lookup__selection{display:flex;align-items:center;gap:12px;min-width:0;padding:12px 14px;border:1px solid var(--border-accent-soft);border-radius:14px;background:var(--surface-selected)}.nova-entity-lookup--selected .nova-entity-lookup__control{display:none}.nova-entity-lookup__selection-copy{flex:1 1 auto}
.nova-entity-lookup__change{flex:0 0 auto;padding:8px 10px;border:0;border-radius:9px;color:var(--accent-strong);background:transparent;font:inherit;font-size:.78rem;font-weight:700;cursor:pointer}
.entity-lookup-showcase .showcase-lookup-grid {
    width: min(100%, 680px);
}

.entity-lookup-showcase .showcase-mobile-frame {
    width: min(100%, 320px);
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-subtle);
}

.entity-lookup-showcase
    [data-nova-entity-lookup-static]
    .nova-entity-lookup__panel {
    position: relative;
    top: auto;
}

.entity-lookup-showcase
    [data-nova-entity-lookup-static]:is(
        .nova-entity-lookup--open,
        .nova-entity-lookup--loading,
        .nova-entity-lookup--results
    ) :is(
        .nova-entity-lookup__control,
        .nova-entity-lookup__panel
    ) {
    margin-top: 12px;
}
@media(max-width:480px){.nova-entity-lookup__option,.nova-entity-lookup__selection{align-items:flex-start;flex-wrap:wrap}.nova-entity-lookup__option-copy,.nova-entity-lookup__selection-copy{flex-basis:calc(100% - 80px)}}
@media(prefers-reduced-motion:reduce){.nova-entity-lookup__spinner{animation-duration:1400ms}}
.nova-entity-lookup__selection{display:none}
.nova-entity-lookup--selected .nova-entity-lookup__selection{display:flex}
/* SuperNOVA UI: Theme selector */

.nova-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.nova-theme-selector {
    display: inline-flex;
    gap: 3px;
    margin: 0;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-subtle);
}

.nova-theme-selector__option {
    position: relative;
    cursor: pointer;
}

.nova-theme-selector__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nova-theme-selector__option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    transition:
        color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease;
}

.nova-theme-selector__option:hover span {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.nova-theme-selector__option input:checked + span {
    color: var(--text-primary);
    background: var(--surface-active);
}

.nova-theme-selector__option input:focus-visible + span {
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.nova-theme-floating {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 1100;

    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--bg-panel);
    box-shadow: var(--shadow-overlay);

    backdrop-filter: blur(20px);
}

.nova-theme-floating .nova-theme-selector {
    border: 0;
    background: transparent;
}

@media (max-width: 720px) {
    .nova-theme-floating {
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
    }
}

img[src="/assets/brand/supernova-logo-dark.svg"] {
    content: var(--brand-logo-source);
}
