/* Damaged Goods App Styling - Accessible, Device-Native, Content-First Design */

/* --- Default Light Theme: Fran Desert Summer Palette (Warm Desert Canvas, WCAG AAA High Contrast for Color-Blind Readability) --- */
:root, :root[data-fa-palette="desert-summer"] {
    --fa-palette-name: "desert-summer";
    --fa-cream: #f9f3ea;            /* Warm Desert Sand Canvas */
    --fa-surface: #ffffff;          /* Crisp White Card Surface for maximum contrast */
    --fa-text: #18120e;             /* Deep Mesquite Espresso (16.7:1 WCAG AAA Contrast) */
    --fa-text-muted: #3d3128;       /* Deep Warm Bark (11.2:1 WCAG AAA Contrast) */
    --fa-text-on-primary: #ffffff;
    --fa-border: #d4c2ae;           /* Sun-bleached Accessible Border */
    --fa-border-focus: #842f06;     /* High-contrast Canyon Rust Focus */
    --fa-primary: #a7430d;          /* Deep Terracotta Blaze (WCAG Compliant) */
    --fa-primary-dark: #842f06;     /* Canyon Rust */
    --fa-primary-light: #c85a17;    /* Terracotta Highlight */
    --fa-gold: #92400e;             /* Deep Sunburst Bronze (6.2:1 Contrast) */
    --fa-glow: #dda136;             /* Sunburst Gold Glow */
    --fa-accent: #1e5a32;           /* Deep Desert Sage (6.5:1 Contrast) */
    --fa-accent-dark: #143d22;      /* Midnight Sage */
    --fa-ember: #8f1d18;            /* Red Clay Ember (8.5:1 WCAG AAA Contrast for Color-Blind) */
    --fa-wine: #631713;             /* Mesquite Wine */
    --fa-fir: #18120e;              /* Deep Charcoal Anchor */
    --fa-footer: #f5ece0;           /* Warm Sand Footer */
    --fa-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --dg-card-shadow: 0 1px 3px 0 rgba(24, 18, 14, 0.07), 0 1px 2px -1px rgba(24, 18, 14, 0.05);
    --dg-border-width: 1px;
}

/* Explicit data-theme="light" with Desert Summer Warm Canvas */
:root[data-theme="light"], :root[data-fa-palette="desert-summer"][data-theme="light"] {
    --fa-cream: #f9f3ea;
    --fa-surface: #ffffff;
    --fa-text: #18120e;
    --fa-text-muted: #3d3128;
    --fa-text-on-primary: #ffffff;
    --fa-border: #d4c2ae;
    --fa-border-focus: #842f06;
    --fa-primary: #a7430d;
    --fa-primary-dark: #842f06;
    --fa-primary-light: #c85a17;
    --fa-gold: #92400e;
    --fa-glow: #dda136;
    --fa-accent: #1e5a32;
    --fa-accent-dark: #143d22;
    --fa-ember: #8f1d18;
    --fa-wine: #631713;
    --fa-footer: #f5ece0;
    --dg-card-shadow: 0 1px 3px 0 rgba(24, 18, 14, 0.07), 0 1px 2px -1px rgba(24, 18, 14, 0.05);
}

