@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600&display=swap');

:root {
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-input: #222;
    --text-primary: #f0f0f0;
    --text-secondary: #999;
    --accent: #00cc66;
    --accent-hover: #00e676;
    --error: #ff4444;
    --success: #00cc66;
    --border: #333;

    /* HUD tokens — premium "champagne on obsidian" palette.
       Refined from the original Tarkov amber: deeper neutral blacks (less
       brown cast), richer champagne-gold accent, cleaner warm-platinum
       text, sage green in place of military olive for a less utilitarian
       read. Structure unchanged — only color values move. */
    --hud-panel: rgba(10, 10, 13, 0.86);
    --hud-panel-hot: rgba(16, 16, 20, 0.94);
    --hud-line: rgba(196, 168, 108, 0.28);
    --hud-line-hot: rgba(232, 196, 114, 0.82);
    --hud-label: #e4d4ac;
    --hud-label-dim: rgba(228, 212, 172, 0.52);
    --hud-accent: #d4a853;
    --hud-accent-mil: #7d8b72;
    --hud-text: #ecdcbe;
    --hud-text-dim: rgba(236, 220, 190, 0.55);
    --hud-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

h1:focus { outline: none; }

.app-layout {
    min-height: 100vh;
}

/* Landing Page */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent), #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 480px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    width: 100%;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.feature-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* CTA Button */
.cta-button {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    max-width: 320px;
}

.cta-button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.cta-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Auth Pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
}

.auth-card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input::placeholder {
    color: #555;
}

.error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--error);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.success-message {
    text-align: center;
}

.success-message h3 {
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.link-button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-decoration: underline;
}

.link-button:hover {
    color: var(--accent-hover);
}

/* Dashboard */
.dashboard {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
    font-size: 1.5rem;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logout-button {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color 0.2s, color 0.2s;
}

.logout-button:hover {
    border-color: var(--error);
    color: var(--error);
}

.placeholder-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
}

.placeholder-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.placeholder-card p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Blazor error UI — HUD-palette replacement for the default yellow bar */
#blazor-error-ui {
    color-scheme: dark only;
    background: var(--hud-panel-hot);
    border-top: 1px solid var(--hud-line-hot);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.55);
    color: var(--hud-text);
    font-family: var(--hud-mono);
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.25rem 0.9rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(6px);
}

#blazor-error-ui .blazor-error-icon {
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 auto;
    border: 1px solid var(--hud-line-hot);
    color: var(--hud-accent);
    font-family: var(--hud-mono);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#blazor-error-ui .blazor-error-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1 1 auto;
    min-width: 0;
}

#blazor-error-ui .blazor-error-title {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hud-label);
}

#blazor-error-ui .blazor-error-sub {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: var(--hud-text-dim);
}

#blazor-error-ui .reload {
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hud-accent);
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--hud-line-hot);
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

#blazor-error-ui .reload:hover {
    background: rgba(232, 196, 114, 0.12);
    color: var(--hud-text);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    color: var(--hud-label-dim);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.35rem;
    transition: color 0.15s ease;
}

#blazor-error-ui .dismiss:hover {
    color: var(--hud-accent);
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Loading */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

.loading-progress circle {
    fill: none;
    stroke: #333;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--text-primary);
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Builder Page */
.builder-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.builder-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.7rem 1.25rem 0.55rem;
    background: linear-gradient(180deg, rgba(11, 9, 7, 0.95), rgba(11, 9, 7, 0.75));
    border-bottom: 1px solid var(--hud-line);
    flex-shrink: 0;
    font-family: var(--hud-mono);
    position: relative;
}

.builder-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 168, 83, 0.35) 30%,
        rgba(212, 168, 83, 0.35) 70%,
        transparent 100%);
    pointer-events: none;
}

.builder-logo {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--hud-label);
    text-decoration: none;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-family: var(--hud-mono);
    justify-self: start;
}

.builder-logo:hover {
    color: var(--hud-accent);
}

.builder-title {
    justify-self: center;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.builder-title-main {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--hud-text);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-family: var(--hud-mono);
}

.builder-filters {
    display: flex;
    gap: 1.35rem;
    font-size: 0.62rem;
    color: var(--hud-label-dim);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.builder-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: default;
    user-select: none;
}

.builder-filter-chip::before {
    content: "";
    width: 9px; height: 9px;
    border: 1px solid var(--hud-line);
    background: var(--hud-accent-mil);
    box-shadow: inset 0 0 0 1.5px rgba(11, 9, 7, 0.95);
}

.builder-filter-chip.is-off::before {
    background: transparent;
}

