:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-dark: #0b1220;
    --text: #111827;
    --muted: #64748b;
    --line: #dbe3ef;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eaf1ff;
    --secondary: #6d5ce7;
    --success: #15803d;
    --success-soft: #eaf8ef;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --warning: #b45309;
    --warning-soft: #fff7e6;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-md: 0 18px 50px rgba(15, 23, 42, .10);
    --radius-sm: .75rem;
    --radius: 1.1rem;
    --radius-lg: 1.6rem;
    --max-width: 1240px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(37, 99, 235, .08), transparent 24rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

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

img,
svg {
    display: block;
    max-width: 100%;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 9999;
    top: .75rem;
    left: .75rem;
    transform: translateY(-160%);
    padding: .7rem 1rem;
    border-radius: .6rem;
    background: var(--surface-dark);
    color: #fff;
}

.skip-link:focus {
    transform: none;
}

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

.site-header {
    position: sticky;
    z-index: 100;
    top: 0;
    border-bottom: 1px solid rgba(219, 227, 239, .85);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
    backdrop-filter: blur(18px);
}

.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    width: min(calc(100% - 2rem), var(--max-width));
    min-height: 76px;
    margin: 0 auto;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .75rem;
    min-width: max-content;
}

.brand-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    filter: drop-shadow(0 9px 16px rgba(79, 70, 229, .18));
}

.brand-copy,
.brand-copy strong,
.brand-copy small {
    display: block;
}

.brand-copy strong {
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 780;
    letter-spacing: -.035em;
    line-height: 1.1;
}

.brand-copy small {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .7rem;
    line-height: 1.15;
    white-space: nowrap;
}

.main-nav,
.nav-links,
.nav-actions {
    display: flex;
    align-items: center;
}

.main-nav {
    justify-content: space-between;
    flex: 1 1 auto;
    min-width: 0;
    gap: 1rem;
}

.nav-links,
.nav-actions {
    gap: .35rem;
}

.nav-link,
.nav-cta,
.nav-dropdown-trigger,
.account-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: .75rem;
    font-size: .88rem;
    font-weight: 680;
    line-height: 1.2;
    white-space: nowrap;
}

.nav-link,
.nav-dropdown-trigger {
    padding: .66rem .78rem;
    color: #475569;
}

.nav-link:hover,
.nav-link.is-active,
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.is-active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-cta {
    gap: .4rem;
    margin-left: .15rem;
    padding: .66rem 1rem;
    background: linear-gradient(135deg, var(--primary), #3157df);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .19);
}

.nav-cta:hover,
.nav-cta.is-active {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.nav-cta > span {
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown-trigger,
.account-trigger {
    border: 0;
    background: transparent;
}

.dropdown-chevron {
    width: 16px;
    height: 16px;
    margin-left: .35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
}

.nav-dropdown[open] > summary .dropdown-chevron {
    transform: rotate(180deg);
}

.account-trigger {
    gap: .5rem;
    padding: .35rem .45rem .35rem .35rem;
    border: 1px solid var(--line);
    background: #fff;
    color: #334155;
}

.account-trigger:hover {
    border-color: #b8c8e3;
    background: var(--surface-soft);
}

.account-avatar {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .18);
}

.account-avatar--large {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: .9rem;
}

.account-trigger-label {
    font-size: .85rem;
    font-weight: 720;
}

.nav-dropdown-menu {
    position: absolute;
    z-index: 120;
    top: calc(100% + .7rem);
    right: 0;
    width: 290px;
    padding: .55rem;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .16);
}

.nav-dropdown-menu::before {
    position: absolute;
    top: -.45rem;
    right: 1.2rem;
    width: .8rem;
    height: .8rem;
    border-top: 1px solid rgba(203, 213, 225, .9);
    border-left: 1px solid rgba(203, 213, 225, .9);
    background: #fff;
    content: "";
    transform: rotate(45deg);
}

.nav-dropdown-menu > a,
.nav-logout-form button {
    display: flex;
    align-items: center;
    width: 100%;
    gap: .75rem;
    padding: .72rem .75rem;
    border: 0;
    border-radius: .75rem;
    background: transparent;
    color: #334155;
    text-align: left;
    cursor: pointer;
}

.nav-dropdown-menu > a:hover,
.nav-logout-form button:hover {
    background: var(--surface-soft);
    color: var(--primary-dark);
}

.nav-dropdown-menu svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-dropdown-menu strong,
.nav-dropdown-menu small {
    display: block;
}

.nav-dropdown-menu strong {
    color: #1e293b;
    font-size: .86rem;
    line-height: 1.25;
}

.nav-dropdown-menu small {
    margin-top: .12rem;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.25;
}

.account-summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: -.05rem -.05rem .45rem;
    padding: .7rem;
    border-bottom: 1px solid var(--line);
}

.account-summary > span:last-child {
    min-width: 0;
}

