.inv-root {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 800px;
    min-width: 0;
    margin: 0 auto;
}

.inv-header > div,
.inv-dashboard,
.inv-gauge-info,
.inv-section,
.inv-code-left,
.inv-code-right {
    min-width: 0;
}

.inv-header-sub {
    margin: 0.35rem 0 0;
    color: var(--hh-text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.inv-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Lifetime generation allowance */
.inv-hero {
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 5vw, 2rem);
    padding: clamp(1.25rem, 5vw, 2rem);
}

.inv-gauge-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    flex: 0 0 120px;
}

.inv-gauge-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.inv-ring-bg,
.inv-ring-fill {
    fill: none;
    stroke-width: 8;
}

.inv-ring-bg {
    stroke: var(--hh-glass-border);
}

.inv-ring-fill {
    stroke: var(--hh-secondary);
    stroke-linecap: round;
    transition: stroke-dasharray 350ms ease;
}

.inv-gauge-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.inv-gauge-val {
    color: var(--hh-text-primary);
    font-size: 2rem;
    font-weight: 750;
    line-height: 1;
}

.inv-gauge-max {
    margin-top: 0.25rem;
    color: var(--hh-text-muted);
    font-size: 0.75rem;
}

.inv-gauge-info {
    flex: 1;
}

.inv-gauge-info h2 {
    margin: 0 0 0.5rem;
    color: var(--hh-text-primary);
    font-size: 1.25rem;
    font-weight: 650;
}

.inv-gauge-info > p {
    margin: 0 0 1rem;
    color: var(--hh-text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.inv-gen-btn,
.inv-send-btn {
    min-height: 44px;
    gap: 0.5rem;
    font-weight: 650;
}

.inv-allowance-note {
    margin-top: 0.75rem !important;
    color: var(--hh-text-secondary) !important;
}

.inv-gauge-info > .hh-action-status {
    margin-top: 0.9rem;
}

/* Sections and native form */
.inv-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inv-section-header {
    flex-wrap: wrap;
    gap: 0.6rem;
}

.inv-section-header h2 {
    min-width: 0;
}

.inv-section-header .db-section-meta {
    margin-left: auto;
    white-space: nowrap;
}

.inv-email-form {
    padding: 1.25rem 1.5rem 0;
}

.inv-email-form fieldset {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.inv-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.inv-form-field label {
    color: var(--hh-text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.inv-form-field input,
.inv-form-field select {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--hh-glass-border-highlight);
    border-radius: var(--hh-radius-sm);
    outline: none;
    background: var(--hh-surface-soft);
    color: var(--hh-text-primary);
    font: inherit;
}

.inv-form-field input::placeholder {
    color: var(--hh-text-muted);
}

.inv-form-field input:focus-visible,
.inv-form-field select:focus-visible,
.inv-copy-button:focus-visible {
    border-color: var(--hh-secondary);
    box-shadow: 0 0 0 3px rgba(var(--hh-secondary-rgb), 0.18);
}

.inv-form-field select:disabled {
    cursor: not-allowed;
}

.inv-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--hh-glass-border);
    border-radius: var(--hh-radius-sm);
    background: var(--hh-surface-soft);
    color: var(--hh-text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.inv-privacy-note .mud-icon-root {
    flex: 0 0 auto;
    color: var(--hh-secondary);
}

.inv-form-hint {
    margin: 0;
    color: var(--hh-text-secondary);
    font-size: 0.8375rem;
    line-height: 1.5;
}

.inv-send-btn {
    align-self: flex-end;
}

.inv-section-feedback {
    min-height: 0;
    padding: 0 1.5rem 1.25rem;
}

.inv-section-feedback > .hh-action-status {
    margin-top: 1rem;
}

/* Code history */
.inv-code-list {
    display: flex;
    flex-direction: column;
}

.inv-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--hh-glass-border);
    border-left: 3px solid var(--hh-glass-border-highlight);
}

.inv-code-row:last-child {
    border-bottom: 0;
}

.inv-code-row.available {
    border-left-color: var(--hh-secondary);
}

.inv-code-row.reserved {
    border-left-color: var(--hh-warning);
}

.inv-code-row.expired {
    border-left-color: var(--hh-danger);
}

.inv-code-row.revoked {
    border-left-color: var(--hh-text-muted);
}

.inv-code-left,
.inv-code-right {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.inv-code-left {
    flex-wrap: wrap;
}

.inv-code-right {
    justify-content: flex-end;
}

.inv-code-text {
    overflow-wrap: anywhere;
    color: var(--hh-text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: 0.09em;
}

.inv-code-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--hh-glass-border-highlight);
    border-radius: var(--hh-radius-sm);
    background: var(--hh-surface-soft-alt);
    color: var(--hh-text-secondary);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.2;
}

.inv-code-status.available {
    border-color: rgba(var(--hh-secondary-rgb), 0.3);
    background: rgba(var(--hh-secondary-rgb), 0.12);
    color: var(--hh-secondary);
}

.inv-code-status.reserved {
    border-color: rgba(var(--hh-warning-rgb), 0.35);
    background: rgba(var(--hh-warning-rgb), 0.12);
    color: var(--hh-warning);
}

.inv-code-status.expired {
    border-color: rgba(var(--hh-danger-rgb), 0.3);
    background: rgba(var(--hh-danger-rgb), 0.1);
    color: var(--hh-danger);
}

.inv-code-meta {
    color: var(--hh-text-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
    text-align: right;
}

.inv-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--hh-glass-border-highlight);
    border-radius: 50%;
    background: var(--hh-surface-soft);
    color: var(--hh-secondary);
    cursor: pointer;
}

.inv-copy-button:hover:not(:disabled) {
    border-color: var(--hh-secondary);
    background: rgba(var(--hh-secondary-rgb), 0.1);
}

.inv-copy-button:disabled {
    cursor: wait;
}

.inv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2.75rem 1.5rem;
    text-align: center;
}

.inv-empty .mud-icon-root {
    color: var(--hh-text-muted);
}

.inv-empty p {
    margin: 0;
    color: var(--hh-text-muted);
    font-size: 0.9375rem;
}

@media (max-width: 640px) {
    .inv-hero {
        align-items: flex-start;
    }

    .inv-gauge-wrap {
        width: 104px;
        height: 104px;
        flex-basis: 104px;
    }

    .inv-code-row {
        align-items: flex-start;
        padding: 0.85rem 1rem;
    }

    .inv-code-left,
    .inv-code-right {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .inv-root,
    .inv-dashboard {
        gap: 1rem;
    }

    .inv-hero {
        align-items: center;
        flex-direction: column;
        padding: 1.25rem 1rem;
        text-align: center;
    }

    .inv-gauge-info,
    .inv-gen-btn,
    .inv-send-btn {
        width: 100%;
    }

    .inv-gen-btn,
    .inv-send-btn {
        justify-content: center;
    }

    .inv-email-form {
        padding: 1rem 1rem 0;
    }

    .inv-section-feedback {
        padding: 0 1rem 1rem;
    }

    .inv-section-header .db-section-meta {
        width: 100%;
        margin-left: 2.1rem;
    }

    .inv-code-row {
        align-items: stretch;
        flex-direction: column;
        gap: 0.65rem;
    }

    .inv-code-left,
    .inv-code-right {
        width: 100%;
    }

    .inv-code-right {
        justify-content: space-between;
    }

    .inv-code-meta {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .inv-ring-fill {
        transition: none;
    }
}