.builder-step {
    font-size: 0.68rem;
    color: var(--hud-label-dim);
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: var(--hud-mono);
}

.builder-total {
    font-size: 0.78rem;
    color: var(--hud-accent);
    font-weight: 500;
    font-family: var(--hud-mono);
    letter-spacing: 0.06em;
}

/* Top-right auth chip — Sign In when unauth, username+Logout when authed */
.builder-auth-email {
    font-size: 0.62rem;
    color: var(--hud-text-dim);
    font-family: var(--hud-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0 0.15rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.builder-auth-btn {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--hud-line);
    color: var(--hud-text);
    font-family: var(--hud-mono);
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.builder-auth-btn:hover {
    background: rgba(38, 28, 14, 0.6);
    border-color: var(--hud-line-hot);
    color: var(--hud-accent);
}
.builder-auth-btn-accent {
    color: var(--hud-accent);
    border-color: rgba(212, 168, 83, 0.55);
}

.save-dialog-error-link {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--hud-accent);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.9em;
    border-bottom: 1px solid var(--hud-line-hot);
    padding-bottom: 1px;
    transition: color 0.15s ease;
}
.save-dialog-error-link:hover {
    color: var(--hud-text);
}

/* Pricing page */
.pricing-page {
    min-height: 100vh;
    background: #0b0907;
    color: var(--hud-text);
    font-family: var(--hud-mono);
    padding: 4rem 1.5rem 5rem;
}
.pricing-hero {
    max-width: 780px;
    margin: 0 auto 3.5rem;
    text-align: center;
}
.pricing-eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--hud-accent);
}
.pricing-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2.2rem;
    line-height: 1.15;
    color: var(--hud-label);
    margin: 0.75rem 0 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.pricing-sub {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--hud-text-dim);
    font-size: 1.02rem;
    line-height: 1.55;
}
.pricing-grid {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1px;
    background: var(--hud-line);
    padding: 1px;
}
.pricing-card {
    background: rgba(12, 9, 6, 0.96);
    padding: 2rem 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    min-height: 440px;
}
.pricing-card-featured {
    background: rgba(20, 15, 8, 0.98);
    box-shadow: inset 0 0 0 1px var(--hud-line-hot);
}
.pricing-badge {
    position: absolute;
    top: -1px;
    right: 1rem;
    background: var(--hud-accent);
    color: #0b0907;
    padding: 0.25rem 0.6rem;
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
}
.pricing-card-name {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hud-label);
    font-weight: 500;
}
.pricing-card-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}
.pricing-card-amount {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--hud-text);
    letter-spacing: -0.02em;
}
.pricing-card-period {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hud-text-dim);
}
.pricing-card-tagline {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--hud-text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}
.pricing-card-features {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-family: var(--hud-mono);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    color: var(--hud-text);
}
.pricing-card-features li::before {
    content: "→ ";
    color: var(--hud-accent);
    margin-right: 0.4rem;
}
.pricing-card-cta {
    margin-top: 1rem;
    text-align: center;
    padding: 0.75rem 1rem;
    border: 1px solid var(--hud-line);
    color: var(--hud-text);
    background: transparent;
    font-family: var(--hud-mono);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pricing-card-cta:hover:not(:disabled) {
    background: rgba(38, 28, 14, 0.6);
    color: var(--hud-accent);
    border-color: var(--hud-line-hot);
}
.pricing-card-cta:disabled {
    opacity: 0.55;
    cursor: wait;
}
.pricing-card-cta-accent {
    color: var(--hud-accent);
    border-color: rgba(212, 168, 83, 0.55);
    font-weight: 500;
}
.pricing-error {
    max-width: 560px;
    margin: 2rem auto 0;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(220, 80, 60, 0.5);
    color: #f2c8b0;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.pricing-footnote {
    text-align: center;
    color: var(--hud-text-dim);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    margin-top: 3rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.pricing-footnote a {
    color: var(--hud-accent);
    text-decoration: none;
    border-bottom: 1px solid var(--hud-line-hot);
}

/* Admin pages */
.admin-page {
    min-height: 100vh;
    background: #0b0907;
    color: var(--hud-text);
    font-family: var(--hud-mono);
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--hud-line);
    background: rgba(11, 9, 7, 0.95);
}
.admin-nav {
    display: flex;
    gap: 1rem;
}
.admin-nav-link {
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hud-label-dim);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border: 1px solid transparent;
}
.admin-nav-link:hover {
    color: var(--hud-accent);
    border-color: var(--hud-line-hot);
}
.admin-nav-active {
    color: var(--hud-accent);
    border-color: var(--hud-line);
}
.admin-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}
.admin-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--hud-label);
    margin: 0 0 1.5rem;
    letter-spacing: -0.01em;
}
.admin-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--hud-label);
    margin: 2.25rem 0 0.8rem;
}
.admin-error {
    padding: 0.7rem 1rem;
    border: 1px solid rgba(220, 80, 60, 0.5);
    color: #f2c8b0;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.admin-loading, .admin-empty {
    padding: 1.5rem 0;
    color: var(--hud-text-dim);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(12, 9, 6, 0.9);
    border: 1px solid var(--hud-line);
    font-size: 0.72rem;
}
.admin-table th {
    text-align: left;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--hud-label);
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--hud-line);
    background: rgba(22, 17, 11, 0.7);
    font-size: 0.6rem;
}
.admin-table td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(196, 168, 108, 0.12);
    color: var(--hud-text);
    vertical-align: middle;
}
.admin-table code {
    font-size: 0.65rem;
    color: var(--hud-text-dim);
    font-family: var(--hud-mono);
}
.admin-row-inactive td {
    color: var(--hud-text-dim);
    opacity: 0.7;
}
.admin-btn {
    background: transparent;
    border: 1px solid var(--hud-line);
    color: var(--hud-text);
    font-family: var(--hud-mono);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.admin-btn:hover {
    background: rgba(38, 28, 14, 0.55);
    color: var(--hud-accent);
    border-color: var(--hud-line-hot);
}
.admin-btn-accent {
    color: var(--hud-accent);
    border-color: rgba(212, 168, 83, 0.55);
}
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.admin-stat {
    background: rgba(12, 9, 6, 0.9);
    border: 1px solid var(--hud-line);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.admin-stat-label {
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--hud-text-dim);
}
.admin-stat-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 2.1rem;
    font-weight: 600;
    color: var(--hud-accent);
    letter-spacing: -0.02em;
}