.account-summary small {
    overflow: hidden;
    max-width: 195px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-logout-form {
    margin: .35rem -.05rem -.05rem;
    padding: .35rem .05rem .05rem;
    border-top: 1px solid var(--line);
}

.nav-logout-form button {
    font-weight: 680;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: #fff;
    cursor: pointer;
}

.nav-toggle span:not(.sr-only) {
    display: block;
    height: 2px;
    margin: 4px 0;
    border-radius: 2px;
    background: var(--text);
    transition: transform .18s ease, opacity .18s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.page-shell {
    width: min(calc(100% - 2rem), var(--max-width));
    min-height: calc(100vh - 170px);
    margin: 0 auto;
    padding: 2.25rem 0 4rem;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    width: min(calc(100% - 2rem), var(--max-width));
    margin: 0 auto;
    padding: 1.5rem 0;
    gap: 2rem;
    color: var(--muted);
    font-size: .82rem;
}

.footer-inner p {
    margin: 0;
}

.messages {
    display: grid;
    position: fixed;
    z-index: 300;
    top: 92px;
    right: 1rem;
    width: min(420px, calc(100% - 2rem));
    gap: .65rem;
}

.message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: .95rem 1rem;
    border: 1px solid var(--line);
    border-radius: .9rem;
    background: #fff;
    box-shadow: var(--shadow-md);
    font-size: .9rem;
}

.message--success {
    border-color: #bbdfc7;
    background: var(--success-soft);
    color: #166534;
}

.message--error {
    border-color: #f1c0bb;
    background: var(--danger-soft);
    color: var(--danger);
}

.message--warning {
    border-color: #f1d59a;
    background: var(--warning-soft);
    color: var(--warning);
}

.message-close {
    padding: 0 .2rem;
    border: 0;
    background: transparent;
    color: currentColor;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.hero {
    display: grid;
    position: relative;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    min-height: 540px;
    padding: clamp(2.2rem, 5vw, 4.6rem);
    border-radius: 2rem;
    background:
        radial-gradient(circle at 80% 20%, rgba(102, 126, 234, .28), transparent 22rem),
        linear-gradient(135deg, #07101f 0%, #101d35 56%, #142a55 100%);
    color: #fff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .18);
}

.hero::after {
    position: absolute;
    right: -10%;
    bottom: -60%;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 120px rgba(255, 255, 255, .018);
    content: "";
}

.hero-copy {
    position: relative;
    z-index: 2;
    align-self: center;
    max-width: 690px;
}

.eyebrow {
    margin: 0 0 .55rem;
    color: var(--primary);
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #8fb4ff;
}

.hero h1,
.page-header h1,
.project-hero h1 {
    margin: 0;
    font-size: clamp(2.25rem, 5vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -.055em;
}

.hero-lead {
    max-width: 650px;
    margin: 1.4rem 0 0;
    color: #cbd5e1;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.hero-actions,
.button-group,
.form-actions,
.card-actions,
.version-actions,
.project-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .7rem;
}

.hero-actions {
    margin-top: 2rem;
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    margin-top: 2rem;
    gap: .75rem 1.25rem;
    color: #a9bad2;
    font-size: .82rem;
}

.trust-row span::before {
    margin-right: .45rem;
    color: #72e39c;
    content: "✓";
}

.hero-visual {
    display: grid;
    position: relative;
    z-index: 2;
    align-items: center;
    justify-items: end;
}

.studio-card {
    width: min(100%, 440px);
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 1.25rem;
    background: rgba(9, 18, 34, .72);
    box-shadow: 0 25px 60px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px);
}

.studio-card-top {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: #cbd5e1;
    font-size: .78rem;
}

.studio-card-top strong {
    margin-left: auto;
    color: #fff;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #41d875;
    box-shadow: 0 0 0 5px rgba(65, 216, 117, .12);
}

.waveform {
    display: flex;
    align-items: center;
    height: 128px;
    margin: 1.4rem 0;
    gap: 4px;
}

.waveform i {
    flex: 1;
    min-width: 2px;
    height: 20%;
    border-radius: 6px;
    background: linear-gradient(180deg, #7aa7ff, #7c5ce6);
    opacity: .85;
}

.waveform i:nth-child(3n) { height: 70%; }
.waveform i:nth-child(4n) { height: 42%; }
.waveform i:nth-child(5n) { height: 88%; }
.waveform i:nth-child(7n) { height: 58%; }
.waveform i:nth-child(11n) { height: 100%; }

.track-list {
    display: grid;
    gap: .5rem;
}

.track-list span {
    display: flex;
    align-items: center;
    padding: .55rem .7rem;
    border-radius: .65rem;
    background: rgba(255, 255, 255, .045);
    color: #d7e0ed;
    font-size: .76rem;
}

.track-list b {
    margin-right: .65rem;
    color: #7fa8ff;
}

.floating-note {
    display: grid;
    position: absolute;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 18px;
    background: rgba(88, 107, 196, .35);
    color: #fff;
    box-shadow: var(--shadow-md);
    font-size: 1.6rem;
    backdrop-filter: blur(10px);
}

.floating-note--one { top: 11%; right: 4%; transform: rotate(8deg); }
.floating-note--two { bottom: 10%; left: 5%; transform: rotate(-10deg); }

.stats-grid,
.feature-grid,
.project-grid,
.form-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.2rem;
}

.stat-card,
.feature-card,
.project-card,
.panel,
.form-section {
    border: 1px solid rgba(219, 227, 239, .95);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.stat-card {
    padding: 1.35rem;
    border-radius: var(--radius);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin: .2rem 0 -.1rem;
    font-size: 2rem;
    letter-spacing: -.04em;
}

.stat-card small {
    color: var(--muted);
}

.section-block {
    margin-top: 3.3rem;
}

.section-heading,
.page-header,
.project-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.section-heading {
    margin-bottom: 1.3rem;
}

.section-heading--compact {
    margin-bottom: 1rem;
}

.section-heading h2,
.panel h2,
.feature-card h2,
.form-section h2,
.project-card h2,
.project-card h3 {
    margin: 0;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.section-heading p,
.page-header p,
.panel p,
.project-card p,
.feature-card p {
    color: var(--muted);
}

.section-heading p,
.page-header p {
    margin: .35rem 0 0;
}

.text-link,
.icon-link {
    color: var(--primary);
    font-weight: 750;
}

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

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.2rem;
}

.feature-card {
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.feature-number {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 850;
    letter-spacing: .12em;
}

.feature-card p {
    margin-bottom: 0;
}

.project-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-grid--library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
    overflow: hidden;
    border-radius: var(--radius);
    transition: transform .2s ease, box-shadow .2s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.project-card-cover {
    display: flex;
    position: relative;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 150px;
    padding: 1rem;
    background:
        radial-gradient(circle at 75% 15%, rgba(255, 255, 255, .22), transparent 7rem),
        linear-gradient(135deg, #1d4ed8, #5b4dd7 60%, #111b36);
}

.genre-pill,
.version-pill {
    padding: .35rem .6rem;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 99px;
    background: rgba(10, 18, 35, .24);
    color: #fff;
    font-size: .7rem;
    font-weight: 750;
    backdrop-filter: blur(8px);
}

.version-pill {
    position: absolute;
    right: .9rem;
    bottom: .9rem;
}

.music-glyph {
    align-self: center;
    margin: auto;
    color: rgba(255, 255, 255, .9);
    font-size: 3.6rem;
    text-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

.project-card-body {
    padding: 1.15rem;
}

.project-card h2,
.project-card h3 {
    margin-top: .65rem;
    font-size: 1.08rem;
}

.project-card h2 a:hover,
.project-card h3 a:hover {
    color: var(--primary);
}

.project-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: .65rem 0 1rem;
    font-size: .86rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.card-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: .28rem .55rem;
    border-radius: 99px;
    background: #edf2f7;
    color: #475569;
    font-size: .68rem;
    font-weight: 800;
}

.status--music_ready {
    background: var(--success-soft);
    color: var(--success);
}

.status--lyrics_ready {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.status--music_generating,
.status--lyrics_generating {
    background: #f3edff;
    color: #6d28d9;
}

.status--failed {
    background: var(--danger-soft);
    color: var(--danger);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .85rem;
    color: var(--muted);
    font-size: .75rem;
}

.card-meta span + span::before {
    margin-right: .65rem;
    color: #c4cedb;
    content: "•";
}

.card-actions {
    margin-top: 1rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .68rem 1rem;
    border: 1px solid transparent;
    border-radius: .75rem;
    font-weight: 760;
    line-height: 1.1;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

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

.button:disabled {
    transform: none;
    cursor: wait;
    opacity: .68;
}

.button--primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .17);
}

.button--primary:hover {
    background: var(--primary-dark);
}

.button--secondary {
    border-color: #cbc5ff;
    background: #f1efff;
    color: #5945cc;
}

.button--secondary:hover {
    background: #e9e5ff;
}

.button--ghost {
    border-color: var(--line);
    background: #fff;
    color: #334155;
}

.button--ghost:hover {
    border-color: #b9c6d8;
    background: var(--surface-soft);
}

.button--large {
    min-height: 50px;
    padding-inline: 1.35rem;
}

.button--small {
    min-height: 34px;
    padding: .48rem .7rem;
    border-radius: .6rem;
    font-size: .78rem;
}

.page-header {
    align-items: center;
    margin-bottom: 2rem;
    padding: .5rem 0;
}

.page-header--compact h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.page-header h1,
.project-hero h1 {
    font-size: clamp(2.1rem, 4vw, 3.6rem);
}

.page-header > div,
.project-hero-main {
    max-width: 820px;
}

.panel,
.form-section {
    padding: clamp(1.2rem, 2.4vw, 2rem);
    border-radius: var(--radius);
}

.empty-state {
    display: grid;
    min-height: 270px;
    place-items: center;
    padding: 2.5rem;
    border: 1px dashed #bdc9d9;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .72);
    text-align: center;
}

.empty-state--large {
    min-height: 430px;
}

.empty-state h2,
.empty-state h3,
.empty-state p {
    margin: .3rem 0;
}

.empty-state p {
    max-width: 560px;
    color: var(--muted);
}

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

.empty-icon {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    border-radius: 20px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 2rem;
}

.studio-form {
    display: grid;
    gap: 1.15rem;
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: .9rem;
}

.form-section-heading > span {
    display: grid;
    flex: 0 0 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 850;
}

.form-section-heading p {
    margin: .25rem 0 0;
    color: var(--muted);
    font-size: .88rem;
}

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

.form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field {
    display: grid;
    align-content: start;
    gap: .4rem;
}

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

.form-field label {
    color: #263449;
    font-size: .86rem;
    font-weight: 780;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid #cdd7e5;
    border-radius: .75rem;
    background: #fff;
    color: var(--text);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.form-field input,
.form-field select {
    min-height: 48px;
    padding: .7rem .8rem;
}

.form-field textarea {
    min-height: 120px;
    padding: .8rem;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.form-field small,
.helptext,
.fine-print {
    color: var(--muted);
    font-size: .76rem;
}

.errorlist {
    margin: .15rem 0 0;
    padding-left: 1.1rem;
    color: var(--danger);
    font-size: .78rem;
}

.form-alert {
    padding: .9rem 1rem;
    border: 1px solid #f1c0bb;
    border-radius: .75rem;
    background: var(--danger-soft);
    color: var(--danger);
}

.input-with-suffix {
    display: flex;
    align-items: stretch;
}

.input-with-suffix input {
    border-radius: .75rem 0 0 .75rem;
}

.input-with-suffix span {
    display: flex;
    align-items: center;
    padding: 0 .8rem;
    border: 1px solid #cdd7e5;
    border-left: 0;
    border-radius: 0 .75rem .75rem 0;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .78rem;
}

.instrument-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.instrument-presets button {
    padding: .38rem .65rem;
    border: 1px solid #cbd7e8;
    border-radius: 99px;
    background: #fff;
    color: #46566d;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.instrument-presets button:hover,
.instrument-presets button.is-added {
    border-color: #9db7e8;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.form-actions--sticky {
    position: sticky;
    z-index: 20;
    bottom: 1rem;
    width: fit-content;
    margin: .6rem auto 0;
    padding: .6rem;
    border: 1px solid rgba(219, 227, 239, .9);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
}

.project-hero {
    align-items: flex-end;
    padding: 1rem 0 1.8rem;
}

.project-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: .75rem;
    gap: .55rem .8rem;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.project-hero-main > p {
    max-width: 760px;
    margin: 1rem 0 0;
    color: var(--muted);
}

.project-hero-actions {
    flex-direction: column;
    align-items: flex-end;
}

.progress-block {
    max-width: 520px;
    margin-top: 1.25rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: .35rem;
    color: var(--muted);
    font-size: .76rem;
}

.progress-track {
    overflow: hidden;
    height: 8px;
    border-radius: 99px;
    background: #dfe7f1;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.workflow {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.workflow-step {
    display: flex;
    align-items: center;
    min-width: 130px;
    gap: .55rem;
    color: #8a98aa;
}

.workflow-step > span {
    display: grid;
    flex: 0 0 32px;
    height: 32px;
    place-items: center;
    border: 2px solid #ccd6e3;
    border-radius: 50%;
    background: #fff;
    font-size: .75rem;
    font-weight: 850;
}

.workflow-step strong,
.workflow-step small {
    display: block;
}

.workflow-step strong {
    font-size: .78rem;
}

.workflow-step small {
    font-size: .66rem;
}

.workflow-step.is-current,
.workflow-step.is-complete {
    color: var(--text);
}

.workflow-step.is-current > span {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 5px var(--primary-soft);
}

.workflow-step.is-complete > span {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.workflow-line {
    flex: 1;
    height: 2px;
    margin: 0 .6rem;
    background: #dce4ee;
}

.workflow-line.is-complete {
    background: var(--success);
}

.alert-panel {
    display: flex;
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
}

.alert-panel p {
    margin: .2rem 0 0;
}

.alert-panel--error {
    border: 1px solid #f1c0bb;
    background: var(--danger-soft);
    color: var(--danger);
}

.studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
    gap: 1.1rem;
}

.studio-main,
.studio-sidebar {
    display: grid;
    gap: 1.1rem;
}

.studio-sidebar {
    position: sticky;
    top: 96px;
}

.action-panel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: 210px;
    gap: 1.2rem;
    background: linear-gradient(135deg, #fff, #f5f8ff);
}

.action-panel-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 1.5rem;
}

.action-panel h2 {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.prose-lead {
    margin: 0;
    color: #334155 !important;
    font-size: 1.02rem;
}

.lyrics-display {
    max-height: 760px;
    overflow: auto;
    padding: 1.4rem;
    border: 1px solid #e0e7f0;
    border-radius: .9rem;
    background: #fbfcfe;
    color: #283548;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9rem;
    line-height: 1.8;
}

.lyrics-display p {
    margin: 0 0 1rem;
    color: inherit;
}

.production-panel {
    border-color: #cbd9f6;
    background: linear-gradient(135deg, #fff, #f3f7ff);
}

.production-note {
    margin-top: 1rem;
    padding: .9rem 1rem;
    border-left: 3px solid var(--primary);
    border-radius: 0 .7rem .7rem 0;
    background: rgba(255, 255, 255, .78);
}

.production-note p {
    margin: .2rem 0 0;
}

.audio-result {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 1.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #091327, #172a4f);
    color: #fff;
}

.audio-result-cover {
    display: grid;
    position: relative;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 1rem;
    background:
        radial-gradient(circle at 65% 30%, rgba(134, 162, 255, .45), transparent 6rem),
        linear-gradient(145deg, #2c63ce, #6a4fd2);
}

.audio-result-cover span {
    position: absolute;
    top: .65rem;
    right: .65rem;
    padding: .25rem .5rem;
    border-radius: 99px;
    background: rgba(0, 0, 0, .22);
    font-size: .7rem;
    font-weight: 850;
}

.audio-result-cover strong {
    font-size: 4rem;
}

.audio-result .eyebrow {
    color: #9dbbff;
}

.audio-result-content > p {
    color: #b9c7dc;
}

.audio-player {
    display: block;
    width: 100%;
    margin: 1rem 0;
}

.version-list {
    display: grid;
    gap: .65rem;
}

.version-row {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    align-items: center;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: var(--surface-soft);
    gap: .8rem;
}

.version-row.is-selected {
    border-color: #a9c5f8;
    background: var(--primary-soft);
}

.version-number {
    display: grid;
    height: 42px;
    place-items: center;
    border-radius: .7rem;
    background: #fff;
    color: var(--primary);
    font-size: .75rem;
    font-weight: 900;
}

.version-info strong,
.version-info span {
    display: block;
}

.version-info span {
    color: var(--muted);
    font-size: .73rem;
}

.settings-card,
.instrumentation-card {
    padding: 1.2rem;
}

.settings-list {
    display: grid;
    margin: 0;
    gap: .2rem;
}

.settings-list > div {
    display: flex;
    justify-content: space-between;
    padding: .62rem 0;
    border-bottom: 1px solid #ebeff5;
    gap: 1rem;
}

.settings-list > div:last-child {
    border-bottom: 0;
}

.settings-list dt {
    color: var(--muted);
    font-size: .76rem;
}

.settings-list dd {
    margin: 0;
    text-align: right;
    font-size: .78rem;
    font-weight: 750;
}

.instrumentation-card p:not(.eyebrow) {
    font-size: .82rem;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 1.1rem;
}

.lyrics-editor-form textarea {
    min-height: 650px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.75;
}

.editor-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-label-row span {
    color: var(--muted);
    font-size: .72rem;
}

.editor-guide {
    position: sticky;
    top: 96px;
}

.editor-guide pre {
    overflow: auto;
    padding: 1rem;
    border-radius: .75rem;
    background: var(--surface-dark);
    color: #d7e6ff;
    font-size: .72rem;
    line-height: 1.55;
}

.check-list {
    display: grid;
    padding: 0;
    gap: .65rem;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--muted);
    font-size: .8rem;
}

.check-list li::before {
    position: absolute;
    left: 0;
    color: var(--success);
    content: "✓";
    font-weight: 900;
}

@media (max-width: 1120px) {
    .header-inner {
        gap: 1rem;
    }

    .brand-copy small,
    .account-trigger-label {
        display: none;
    }

    .main-nav {
        gap: .5rem;
    }

    .nav-link,
    .nav-dropdown-trigger {
        padding-inline: .65rem;
    }
}

@media (max-width: 980px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: stretch;
        max-height: calc(100vh - 94px);
        gap: .55rem;
        padding: .8rem;
        overflow-y: auto;
        border: 1px solid var(--line);
        border-top: 0;
        border-radius: 0 0 1rem 1rem;
        background: #fff;
        box-shadow: var(--shadow-md);
    }

    .main-nav.is-open {
        display: flex;
    }

    .nav-links,
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: .3rem;
    }

    .nav-actions {
        padding-top: .55rem;
        border-top: 1px solid var(--line);
    }

    .nav-link,
    .nav-cta,
    .nav-dropdown-trigger,
    .account-trigger {
        justify-content: flex-start;
        width: 100%;
        margin-left: 0;
        padding: .75rem .85rem;
    }

    .nav-cta {
        justify-content: center;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        width: 100%;
        margin-top: .35rem;
        padding: .4rem;
        border-radius: .8rem;
        background: var(--surface-soft);
        box-shadow: none;
    }

    .nav-dropdown-menu::before {
        display: none;
    }

    .account-trigger-label {
        display: inline;
    }

    .account-summary {
        background: #fff;
        border-radius: .65rem;
    }

    .account-summary small {
        max-width: min(70vw, 420px);
    }
}

@media (max-width: 1080px) {
    .project-grid,
    .project-grid--library {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        grid-template-columns: 1fr 380px;
        padding: 3rem;
    }

    .studio-layout {
        grid-template-columns: minmax(0, 1fr) 290px;
    }

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

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-visual {
        margin-top: 2rem;
        justify-items: center;
    }

    .studio-card {
        width: 100%;
    }

    .feature-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .studio-layout,
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .studio-sidebar,
    .editor-guide {
        position: static;
    }

    .workflow {
        overflow-x: auto;
    }

    .workflow-step {
        min-width: 120px;
    }

    .action-panel {
        grid-template-columns: auto 1fr;
    }

    .action-panel form {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(calc(100% - 1.1rem), var(--max-width));
        padding-top: 1.2rem;
    }

    .header-inner,
    .footer-inner {
        width: min(calc(100% - 1.1rem), var(--max-width));
    }

    .hero {
        padding: 2rem 1.25rem;
        border-radius: 1.3rem;
    }

    .hero h1 {
        font-size: 2.55rem;
    }

    .hero-actions,
    .hero-actions .button {
        width: 100%;
    }

    .floating-note {
        display: none;
    }

    .project-grid,
    .project-grid--library,
    .form-grid,
    .form-grid--three {
        grid-template-columns: 1fr;
    }

    .page-header,
    .project-hero,
    .section-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .button,
    .project-hero-actions .button {
        width: 100%;
    }

    .project-hero-actions {
        align-items: stretch;
    }

    .panel,
    .form-section {
        padding: 1.05rem;
    }

    .form-actions--sticky {
        width: 100%;
    }

    .form-actions--sticky .button {
        flex: 1;
    }

    .action-panel {
        grid-template-columns: 1fr;
    }

    .audio-result {
        grid-template-columns: 1fr;
    }

    .audio-result-cover {
        max-width: 180px;
    }

    .version-row {
        grid-template-columns: 42px 1fr;
    }

    .version-actions {
        grid-column: 1 / -1;
    }

    .version-actions .button {
        flex: 1;
    }

    .footer-inner {
        flex-direction: column;
        gap: .5rem;
    }
}

/* Neginati v2 — comparaison et gestion sécurisée des versions */
.version-history-panel {
    overflow: hidden;
}

.version-count {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: .35rem .7rem;
    border: 1px solid #cbd7e8;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
    white-space: nowrap;
}

.version-list--players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 1rem;
}

.version-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: linear-gradient(145deg, #fff, #f8fafc);
    box-shadow: var(--shadow-sm);
    gap: .9rem;
}

.version-card.is-selected {
    border-color: #9dbcf2;
    background: linear-gradient(145deg, #f7faff, #eef4ff);
    box-shadow: 0 14px 36px rgba(37, 99, 235, .12);
}

.version-card-header,
.version-title-group {
    display: flex;
    align-items: center;
}

.version-card-header {
    justify-content: space-between;
    gap: .8rem;
}

.version-title-group {
    min-width: 0;
    gap: .75rem;
}

.final-version-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: var(--success);
    color: #fff;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.version-audio-player {
    margin: 0;
}

.version-metadata {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: .75rem;
    border: 1px solid #e3e9f2;
    border-radius: .8rem;
    background: rgba(255, 255, 255, .78);
    gap: .65rem .9rem;
}

.version-metadata div {
    min-width: 0;
}

.version-metadata dt {
    color: var(--muted);
    font-size: .66rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.version-metadata dd {
    overflow-wrap: anywhere;
    margin: .12rem 0 0;
    color: var(--text);
    font-size: .77rem;
    font-weight: 800;
}

.version-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: auto;
    gap: .45rem;
}

.version-actions form {
    margin: 0;
}

.button--danger-ghost {
    border: 1px solid #efb6b0;
    background: #fff;
    color: var(--danger);
}

.button--danger-ghost:hover {
    border-color: var(--danger);
    background: var(--danger-soft);
}

.version-protection-note {
    color: var(--muted);
    font-size: .69rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .version-list--players {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .version-card-header {
        align-items: flex-start;
    }

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

    .version-actions,
    .version-actions form,
    .version-actions .button {
        width: 100%;
    }

    .version-actions .button {
        justify-content: center;
    }
}


/* Neginati v3 — préréglages professionnels */
.preset-panel {
    display: grid;
    padding: clamp(1.2rem, 2.5vw, 2rem);
    border: 1px solid #b8cdf5;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .14), transparent 36%),
        linear-gradient(145deg, #f8fbff, #eef4ff);
    box-shadow: 0 18px 48px rgba(37, 99, 235, .1);
    gap: 1.15rem;
}

.preset-panel__intro h2 {
    margin: .2rem 0 .35rem;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.preset-panel__intro p:last-child {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
}

.preset-panel__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem;
}

.preset-panel__controls .button {
    min-height: 48px;
    white-space: nowrap;
}

.preset-panel__controls .button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.preset-preview {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    padding: 1rem;
    border: 1px solid rgba(157, 188, 242, .8);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .82);
    gap: 1rem;
}

.preset-preview[hidden] {
    display: none;
}

.preset-preview__category {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.preset-preview h3 {
    margin: .55rem 0 .3rem;
    font-size: 1.12rem;
}

.preset-preview p {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.55;
}

.preset-preview__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    margin: 0;
    gap: .55rem;
}

.preset-preview__facts div {
    min-width: 0;
    padding: .7rem;
    border: 1px solid #dce5f2;
    border-radius: .8rem;
    background: #fff;
}

.preset-preview__facts dt {
    color: var(--muted);
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.preset-preview__facts dd {
    overflow-wrap: anywhere;
    margin: .18rem 0 0;
    color: var(--text);
    font-size: .76rem;
    font-weight: 800;
}

.preset-feedback {
    min-height: 1.2rem;
    margin: 0;
    color: var(--success);
    font-size: .78rem;
    font-weight: 750;
}

@media (max-width: 900px) {
    .preset-preview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .preset-panel__controls {
        grid-template-columns: 1fr;
    }

    .preset-panel__controls .button {
        width: 100%;
        justify-content: center;
    }

    .preset-preview__facts {
        grid-template-columns: 1fr;
    }
}

/* API usage and cost control */
.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card--usage {
    border-color: rgba(98, 121, 255, .24);
    background:
        radial-gradient(circle at top right, rgba(98, 121, 255, .13), transparent 48%),
        var(--surface);
}

.stat-card--usage a {
    color: var(--primary);
    font-weight: 750;
}

.generation-cost-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: .9rem 1rem;
    border: 1px solid #d7e1f5;
    border-radius: .9rem;
    background: rgba(255, 255, 255, .86);
}

.generation-cost-preview > div {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.generation-cost-preview p {
    margin: .15rem 0 0;
    font-size: .82rem;
}

.generation-cost-preview__icon {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 900;
}

.cost-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 32px;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: #eaf8ef;
    color: #17603a;
    font-size: .76rem;
    font-weight: 850;
    white-space: nowrap;
}

.usage-mini-list,
.usage-rate-list {
    display: grid;
    margin: 0;
    gap: .55rem;
}

.usage-mini-list div,
.usage-rate-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid #e5eaf2;
}

.usage-mini-list div:last-child,
.usage-rate-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.usage-mini-list dt,
.usage-rate-list dt {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
}

.usage-mini-list dd,
.usage-rate-list dd {
    margin: 0;
    color: var(--text);
    font-size: .8rem;
    font-weight: 850;
    text-align: right;
    overflow-wrap: anywhere;
}

.usage-page-header {
    margin-bottom: 1.2rem;
}

.usage-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.usage-stat-card {
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid rgba(219, 227, 239, .95);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.usage-stat-card__label {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 750;
}

.usage-stat-card strong {
    display: block;
    margin: .25rem 0 .05rem;
    color: var(--text);
    font-size: clamp(1.45rem, 3vw, 2rem);
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
}

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

.usage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr);
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.usage-budget-panel,
.usage-rate-panel,
.usage-history-panel {
    padding: 1.35rem;
}

.budget-progress-list {
    display: grid;
    margin-bottom: 1.35rem;
    gap: 1rem;
}

.budget-progress {
    padding: 1rem;
    border: 1px solid #e0e7f0;
    border-radius: .9rem;
    background: #fbfcff;
}

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

.budget-progress__heading div {
    display: grid;
    gap: .1rem;
}

.budget-progress__heading span,
.budget-progress__heading b {
    color: var(--muted);
    font-size: .72rem;
}

.budget-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5eaf4;
}

.budget-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width .25s ease;
}

.usage-policy-form {
    padding-top: 1.2rem;
    border-top: 1px solid #e5eaf2;
}

.usage-policy-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem;
    border: 1px solid #dce4f1;
    border-radius: .85rem;
    background: #fbfcff;
    cursor: pointer;
}

.usage-policy-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: .15rem;
}

.usage-policy-checkbox span {
    display: grid;
    gap: .2rem;
}

.usage-policy-checkbox small {
    display: block;
}

.usage-information {
    margin-top: 1rem;
    padding: .9rem;
    border-radius: .85rem;
    background: #f2f5fb;
}

.usage-information p {
    margin: .25rem 0 0;
    font-size: .78rem;
    line-height: 1.55;
}

.usage-table-wrap {
    overflow-x: auto;
    border: 1px solid #e0e6ef;
    border-radius: .9rem;
}

.usage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.usage-table th,
.usage-table td {
    padding: .8rem;
    border-bottom: 1px solid #e7ebf2;
    text-align: left;
    vertical-align: top;
}

.usage-table th {
    background: #f5f7fb;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.usage-table tbody tr:last-child td {
    border-bottom: 0;
}

.usage-table td small {
    display: block;
    margin-top: .15rem;
    color: var(--muted);
}

.usage-table a {
    color: var(--primary);
    font-weight: 750;
}

.provider-badge,
.usage-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 850;
    white-space: nowrap;
}

.provider-badge--openai {
    background: #eaf8f3;
    color: #176248;
}

.provider-badge--elevenlabs {
    background: #eeeefe;
    color: #4c46a8;
}

.usage-status--success {
    background: #eaf8ef;
    color: #17603a;
}

.usage-status--failed {
    background: #fff0ee;
    color: #a63b32;
}

.usage-status--blocked {
    background: #fff6df;
    color: #8a5a00;
}

.usage-error-row td {
    padding-top: .55rem;
    padding-bottom: .55rem;
    background: #fff8f7;
    color: #9e3c34;
    font-size: .72rem;
}

.empty-state--compact {
    min-height: 230px;
}

@media (max-width: 1100px) {
    .stats-grid,
    .usage-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 700px) {
    .stats-grid,
    .usage-summary-grid {
        grid-template-columns: 1fr;
    }

    .generation-cost-preview {
        align-items: flex-start;
        flex-direction: column;
    }

    .usage-table-wrap {
        overflow: visible;
        border: 0;
    }

    .usage-table,
    .usage-table thead,
    .usage-table tbody,
    .usage-table tr,
    .usage-table th,
    .usage-table td {
        display: block;
    }

    .usage-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .usage-table tr {
        margin-bottom: .75rem;
        overflow: hidden;
        border: 1px solid #e0e6ef;
        border-radius: .85rem;
        background: #fff;
    }

    .usage-table td {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr);
        gap: .7rem;
        border-bottom: 1px solid #edf0f5;
    }

    .usage-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .66rem;
        font-weight: 850;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    .usage-error-row td {
        display: block;
    }

    .usage-error-row td::before {
        content: "Erreur";
        display: block;
        margin-bottom: .3rem;
    }
}

/* Neginati v5 — background generation */
.generation-job-panel {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(37, 99, 235, .22);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(109, 92, 231, .05)),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.generation-job-panel--failed {
    border-color: rgba(180, 35, 24, .22);
    background:
        linear-gradient(135deg, rgba(180, 35, 24, .07), rgba(255, 240, 238, .82)),
        var(--surface);
}

.generation-job-panel__header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 1rem;
}