/* --- Native Dark Mode via Device Preference when not explicit light --- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --fa-cream: #090d16;
        --fa-surface: #131c2e;
        --fa-text: #f8fafc;
        --fa-text-muted: #94a3b8;
        --fa-text-on-primary: #ffffff;
        --fa-border: #334155;
        --fa-border-focus: #38bdf8;
        --fa-primary: #38bdf8;
        --fa-primary-dark: #0284c7;
        --fa-primary-light: #7dd3fc;
        --fa-gold: #fbbf24;
        --fa-accent: #2dd4bf;
        --fa-accent-dark: #14b8a6;
        --fa-ember: #f87171;
        --fa-wine: #f43f5e;
        --fa-footer: #0f172a;
        --dg-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    }
}

:root[data-theme="dark"] {
    --fa-cream: #090d16;
    --fa-surface: #131c2e;
    --fa-text: #f8fafc;
    --fa-text-muted: #94a3b8;
    --fa-text-on-primary: #ffffff;
    --fa-border: #334155;
    --fa-border-focus: #38bdf8;
    --fa-primary: #38bdf8;
    --fa-primary-dark: #0284c7;
    --fa-primary-light: #7dd3fc;
    --fa-gold: #fbbf24;
    --fa-accent: #2dd4bf;
    --fa-accent-dark: #14b8a6;
    --fa-ember: #f87171;
    --fa-wine: #f43f5e;
    --fa-footer: #0f172a;
    --dg-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
}

/* --- Color-Blind & High-Contrast Support via Native Device Preference --- */
@media (prefers-contrast: more) {
    :root {
        --fa-cream: #ffffff;
        --fa-surface: #ffffff;
        --fa-text: #000000;
        --fa-text-muted: #1e293b;
        --fa-text-on-primary: #ffffff;
        --fa-border: #000000;
        --fa-border-focus: #000000;
        --fa-primary: #004d73;
        --fa-primary-dark: #002e45;
        --fa-primary-light: #006699;
        --fa-gold: #78350f;
        --fa-accent: #064e3b;
        --fa-accent-dark: #022c22;
        --fa-ember: #7f1d1d;
        --fa-wine: #4c0519;
        --dg-border-width: 2px;
        --dg-card-shadow: none;
    }

    :root[data-theme="dark"] {
        --fa-cream: #000000;
        --fa-surface: #0a0a0a;
        --fa-text: #ffffff;
        --fa-text-muted: #f1f5f9;
        --fa-text-on-primary: #000000;
        --fa-border: #ffffff;
        --fa-border-focus: #ffffff;
        --fa-primary: #7dd3fc;
        --fa-primary-dark: #bae6fd;
        --fa-primary-light: #e0f2fe;
        --fa-gold: #fde68a;
        --fa-accent: #a7f3d0;
        --fa-accent-dark: #d1fae5;
        --fa-ember: #fca5a5;
        --fa-wine: #fecdd3;
        --dg-border-width: 2px;
        --dg-card-shadow: none;
    }
}

/* Global Reset & Base Typography - Pure White Background Enforcement */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--fa-cream) !important;
    background-color: var(--fa-cream) !important;
    color: var(--fa-text);
    font-family: var(--fa-font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.dg-shell {
    background-color: var(--fa-cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dg-main-content {
    flex: 1;
    background-color: var(--fa-cream);
}

/* Layout Containers: Mobile App Frame across all screen sizes */
.dg-container {
    max-width: 580px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1rem 6rem 1rem;
}

/* Mobile-First App Top Bar (Consistent on Mobile & Desktop - Strictly NO Left Borders) */
.dg-topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(249, 243, 234, 0.94);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--fa-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(24, 18, 14, 0.03);
}

.dg-topbar-inner {
    max-width: 580px;
    width: 100%;
    height: 100%;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.dg-topbar-left,
.dg-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.dg-topbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    z-index: 1;
}

.dg-gold-shard {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--fa-gold);
    transform: rotate(45deg);
    border-radius: 2px;
    box-shadow: 0 0 6px var(--fa-glow);
}

.dg-topbar-title {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    color: var(--fa-primary);
    white-space: nowrap;
}

.dg-topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--fa-border);
    color: var(--fa-text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.dg-topbar-icon-btn:hover {
    background: #ffffff;
    color: var(--fa-primary);
    transform: scale(1.05);
}

.dg-topbar-user-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--fa-gold);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dg-topbar-signin-btn {
    background: var(--fa-primary);
    color: #ffffff;
    border: 1px solid var(--fa-primary-dark);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.15s ease;
}

.dg-topbar-signin-btn:hover {
    background: var(--fa-primary-dark);
}

/* Header & Brand Title */
.dg-brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--fa-border);
    margin-bottom: 1.5rem;
}

.dg-brand-title {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    color: var(--fa-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dg-tagline {
    font-size: 0.85rem;
    color: var(--fa-text-muted);
}

/* Discovery Profile Card - Vertical Feed Flow */
.dg-profile-card {
    position: relative;
    background-color: var(--fa-surface);
    border: 1px solid var(--fa-border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--dg-card-shadow);
}

/* Subcards Horizontal Scroll Track Under Profile Image */
.dg-subcards-deck-wrap {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid var(--fa-border);
    background: rgba(249, 243, 234, 0.45);
}

.dg-subcards-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0 0.15rem;
}

.dg-subcards-title {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fa-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dg-subcards-hint {
    font-size: 0.75rem;
    color: var(--fa-text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dg-subcards-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 1.1rem;
    padding: 0.4rem 0.2rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 67, 13, 0.4) transparent;
}

.dg-subcards-track::-webkit-scrollbar {
    height: 6px;
}

.dg-subcards-track::-webkit-scrollbar-track {
    background: transparent;
}

.dg-subcards-track::-webkit-scrollbar-thumb {
    background: rgba(167, 67, 13, 0.35);
    border-radius: 999px;
}

/* Pristine Clear Glass Description Cards - Optical Clarity & Specular Bevel (NO Left Borders) */
.dg-clear-glass-card {
    position: relative;
    flex: 0 0 88%;
    min-width: 290px;
    max-width: 440px;
    height: 380px;
    scroll-snap-align: start;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.38) 45%, rgba(255, 255, 255, 0.55) 100%);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
    box-shadow: 
        0 10px 32px -4px rgba(24, 18, 14, 0.05),
        0 3px 10px -2px rgba(24, 18, 14, 0.03),
        inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

/* Clear Glass Specular Sheen Reflection across top surface */
.dg-clear-glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 42%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.08) 75%, transparent 100%);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