.builder-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.builder-viewport {
    flex: 7;
    position: relative;
    overflow: hidden;
}

.builder-viewport canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    outline: none;
}

.builder-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
}

.builder-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.builder-sidebar {
    flex: 3;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    background: var(--bg-dark);
}

.builder-controls {
    padding: 0.55rem 1.25rem;
    background: linear-gradient(0deg, rgba(11, 9, 7, 0.95), rgba(11, 9, 7, 0.7));
    border-top: 1px solid var(--hud-line);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--hud-mono);
    position: relative;
}

.builder-controls::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -1px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 168, 83, 0.35) 30%,
        rgba(212, 168, 83, 0.35) 70%,
        transparent 100%);
    pointer-events: none;
}

.builder-controls-left,
.builder-controls-right {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.builder-foot-tab {
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--hud-label-dim);
    padding: 0.35rem 0.6rem;
    border: 1px solid transparent;
    cursor: default;
    user-select: none;
}

.builder-foot-tab.is-accent {
    color: var(--hud-accent);
    border-color: var(--hud-line);
    font-weight: 500;
}

/* Build Progress */
.build-progress {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}

.build-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.build-progress-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.build-progress-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.build-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.build-progress-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: rgba(0, 204, 102, 0.08);
    border-radius: 6px;
}