.generation-job-panel__header h2,
.generation-job-panel__header p {
    margin-top: 0;
}

.generation-job-panel__header h2 {
    margin-bottom: .3rem;
}

.generation-job-panel__header p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.generation-job-panel__icon {
    display: grid;
    width: 2.9rem;
    height: 2.9rem;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
    animation: generation-job-pulse 1.8s ease-in-out infinite;
}

.generation-job-panel--failed .generation-job-panel__icon {
    background: var(--danger);
    box-shadow: 0 10px 24px rgba(180, 35, 24, .18);
    animation: none;
}

.job-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .74rem;
    font-weight: 850;
    white-space: nowrap;
}

.job-status-badge--failed {
    background: var(--danger-soft);
    color: var(--danger);
}

.progress-block--job {
    margin-top: 0;
}

.progress-track--job {
    overflow: hidden;
}

.progress-track--job span {
    position: relative;
    transition: width .45s ease;
}

.progress-track--job span::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    animation: generation-job-shimmer 1.6s linear infinite;
}

.job-background-note {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

button[disabled],
.button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
}

@keyframes generation-job-pulse {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
}

@keyframes generation-job-shimmer {
    from { transform: translateX(-140%); }
    to { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
    .generation-job-panel__icon,
    .progress-track--job span::after {
        animation: none;
    }
}

@media (max-width: 700px) {
    .generation-job-panel__header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .job-status-badge {
        grid-column: 1 / -1;
        justify-self: start;
    }
}


/* v7 — santé système et maintenance */
.health-heading {
    align-items: flex-end;
}

.health-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    margin: 1.25rem 0;
    padding: 1.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.health-summary--ok { border-left: .35rem solid #16835c; }
.health-summary--warning { border-left: .35rem solid #b36b00; }
.health-summary--error { border-left: .35rem solid var(--danger); }

.health-summary__label {
    display: block;
    margin-bottom: .25rem;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.health-summary strong { font-size: clamp(1.25rem, 2vw, 1.7rem); }

.health-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(5.2rem, 1fr));
    gap: .7rem;
    margin: 0;
}

.health-metrics div {
    min-width: 0;
    padding: .7rem .8rem;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    text-align: center;
}

.health-metrics dt { color: var(--muted); font-size: .72rem; font-weight: 750; }
.health-metrics dd { margin: .2rem 0 0; font-size: 1.12rem; font-weight: 850; }

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

.health-card {
    padding: 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.health-card--warning { background: #fffaf0; }
.health-card--error { background: var(--danger-soft); }

.health-card__header {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.health-card h2 { margin: 0; font-size: 1.05rem; }
.health-card p { margin: .7rem 0 0; color: var(--muted); }
.health-card ul { margin: .75rem 0 0; padding-left: 1.2rem; color: var(--muted); }

.health-badge {
    display: inline-flex;
    padding: .3rem .58rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 850;
    white-space: nowrap;
}

.health-badge--ok { background: #e6f7f0; color: #086644; }
.health-badge--warning { background: #fff0cc; color: #875000; }
.health-badge--error { background: #ffe5e7; color: var(--danger); }

.maintenance-panel { margin-top: 1rem; }
.maintenance-commands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.maintenance-commands div { min-width: 0; padding: .9rem; border-radius: var(--radius-md); background: var(--surface-alt); }
.maintenance-commands strong { display: block; margin-bottom: .45rem; }
.maintenance-commands code { display: block; overflow-wrap: anywhere; color: var(--primary-dark); }

@media (max-width: 900px) {
    .health-summary { grid-template-columns: 1fr; }
    .health-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .maintenance-commands { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .health-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Neginati application shell and dashboard
   ========================================================================== */
:root {
    --neg-bg: #070611;
    --neg-bg-soft: #0d0a1c;
    --neg-panel: rgba(17, 13, 34, .88);
    --neg-panel-strong: #121026;
    --neg-border: rgba(183, 148, 246, .16);
    --neg-purple: #7c3aed;
    --neg-purple-light: #a855f7;
    --neg-gold: #f59e0b;
    --neg-text: #f8f5ff;
    --neg-muted: #aaa3bc;
    --neg-green: #10b981;
}

.app-body,
.public-body {
    background:
        radial-gradient(circle at 72% 5%, rgba(124, 58, 237, .15), transparent 26rem),
        radial-gradient(circle at 20% 90%, rgba(245, 158, 11, .06), transparent 22rem),
        var(--neg-bg);
    color: var(--neg-text);
}

.app-layout { min-height: 100vh; }
.app-sidebar {
    position: fixed; z-index: 300; inset: 0 auto 0 0; display: flex; flex-direction: column;
    width: 272px; padding: 1.25rem 1rem; overflow-y: auto;
    border-right: 1px solid var(--neg-border);
    background: linear-gradient(180deg, rgba(14, 11, 29, .98), rgba(8, 7, 18, .98));
    box-shadow: 22px 0 60px rgba(0, 0, 0, .22);
}
.sidebar-brand-wrap { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.3rem; padding: 0 .25rem; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; }
.sidebar-brand img { width: 46px; height: 46px; filter: drop-shadow(0 8px 20px rgba(124, 58, 237, .4)); }
.sidebar-brand span, .sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-family: Georgia, 'Times New Roman', serif; font-size: 1.42rem; letter-spacing: .045em; }
.sidebar-brand small { color: #e7b44e; font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-close { display: none; border: 0; background: transparent; color: #fff; font-size: 1.8rem; cursor: pointer; }
.sidebar-nav { display: grid; gap: .25rem; }
.sidebar-label { margin: 1.25rem .75rem .35rem; color: #a874ff; font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-link { display: flex; align-items: center; gap: .75rem; min-height: 46px; padding: .72rem .8rem; border-radius: .8rem; color: #d6d0e0; font-size: .9rem; font-weight: 650; transition: .18s ease; }
.sidebar-link svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-link:hover, .sidebar-link.is-active { background: rgba(124, 58, 237, .16); color: #c996ff; transform: translateX(2px); }
.sidebar-link--primary { margin: .45rem 0; background: linear-gradient(135deg, #6d28d9, #8b2be2); color: #fff; box-shadow: 0 12px 28px rgba(109, 40, 217, .22); }
.sidebar-link--primary:hover, .sidebar-link--primary.is-active { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.sidebar-account { display: grid; grid-template-columns: 38px minmax(0, 1fr) 34px; align-items: center; gap: .65rem; margin-top: auto; padding: .85rem .55rem 0; border-top: 1px solid var(--neg-border); }
.sidebar-avatar, .topbar-avatar { display: grid; place-items: center; border: 1px solid rgba(245, 158, 11, .45); border-radius: 50%; background: linear-gradient(145deg, #6d28d9, #2a185d); color: #fff; font-weight: 800; }
.sidebar-avatar { width: 38px; height: 38px; }
.sidebar-account-copy { min-width: 0; }
.sidebar-account-copy strong, .sidebar-account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-copy strong { font-size: .78rem; }
.sidebar-account-copy small { color: var(--neg-muted); font-size: .68rem; }
.sidebar-account form button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: .65rem; background: transparent; color: #ef8e9b; cursor: pointer; }
.sidebar-account form button:hover { background: rgba(239, 68, 68, .11); }
.sidebar-account svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-backdrop { display: none; }

.app-main { min-height: 100vh; margin-left: 272px; }
.app-topbar { position: sticky; z-index: 150; top: 0; display: flex; align-items: center; gap: 1rem; min-height: 78px; padding: .85rem clamp(1rem, 2.4vw, 2.2rem); border-bottom: 1px solid var(--neg-border); background: rgba(7, 6, 17, .86); backdrop-filter: blur(20px); }
.sidebar-toggle { display: none; width: 42px; height: 42px; padding: 10px; border: 1px solid var(--neg-border); border-radius: .75rem; background: rgba(255,255,255,.035); }
.sidebar-toggle span:not(.sr-only) { display: block; height: 2px; margin: 4px 0; background: #fff; }
.topbar-title span, .topbar-title strong { display: block; }
.topbar-title span { color: var(--neg-muted); font-size: .67rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.topbar-title strong { font-size: 1rem; }
.topbar-create { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; padding: .72rem 1.1rem; border-radius: .75rem; background: linear-gradient(135deg, #6d28d9, #8b2be2); color: #fff; font-size: .85rem; font-weight: 750; box-shadow: 0 10px 24px rgba(109,40,217,.24); }
.topbar-profile { position: relative; }
.topbar-profile summary { display: flex; align-items: center; gap: .55rem; list-style: none; cursor: pointer; }
.topbar-profile summary::-webkit-details-marker { display: none; }
.topbar-avatar { width: 38px; height: 38px; }
.topbar-profile-copy strong, .topbar-profile-copy small { display: block; line-height: 1.25; }
.topbar-profile-copy strong { font-size: .78rem; }
.topbar-profile-copy small { color: #d6a938; font-size: .66rem; }
.topbar-profile-menu { position: absolute; top: calc(100% + .9rem); right: 0; display: grid; width: 230px; padding: .5rem; border: 1px solid var(--neg-border); border-radius: 1rem; background: #111021; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.topbar-profile-menu a, .topbar-profile-menu button { width: 100%; padding: .72rem .8rem; border: 0; border-radius: .65rem; background: transparent; color: #e8e3ef; text-align: left; cursor: pointer; }
.topbar-profile-menu a:hover, .topbar-profile-menu button:hover { background: rgba(124,58,237,.14); }
.topbar-profile-menu button { color: #ff8f9d; }

.app-page-shell { width: 100%; max-width: 1700px; padding: clamp(1rem, 2.2vw, 2rem); }
.neg-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; }
.neg-dashboard-main, .neg-dashboard-aside { display: grid; align-content: start; gap: 1rem; }
.neg-hero, .neg-panel, .neg-summary-card, .neg-tip-card, .neg-security-card { border: 1px solid var(--neg-border); border-radius: 1.15rem; background: linear-gradient(145deg, rgba(19, 15, 39, .92), rgba(10, 8, 23, .94)); box-shadow: 0 24px 60px rgba(0,0,0,.18); }
.neg-hero { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; min-height: 350px; overflow: hidden; }
.neg-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 72% 48%, rgba(124,58,237,.22), transparent 34%), linear-gradient(110deg, transparent 45%, rgba(245,158,11,.04)); pointer-events: none; }
.neg-hero-copy { position: relative; z-index: 2; padding: clamp(1.5rem, 3vw, 2.4rem); }
.neg-kicker { display: inline-flex; align-items: center; gap: .35rem; margin: 0 0 1rem; padding: .38rem .72rem; border: 1px solid rgba(168,85,247,.28); border-radius: 999px; background: rgba(124,58,237,.09); color: #c894ff; font-size: .76rem; }
.neg-hero h1, .neg-public-hero h1 { margin: 0; color: #fff; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.35rem, 4.7vw, 4.35rem); line-height: 1.02; letter-spacing: -.045em; }
.neg-hero h1 em, .neg-public-hero h1 em { color: #a855f7; font-style: normal; }
.neg-hero-copy > p:not(.neg-kicker) { max-width: 610px; margin: 1.2rem 0; color: #c2bbce; font-size: 1rem; }
.neg-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.neg-button { display: inline-flex; align-items: center; justify-content: center; min-height: 47px; padding: .72rem 1.15rem; border: 1px solid var(--neg-border); border-radius: .72rem; font-weight: 750; }
.neg-button--primary { border-color: transparent; background: linear-gradient(135deg, #6d28d9, #9628e0); color: #fff; box-shadow: 0 12px 30px rgba(109,40,217,.3); }
.neg-button--ghost { background: rgba(255,255,255,.025); color: #fff; }
.neg-button:hover { transform: translateY(-2px); }
.neg-hero-art { position: relative; min-height: 330px; }
.neg-note { position: absolute; z-index: 2; top: 48%; left: 50%; color: #bc64ff; font-family: Georgia, serif; font-size: clamp(8rem, 17vw, 14rem); line-height: 1; transform: translate(-50%,-50%) rotate(8deg); text-shadow: 0 0 22px rgba(168,85,247,.75), 0 0 55px rgba(124,58,237,.48); }
.neg-orbit { position: absolute; left: 48%; top: 55%; border: 2px solid transparent; border-bottom-color: rgba(245,158,11,.8); border-radius: 50%; transform: translate(-50%,-50%) rotate(-18deg); }
.neg-orbit--one { width: 290px; height: 135px; box-shadow: 0 16px 34px rgba(245,158,11,.08); }
.neg-orbit--two { width: 355px; height: 180px; border-bottom-color: rgba(168,85,247,.6); }
.neg-spark { position: absolute; color: #f9c85c; text-shadow: 0 0 15px currentColor; }
.neg-spark--one { top: 20%; right: 18%; font-size: 1.4rem; }.neg-spark--two { bottom: 24%; left: 10%; }
.neg-panel { padding: 1.15rem; }
.neg-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.neg-panel-heading p { margin: 0; color: #a874ff; font-size: .67rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.neg-panel-heading h2 { margin: .15rem 0 0; color: #fff; font-size: 1.05rem; }
.neg-panel-heading a { color: #bb7cff; font-size: .78rem; }
.neg-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.neg-steps article { position: relative; min-height: 190px; padding: 1rem; border: 1px solid var(--neg-border); border-radius: .9rem; background: rgba(255,255,255,.018); text-align: center; }
.neg-steps article > span { position: absolute; top: .65rem; left: .7rem; display: grid; place-items: center; width: 25px; height: 25px; border-radius: .45rem; background: rgba(124,58,237,.28); color: #d4afff; font-size: .72rem; }
.neg-step-icon { margin: .6rem auto .8rem; color: #a855f7; font-size: 2.4rem; text-shadow: 0 0 18px rgba(168,85,247,.4); }
.neg-steps h3 { margin: 0 0 .45rem; color: #fff; font-size: .9rem; }.neg-steps p { margin: 0; color: var(--neg-muted); font-size: .75rem; line-height: 1.5; }
.neg-projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.neg-project-card { display: grid; grid-template-columns: 94px 1fr; gap: .85rem; padding: .75rem; border: 1px solid var(--neg-border); border-radius: .9rem; background: rgba(255,255,255,.018); }
.neg-project-cover { display: grid; place-items: center; align-content: center; min-height: 112px; border-radius: .7rem; background: radial-gradient(circle at 70% 20%, rgba(245,158,11,.42), transparent 35%), linear-gradient(145deg,#461a7d,#11142f); }
.neg-project-cover span { color: #fff; font-size: 2.2rem; }.neg-project-cover small { margin-top: .35rem; color: #f5d985; font-size: .62rem; }
.neg-project-card h3 { margin: .4rem 0 .25rem; color: #fff; font-size: .92rem; }.neg-project-card p { margin: 0 0 .5rem; color: var(--neg-muted); font-size: .72rem; }.neg-project-card > div > small { color: #807990; font-size: .66rem; }
.neg-empty { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; border: 1px dashed rgba(168,85,247,.28); border-radius: .9rem; }.neg-empty > span { color: #a855f7; font-size: 2rem; }.neg-empty h3, .neg-empty p { margin: 0; }.neg-empty p { color: var(--neg-muted); font-size: .78rem; }.neg-empty a { margin-left: auto; color: #c68dff; font-size: .78rem; font-weight: 750; }
.neg-summary-card, .neg-tip-card, .neg-security-card { padding: 1.1rem; }
.neg-summary-list { display: grid; gap: .55rem; }
.neg-summary-list article { display: flex; align-items: center; gap: .75rem; padding: .75rem; border: 1px solid rgba(255,255,255,.055); border-radius: .8rem; background: rgba(255,255,255,.018); }
.neg-summary-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(145deg,#6d28d9,#9d45ef); color: #fff; }.neg-summary-icon--gold { background: linear-gradient(145deg,#9a6505,#e6a619); }.neg-summary-icon--green { background: linear-gradient(145deg,#057a55,#12b981); }.neg-summary-icon--blue { background: linear-gradient(145deg,#1d4ed8,#3b82f6); }
.neg-summary-list strong, .neg-summary-list small { display: block; }.neg-summary-list strong { color: #fff; font-size: 1.25rem; }.neg-summary-list small { color: var(--neg-muted); font-size: .72rem; }
.neg-tip-card { position: relative; overflow: hidden; background: radial-gradient(circle at 100% 0, rgba(245,158,11,.18), transparent 12rem), linear-gradient(145deg,#17102e,#0d0a1c); }.neg-tip-card > span { color: #f5b631; font-size: 2rem; }.neg-tip-card p { margin: .5rem 0 .25rem; color: #d7a638; font-size: .68rem; font-weight: 800; text-transform: uppercase; }.neg-tip-card h2 { margin: 0 0 1rem; font-family: Georgia, serif; font-size: 1.25rem; line-height: 1.25; }.neg-tip-card a { color: #c98eff; font-size: .8rem; font-weight: 750; }
.neg-security-card { display: flex; align-items: center; gap: .75rem; }.neg-security-card > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(16,185,129,.12); color: #34d399; }.neg-security-card strong,.neg-security-card small { display: block; }.neg-security-card small { color: var(--neg-muted); font-size: .7rem; }

.public-header { border-bottom: 1px solid var(--neg-border); background: rgba(7,6,17,.9); backdrop-filter: blur(20px); }.public-header-inner { display: flex; align-items: center; justify-content: space-between; width: min(calc(100% - 2rem), 1240px); min-height: 78px; margin: auto; }.public-brand { display: flex; align-items: center; gap: .7rem; }.public-brand img { width: 44px; }.public-brand strong,.public-brand small { display:block; }.public-brand strong { font-family: Georgia,serif; font-size: 1.35rem; letter-spacing:.04em; }.public-brand small { color:#d6a938; font-size:.58rem; text-transform:uppercase; letter-spacing:.08em; }.public-header nav { display:flex; align-items:center; gap:.5rem; }.public-header nav a { padding:.65rem .9rem; color:#ddd7e7; font-size:.84rem; font-weight:700; }.public-header .public-cta { border-radius:.7rem; background:linear-gradient(135deg,#6d28d9,#9628e0); color:#fff; }.public-page-shell { max-width:1240px; }.neg-public-hero { display:grid; grid-template-columns:1.15fr .85fr; align-items:center; min-height:620px; }.neg-public-hero > div:first-child { padding:2rem 0; }.neg-public-hero > div > p:not(.neg-kicker) { max-width:660px; color:#c2bbce; font-size:1.1rem; }.neg-public-symbol { display:grid; place-items:center; color:#a855f7; font-size:16rem; text-shadow:0 0 35px rgba(168,85,247,.6),0 0 85px rgba(245,158,11,.18); }.neg-public-features { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; padding-bottom:4rem; }.neg-public-features article { padding:1.3rem; border:1px solid var(--neg-border); border-radius:1rem; background:var(--neg-panel); }.neg-public-features span { color:#d7a638; font-size:.72rem; font-weight:800; }.neg-public-features h2 { color:#fff; }.neg-public-features p { color:var(--neg-muted); }.public-footer { display:flex; justify-content:space-between; gap:1rem; width:min(calc(100% - 2rem),1240px); margin:auto; padding:1.5rem 0; border-top:1px solid var(--neg-border); color:#827b8f; font-size:.72rem; }

@media (max-width: 1280px) { .neg-dashboard { grid-template-columns: 1fr; }.neg-dashboard-aside { grid-template-columns: repeat(3, 1fr); }.neg-summary-card { grid-column: span 2; } }
@media (max-width: 1020px) {
    .app-sidebar { transform: translateX(-105%); transition: transform .22s ease; }
    .app-sidebar.is-open { transform: translateX(0); }
    .sidebar-close, .sidebar-toggle { display: block; }
    .sidebar-backdrop { position: fixed; z-index: 250; inset: 0; background: rgba(0,0,0,.58); backdrop-filter: blur(3px); }
    .sidebar-backdrop.is-visible { display: block; }
    .app-main { margin-left: 0; }
    .neg-steps { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
    .app-topbar { min-height: 68px; }.topbar-create { margin-left:auto; padding:.65rem .75rem; }.topbar-profile-copy { display:none; }
    .neg-hero { grid-template-columns:1fr; }.neg-hero-art { min-height:230px; }.neg-note { font-size:9rem; }
    .neg-dashboard-aside { grid-template-columns:1fr; }.neg-summary-card { grid-column:auto; }.neg-projects { grid-template-columns:1fr; }
    .neg-public-hero { grid-template-columns:1fr; min-height:auto; padding:4rem 0; }.neg-public-symbol { font-size:10rem; }.neg-public-features { grid-template-columns:1fr; }
    .public-footer { display:block; }.public-header nav a:first-child { display:none; }
}
@media (max-width: 560px) {
    .app-page-shell { padding:.75rem; }.topbar-title { display:none; }.topbar-create { font-size:.75rem; }.neg-hero-copy { padding:1.25rem; }.neg-hero h1 { font-size:2.45rem; }.neg-steps { grid-template-columns:1fr; }.neg-empty { align-items:flex-start; flex-wrap:wrap; }.neg-empty a { margin-left:0; }.neg-project-card { grid-template-columns:78px 1fr; }.neg-project-cover { min-height:96px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar-link,.neg-button,.app-sidebar { transition:none !important; } }

/* ==========================================================================
   Neginati unified application layout — header, movable sidebar and dark UI
   ========================================================================== */
:root {
    --neg-header-height: 78px;
    --neg-sidebar-width: 272px;
    --neg-sidebar-collapsed: 88px;
    --neg-content-max: 1680px;
}

.app-body { overflow-x: hidden; }
.app-layout { min-height: 100vh; padding-top: var(--neg-header-height); }

.app-topbar {
    position: fixed;
    z-index: 500;
    inset: 0 0 auto 0;
    min-height: var(--neg-header-height);
    padding: .7rem clamp(1rem, 2.4vw, 2rem);
    background: rgba(7, 6, 17, .94);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .18);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .72rem;
    min-width: 245px;
}
.topbar-brand img { width: 44px; height: 44px; filter: drop-shadow(0 9px 24px rgba(124, 58, 237, .42)); }
.topbar-brand span, .topbar-brand strong, .topbar-brand small { display: block; }
.topbar-brand strong { font-family: Georgia, 'Times New Roman', serif; font-size: 1.35rem; letter-spacing: .04em; }
.topbar-brand small { color: #e2b14b; font-size: .58rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }

.app-sidebar {
    inset: var(--neg-header-height) auto 0 0;
    width: var(--neg-sidebar-width);
    padding: 1rem;
    transition: width .22s ease, transform .22s ease;
}
.sidebar-tools { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 .45rem .55rem; color: #b9b1c7; }
.sidebar-tools > strong { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-collapse, .sidebar-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--neg-border);
    border-radius: .65rem;
    background: rgba(255, 255, 255, .035);
    color: #dcd5e8;
    cursor: pointer;
}
.sidebar-collapse svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.sidebar-close { display: none; font-size: 1.4rem; }

.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: calc(100vh - var(--neg-header-height));
    margin-left: var(--neg-sidebar-width);
    transition: margin-left .22s ease;
}
.app-page-shell { flex: 1 0 auto; width: min(100%, var(--neg-content-max)); margin-inline: auto; overflow: clip; }

.sidebar-collapsed .app-sidebar { width: var(--neg-sidebar-collapsed); }
.sidebar-collapsed .app-main { margin-left: var(--neg-sidebar-collapsed); }
.sidebar-collapsed .sidebar-tools > strong,
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-link span,
.sidebar-collapsed .sidebar-account-copy { display: none; }
.sidebar-collapsed .sidebar-tools { justify-content: center; }
.sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
.sidebar-collapsed .sidebar-link { justify-content: center; padding-inline: .65rem; }
.sidebar-collapsed .sidebar-link svg { flex: 0 0 22px; }
.sidebar-collapsed .sidebar-account { grid-template-columns: 1fr; justify-items: center; }
.sidebar-collapsed .sidebar-account form { display: none; }

.sidebar-link { white-space: nowrap; }
.sidebar-link:hover { transform: none; }

.sidebar-toggle { flex: 0 0 42px; cursor: pointer; }
.topbar-title { min-width: 0; }
.topbar-create { white-space: nowrap; }

.topbar-profile-trigger {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 46px;
    padding: .25rem .45rem;
    border: 1px solid transparent;
    border-radius: .85rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.topbar-profile-trigger:hover,
.topbar-profile.is-open .topbar-profile-trigger { border-color: var(--neg-border); background: rgba(255,255,255,.035); }
.profile-chevron { transition: transform .18s ease; }
.topbar-profile.is-open .profile-chevron { transform: rotate(180deg); }
.topbar-profile-menu { display: none; z-index: 520; }
.topbar-profile.is-open .topbar-profile-menu,
.topbar-profile:focus-within .topbar-profile-menu { display: grid; }
.profile-menu-identity { min-width: 0; margin: .1rem .2rem .45rem; padding: .65rem .65rem .75rem; border-bottom: 1px solid var(--neg-border); }
.profile-menu-identity strong, .profile-menu-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-identity strong { color: #fff; font-size: .82rem; }
.profile-menu-identity small { color: var(--neg-muted); font-size: .7rem; }

/* Unified dark surfaces across internal pages. */
.app-body .page-header,
.app-body .project-card,
.app-body .form-section,
.app-body .preset-panel,
.app-body .empty-state,
.app-body .panel,
.app-body .card,
.app-body .modal-content,
.app-body .usage-card,
.app-body .health-card,
.app-body .maintenance-panel {
    border-color: var(--neg-border);
    background: linear-gradient(145deg, rgba(19, 15, 39, .94), rgba(10, 8, 23, .96));
    color: var(--neg-text);
    box-shadow: 0 22px 55px rgba(0,0,0,.2);
}
.app-body .page-header { padding: clamp(1.2rem, 2.4vw, 2rem); border: 1px solid var(--neg-border); border-radius: 1.15rem; }
.app-body .page-header h1,
.app-body .project-card h2,
.app-body .project-card h3,
.app-body .form-section h2,
.app-body .preset-panel h2,
.app-body label { color: #fff; }
.app-body .page-header p,
.app-body .project-card p,
.app-body .form-section p,
.app-body .preset-panel p,
.app-body .form-field small { color: var(--neg-muted); }
.app-body .eyebrow { color: #d8a83e; }

.project-grid--library { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); align-items: stretch; }
.project-card { min-width: 0; overflow: hidden; }
.project-card-cover { background: radial-gradient(circle at 75% 20%, rgba(168,85,247,.24), transparent 45%), linear-gradient(145deg, #21133e, #0c0a1a); }
.project-card-body { background: transparent; }
.project-card .button-group { flex-wrap: wrap; }

.app-body input,
.app-body select,
.app-body textarea {
    width: 100%;
    max-width: 100%;
    border-color: rgba(183, 148, 246, .22);
    background: rgba(5, 4, 14, .78);
    color: #f8f5ff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.app-body input::placeholder,
.app-body textarea::placeholder { color: #777083; }
.app-body input:focus,
.app-body select:focus,
.app-body textarea:focus { border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(124,58,237,.13); }
.app-body select option { background: #111021; color: #fff; }
.studio-form, .form-grid, .form-field { min-width: 0; }
.form-section, .preset-panel { overflow: hidden; }
.form-actions--sticky {
    position: static;
    margin-top: 1rem;
    padding: 1rem 0 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
}
.instrument-presets button { border-color: rgba(183,148,246,.2); background: rgba(124,58,237,.08); color: #d9c8f6; }
.instrument-presets button:hover, .instrument-presets button.is-added { border-color: #8b5cf6; background: rgba(124,58,237,.22); color: #fff; }

.app-footer {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 1rem 2rem;
    margin-top: auto;
    padding: 1.25rem clamp(1rem, 2.4vw, 2rem);
    border-top: 1px solid var(--neg-border);
    background: rgba(6,5,15,.76);
    color: #8f889d;
    font-size: .72rem;
}
.app-footer > div strong, .app-footer > div span { display: block; }
.app-footer > div strong { color: #e8e3ef; font-size: .82rem; }
.app-footer nav { display: flex; flex-wrap: wrap; gap: .85rem; }
.app-footer a:hover { color: #d7a638; }
.app-footer small { white-space: nowrap; }

.public-footer { display: block; width: 100%; padding: 2.5rem max(1rem, calc((100% - 1240px) / 2)); background: #05040d; }
.public-footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, minmax(140px, .7fr)); gap: 2rem; }
.public-footer-grid > div:not(.public-footer-brand) { display: grid; align-content: start; gap: .55rem; }
.public-footer-grid strong { color: #f4f0fb; font-size: .8rem; }
.public-footer-grid a, .public-footer-grid p { color: #91899e; font-size: .74rem; }
.public-footer-grid a:hover { color: #d7a638; }
.public-footer-brand { display: flex; align-items: flex-start; gap: .85rem; }
.public-footer-brand img { flex: 0 0 42px; }
.public-footer-brand p { max-width: 360px; margin: .35rem 0 0; }
.public-footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--neg-border); color: #716a7c; font-size: .68rem; }

@media (hover: hover) and (pointer: fine) {
    .topbar-profile:hover .topbar-profile-menu { display: grid; }
}

@media (max-width: 1020px) {
    .app-layout { padding-top: 68px; }
    .app-topbar { min-height: 68px; }
    .topbar-brand { min-width: 0; margin-right: auto; }
    .topbar-brand small, .topbar-title { display: none; }
    .sidebar-toggle { display: block; order: -1; }
    .app-sidebar { inset: 68px auto 0 0; width: min(86vw, 300px); transform: translateX(-105%); }
    .app-sidebar.is-open { transform: translateX(0); }
    .sidebar-tools > strong { display: block; }
    .sidebar-collapse { display: none; }
    .sidebar-close { display: grid; }
    .app-main, .sidebar-collapsed .app-main { margin-left: 0; min-height: calc(100vh - 68px); }
    .sidebar-collapsed .app-sidebar { width: min(86vw, 300px); }
    .sidebar-collapsed .sidebar-label, .sidebar-collapsed .sidebar-link span, .sidebar-collapsed .sidebar-account-copy { display: block; }
    .sidebar-collapsed .sidebar-link { justify-content: flex-start; padding-inline: .8rem; }
    .sidebar-collapsed .sidebar-account { grid-template-columns: 38px minmax(0,1fr) 34px; justify-items: stretch; }
    .sidebar-collapsed .sidebar-account form { display: block; }
    .sidebar-backdrop.is-visible { display: block; position: fixed; z-index: 290; inset: 68px 0 0; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
    .topbar-create { margin-left: 0; }
}

@media (max-width: 720px) {
    .topbar-brand span { display: none; }
    .topbar-brand img { width: 39px; height: 39px; }
    .topbar-create { padding: .62rem .72rem; font-size: .75rem; }
    .topbar-profile-copy { display: none; }
    .app-page-shell { padding: .8rem; }
    .page-header { align-items: stretch; }
    .page-header .button-group { display: grid; grid-template-columns: 1fr; width: 100%; }
    .page-header .button { width: 100%; }
    .project-grid--library { grid-template-columns: 1fr; }
    .app-footer { grid-template-columns: 1fr; gap: .8rem; }
    .app-footer small { white-space: normal; }
    .public-footer-grid { grid-template-columns: 1fr 1fr; }
    .public-footer-brand { grid-column: 1 / -1; }
    .public-footer-bottom { display: grid; }
}

@media (max-width: 480px) {
    .topbar-create { font-size: 0; }
    .topbar-create span { font-size: 1.2rem; }
    .public-footer-grid { grid-template-columns: 1fr; }
    .public-footer-brand { grid-column: auto; }
}

/* v10 — finition administration sombre et menu profil fiable */
.profile-chevron {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    color: #bdb4c9;
    transition: color .18s ease, transform .18s ease;
}
.profile-chevron svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.topbar-profile-trigger:hover .profile-chevron,
.topbar-profile.is-open .profile-chevron { color: #ffffff; }
.topbar-profile.is-open .profile-chevron { transform: rotate(180deg); }

/* The invisible bridge removes the gap between the trigger and dropdown. */
.topbar-profile-menu {
    top: calc(100% + .38rem);
    isolation: isolate;
}
.topbar-profile-menu::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -.55rem;
    right: 0;
    width: 100%;
    height: .65rem;
}

/* Santé du système: no light surfaces inside the authenticated application. */
.app-body .health-heading h1,
.app-body .health-summary strong,
.app-body .health-metrics dd,
.app-body .health-card h2,
.app-body .maintenance-commands strong { color: #f8f5ff; }

.app-body .health-heading p,
.app-body .health-summary__label,
.app-body .health-metrics dt,
.app-body .health-card p,
.app-body .health-card ul { color: var(--neg-muted); }

.app-body .health-summary {
    border-color: var(--neg-border);
    background:
        radial-gradient(circle at 92% 10%, rgba(124, 58, 237, .14), transparent 34%),
        linear-gradient(145deg, rgba(19, 15, 39, .96), rgba(10, 8, 23, .98));
    color: var(--neg-text);
    box-shadow: 0 22px 55px rgba(0, 0, 0, .22);
}
.app-body .health-summary--ok { border-left-color: #19b77c; }
.app-body .health-summary--warning { border-left-color: #e6a619; }
.app-body .health-summary--error { border-left-color: #ff6177; }

.app-body .health-metrics div,
.app-body .maintenance-commands div {
    border: 1px solid rgba(183, 148, 246, .12);
    background: rgba(255, 255, 255, .025);
}

.app-body .health-card--warning {
    border-color: rgba(230, 166, 25, .28);
    background: linear-gradient(145deg, rgba(48, 34, 10, .72), rgba(16, 11, 22, .96));
}
.app-body .health-card--error {
    border-color: rgba(255, 97, 119, .28);
    background: linear-gradient(145deg, rgba(52, 14, 27, .72), rgba(16, 8, 18, .96));
}
.app-body .health-badge--ok { background: rgba(25, 183, 124, .16); color: #73e0b5; }
.app-body .health-badge--warning { background: rgba(230, 166, 25, .16); color: #f6ce70; }
.app-body .health-badge--error { background: rgba(255, 97, 119, .16); color: #ff9aaa; }
.app-body .maintenance-commands code { color: #c7a8ff; }

/* Neginati — Suivi technique: unified dark administration surface. */
.app-body .usage-admin-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.app-body .usage-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    min-width: 0;
}

.app-body .usage-page-header > div {
    min-width: 0;
    max-width: 760px;
}

.app-body .usage-page-header .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.app-body .usage-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.app-body .usage-stat-card,
.app-body .budget-progress,
.app-body .usage-information {
    border: 1px solid var(--neg-border);
    background:
        radial-gradient(circle at 88% 12%, rgba(124, 58, 237, .13), transparent 34%),
        linear-gradient(145deg, rgba(19, 15, 39, .96), rgba(10, 8, 23, .98));
    color: var(--neg-text);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .2);
}

.app-body .usage-stat-card__label,
.app-body .usage-stat-card small,
.app-body .budget-progress__heading span,
.app-body .budget-progress__heading b,
.app-body .usage-information p,
.app-body .usage-rate-list dt,
.app-body .usage-table td small {
    color: var(--neg-muted);
}

.app-body .usage-stat-card strong,
.app-body .budget-progress__heading strong,
.app-body .usage-information strong,
.app-body .usage-rate-list dd {
    color: #f8f5ff;
}

.app-body .usage-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.app-body .usage-budget-panel,
.app-body .usage-rate-panel,
.app-body .usage-history-panel {
    min-width: 0;
    overflow: hidden;
}

.app-body .budget-track {
    border: 1px solid rgba(183, 148, 246, .12);
    background: rgba(255, 255, 255, .07);
}

.app-body .budget-track span {
    background: linear-gradient(90deg, #6d28d9, #a855f7 58%, #d8a83e);
    box-shadow: 0 0 18px rgba(168, 85, 247, .28);
}

.app-body .usage-policy-form {
    border-top-color: var(--neg-border);
}

.app-body .usage-policy-checkbox label {
    border-color: var(--neg-border);
    background: rgba(255, 255, 255, .025);
}

.app-body .usage-rate-list div,
.app-body .usage-mini-list div {
    border-bottom-color: var(--neg-border);
}

.app-body .usage-information {
    box-shadow: none;
}

.app-body .usage-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border-color: var(--neg-border);
    background: rgba(5, 4, 14, .48);
}

.app-body .usage-table {
    min-width: 760px;
    color: var(--neg-text);
}

.app-body .usage-table th,
.app-body .usage-table td {
    border-bottom-color: var(--neg-border);
}

.app-body .usage-table th {
    background: rgba(124, 58, 237, .11);
    color: #c8bdd7;
}

.app-body .usage-table tbody tr {
    background: transparent;
}

.app-body .usage-table tbody tr:hover {
    background: rgba(124, 58, 237, .06);
}

.app-body .usage-table a {
    color: #c7a8ff;
}

.app-body .provider-badge--openai {
    background: rgba(25, 183, 124, .15);
    color: #77e0b7;
}

.app-body .provider-badge--elevenlabs {
    background: rgba(124, 58, 237, .18);
    color: #d0b6ff;
}

.app-body .usage-status--success {
    background: rgba(25, 183, 124, .15);
    color: #77e0b7;
}

.app-body .usage-status--failed {
    background: rgba(255, 97, 119, .15);
    color: #ff9aaa;
}

.app-body .usage-status--blocked {
    background: rgba(230, 166, 25, .15);
    color: #f6ce70;
}

.app-body .usage-error-row td {
    background: rgba(255, 97, 119, .08);
    color: #ffacb9;
}

@media (max-width: 1180px) {
    .app-body .usage-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-body .usage-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .app-body .usage-page-header .button {
        width: 100%;
        justify-content: center;
    }

    .app-body .usage-table {
        min-width: 0;
    }

    .app-body .usage-table tr {
        border-color: var(--neg-border);
        background: linear-gradient(145deg, rgba(19, 15, 39, .96), rgba(10, 8, 23, .98));
    }

    .app-body .usage-table td {
        border-bottom-color: var(--neg-border);
    }

    .app-body .usage-table td::before {
        color: #a99db9;
    }
}