/* Keep card content crisp above reflection sheen */
.dg-clear-glass-card > * {
    position: relative;
    z-index: 1;
}

.dg-clear-glass-card.dg-clear-glass-card-selected {
    border-color: var(--fa-primary);
    box-shadow: 
        0 0 0 2px var(--fa-primary),
        0 12px 32px -2px rgba(167, 67, 13, 0.18),
        inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95);
}

@media (min-width: 640px) {
    .dg-clear-glass-card {
        flex: 0 0 380px;
        max-width: 380px;
    }
}

:root[data-theme="dark"] .dg-clear-glass-card {
    background: linear-gradient(135deg, rgba(25, 34, 54, 0.7) 0%, rgba(19, 28, 46, 0.5) 50%, rgba(25, 34, 54, 0.65) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 32px -4px rgba(0, 0, 0, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

:root[data-theme="dark"] .dg-clear-glass-card::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 100%);
}

@media (prefers-contrast: more) {
    .dg-clear-glass-card {
        background: #ffffff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: 2px solid #000000 !important;
        box-shadow: none !important;
    }
    .dg-clear-glass-card::before {
        display: none !important;
    }
}

.dg-card-action-bar {
    padding: 1rem 1.2rem;
    background: var(--fa-surface);
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    align-items: center;
}

.dg-profile-image-wrap {
    position: relative;
    width: 100%;
    height: 420px;
    background: #0f172a;
}

.dg-profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease-in-out;
}

.dg-profile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.2rem 1.2rem;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 70%, transparent 100%);
    color: #ffffff;
}

/* Stitch Fix Style AI Damage Gallery Thumbnails */
.dg-stitchfix-bar {
    position: absolute;
    bottom: 5.5rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.4rem 0.2rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 10;
}

.dg-stitchfix-bar::-webkit-scrollbar {
    display: none;
}

.dg-stitchfix-thumb {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.dg-stitchfix-thumb:hover {
    transform: translateY(-2px);
    border-color: #ffffff;
}

.dg-stitchfix-thumb.active {
    border-color: var(--fa-primary-light, #38bdf8);
    box-shadow: 0 0 0 2px var(--fa-primary, #0284c7);
}

.dg-stitchfix-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dg-stitchfix-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    font-size: 0.55rem;
    color: #ffffff;
    text-align: center;
    padding: 0.1rem 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dg-damage-section {
    padding: 1.2rem;
    background-color: var(--fa-surface);
}

/* Uniform, Clean Damage Card - Frosted Glass Feel (NO Left Borders) */
.dg-damage-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 194, 174, 0.65);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.8rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(24, 18, 14, 0.03);
}

.dg-damage-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--fa-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dg-damage-field {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

.dg-damage-label {
    font-weight: 700;
    color: var(--fa-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Five Red Flags / Flaws Section - High Contrast Accessible Frosted Glass Design */
.dg-flags-card {
    background: rgba(255, 248, 246, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(223, 194, 188, 0.85);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.8rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(143, 29, 24, 0.03);
}

.dg-flags-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--fa-ember);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.dg-flag-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 0.4rem;
    color: var(--fa-text);
}

.dg-flag-item:last-child {
    margin-bottom: 0;
}

.dg-flag-index {
    background: #ffffff;
    border: 1.5px solid var(--fa-ember);
    color: var(--fa-ember);
    font-weight: 800;
    font-size: 0.72rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* Classified Personals - Price-Per-Word Disclosures (NO Left Borders) */
.dg-classified-cost-pill {
    background: rgba(167, 67, 13, 0.12);
    color: var(--fa-primary);
    border: 1px solid rgba(167, 67, 13, 0.35);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.dg-classified-clipping {
    background: rgba(255, 253, 248, 0.94);
    border: 1px dashed rgba(167, 67, 13, 0.45);
    border-radius: 8px;
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.75rem;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(24, 18, 14, 0.04);
}

.dg-classified-masthead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(167, 67, 13, 0.3);
    padding-bottom: 0.35rem;
    margin-bottom: 0.55rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fa-primary);
}

.dg-classified-text {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--fa-text);
    letter-spacing: -0.01em;
}

.dg-classified-rate-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(167, 67, 13, 0.3);
    margin-top: 0.65rem;
    padding-top: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--fa-text-muted);
}