.progress-check {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.progress-detail {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.progress-category {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.progress-part {
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Part Selector */
.part-selector {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.part-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.part-selector-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.part-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.part-selector-loading,
.part-selector-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    text-align: center;
}

.retry-button {
    margin-top: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 1rem;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
}

.retry-button:hover {
    border-color: var(--accent);
}

.part-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.part-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.part-card:hover {
    border-color: var(--accent);
    background: rgba(0, 204, 102, 0.05);
}

.part-card-selected {
    border-color: var(--accent);
    background: rgba(0, 204, 102, 0.1);
}

.part-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.5rem;
}

.part-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.part-manufacturer {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

.part-card-specs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.part-spec {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.part-price-badge {
    font-size: 0.7rem;
    color: #4adf7a;
    background: rgba(0, 200, 80, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.part-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.controls-hint {
    font-size: 0.6rem;
    color: var(--hud-label-dim);
    text-align: left;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: var(--hud-mono);
}

.reset-build-btn {
    background: transparent;
    border: 1px solid rgba(200, 100, 80, 0.4);
    color: var(--hud-text);
    padding: 0.4rem 0.9rem;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.6rem;
    font-family: var(--hud-mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.reset-build-btn:hover {
    background: rgba(200, 80, 60, 0.15);
    border-color: rgba(220, 120, 100, 0.75);
    color: #f2c8b0;
}

.build-complete-banner {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 167, 69, 0.9);
    color: #fff;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Save/Load Build Buttons */
.save-build-btn, .load-build-btn {
    background: transparent;
    border: 1px solid var(--hud-line);
    color: var(--hud-text);
    padding: 0.4rem 1rem;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.6rem;
    font-family: var(--hud-mono);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.save-build-btn:hover, .load-build-btn:hover {
    background: rgba(38, 28, 14, 0.6);
    color: var(--hud-accent);
    border-color: var(--hud-line-hot);
}
.save-build-btn {
    color: var(--hud-accent);
    border-color: rgba(212, 168, 83, 0.55);
}

/* Save/Load Dialog Overlay */
.save-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.save-dialog, .load-dialog {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 24px;
    min-width: 340px;
    max-width: 440px;
    width: 90%;
}
.save-dialog h3, .load-dialog h3 {
    color: #f0f0f0;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.save-dialog-input {
    width: 100%;
    padding: 10px 12px;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    color: #f0f0f0;
    font-size: 0.9rem;
    outline: none;
}
.save-dialog-input:focus {
    border-color: rgba(0, 120, 200, 0.6);
}

.save-dialog-error {
    color: #ff4444;
    font-size: 0.8rem;
    margin-top: 8px;
}

.save-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.save-dialog-cancel {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}
.save-dialog-cancel:hover { background: rgba(255,255,255,0.05); }

.save-dialog-confirm {
    background: rgba(0, 120, 200, 0.4);
    border: 1px solid rgba(0, 120, 200, 0.6);
    color: #f0f0f0;
    padding: 8px 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}
.save-dialog-confirm:hover { background: rgba(0, 120, 200, 0.6); }
.save-dialog-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

/* Load Dialog */
.load-dialog { max-width: 500px; }
.load-dialog-loading, .load-dialog-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 20px 0;
    text-align: center;
}

.load-dialog-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.load-dialog-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.load-dialog-item:hover {
    background: rgba(0, 120, 200, 0.15);
    border-color: rgba(0, 120, 200, 0.4);
}

.load-dialog-item-info { display: flex; flex-direction: column; gap: 2px; }
.load-dialog-item-name { color: #f0f0f0; font-size: 0.9rem; font-weight: 500; }
.load-dialog-item-meta { color: var(--text-secondary); font-size: 0.75rem; }

.load-dialog-delete {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.load-dialog-delete:hover { color: #ff4444; background: rgba(255, 68, 68, 0.1); }

/* Shared Build Page */
.shared-build-page {
    min-height: 100vh;
    background: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.shared-build-loading, .shared-build-not-found {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-secondary);
}
.shared-build-not-found h2 { color: var(--text-primary); font-size: 1.5rem; }
.shared-build-not-found p { font-size: 0.95rem; }

.shared-build-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.shared-build-viewer {
    flex: 1;
    position: relative;
}
.shared-build-viewer canvas {
    width: 100% !important;
    height: 100% !important;
}

.shared-build-sidebar {
    width: 320px;
    background: #111;
    border-left: 1px solid #333;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shared-build-title {
    font-size: 1.3rem;
    font-weight: 600;
}
.shared-build-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.shared-build-parts-list h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shared-build-part-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.02);
}
.shared-part-category {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.shared-part-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}
.shared-part-mfg {
    font-size: 0.75rem;
    color: #777;
}

.shared-build-cta {
    display: block;
    text-align: center;
    background: var(--accent);
    color: #000;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: auto;
    transition: background 0.2s;
}
.shared-build-cta:hover { background: var(--accent-hover); }

/* Share button in load dialog */
.load-dialog-share {
    background: transparent;
    border: none;
    color: #4a9eff;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
}
.load-dialog-share:hover { text-decoration: underline; }

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 167, 69, 0.9);
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: toastFade 2.5s ease-in-out forwards;
}
@keyframes toastFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Interactive Builder - Mode 2 */
.builder-header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mode-switch-link {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--accent);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.mode-switch-link:hover {
    background: rgba(0, 204, 102, 0.15);
}

.interactive-prompt {
    position: absolute;
    top: 50%;
    left: 35%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
}

/* SVG Connector Lines */
.connector-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9;
}

.connector-line {
    stroke: var(--hud-line);
    stroke-width: 0.75;
    stroke-linecap: round;
}

.connector-line-installed {
    stroke: rgba(125, 139, 114, 0.55);
}

.connector-line-active {
    stroke: var(--hud-line-hot);
    stroke-width: 1;
}

/* Dots anchored to 3D positions */
.slot-dot-anchor {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 11;
    pointer-events: none;
}

.slot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(216, 200, 154, 0.75);
    background: rgba(14, 11, 8, 0.8);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
    animation: pulse-dot 2.4s ease-in-out infinite;
}

.slot-dot-active {
    border-color: var(--hud-accent);
    background: var(--hud-accent);
    box-shadow: 0 0 8px rgba(232, 196, 114, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.slot-dot-installed {
    border-color: var(--hud-accent-mil);
    background: var(--hud-accent-mil);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 2px rgba(216, 200, 154, 0.35); }
    50%      { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 7px rgba(216, 200, 154, 0.65); }
}

/* Label cards — Tarkov HUD callout */
.slot-card {
    position: absolute;
    z-index: 10;
    cursor: pointer;
    background: var(--hud-panel);
    border: 1px solid var(--hud-line);
    border-radius: 1px;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 124px;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    font-family: var(--hud-mono);
    animation: slot-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--slot-index, 0) * 60ms);
}

@keyframes slot-card-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.slot-card::before {
    content: "";
    position: absolute;
    top: -1px; left: -1px;
    width: 10px; height: 10px;
    border-top: 1px solid var(--hud-label);
    border-left: 1px solid var(--hud-label);
    opacity: 0.7;
    pointer-events: none;
}

.slot-card:hover {
    border-color: var(--hud-line-hot);
    background: var(--hud-panel-hot);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 196, 114, 0.18);
}

/* When a card is hovered, its DOM-prev sibling dot brightens */
.slot-dot-anchor:has(+ .slot-card:hover) .slot-dot {
    box-shadow: 0 0 12px rgba(232, 196, 114, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.slot-card-active {
    border-color: var(--hud-accent);
    background: var(--hud-panel-hot);
}

.slot-card-installed {
    border-color: rgba(125, 139, 114, 0.55);
}

/* Empty slot — reads as a clear call-to-action: dashed warm border,
   subtle diagonal-stripe thumb, large amber "+" glyph, "Select →" status. */
.slot-card-empty {
    border: 1px dashed rgba(216, 200, 154, 0.35);
    background: rgba(14, 11, 8, 0.55);
}
.slot-card-empty::before {
    border-color: rgba(216, 200, 154, 0.45);
    opacity: 0.6;
}
.slot-card-empty .slot-card-thumb {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(232, 196, 114, 0.035) 0 6px,
            transparent 6px 12px
        ),
        linear-gradient(135deg, rgba(22, 17, 11, 0.8), rgba(10, 8, 5, 0.92));
    border-bottom: 1px dashed rgba(216, 200, 154, 0.28);
}
.slot-card-empty .slot-card-name {
    color: var(--hud-label-dim);
}
.slot-card-empty .slot-card-status {
    color: var(--hud-accent);
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.54rem;
    animation: empty-cta-pulse 2.4s ease-in-out infinite;
}
.slot-card-empty:hover {
    border-color: var(--hud-line-hot);
    border-style: solid;
}
.slot-card-empty:hover .slot-card-thumb {
    border-bottom-style: solid;
}
.slot-card-empty:hover .slot-card-status {
    color: var(--hud-accent);
    animation: none;
}

/* Initial Lower Receiver prompt — centered in the viewport before anything
   is installed. Matches the other empty-slot cards but sits dead-center
   and is sized slightly larger as the one clear next action. */
.slot-card-initial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    z-index: 20;
    animation: slot-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.slot-card-initial .slot-card-thumb {
    height: 60px;
}
.slot-card-initial .slot-card-name {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
}
.slot-card-initial .slot-card-status {
    font-size: 0.6rem;
}
.slot-card-initial .slot-card-thumb-plus {
    font-size: 1.8rem;
}
.slot-card-initial:hover {
    transform: translate(-50%, -50%) translateY(-2px);
}

.slot-card-thumb-plus {
    font-family: var(--hud-mono);
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--hud-accent);
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.slot-card-empty:hover .slot-card-thumb-plus {
    opacity: 1;
    transform: scale(1.12);
}

@keyframes empty-cta-pulse {
    0%, 100% { opacity: 0.75; }
    50%      { opacity: 1.0; }
}

.slot-card-installed::before {
    border-color: var(--hud-accent-mil);
    opacity: 1;
}

.slot-card-thumb {
    width: 100%;
    height: 38px;
    background: linear-gradient(135deg, rgba(36, 28, 18, 0.85), rgba(14, 11, 8, 0.9));
    border-bottom: 1px solid var(--hud-line);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slot-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.slot-card-thumb-icon {
    font-size: 0.9rem;
    color: var(--hud-label-dim);
    opacity: 0.8;
}

.slot-card-installed .slot-card-thumb {
    background: linear-gradient(135deg, rgba(48, 42, 22, 0.85), rgba(18, 16, 10, 0.92));
}

.slot-card-name {
    font-size: 0.56rem;
    font-weight: 500;
    color: var(--hud-label);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0.25rem 0.45rem 0.1rem;
    text-align: left;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-card-status {
    font-size: 0.58rem;
    font-weight: 400;
    color: var(--hud-text);
    padding: 0 0.45rem 0.3rem;
    text-align: left;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--hud-mono);
    letter-spacing: 0.02em;
}

.slot-card-installed .slot-card-status {
    color: var(--hud-accent-mil);
}

.slot-card:not(.slot-card-installed) .slot-card-status {
    color: var(--hud-text-dim);
    font-style: italic;
}

/* Part Grid Overlay (Tarkov-style) */
.part-grid-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--hud-panel-hot);
    border: 1px solid var(--hud-line);
    border-radius: 2px;
    padding: 1rem 1rem 1.1rem;
    z-index: 100;
    width: min(560px, 92vw);
    max-height: 72vh;
    overflow-y: auto;
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.4);
    font-family: var(--hud-mono);
    animation: part-grid-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes part-grid-in {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.part-grid-item {
    animation: part-grid-row-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--grid-index, 0) * 28ms);
}

@keyframes part-grid-row-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .slot-card,
    .part-grid-overlay,
    .part-grid-item,
    .slot-dot {
        animation: none !important;
        transition: none !important;
    }
    .slot-card:hover { transform: none; }
}

/* Cinematic view — hide only the callout overlay (dots, cards, connector
   lines) so the 3D weapon shows cleanly. Header and footer stay visible so
   the user can still see title/filters and toggle back via the footer
   button. Triggered by C key or the footer Cinematic button.
   !important required because .slot-card has a keyframe animation whose
   end state sets opacity:1, which overrides a plain declaration. */
.builder-page-cinematic .slot-card,
.builder-page-cinematic .slot-dot-anchor,
.builder-page-cinematic .connector-svg,
.builder-page-cinematic .interactive-prompt {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: opacity 0.25s ease !important;
}

.builder-foot-btn {
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}
.builder-foot-btn:hover {
    color: var(--hud-accent);
    border-color: var(--hud-line-hot);
}

.part-grid-overlay::before,
.part-grid-overlay::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--hud-label);
    pointer-events: none;
}

.part-grid-overlay::before {
    top: -1px; left: -1px;
    border-top: 1px solid; border-left: 1px solid;
}

.part-grid-overlay::after {
    bottom: -1px; right: -1px;
    border-bottom: 1px solid; border-right: 1px solid;
}

.part-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--hud-line);
}

.part-grid-header h3 {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--hud-label);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-family: var(--hud-mono);
}

.part-grid-close {
    background: none;
    border: 1px solid transparent;
    color: var(--hud-label-dim);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1.5;
    border-radius: 1px;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.part-grid-close:hover {
    color: var(--hud-accent);
    border-color: var(--hud-line-hot);
}

.part-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1px;
    background: var(--hud-line);
    padding: 1px;
}

.part-grid-item {
    background: rgba(12, 9, 6, 0.9);
    border: 0;
    padding: 0.7rem 0.65rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    position: relative;
}

.part-grid-item:hover {
    background: rgba(38, 28, 14, 0.95);
}

.part-grid-item:hover .part-grid-name {
    color: var(--hud-accent);
}

.part-grid-thumb {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, rgba(36, 28, 18, 0.55), rgba(10, 8, 5, 0.8));
    border: 1px solid var(--hud-line);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.35rem;
    position: relative;
}

.part-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.part-grid-icon {
    font-size: 1.2rem;
    color: var(--hud-label-dim);
    opacity: 0.7;
}