.dg-abbrev-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dg-abbrev-badge {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(212, 194, 174, 0.75);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.68rem;
    color: var(--fa-text-muted);
    font-weight: 600;
}

.dg-abbrev-badge strong {
    color: var(--fa-primary);
    font-weight: 800;
}

:root[data-theme="dark"] .dg-classified-clipping {
    background: rgba(24, 33, 52, 0.9);
    border-color: rgba(221, 161, 54, 0.4);
}

:root[data-theme="dark"] .dg-classified-text {
    color: #f8fafc;
}

:root[data-theme="dark"] .dg-abbrev-badge {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
    color: #94a3b8;
}

/* Mobile Bottom Navigation Bar (Centered Mobile Dock on Desktop & Mobile - Strictly NO Left Borders) */
.dg-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 580px;
    margin: 0 auto;
    height: 62px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid var(--fa-border);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    box-shadow: 0 -4px 16px rgba(24, 18, 14, 0.04);
}

:root[data-theme="dark"] .dg-topbar {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .dg-topbar-icon-btn {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f8fafc;
}

:root[data-theme="dark"] .dg-bottom-nav {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(255, 255, 255, 0.12);
}

.dg-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--fa-text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 0.2rem;
    flex: 1;
}

.dg-nav-item.active {
    color: var(--fa-primary);
    font-weight: 700;
}

/* WCAG AAA/AA Button Styles */
.dg-btn-primary {
    background-color: var(--fa-primary);
    color: var(--fa-text-on-primary);
    border: 1px solid var(--fa-primary-dark);
    border-radius: 8px;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.dg-btn-primary:hover {
    background-color: var(--fa-primary-dark);
}

.dg-btn-secondary {
    background-color: #ffffff;
    color: var(--fa-text);
    border: 1px solid var(--fa-border);
    border-radius: 8px;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.dg-btn-secondary:hover {
    background-color: #f1f5f9;
}

/* Location Banners - Clean, Content-Focused, No Left Borders */
.dg-location-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid var(--fa-border);
}

.dg-location-banner.locked {
    background: #ffffff;
    color: var(--fa-text);
}

.dg-location-banner.unlocked {
    background: #ffffff;
    color: var(--fa-text);
}

/* Reddit-Style Profile & Damages View Modal (Scroll Down, Not Left/Right, Close Back to Discover) */
.dg-reddit-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 14, 11, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
}

.dg-reddit-modal-panel {
    background: var(--fa-background, #f9f3ea);
    max-width: 580px;
    width: 100%;
    min-height: 100vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 5rem;
}

.dg-reddit-modal-topbar {
    position: sticky;
    top: 0;
    z-index: 2010;
    background: rgba(249, 243, 234, 0.96);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--fa-border);
    height: 56px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dg-reddit-close-btn {
    background: #ffffff;
    border: 1px solid var(--fa-border);
    color: var(--fa-text);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(24, 18, 14, 0.05);
    transition: all 0.15s ease;
}

.dg-reddit-close-btn:hover {
    background: var(--fa-cream);
    color: var(--fa-primary);
}

.dg-reddit-damage-card {
    background: #ffffff;
    border: 1px solid var(--fa-border);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.1rem;
    box-shadow: 0 2px 8px rgba(24, 18, 14, 0.04);
}

.dg-reddit-damage-card.featured {
    border-color: var(--fa-primary);
    box-shadow: 0 4px 14px rgba(167, 67, 13, 0.1);
}

.dg-btn-damages-trigger {
    width: 100%;
    background: linear-gradient(135deg, rgba(167, 67, 13, 0.09) 0%, rgba(221, 161, 54, 0.15) 100%);
    border: 1.5px solid var(--fa-primary);
    color: var(--fa-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    margin-top: 0.4rem;
}

.dg-btn-damages-trigger:hover {
    background: var(--fa-primary);
    color: #ffffff;
}

:root[data-theme="dark"] .dg-reddit-modal-panel {
    background: var(--fa-background, #0f172a);
}

:root[data-theme="dark"] .dg-reddit-modal-topbar {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .dg-reddit-close-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

:root[data-theme="dark"] .dg-reddit-damage-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
}