.part-grid-msrp {
    color: var(--hud-label-dim) !important;
    font-weight: 400 !important;
    letter-spacing: 0.04em;
}

.part-grid-name {
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--hud-text);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--hud-mono);
    transition: color 0.15s;
}

.part-grid-mfg {
    font-size: 0.58rem;
    color: var(--hud-label-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--hud-mono);
}

.part-grid-price {
    font-size: 0.68rem;
    color: var(--hud-accent);
    font-weight: 500;
    font-family: var(--hud-mono);
    letter-spacing: 0.04em;
    margin-top: 0.15rem;
}

.part-grid-compare-btn {
    font-size: 0.54rem;
    padding: 3px 8px;
    background: transparent;
    color: var(--hud-label-dim);
    border: 1px solid var(--hud-line);
    border-radius: 0;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-family: var(--hud-mono);
    margin-top: 0.35rem;
    align-self: flex-start;
}

.part-grid-compare-btn:hover {
    color: var(--hud-accent);
    border-color: var(--hud-line-hot);
    background: rgba(38, 28, 14, 0.6);
}

.price-compare-panel {
    grid-column: 1 / -1;
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(74, 223, 122, 0.25);
    border-radius: 6px;
    padding: 10px;
    margin: -4px 0 8px;
}

.price-compare-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 4px;
    gap: 8px;
}

.price-compare-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.price-compare-best {
    background: rgba(74, 223, 122, 0.08);
}

.price-compare-retailer {
    font-size: 0.75rem;
    color: #ccc;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-compare-badge {
    font-size: 0.6rem;
    padding: 1px 6px;
    background: #4adf7a;
    color: #111;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.price-compare-amount {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    min-width: 60px;
    text-align: right;
}

.price-compare-buy {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: rgba(74, 158, 223, 0.2);
    color: #4a9edf;
    border: 1px solid rgba(74, 158, 223, 0.3);
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.price-compare-buy:hover {
    background: rgba(74, 158, 223, 0.4);
}

.price-compare-loading {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    padding: 8px;
    margin: 0;
}

/* Gallery Page */
.gallery-page, .profile-page {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: rgba(15, 15, 20, 0.95);
    border-bottom: 1px solid var(--border);
}

.gallery-header-nav {
    display: flex;
    gap: 1.5rem;
}

.gallery-nav-link {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

.gallery-nav-link:hover, .gallery-nav-active {
    color: #fff;
}

.gallery-content, .profile-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.gallery-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.gallery-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gallery-search {
    flex: 1;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
}

.gallery-search::placeholder { color: #666; }
.gallery-search:focus { border-color: var(--accent); outline: none; }

.gallery-sort {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
}

.gallery-loading, .gallery-empty {
    text-align: center;
    padding: 3rem;
    color: #888;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.gallery-card:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
}

.gallery-card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.gallery-card-name {
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-card-meta {
    font-size: 0.75rem;
    color: #888;
    margin: 0 0 0.75rem;
}

.gallery-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-card-builder {
    font-size: 0.7rem;
    color: var(--accent);
    text-decoration: none;
}

.gallery-card-builder:hover { text-decoration: underline; }

.gallery-card-date {
    font-size: 0.65rem;
    color: #666;
}

.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.gallery-page-btn {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #ccc;
    cursor: pointer;
    font-size: 0.8rem;
}

.gallery-page-btn:disabled { opacity: 0.4; cursor: default; }
.gallery-page-btn:not(:disabled):hover { border-color: var(--accent); }

.gallery-page-info {
    font-size: 0.8rem;
    color: #888;
}

/* Profile Page */
.profile-header-section {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-display-name {
    font-size: 1.3rem;
    margin: 0 0 0.25rem;
}

.profile-bio {
    font-size: 0.85rem;
    color: #aaa;
    margin: 0 0 0.75rem;
}

.profile-stats {
    display: flex;
    gap: 1.5rem;
}

.profile-stat {
    font-size: 0.75rem;
    color: #888;
}

.profile-section-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.profile-no-builds {
    color: #666;
    font-size: 0.85rem;
}

/* Edit Profile */
.edit-profile-form {
    max-width: 500px;
}

.edit-profile-label {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 0.3rem;
    margin-top: 1rem;
}

.edit-profile-input, .edit-profile-textarea {
    width: 100%;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
}

.edit-profile-input:focus, .edit-profile-textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.edit-profile-textarea {
    min-height: 80px;
    resize: vertical;
}

.edit-profile-actions {
    margin-top: 1.5rem;
}

.edit-profile-success {
    color: #4adf7a;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .builder-main { flex-direction: column; }
    .builder-viewport { flex: 1; min-height: 40vh; }
    .builder-sidebar { flex: none; height: 45vh; border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 600px) {
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1rem; }
    .auth-card { padding: 1.5rem; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .builder-header { padding: 0.5rem 1rem; }
    .controls-hint { font-size: 0.65rem; }
}

/* ── Social: Like, Follow, Comments ── */
.shared-build-social {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.social-like-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.social-like-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.social-like-btn.social-liked {
    color: #e74c3c;
    border-color: #e74c3c;
}

.social-comment-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-follow-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.social-follow-btn:hover {
    filter: brightness(1.15);
}

.social-follow-btn.social-following {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.social-follow-btn.social-following:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* ── Comments Section ── */
.shared-build-comments {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.shared-build-comments h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.comment-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 60px;
}

.comment-input:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-submit-btn {
    align-self: flex-end;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}

.comment-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.comment-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.comment-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.comment-author {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.8rem;
}

.comment-date {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.comment-delete-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0 0.25rem;
}

.comment-delete-btn:hover {
    color: #e74c3c;
}

.comment-content {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* ── Community Stats ── */
.community-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 2rem 0;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Homepage Build Sections ── */
.homepage-section {
    max-width: 1100px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
}

.homepage-section-title {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.homepage-builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.homepage-build-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.homepage-build-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.homepage-build-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.homepage-build-name {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0 0 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.homepage-build-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0 0 0.35rem;
}

.homepage-build-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.homepage-build-builder {
    color: var(--accent);
    font-size: 0.75rem;
}

.homepage-build-date {
    color: var(--text-muted);
    font-size: 0.7rem;
}

@media (max-width: 600px) {
    .community-stats { gap: 1.5rem; }
    .stat-number { font-size: 1.5rem; }
    .homepage-builds-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ── Embed Builder (iframe mode) ── */
.embed-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-dark);
    color: var(--text-primary);
    text-align: center;
    padding: 2rem;
}

.embed-error h2 { color: #e74c3c; margin-bottom: 0.5rem; }
.embed-error p { color: var(--text-secondary); margin-bottom: 1rem; }
.embed-error a { color: var(--accent); }

.embed-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-dark);
    color: var(--text-secondary);
}

.embed-builder {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-dark);
    overflow: hidden;
}

.embed-branding {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.embed-logo {
    max-height: 28px;
    max-width: 120px;
}

.embed-viewport {
    flex: 1;
    position: relative;
}

.embed-viewport canvas {
    width: 100% !important;
    height: 100% !important;
}

.embed-parts-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 260px;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    z-index: 10;
}

.embed-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.embed-panel-header h3 {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin: 0;
}

.embed-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.embed-part-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.embed-part-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.embed-part-item.embed-part-installed {
    border-left: 3px solid var(--accent);
}

.embed-part-name {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.embed-part-mfg {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.embed-category-bar {
    display: flex;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}

.embed-cat-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.embed-cat-btn:hover { border-color: var(--accent); }

.embed-cat-btn.embed-cat-active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.embed-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.embed-powered {
    color: var(--text-muted);
    font-size: 0.65rem;
}

/* =========================================================================
   Legal surface: global footer, cookie consent, Privacy/Terms pages
   ========================================================================= */

.app-footer {
    background: rgba(10, 8, 5, 0.95);
    border-top: 1px solid var(--hud-line);
    padding: 1.25rem 2rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.app-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-footer-brand {
    font-weight: 600;
    color: var(--hud-accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.app-footer-links {
    display: flex;
    gap: 1.25rem;
}

.app-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.app-footer-links a:hover {
    color: var(--hud-text);
}

/* Cookie consent banner — fixed at bottom, dismissable */
.cookie-consent {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 640px;
    margin: 0 auto;
    background: rgba(18, 14, 9, 0.97);
    border: 1px solid var(--hud-accent);
    border-radius: 4px;
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--hud-text);
    font-size: 0.78rem;
    line-height: 1.4;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 9999;
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-link {
    color: var(--hud-accent);
    text-decoration: underline;
    margin-left: 0.35rem;
}

.cookie-consent-dismiss {
    flex: 0 0 auto;
    background: var(--hud-accent);
    color: #1a1208;
    border: none;
    padding: 0.45rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
}

.cookie-consent-dismiss:hover {
    background: #e5c070;
}

/* Legal pages — readable, long-form */
.legal-page {
    min-height: 100vh;
    background: var(--bg-dark);
    padding: 2rem;
    color: var(--text-primary);
}

.legal-page .builder-logo {
    display: inline-block;
    margin-bottom: 2.5rem;
}

.legal-content {
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.7;
    font-size: 0.95rem;
}

.legal-content h1 {
    font-size: 2rem;
    margin-bottom: 0.4rem;
    color: var(--hud-accent);
}

.legal-content .legal-updated {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 2.4rem;
}

.legal-content h2 {
    font-size: 1.15rem;
    margin-top: 2.2rem;
    margin-bottom: 0.7rem;
    color: var(--hud-text);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.legal-content p,
.legal-content ul {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.legal-content li {
    margin-bottom: 0.4rem;
}

.legal-content code {
    background: rgba(212, 168, 83, 0.12);
    color: var(--hud-accent);
    padding: 0.08rem 0.35rem;
    border-radius: 2px;
    font-size: 0.85em;
}

.legal-content a {
    color: var(--hud-accent);
    text-decoration: underline;
}
