﻿:root {
    --primary: #007bff;
    --primary-dark: #0056b3;
    --secondary: #6c757d;
    --secondary-dark: #545b62;
    --danger: #dc3545;
    --bg: #f9f9f9;
    --surface: #ffffff;
    --text: #333333;
    --muted: #777777;
    --radius: 8px;
    --shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 18px 30px rgba(15, 23, 42, 0.12);
    --bg-veil: rgba(255,255,255,0.88);
    /* Added for component-specific styling */
    --border-color: #e5e7eb;
    --card-bg: rgba(0,0,0,0.03);
}

/* Shared achievement components */
.achievement-badge { background:#22c55e; color:#fff; font-size:.75rem; padding:.25rem .75rem; border-radius:999px; font-weight:600; text-transform:uppercase; letter-spacing:.08em; display:inline-flex; align-items:center; gap:.35rem; }
.achievement-counter { font-size:.85rem; color:var(--muted); font-weight:600; }
.achievement-progress { position:relative; width:100%; height:20px; border-radius:999px; background:rgba(148,163,184,0.2); overflow:hidden; }
.achievement-progress-fill { position:absolute; inset:0; background:linear-gradient(90deg,#2563eb,#22d3ee); z-index:0; }
.achievement-progress-label { position:absolute; inset:auto; top:50%; left:50%; transform:translate(-50%,-50%); z-index:1; font-size:.7rem; font-weight:600; color:#f8fafc; background:rgba(15,23,42,0.55); padding:.15rem .5rem; border-radius:999px; white-space:nowrap; pointer-events:none; }
.profile-achievement-grid { display:grid; gap:1.5rem; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); }
.profile-card--achievement { display:flex; flex-direction:column; gap:1.5rem; }
.profile-card--achievement.is-completed { border:1px solid rgba(34,197,94,0.35); box-shadow:0 16px 40px rgba(34,197,94,0.12); }
.profile-card--achievement .profile-card-subtitle { margin:.35rem 0 0; color:var(--muted); }
.achievement-rank-summary { display:flex; align-items:center; justify-content:space-between; gap:1.5rem; flex-wrap:wrap; }
.achievement-rank-current { display:flex; align-items:center; gap:.75rem; }
.achievement-rank-current img { width:40px; height:40px; object-fit:contain; border-radius:50%; background:rgba(148,163,184,0.2); padding:.25rem; }
.achievement-rank-label { display:block; font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
.achievement-rank-next { text-align:right; font-size:.9rem; color:var(--muted); }
.achievement-rank-name { font-weight:600; }
.achievement-rank-list { list-style:none; margin:1.25rem 0 0; padding:0; display:flex; flex-direction:column; gap:.5rem; }
.achievement-rank-list li { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.65rem; padding:.65rem .85rem; border-radius:var(--radius); background:rgba(148,163,184,0.08); }
.achievement-rank-list li.is-completed { background:rgba(34,197,94,0.12); color:#166534; }
.achievement-rank-list li.is-active-flair { box-shadow:0 0 0 2px rgba(59,130,246,0.3); }
.achievement-rank-chip { display:flex; align-items:center; gap:.55rem; font-weight:600; }
.achievement-rank-chip img { width:30px; height:30px; object-fit:contain; }
.achievement-rank-progress { font-size:.85rem; color:var(--muted); font-weight:500; }
.rank-flair { --flair-color: rgba(15,23,42,0.85); --flair-contrast: #ffffff; display:inline-flex; align-items:center; gap:.45rem; padding:0 .85rem; height:32px; border-radius:999px; font-weight:600; font-size:.85rem; background:var(--flair-color, rgba(15,23,42,0.85)); color:var(--flair-contrast, #ffffff); box-shadow:0 4px 12px rgba(15,23,42,0.18); border:1px solid rgba(255,255,255,0.18); }
.rank-flair img { width:22px; height:22px; object-fit:contain; filter:drop-shadow(0 1px 2px rgba(15,23,42,0.2)); }
.rank-flair span { line-height:1; }
.rank-flair.rank-alpha,
.rank-flair.rank-beta { position:relative; overflow:hidden; }
.rank-flair.rank-alpha { --flair-color:#b91c1c; --flair-contrast:#fff; background:linear-gradient(135deg,#991b1b,#ef4444,#b91c1c); box-shadow:0 6px 18px rgba(185,28,28,0.35); }
.rank-flair.rank-beta { --flair-color:#5b21b6; --flair-contrast:#fff; background:linear-gradient(135deg,#4c1d95,#8b5cf6,#5b21b6); box-shadow:0 6px 18px rgba(91,33,182,0.35); }
.rank-flair.rank-alpha::after,
.rank-flair.rank-beta::after { content:""; position:absolute; top:-60%; left:-120%; width:50%; height:220%; background:linear-gradient(120deg,rgba(255,255,255,0) 10%,rgba(255,255,255,0.75) 45%,rgba(255,255,255,0) 75%); transform:rotate(25deg); animation:flair-sheen 2.8s linear infinite; }

@keyframes flair-sheen {
    0% { left:-120%; }
    55% { left:130%; }
    100% { left:130%; }
}
.rank-flair.rank-grandmaster { background:linear-gradient(90deg,#FF4B2B,#FFEE58,#4CAF50,#00CED1,#4169E1,#8E44AD,#FF4B2B); color:#111827; border-color:rgba(255,255,255,0.4); }
.rank-flair-action.is-loading { opacity:.6; pointer-events:none; }
.achievement-rank-actions { margin-left:auto; display:flex; align-items:center; gap:.5rem; }
.achievement-rank-actions .btn { padding:.35rem .85rem; font-size:.75rem; line-height:1.1; }
.achievement-rank-row { display:flex; gap:1rem; flex-wrap:wrap; font-size:.85rem; color:var(--muted); margin:.5rem 0; }
.achievement-rank-row strong { color:var(--text); }
.achievement-rank-entry { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.achievement-rank-display { display:flex; align-items:center; gap:.4rem; flex-wrap:wrap; color:var(--text); }
.achievement-rank-icon { width:32px; height:32px; object-fit:contain; border-radius:50%; background:rgba(148,163,184,0.18); padding:.2rem; }
.achievement-track { margin-top:.75rem; }
.achievement-track-list { display:flex; gap:.75rem; overflow-x:auto; padding:.35rem 0; }
.achievement-track-step { display:flex; align-items:center; gap:.5rem; padding:.35rem .65rem; border-radius:var(--radius); background:rgba(148,163,184,0.08); flex-shrink:0; }
.achievement-track-step.is-completed { background:rgba(34,197,94,0.16); box-shadow:0 8px 20px rgba(34,197,94,0.12); }
.achievement-track-icon { width:36px; height:36px; object-fit:contain; border-radius:50%; background:rgba(148,163,184,0.18); padding:.25rem; }
.achievement-track-name { font-weight:600; color:var(--text); }
.achievement-rank-legend { margin:1.25rem 0 1.5rem; padding:.85rem 1rem; border-radius:var(--radius); border:1px solid var(--border-color); background:var(--card-bg); }
.achievement-rank-legend-list { margin:0; padding:0; list-style:none; display:flex; gap:.75rem; flex-wrap:wrap; justify-content: center; }
.achievement-rank-legend-item { display:flex; align-items:center; gap:.5rem; font-weight:600; color:var(--rank-color, var(--muted)); background:rgba(148,163,184,0.08); padding:.4rem .65rem; border-radius:999px; }
.achievement-rank-legend-icon { width:32px; height:32px; object-fit:contain; border-radius:50%; background:rgba(148,163,184,0.18); padding:.2rem; }
.achievement-rank-legend-name { font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; }

/* Dark theme overrides */
[data-theme='dark'] {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --secondary: #4b5563;
    --secondary-dark: #374151;
    --danger: #ef4444;
    --bg: #1f2937;
    --surface: #111827;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
    --bg-veil: rgba(0,0,0,0.78);
    /* Added for component-specific styling */
    --border-color: #374151;
    --card-bg: rgba(255,255,255,0.05);
}
[data-theme='dark'] .achievement-progress-label { background:rgba(15,23,42,0.75); color:#f8fafc; }
[data-theme='dark'] .achievement-rank-legend { background:rgba(255,255,255,0.04); }
[data-theme='dark'] .achievement-rank-legend-item { background:rgba(255,255,255,0.04); }

/* General styles */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; overflow-y: auto; }
body {
    font-family: Arial, sans-serif;
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    color: var(--text);
    transition: background-color 0.3s, color 0.3s;
}
img { max-width: 100%; height: auto; }

.avatar {
    --avatar-size: 48px;
    --avatar-font-size: calc(var(--avatar-size) / 2.25);
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    border: 1px solid var(--border-color, #e5e7eb);
    object-fit: cover;
    background: #fff;
    display: inline-block;
}

.avatar--sm { --avatar-size: 32px; }
.avatar--md { --avatar-size: 40px; }
.avatar--lg { --avatar-size: 56px; }
.avatar--xl { --avatar-size: 64px; }
.avatar--xxl { --avatar-size: 112px; }
.avatar--hero { --avatar-size: 80px; }

.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--avatar-font-size, 1.25rem);
    text-transform: uppercase;
    color: #1f2937;
    background: #e5e7eb;
}

[data-theme='dark'] .avatar {
    background: rgba(17, 24, 39, 0.85);
    border-color: rgba(75, 85, 99, 0.7);
}

[data-theme='dark'] .avatar-fallback {
    color: #f9fafb;
    background: rgba(55, 65, 81, 0.85);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', serif;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* Container and layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
/* Ensure inner containers used inside .content expand to full width */
.content .container { width: 100%; }

header, footer {
    background-color: #33333300;
    color: #fff;
    padding: 1em 0;
    text-align: center;
}

header a, footer a {
    color: #fff;
}

/* Form styles */
form {
    background: #ffffff29;
    padding: 20px;
    border-radius: 5px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 8px;
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form input[type="email"],
form input[type="datetime-local"],
form input[type="file"],
form input[type="submit"],
form button,
form textarea,
form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--muted);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text);
}

form input[type="submit"],
form button {
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
}

form input[type="submit"]:hover,
form button:hover {
    background-color: var(--primary-dark);
}

/* Filters for admin user table */
form.user-filters {
    background: none;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    width: auto;
    max-width: none;
}

form.user-filters input[type="text"],
form.user-filters select {
    width: auto;
    flex: 0 0 200px;
    max-width: 200px;
    padding: 4px 8px;
}

form.user-filters button,
form.user-filters a.btn {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}

/* Generic table search input */
.table-search {
    width: 100%;
    max-width: 200px;
    padding: 4px 8px;
    margin-bottom: 10px;
}


@media (min-width: 769px) {
    form.user-filters {
        flex-wrap: nowrap;
    }
}


@media (max-width: 768px) {
    form.user-filters input[type="text"],
    form.user-filters select {
        flex: 1 1 100%;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .table-search {
        max-width: none;
    }
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    color: var(--text);
    background: var(--surface);
}

table th, table td {
    border: 1px solid var(--muted);
    padding: 10px;
    text-align: left;
    color: var(--text);
}

table th {
    background: var(--bg);
    color: var(--text);
}

/* Table wrapper for responsive scrolling */
.table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

table tr:nth-child(even) {
    background: var(--bg);
}

/* Cart page */
.cart-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px 0 48px;
}

.cart-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg, var(--shadow));
}

.cart-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(14,116,144,0.08));
    border-color: rgba(59,130,246,0.25);
}

.cart-hero-text h1 {
    margin-bottom: 0.5rem;
}

.cart-hero-text p {
    margin: 0;
    color: var(--muted);
}

.cart-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cart-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(59,130,246,0.12);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.cart-chip--ghost {
    background: transparent;
    border: 1px solid rgba(59,130,246,0.35);
    color: var(--text);
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 24px;
    align-items: start;
}

.cart-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.75rem;
}

.cart-section-heading h2 {
    margin: 0;
}

.cart-section-heading .muted {
    margin-top: 0.25rem;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.cart-item {
    border: 1px solid var(--border-color);
    border-radius: calc(var(--radius) - 4px);
    padding: 1.25rem;
    background: var(--surface-subtle, rgba(15,23,42,0.02));
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cart-item:hover {
    border-color: rgba(59,130,246,0.35);
    box-shadow: var(--shadow-sm, 0 10px 25px -12px rgba(15,23,42,0.3));
    transform: translateY(-2px);
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.cart-item-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.cart-item-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-stat--quantity .cart-inline-form {
    gap: 0.5rem;
}

.cart-item-stat--subtotal {
    align-items: flex-start;
}

.cart-item-stat--subtotal .cart-inline-form {
    margin-top: 0.35rem;
}

.cart-stat-label {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}

.cart-item-name {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cart-item-title {
    font-weight: 600;
}

.cart-item-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    background: rgba(148,163,184,0.16);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.cart-inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.cart-inline-form button {
    width: auto;
    margin: 0;
    padding: 0.5rem 0.9rem;
}

.cart-quantity-form {
    flex-wrap: wrap;
}

.cart-quantity-input {
    width: 80px;
    max-width: 100px;
    margin: 0;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--surface);
    font-weight: 600;
    text-align: center;
}

.cart-stock {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.cart-price {
    font-weight: 600;
}

.cart-price--highlight {
    color: var(--primary);
}

.cart-remove-form {
    text-align: right;
    width: auto;
}

.btn-ghost {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(220,53,69,0.35);
}

.btn-ghost:hover {
    background: rgba(220,53,69,0.08);
}

.cart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cart-summary-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 600;
}

.cart-summary-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.cart-alert {
    background: rgba(250,204,21,0.12);
    border-color: rgba(250,204,21,0.45);
}

.cart-alert p {
    margin: 0.35rem 0 0;
    color: var(--text);
}

.cart-checkout-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cart-payment {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-payment h3 {
    margin: 0;
}

.cart-payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cart-payment-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: rgba(148,163,184,0.08);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.cart-payment-option:hover {
    border-color: var(--primary);
    background: rgba(59,130,246,0.12);
}

.cart-payment-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.cart-payment-option span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cart-upload {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-upload label {
    font-weight: 600;
}

.cart-checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-checkout-actions .btn {
    width: 100%;
}

.cart-empty {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.cart-empty h2 {
    margin: 0;
}

.cart-empty .btn {
    width: auto;
    padding-inline: 1.5rem;
}

@media (min-width: 640px) {
    .cart-checkout-actions {
        flex-direction: row;
        align-items: center;
    }

    .cart-checkout-actions .btn {
        width: auto;
    }
}

@media (max-width: 960px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .cart-main {
        padding: 1.5rem;
    }

    .cart-card {
        padding: 1.25rem;
    }

    .cart-item {
        padding: 1rem;
    }

    .cart-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cart-item-stat--subtotal {
        align-items: stretch;
    }

    .cart-remove-form {
        width: 100%;
    }

    .cart-item-stat--subtotal .cart-inline-form {
        display: flex;
        justify-content: flex-start;
    }

    .cart-inline-form {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cart-inline-form button {
        width: auto;
    }
}

[data-theme='dark'] .cart-card {
    border-color: rgba(148,163,184,0.16);
}

[data-theme='dark'] .cart-hero {
    background: linear-gradient(135deg, rgba(59,130,246,0.22), rgba(14,116,144,0.25));
    border-color: rgba(59,130,246,0.45);
}

[data-theme='dark'] .cart-payment-option {
    background: rgba(255,255,255,0.04);
}

[data-theme='dark'] .cart-payment-option:hover {
    background: rgba(59,130,246,0.16);
}

[data-theme='dark'] .cart-alert {
    background: rgba(250,204,21,0.18);
    border-color: rgba(250,204,21,0.6);
}

[data-theme='dark'] .cart-badge {
    background: rgba(255,255,255,0.08);
}

[data-theme='dark'] .cart-item {
    background: rgba(15,23,42,0.35);
    border-color: rgba(148,163,184,0.2);
}

[data-theme='dark'] .cart-item:hover {
    box-shadow: 0 12px 28px -16px rgba(59,130,246,0.65);
    border-color: rgba(59,130,246,0.6);
}

[data-theme='dark'] .btn-ghost {
    border-color: rgba(239,68,68,0.5);
}

[data-theme='dark'] .btn-ghost:hover {
    background: rgba(239,68,68,0.2);
}

/* Utility visibility classes */
.mobile-only { display: none; }

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    header, footer {
        text-align: left;
        padding: 1em;
    }

    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
}

/* Mobile stacked table */
@media (max-width: 768px) {
    .stacked-table table,
    .stacked-table thead,
    .stacked-table tbody,
    .stacked-table tr,
    .stacked-table th {
        display: block;
    }

    /* Visually hide table header but keep for screen readers */
    .stacked-table thead {
        border: 0;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    .stacked-table tr {
        margin-bottom: 1em;
        border: 1px solid var(--muted);
        border-radius: var(--radius);
        padding: 10px;
        background: var(--surface);
    }

    .stacked-table td {
        display: block;
        border: none;
        border-bottom: 1px solid var(--muted);
        padding: 6px 0;
    }

    .stacked-table td:last-child {
        border-bottom: none;
    }

    .stacked-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        color: var(--muted);
        margin-bottom: 4px;
    }

    .stacked-table td.desktop-only,
    .stacked-table th.desktop-only {
        display: none !important;
    }

    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
}

/* Sticky bulk action bar */
.bulk-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--muted);
    padding: 10px;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
.bulk-bar.show { display: flex; }

/* Sticky bulk action bar */
.bulk-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--muted);
    padding: 10px;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
.bulk-bar.show { display: flex; }

/* Sticky bulk action bar */
.bulk-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--muted);
    padding: 10px;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
.bulk-bar.show { display: flex; }

/* Sticky bulk action bar */
.bulk-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--muted);
    padding: 10px;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
.bulk-bar.show { display: flex; }



/* Auction item styles */
.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.auction-item { border: 1px solid #ddd; padding: 20px; text-align: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: visible; position: relative; }

.auction-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .auction-image {
        max-width: 100%;
        height: auto;
    }
}

/* Bid history */
.bid-history {
    margin-top: 10px;
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--surface);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    padding: 0;
}

.bid-history-table-wrapper {
    width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: inherit;
}

.bid-history-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.bid-history-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.bid-history-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.bid-history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    table-layout: fixed;
}

.bid-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(148, 163, 184, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0.5rem 0.65rem;
    text-align: left;
}

.bid-history-table tbody tr {
    transition: background 0.2s ease, transform 0.2s ease;
}

.bid-history-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

.bid-history-table tbody td {
    padding: 0.55rem 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 0.8rem;
    color: var(--text);
    white-space: normal;
    line-height: 1.25;
}

.bid-history-table tbody tr:first-child td {
    border-top: none;
}

.bid-history-table th,
.bid-history-table td {
    vertical-align: middle;
    text-align: left;
}

.bid-history-bidder {
    font-weight: 600;
    white-space: normal;
    word-break: break-word;
}

.bid-history-amount {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.bid-history-timestamp {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: normal;
}

.bid-history-timestamp-date,
.bid-history-timestamp-time {
    display: block;
    line-height: 1.1;
}

.bid-history-timestamp-date {
    font-size: 0.72rem;
    font-weight: 600;
}

.bid-history-timestamp-time {
    font-size: 0.68rem;
    color: var(--muted);
}

.bid-history-header-amount,
.bid-history-header-timestamp {
    text-align: right;
}

.bid-history-col-bidder { width: 45%; }
.bid-history-col-amount { width: 22%; }
.bid-history-col-timestamp { width: 33%; }

@media (max-width: 768px) {
    .bid-history {
        max-height: 220px;
    }

    .bid-history-table {
        min-width: 0;
    }

    .bid-history-table thead th {
        font-size: 0.65rem;
        padding: 0.6rem 0.75rem;
    }

    .bid-history-table tbody td {
        font-size: 0.85rem;
        padding: 0.6rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .bid-history {
        max-height: 200px;
    }

    .bid-history-table {
        min-width: 280px;
    }

    .bid-history-table thead th {
        font-size: 0.6rem;
        letter-spacing: 0.04em;
    }

    .bid-history-table tbody td {
        font-size: 0.8rem;
    }
}

.bid-history-empty {
    margin: 0;
    padding: 1.2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.bid-watcher-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

[data-theme='dark'] .bid-history {
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}

[data-theme='dark'] .bid-history-table thead th {
    background: rgba(30, 41, 59, 0.85);
    color: var(--muted);
}

[data-theme='dark'] .bid-history-table tbody td {
    border-top: 1px solid rgba(55, 65, 81, 0.65);
}

[data-theme='dark'] .bid-history-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.18);
}

[data-theme='dark'] .bid-history-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
}

[data-theme='dark'] .bid-watcher-tag {
    background: rgba(59, 130, 246, 0.28);
    color: #93c5fd;
}

/* Avoid forcing full-page centering which caused overflow/scroll issues,
   especially on tall admin pages with many open sections. If a page needs
   vertical centering, add the 'page-centered' class to <body>. */
body.page-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.sidebar-toggle {
    font-size: 30px;
    cursor: pointer;
    padding: 15px;
    background-color: #333;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.sidebar {
    width: 250px;
    height: 100vh;
    background-color: #333;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin-top: 60px; /* Adjusted to account for the sidebar toggle button */
}

.sidebar-nav ul {
    padding: 0;
}

.sidebar-nav li {
    padding: 15px;
}

.sidebar-nav a {
    color: white;
    text-decoration: none;
    display: block;
}

.sidebar-nav a:hover {
    background-color: #575757;
}

.content-wrapper {
    transition: margin-left 0.3s ease-in-out;
    width: 100%;
    display: flex;
    align-items: flex-start; /* start at top to ensure page scroll works */
    justify-content: center;
}

.content-wrapper.shifted {
    margin-left: 250px;
}

.content {
    padding: 20px;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
    color: var(--text);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
}

form {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}

/* Neutralize global form constraints within the storefront */
.storefront-toolbar form.storefront-filters {
    width: 100%;
    max-width: none;
    align-items: stretch;   /* prevent column centering */
}

/* Optional: prevent future collisions by scoping the global form rule */
body.storefront-theme form {
    max-width: none;
    align-items: stretch;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="number"],
form input[type="file"], /* Added file input type */
form textarea, /* Added textarea */
form button {
    width: 100%;
    max-width: 100%; /* Ensure the input and button elements do not exceed the form width */
    padding: 10px;
    margin: 10px 0;
    box-sizing: border-box;
}

/* Buttons */
.btn, form button {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 10px 16px;
    text-align: center;
}
.btn:hover, form button:hover { background-color: var(--primary-dark); }
.btn-secondary { background-color: var(--secondary); }
.btn-secondary:hover { background-color: var(--secondary-dark); }
.btn-danger { background-color: var(--danger); }

.btn-sm { padding: 4px 8px !important; font-size: 0.875em; }

.admin-section { margin-bottom: 1rem; }
.admin-section .section-toggle { width: 100%; text-align: left; margin-bottom: 8px; }
.admin-section .section-content { display: none; }

/* Ensure dark-mode text colors inside admin cards and tables */
.card,
.admin-section,
.admin-section .section-content,
.table,
.table th,
.table td {
    color: var(--text);
}

.admin-table th, .admin-table td { padding: 6px 8px; font-size: 0.9em; }

.news-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.news-item {
    background-color: var(--surface);
    border: 1px solid #ddd;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    width: 300px;
}

.news-item img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    background: var(--surface);
}
.auction-item p, .news-item p { overflow-wrap: anywhere; }
/* Preserve newlines in news descriptions for proper formatting */
.news-item p { white-space: pre-line; }
.bid-history-table td { overflow-wrap: anywhere; }

/* Cards */
.card {
    background-color: var(--surface);
    border: 1px solid #ddd;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    overflow: hidden;
    position: relative;
}
.auth-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 800px;
}
.auth-card { width: 100%; max-width: 480px; }
.cta-row { display: flex; gap: 12px; margin: 10px 0 20px; flex-wrap: wrap; }
.form-errors .error { color: var(--danger); font-size: 0.9em; }

/* Adjusting auction bid and button */
form.auction-bid-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%; /* Ensure the form width does not exceed its container */
}
/* In-card bid form: keep subtle styling, no card-like shadow */
.auction-item form.auction-bid-form { box-shadow: none; border: 1px solid var(--muted); background: var(--surface); border-radius: 6px; margin: 0; padding: 14px; width: 100%; }

form.auction-bid-form input[type="number"] {
    width: 100%;
    max-width: 100%; /* Ensure the input width does not exceed the form width */
    padding: 10px;
    margin: 10px 0;
    box-sizing: border-box;
}

form.auction-bid-form button {
    width: 100%;
    max-width: 100%; /* Ensure the button width does not exceed the form width */
    padding: 10px;
    margin: 10px 0;
    box-sizing: border-box;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

form.auction-bid-form button:hover {
    background-color: #0056b3;
}


/* Flash messages */
.flash-container { width: 100%; max-width: 800px; margin-bottom: 10px; }
.flash { padding: 10px 12px; border-radius: 6px; margin-bottom: 8px; }
.flash.success { background: #d1e7dd; color: #0f5132; }
.flash.danger { background: #f8d7da; color: #842029; }
.flash.info { background: #cff4fc; color: #055160; }

/* Sidebar & Navigation */
.sidebar { width: 260px; height: 100vh; background: rgba(255,255,255,0.75); color: #1f2937; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-right: 1px solid rgba(0,0,0,0.1); position: fixed; top: 0; left: 0; transform: translateX(-100%); transition: transform .3s ease-in-out; z-index: 999; }
.sidebar.active { transform: translateX(0); }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px; }
.sidebar .brand { justify-content: center; padding: 20px 16px; }
.sidebar .brand-logo { background: transparent; width: auto; height: auto; }
.sidebar .brand-logo img { display: block; max-width: 70%; height: auto; }
.brand-logo { width: 28px; height: 28px; display: grid; place-items: center; background: rgba(255,255,255,0.15); border-radius: 6px; }
.brand-name { font-weight: 700; letter-spacing: .3px; }
.sidebar-nav { list-style: none; padding: 0; margin: 10px 0; }
.sidebar-nav > ul { display: none; }
.menu-container { position: relative; width: 100%; height: calc(100vh - 140px); overflow: hidden; }
.menu-panel { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow-y: auto; padding-bottom: 24px; transition: transform .3s ease-in-out; }
.menu-root { transform: translateX(0%); }
.submenu { transform: translateX(100%); }
.sidebar.submenu-active[data-submenu="warroom"] .menu-root { transform: translateX(-100%); }
.sidebar.submenu-active[data-submenu="warroom"] #submenu-warroom { transform: translateX(0%); }
.sidebar.submenu-active[data-submenu="user"] .menu-root { transform: translateX(-100%); }
.sidebar.submenu-active[data-submenu="user"] #submenu-user { transform: translateX(0%); }
.submenu-header { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid rgba(0,0,0,0.08); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.submenu-header .btn { padding: 6px 10px; border: 1px solid rgba(0,0,0,0.12); border-radius: 6px; background: transparent; color: var(--text); }
[data-theme='dark'] .submenu-header { border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li { padding: 0; }
.sidebar-nav a, .sidebar-nav a.nav-link { color: #1f2937; display: block; padding: 12px 18px; border-radius: 6px; margin: 4px 10px; text-decoration: none; }
.sidebar-nav a.nav-link:hover { background: rgba(0,0,0,0.06); }
.sidebar-nav a.nav-link.active { background: rgba(0,0,0,0.12); }
.sidebar-nav .theme-toggle {
    color: #1f2937;
    display: block;
    padding: 12px 18px;
    border-radius: 6px;
    margin: 4px 10px;
    text-align: left;
}
.sidebar-nav .theme-toggle:hover { background: rgba(0,0,0,0.06); }
.sidebar .nav-link.balance { color: #1f2937; display: block; padding: 12px 18px; border-radius: 6px; margin: 4px 10px; background: rgba(0,0,0,0.06); }
.sidebar-toggle { font-size: 30px; cursor: pointer; padding: 10px 14px; background: rgba(17,24,39,0.35); color: #e5e7eb; position: fixed; top: 8px; left: 8px; z-index: 1000; display: none; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(4px); }
.sidebar-toggle:hover { background: rgba(17,24,39,0.55); }
[data-theme='dark'] .sidebar { background: linear-gradient(180deg, #1f2937 0%, #0f172a 100%); color: #e5e7eb; border-right: 1px solid rgba(255,255,255,0.1); }
[data-theme='dark'] .sidebar-nav a,
[data-theme='dark'] .sidebar-nav a.nav-link { color: #e5e7eb; }
[data-theme='dark'] .sidebar-nav a.nav-link:hover { background: rgba(255,255,255,0.08); }
[data-theme='dark'] .sidebar-nav a.nav-link.active { background: rgba(255,255,255,0.16); }
[data-theme='dark'] .sidebar-nav .theme-toggle { color: #e5e7eb; }
[data-theme='dark'] .sidebar-nav .theme-toggle:hover { background: rgba(255,255,255,0.08); }
[data-theme='dark'] .sidebar .nav-link.balance { color: #e5e7eb; background: rgba(255,255,255,0.06); }
[data-theme='dark'] .sidebar-inbox-link {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #e5e7eb;
}

[data-theme='dark'] .sidebar-inbox-link:hover,
[data-theme='dark'] .sidebar-inbox-link:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
}

[data-theme='dark'] .sidebar-inbox-link.active {
    background: rgba(255, 255, 255, 0.16);
}
.content-wrapper.shifted { margin-left: 0; }

/* Top navigation (desktop) */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 16px;
    gap: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    width: 100%;
    box-sizing: border-box;
}
.topnav .brand { padding: 0; }
.topnav .brand-logo { width: 36px; height: 36px; display: grid; place-items: center; background: transparent; }
.topnav .brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Swap logos based on theme */
.topnav .brand-logo .logo-dark,
.sidebar .brand-logo .logo-dark { display: none; }
[data-theme='dark'] .topnav .brand-logo .logo-light,
[data-theme='dark'] .sidebar .brand-logo .logo-light { display: none; }
[data-theme='dark'] .topnav .brand-logo .logo-dark,
[data-theme='dark'] .sidebar .brand-logo .logo-dark { display: block; }
.topnav .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    justify-content: flex-end;
}
.nav-group { position: relative; display: inline-block; }
.nav-group .nav-label { cursor: default; }
.nav-group .dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 180px; background: var(--surface); border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px 0; z-index: 1000; }
.nav-group .dropdown-right { right: 0; left: auto; }
.nav-group .dropdown a { display: block; padding: 8px 14px; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav-group .dropdown a:hover, .nav-group .dropdown a.active { background: rgba(0,0,0,0.06); }
@media (min-width: 769px) {
  .nav-group:hover .dropdown { display: block; }
}
.topnav a.nav-link {
    color: var(--text);
    padding: 10px 12px;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.topnav .nav-link.nav-quest-link {
    padding: 6px 8px;
}
.nav-quest-icon {
    width: 45px;
    height: 45px;
    display: block;
    object-fit: contain;
}
.topnav a.nav-link.active,
.topnav a.nav-link:hover {
    background: rgba(0,0,0,0.05);
}
.topnav a.nav-link:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.topnav a.nav-link.has-unread,
.sidebar-nav a.nav-link.has-unread,
.inbox-link.has-unread { color: var(--danger); }
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text);
    transition: background 0.2s, transform 0.2s;
}
.theme-toggle:hover {
    background: rgba(0,0,0,0.05);
    transform: translateY(-1px);
}
.nav-link.balance { pointer-events: none; color: var(--muted); font-weight: 600; }

/* Auction grid */
.auction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  width: 100%;
  align-items: stretch;
}
/* Guarantee at least 2 columns on medium+ screens */
@media (min-width: 900px) {
  .auction-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.auction-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; width: 100%; align-items: stretch; }
.auction-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; width: 100%; }
.auction-item { border: 1px solid #ddd; padding: 20px; text-align: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 20px; overflow: hidden; }
.auction-image { width: 100%; height: auto; max-height: 360px; object-fit: contain; border-radius: 6px; }

/* Fade/finished states for auctions */
.auction-item.finished { opacity: 0.85; }
.auction-item.fade-out { opacity: 0; transition: opacity 0.6s ease; }

@media (max-width: 768px) {
  .topnav { display: none; }
  .sidebar-toggle { display: block; padding: 12px; }
  .sidebar { display: block; width: 82vw; }
  .auction-grid { grid-template-columns: 1fr; }
  .auth-cards { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .content { padding: 12px; }
  .toast-container {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 16px;
    left: 16px;
    align-items: flex-end;
  }
  /* Keep non-stacked tables as tables on mobile; make them horizontally scrollable instead of stacking */
  .table-wrapper:not(.stacked-table) table { display: table !important; width: 100%; min-width: 560px; border-collapse: collapse; }
  .table-wrapper:not(.stacked-table) thead { display: table-header-group !important; }
  .table-wrapper:not(.stacked-table) tbody { display: table-row-group !important; }
  .table-wrapper:not(.stacked-table) tr { display: table-row !important; }
  .table-wrapper:not(.stacked-table) th,
  .table-wrapper:not(.stacked-table) td { display: table-cell !important; white-space: nowrap; padding: 8px; }
  .table-wrapper:not(.stacked-table) table td:before { content: none !important; }
}

@media (min-width: 769px) {
  .sidebar { display: none; }
  .sidebar-toggle { display: none; }
  /* offset main content so it doesn't sit under the fixed navbar */
  .content-wrapper { padding-top: 64px; }
}

/* Backdrop for mobile sidebar */
.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 998; }
.backdrop.active { display: block; }

/* Forms inside cards should not create nested card shadows */
.card > form { background: transparent; box-shadow: none; border: 0; padding: 0; margin: 0; }
.card > form .form-group { width: 100%; }
.card > form input, .card > form textarea, .card > form select, .card > form button { width: 100%; max-width: 100%; }

/* Auction card polish */
.muted { color: var(--muted); }
.auction-item { transition: box-shadow .2s ease, transform .12s ease; }
.auction-item:hover { box-shadow: 0 12px 28px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08); transform: translateY(-1px); }
.auction-item .card-media { width: 100%; border-radius:6px; overflow:hidden; position:relative; }
.image-wrapper { display:inline-block; border-radius:6px; overflow:hidden; position:relative; }
.auction-item .card-body { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.auction-item .item-title { margin: 4px 0 2px; font-size: 1.25rem; line-height: 1.3; }
.auction-item .item-description { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.4; max-height: 4.2em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* Price chips row */
.auction-item .price-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.auction-item .price-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 0.9rem; background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.auction-item .price-chip.current { background: #0b5ed7; border-color: #063a8a; color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(11, 94, 215, 0.25); gap: 8px; padding: 6px 14px; }
.auction-item .price-chip.current .chip-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: rgba(255,255,255,0.85); }
.auction-item .price-chip.current .current-bid { color: #fff; font-weight: 700; font-size: 0.95rem; }
.auction-item .price-chip .chip-label { display: inline-block; }
.auction-item .price-chip.buyout { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.auction-item .price-chip.time { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }

/* Actions row */
.auction-item .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin-top: 8px; }
.auction-item .auction-bid-form { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "bid-label bid-label" "bid-input bid-button" "max max"; gap: 8px; align-items: end; }
.auction-item .auction-bid-form .bid-label { grid-area: bid-label; margin: 0; color: var(--muted); font-size: 0.9rem; }
.auction-item .auction-bid-form .bid-input { grid-area: bid-input; margin: 0; }
.auction-item .auction-bid-form .bid-submit { grid-area: bid-button; margin: 0; height: 100%; white-space: nowrap; }
.auction-item .auction-bid-form .max-bid-field { grid-area: max; width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.auction-item .auction-bid-form .max-bid-field label { margin: 0; color: var(--muted); font-size: 0.85rem; }
.auction-item .auction-bid-form .max-bid-field input[type="number"] { margin: 0; }
.auction-item .auction-bid-form .accept-max-bid { width: 100%; margin: 0; }
.auction-item .auction-bid-form .accept-max-bid.btn-secondary { background: #4b5563; border-color: #4b5563; color: #fff; }
.auction-item .auction-bid-form .accept-max-bid.btn-secondary:hover { background: #374151; }
.auction-item .auction-bid-form .accept-max-bid.btn-secondary:disabled { background: #4b5563; border-color: #4b5563; }
.auction-item .buyout-wrapper { width: 100%; display: flex; justify-content: flex-end; }

.auction-item .aux-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 4px; flex-wrap: wrap; }

/* Buttons scoped to auction cards */
.auction-item .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 8px; border: 1px solid transparent; background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.auction-item .btn:hover { background: var(--primary-dark); }
.auction-item .btn:disabled { opacity: .6; cursor: not-allowed; filter: grayscale(0.1); }
.auction-item .btn-outline { background: #fff; color: var(--primary); border-color: rgba(0,123,255,0.45); }
.auction-item .btn-outline:hover { background: rgba(0,123,255,0.06); }
.auction-item .btn-link { background: transparent; color: var(--primary); border-color: transparent; padding-left: 0; padding-right: 0; }
.auction-item .btn-link:hover { text-decoration: underline; }
.auction-item .btn-danger { background: var(--danger); border-color: var(--danger); }
.auction-item .btn-danger:hover { background: #bb2d3b; }

/* Compact mobile + remove bid form box */
.auction-item form.auction-bid-form { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; }

@media (max-width: 600px) {
  .auction-item .price-row { gap: 6px; }
  .auction-item .price-chip { padding: 4px 8px; font-size: .85rem; }
  .auction-item .price-chip.current { padding: 5px 12px; gap: 6px; }
  .auction-item .price-chip.current .chip-label { font-size: 0.65rem; letter-spacing: 0.06em; }
  .auction-item .price-chip.current .current-bid { font-size: 0.9rem; }
  .auction-item .aux-actions { justify-content: flex-start; gap: 6px; }
}







body.bg-active {background-size: cover; background-position: center center; background-repeat: no-repeat; background-attachment: fixed;}

/* Spectator mode */
.spectator .spectator-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .spectator .spectator-layout { grid-template-columns: 1fr; } }
.spectator .spectator-layout.zoom { grid-template-columns: 0.9fr 1.1fr; }
.spectator .spectator-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.spectator .spectator-selected { color: var(--muted); font-size: 0.95em; }
.spectator .spectator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.spectator .spectator-item { background: var(--surface); border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.spectator .spectator-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.spectator .spectator-item.selected { outline: 2px solid var(--primary); outline-offset: 0; }
.spectator .spectator-item.finished { opacity: 0.9; }
.spectator .spectator-item.fade-out { opacity: 0; transition: opacity 0.6s ease; }
.spectator .spectator-item-media { background: #f8fafc; display: grid; place-items: center; }
.spectator .spectator-item-media img { display: block; width: 100%; height: 160px; object-fit: contain; background: #f5f5f5; }
.spectator .spectator-item-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; word-break: break-word; overflow-wrap: anywhere; }
.spectator .spectator-item-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spectator .spectator-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.spectator .spectator-item-meta2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .92em; }
.spectator .bidder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.spectator .spectator-item-footer { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .95em; margin-top: auto; }
.spectator .badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .82em; line-height: 1; color: #111827; background: #d1fae5; }
.spectator .badge[data-status="paused"] { background: #fee2e2; color: #7f1d1d; }
.spectator .price { font-weight: 700; }
.spectator .buyout { color: #065f46; font-weight: 600; }
.spectator .spectator-right { min-height: 480px; }
.spectator .spectator-log-header { display: grid; gap: 4px; margin-bottom: 8px; }
.spectator .spectator-log-header .log-title { font-weight: 700; }
.spectator .spectator-log { background: var(--surface); border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; height: calc(100vh - 250px); min-height: 400px; overflow-y: auto; }
.spectator .log-row { padding: 6px 4px; border-bottom: 1px dashed #e5e7eb; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: .95em; }
.spectator .log-row:last-child { border-bottom: 0; }
.spectator .log-row.type-new_auction { color: #1f2937; }
.spectator .log-row.type-new_bid { color: #1d4ed8; }
.spectator .log-row.type-finalize_auction { color: #065f46; }
.spectator .log-row.type-auction_pause { color: #b45309; }
.spectator .spectator-hint { color: var(--muted); font-size: .9em; margin-top: 8px; }

/* Inbox table */
.inbox-actions { margin-bottom: 10px; }
.inbox-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.inbox-table th, .inbox-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--muted);
    text-align: left;
}
.inbox-table tr:last-child td { border-bottom: none; }
.inbox-table tr:hover { background: var(--bg); }
.inbox-table tr.unread { font-weight: 700; background: var(--bg); }
.inbox-table tr.unread td.message a { color: var(--danger); }
.inbox-table td.status { width: 24px; text-align: center; color: var(--danger); }

@media (max-width: 600px) {
    .inbox-table { display: block; box-shadow: none; overflow: visible; }
    .inbox-table thead { display: none; }
    .inbox-table tbody, .inbox-table tr, .inbox-table td { display: block; width: 100%; }
    .inbox-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--muted);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        background: var(--surface);
    }
    .inbox-table tr.unread { background: var(--bg); }
    .inbox-table td { padding: 8px 12px; border: none; }
    .inbox-table td.status { text-align: right; }
    .inbox-table td.time { color: var(--muted); font-size: .9em; }
}

/* Status badges (used on profile page) */
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .85em; line-height: 1; }
.status-badge.pending { background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; }
.status-badge.paid { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.status-badge.delivered { background: #cfe2ff; color: #084298; border: 1px solid #b6d4fe; }

/* Inline bid success badge/toast */
.bid-toast {
  position: fixed;
  /* offset below fixed navbar (56px) with extra margin */
  top: calc(56px + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: #d1e7dd;
  color: #0f5132;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 1200;
}

/* Compose message page */
.compose-container { max-width: 600px; margin: 0 auto; }
.compose-form { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--muted); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.compose-form .form-row { display: flex; flex-direction: column; }
.compose-form input, .compose-form textarea { border: 1px solid var(--muted); border-radius: var(--radius); padding: 10px; color: var(--text); background: var(--surface); }
.compose-form textarea { min-height: 200px; resize: vertical; }
.compose-actions { display: flex; justify-content: flex-end; }
@media (max-width: 600px) {
  .compose-form { padding: 12px; }
}

/* Reduce overall scale on wider screens to avoid oversized layout */
@media (min-width: 1024px) {
  body {
    zoom: 0.75;
  }
}


/* Calendar */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.calendar-title {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.calendar-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }

.calendar {
  width: 100%;
  background: rgb(from var(--surface) r g b / var(--surface-alpha, 0.6));
  color: var(--text);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  overflow: hidden;
}
.days-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
  font-weight: 700;
  background: var(--bg);
}
.days-header > div {
  padding: 8px 4px;
  border-right: 1px solid var(--muted);
}
.days-header > div:last-child { border-right: none; }

.week-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto; /* first row for day cells */
  grid-auto-rows: minmax(1.6rem, auto); /* event rows grow */
  align-content: start;
  border-bottom: 1px solid var(--muted);
}
.week-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to right,
    var(--muted) 0,
    var(--muted) 1px,
    transparent 1px,
    transparent calc(100% / 7)
  );
  z-index: 0;
}
.week-grid .day-cell {
  border-top: 1px solid var(--muted);
  padding: 4px;
  min-height: 90px;
  position: relative;
  z-index: 1;
}
.week-grid .day-cell .date { font-size: 0.8rem; font-weight: 600; }

.event-bar {
  display: block;
  padding: 2px 4px;
  font-size: 0.75rem;
  color: #fff;
  border-radius: 4px;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  align-self: stretch; /* fill the row height */
  height: 100%;
  z-index: 10;
}

@media (max-width: 900px) {
  .calendar-title { font-size: 1rem; }
  .week-grid .day-cell { min-height: 72px; }
}

@media (max-width: 600px) {
  .calendar-toolbar { gap: 8px; }
  .calendar-title { font-size: 1rem; }
  .days-header > div { font-size: 0.8rem; padding: 6px 2px; }
  .week-grid .day-cell { min-height: 56px; padding: 3px; }
  .event-bar { font-size: 0.7rem; }
}

.foil-holo {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  isolation: isolate;
}

.wanted-image-wrap {
  display: inline-block;
  border-radius: 12px;
}

.wanted-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.foil-holo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(255,0,150,0.4) 0%, rgba(0,200,255,0.4) 25%, rgba(255,255,0,0.4) 50%, rgba(0,200,255,0.4) 75%, rgba(255,0,150,0.4) 100%);
  background-size: 400% 400%;
  background-repeat: no-repeat;
  mix-blend-mode: overlay;


  pointer-events: none;
  animation: foilHolo 3s linear infinite alternate;
  border-radius: inherit;
  z-index: 1;
}
@keyframes foilHolo {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}

.foil-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 4px;
  text-transform: capitalize;
  pointer-events: none;
  z-index: 2;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1200;
}
.toast {
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}
.toast-title {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.toast-message {
  display: block;
}

/* Push notification banner */
.push-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  right: calc(24px + env(safe-area-inset-right, 0px));
  max-width: 340px;
  width: calc(100% - 48px);
  width: min(340px, calc(100% - 48px));
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  padding: 16px;
  display: none;
  z-index: 1300;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.push-banner--visible {
  display: block;
}

.push-banner__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.push-banner__message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.push-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.push-banner__actions .btn {
  flex: 1 1 140px;
}

.push-banner__dismiss {
  margin-left: auto;
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 600px) {
  .push-banner {
    left: 16px;
    left: max(16px, env(safe-area-inset-left, 0px));
    right: 16px;
    right: max(16px, env(safe-area-inset-right, 0px));
    width: auto;
    bottom: 16px;
    max-width: none;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .push-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .push-banner__actions .btn {
    flex: 1 1 auto;
    width: 100%;
  }

  .push-banner__dismiss {
    align-self: center;
  }
}
/* XP and rank styling */
.nav-user-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-rank-icon {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px;
}

.nav-rank-name {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
}

.dropdown-item.rank-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    padding-top: 8px;
    padding-bottom: 8px;
    justify-content: center;
}

.dropdown-item.rank-summary:hover {
    background: transparent;
}

.rank-icon-small {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.rank-summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.rank-summary-text strong {
    font-size: 0.9rem;
}

.dropdown-divider {
    height: 1px;
    width: 100%;
    background: var(--border);
    margin: 4px 0;
}

.sidebar-user-card {
    margin: 16px 18px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-user-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 1rem;
    color: inherit;
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-user-toggle:hover {
    text-decoration: underline;
}

.sidebar-inbox-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-inbox-link:hover,
.sidebar-inbox-link:focus-visible,
.sidebar-inbox-link.active {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.sidebar-inbox-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar-user-body {
    display: flex;
    gap: 14px;
    align-items: center;
}

.sidebar-rank-badge {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.rank-badge {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.sidebar-rank-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar-rank-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
}

.sidebar-balance-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sidebar-rank-name {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.sidebar-balance {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.sidebar-quest-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.sidebar-quest-link:hover,
.sidebar-quest-link:focus-visible,
.sidebar-quest-link.active {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme='dark'] .sidebar-quest-link:hover,
[data-theme='dark'] .sidebar-quest-link:focus-visible,
[data-theme='dark'] .sidebar-quest-link.active {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-quest-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar-quest-icon {
    width: 38px;
    height: 38px;
    display: block;
    object-fit: contain;
}

.sidebar-rank-xp,
.sidebar-rank-next {
    color: var(--muted);
    font-size: 0.78rem;
}

.sidebar-rank-next {
    font-weight: 500;
}

.xp-summary-card {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg, rgba(0, 0, 0, 0.02));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.xp-summary-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.xp-summary-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xp-summary-rank {
    font-weight: 700;
    text-transform: uppercase;
}

.xp-summary-total {
    font-size: 0.9rem;
}

.xp-summary-next {
    font-size: 0.8rem;
    color: var(--muted);
}

.xp-summary-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.xp-summary-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent, #ff9800), var(--accent-strong, #ff5722));
    transition: width 0.3s ease;
}

.xp-summary-thresholds {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
}

.admin-xp-card {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg, rgba(0, 0, 0, 0.03));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-xp-summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-xp-summary img {
    width: 72px;
    height: 72px;
}

.admin-xp-meta p {
    margin: 2px 0;
    font-size: 0.9rem;
}

.admin-xp-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.xp-adjust-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.xp-adjust-row label {
    font-weight: 600;
    min-width: 120px;
}

.xp-adjust-row input {
    width: 140px;
}

.xp-rank-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

@media (max-width: 768px) {
    .nav-rank-name {
        display: none;
    }

    .sidebar-user-card {
        margin: 12px;
        padding: 12px;
    }

    .sidebar-user-header {
        gap: 8px;
    }

    .sidebar-user-body {
        align-items: flex-start;
    }

    .sidebar-rank-badge {
        width: 52px;
        height: 52px;
    }

    .sidebar-inbox-link {
        padding: 3px 10px;
        font-size: 0.8rem;
        margin-top: -2px;
        margin-right: -2px;
    }

    .xp-summary-card {
        padding: 12px;
    }
}

.nav-user-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-xp-summary.mini img {
    width: 56px;
    height: 56px;
}

.user-xp-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-xp-controls.compact {
    gap: 8px;
}

.admin-xp-controls.compact .xp-adjust-row {
    gap: 6px;
}

.admin-xp-controls.compact label {
    min-width: 100px;
}

@media (max-width: 768px) {
    .user-xp-block {
        gap: 10px;
    }

    .admin-xp-controls.compact label {
        min-width: 90px;
    }
}
.rank-username {
    font-weight: 600;
    color: inherit;
    text-decoration: inherit;
}

.rank-username.rank-recruit { color: #4B5320; }
.rank-username.rank-soldier { color: #6E7B8B; }
.rank-username.rank-knight { color: #4169E1; }
.rank-username.rank-captain { color: #228B22; }
.rank-username.rank-warlord { color: #B22222; }
.rank-username.rank-commander { color: #8B4513; }
.rank-username.rank-marshal { color: #FFD700; }
.rank-username.rank-champion { color: #C0C0C0; }
.rank-username.rank-master { color: #00CED1; }

.rank-username.rank-grandmaster {
    display: inline-block;
    background: linear-gradient(90deg, #FF4B2B, #FFEE58, #4CAF50, #00CED1, #4169E1, #8E44AD, #FF4B2B);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: grandmaster-rainbow 3.5s linear infinite;
}

@keyframes grandmaster-rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
/* Profile page */
.profile-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 24px 0 48px;
}

.profile-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(236,72,153,0.08));
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px 28px;
    box-shadow: var(--shadow-lg);
}

.profile-hero-main {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 260px;
}

.profile-avatar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 18px;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.8);
    box-shadow: var(--shadow);
    background: var(--surface);
}

.profile-avatar.placeholder {
    display: grid;
    place-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--muted);
}

.profile-hero-rank {
    position: absolute;
    bottom: -8px;
    right: -10px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.profile-hero-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.profile-name-stack {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.profile-name-stack .rank-flair {
    margin-top: 2px;
}

.profile-name {
    margin: 0;
    font-size: 1.8rem;
}

.profile-role {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(59,130,246,0.16);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-self: flex-start;
}

.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profile-flair-picker {
    position: relative;
    flex-shrink: 0;
}

.profile-flair-toggle {
    white-space: nowrap;
}

.profile-flair-backdrop,
.profile-flair-panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.profile-flair-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1000;
}

.profile-flair-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
    max-width: min(520px, calc(100vw - 32px));
    width: 100%;
    max-height: min(520px, calc(100vh - 64px));
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1100;
    overflow: hidden;
    transition: opacity 150ms ease, transform 150ms ease;
}

.profile-flair-picker.is-open .profile-flair-backdrop,
.profile-flair-picker.is-open .profile-flair-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.profile-flair-picker.is-visible .profile-flair-panel {
    transform: translate(-50%, -50%) scale(1);
}

.profile-flair-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.profile-flair-panel-head h3 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}

.profile-flair-panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-flair-panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-flair-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.profile-flair-close:hover {
    color: var(--primary);
}

.profile-flair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 4px;
}

.flair-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.flair-card.is-active {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.22);
}

.flair-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flair-card .rank-flair {
    font-size: 1rem;
    padding-inline: 1rem;
    height: 38px;
}

.flair-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--muted);
}

.flair-card-track {
    font-weight: 600;
    color: var(--primary);
}

.flair-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flair-card-status {
    font-weight: 600;
    color: var(--primary);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
}

.profile-card.profile-card--item {
    background: rgb(from var(--surface) r g b / var(--surface-alpha, 0.6));
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.profile-card--highlight {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(59,130,246,0.12));
    background: var(--surface);
}

.profile-card-head h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.profile-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-rank-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    justify-content: space-between;
}

.profile-rank-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.profile-rank-sub {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-rank-next {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.profile-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(59,130,246,0.12);
    overflow: hidden;
}

.profile-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), rgba(16,185,129,0.9));
}

.profile-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
}

.profile-balance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.profile-balance div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.04);
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.profile-contact dl {
    margin: 0;
    display: grid;
    gap: 10px;
}

.profile-contact dt {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.profile-contact dd {
    margin: 4px 0 0;
    font-size: 0.95rem;
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: transparent;
}

.profile-section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.profile-section-head h2 {
    margin: 0;
}

.profile-section-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-view-toggle {
    display: inline-flex;
    border-radius: 999px;
    background: rgba(0,0,0,0.05);
    padding: 4px;
    gap: 4px;
}

.profile-toggle-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.profile-toggle-btn:hover,
.profile-toggle-btn.is-active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.profile-resource {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
    background: transparent;
    box-shadow: none;
}

.profile-cards {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.profile-cards.is-list {
    display: flex;
    flex-direction: column;
}

.profile-card--item .profile-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 14px;
}

.profile-card--item .profile-card-text {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0;
}

.profile-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(107,114,128,0.15);
    color: var(--text);
    text-transform: uppercase;
}

.status-pill.pending { background: rgba(251,191,36,0.28); color: #92400e; }
.status-pill.paid { background: rgba(16,185,129,0.24); color: #065f46; }
.status-pill.delivered { background: rgba(59,130,246,0.24); color: #1d4ed8; }

.profile-status-select {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    min-width: 140px;
    background: var(--surface);
    color: var(--text);
    transition: background 0.2s ease, color 0.2s ease;
}

.profile-status-select option {
    background: var(--surface);
    color: var(--text);
}

.profile-card-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0 0;
    margin: 0;
    margin-top: auto;
    background: transparent;
    color: inherit;
    border-top: 1px solid var(--border-color);
    align-items: flex-start;
    text-align: left;
}

.profile-card-footer .profile-inline-form {
    width: 100%;
}

.profile-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    font-size: 0.85rem;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
}

.profile-inline-form button {
    margin: 0;
    justify-self: end;
}

.profile-upload-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-upload-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--muted);
}

.profile-upload-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    cursor: pointer;
    background: transparent;
    transition: border-color 0.2s ease;
}

.profile-upload-control:hover {
    border-color: rgba(59,130,246,0.6);
}

.profile-upload-control:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}

.profile-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.profile-upload-button {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(59,130,246,0.18);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.profile-upload-filename {
    flex: 1;
    min-width: 0;
    color: var(--muted);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .profile-inline-form {
        grid-template-columns: 1fr;
    }

    .profile-inline-form button {
        width: 100%;
    }

    .profile-upload-control {
        flex-wrap: wrap;
        justify-content: center;
    }

    .profile-upload-button {
        width: 100%;
        text-align: center;
    }
}

.profile-orders {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.profile-table-wrapper {
    overflow-x: auto;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.profile-table th,
.profile-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.profile-table th[data-sort-key] {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.profile-table th.is-sorted-asc::after,
.profile-table th.is-sorted-desc::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.profile-table th.is-sorted-asc::after {
    border-bottom: 6px solid var(--primary);
    margin-top: -6px;
}

.profile-table th.is-sorted-desc::after {
    border-top: 6px solid var(--primary);
    margin-top: -2px;
}

.profile-table-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-order-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
}

.profile-order-item-amount {
    font-weight: 600;
}

.profile-order-seller {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.profile-order-receipt {
    margin-top: 12px;
}

.profile-order-cards {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    padding: 18px;
}

.profile-order-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--muted);
}

.profile-order-row span:first-child {
    font-weight: 600;
    color: var(--text);
}

.profile-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(115,115,115,0.12);
}

.profile-pill.muted {
    color: var(--muted);
}

.profile-empty {
    margin: 0;
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed var(--border-color);
    text-align: center;
    color: var(--muted);
    background: var(--surface);
}

@media (max-width: 960px) {
    .profile-hero {
        padding: 20px;
    }
    .profile-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .profile-page {
        gap: 24px;
    }
    .profile-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .profile-hero-main {
        width: 100%;
    }
    .profile-actions {
        width: 100%;
        gap: 10px;
    }
    .profile-resource {
        padding: 14px;
    }
    .profile-order-cards {
        padding: 14px;
    }
}
\n.sr-only {\n    position: absolute;\n    width: 1px;\n    height: 1px;\n    padding: 0;\n    margin: -1px;\n    overflow: hidden;\n    clip: rect(0, 0, 0, 0);\n    white-space: nowrap;\n    border: 0;\n}\n
.profile-card .btn,
.profile-section .btn {
    border: none;
    background: var(--primary);
    color: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.profile-card .btn.btn-secondary,
.profile-section .btn.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.profile-card .btn:hover,
.profile-section .btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.profile-card .btn:active,
.profile-section .btn:active {
    transform: translateY(0);
}

.profile-card--item {
    gap: 14px;
}

.profile-card--item header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: left;
}
.profile-card--item header > * {
    margin: 0;
}

.profile-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
}

.profile-card-meta-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.profile-card-meta time,
.profile-card-meta span:last-child {
    font-weight: 600;
    color: var(--text);
}

.profile-card-title {
    font-size: 1rem;
    font-weight: 600;
}

.profile-card-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
}

.profile-cards.is-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-cards.is-list {
    gap: 12px;
}

.profile-cards.is-list .profile-card--item {
    display: grid;
    grid-template-columns: minmax(120px, 160px) 1fr;
    align-items: stretch;
}

.profile-cards.is-list .profile-card--item header,
.profile-cards.is-list .profile-card--item .profile-card-text,
.profile-cards.is-list .profile-card--item .profile-status-row,
.profile-cards.is-list .profile-card--item .profile-card-footer {
    grid-column: 2;
}

.profile-cards.is-list .profile-card--item .profile-card-image {
    grid-row: span 4;
    height: 100%;
    min-height: 160px;
}

.profile-orders [hidden],
.profile-orders [aria-hidden="true"] {
    display: none !important;
}

.profile-order-cards {
    padding-top: 0;
}

.profile-order-cards .profile-card--order {
    gap: 12px;
}

.profile-order-cards .profile-card-body {
    gap: 10px;
}

.profile-table-actions details summary {
    cursor: pointer;
}

.profile-status-row select,
.profile-status-row button {
    flex-shrink: 0;
}

.profile-status-row .profile-inline-form,
.profile-status-row .profile-status-select {
    width: auto;
}

.profile-status-row .profile-status-select {
    max-width: 180px;
}
@media (max-width: 600px) {\n    .profile-status-row {\n        align-items: flex-start;\n    }\n    .profile-status-row .profile-status-select {\n        width: 100%;\n        max-width: none;\n    }\n}\n

.profile-won [data-won-view][hidden],
.profile-won [data-won-view][aria-hidden="true"] {
    display: none !important;
}

.profile-won-table th,
.profile-won-table td {
    vertical-align: middle;
}

.profile-inline-form input[type="file"]::-webkit-file-upload-button,
.profile-inline-form input[type="file"]::file-selector-button {
    margin-right: 8px;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    background: rgba(59,130,246,0.12);
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.profile-inline-form input[type="file"]::-webkit-file-upload-button:hover,
.profile-inline-form input[type="file"]::file-selector-button:hover {
    background: rgba(59,130,246,0.2);
}
.au-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.au-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.au-controls .category-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}

.au-controls .category-filter label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.au-controls .category-select {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 180px;
}

.au-controls .category-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 10px 44px 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--surface), var(--card-bg));
    color: var(--text);
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.au-controls .category-select::after {
    content: '';
    position: absolute;
    right: 16px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--muted);
    border-top: none;
    border-left: none;
    transform: translateY(-2px) rotate(45deg);
    pointer-events: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.au-controls .category-select select:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.15);
}

.au-controls .category-select select:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.au-controls .category-select:focus-within::after {
    border-color: var(--primary);
    transform: translateY(0) rotate(225deg);
}

.au-controls .category-select select option {
    background: var(--surface);
    color: var(--text);
}

[data-theme='dark'] .au-controls .category-select select {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme='dark'] .au-controls .category-select select:hover {
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.2);
}

[data-theme='dark'] .au-controls .category-select::after {
    border-color: rgba(148, 163, 184, 0.9);
}

@media (max-width: 600px) {
    .au-controls .category-filter {
        width: 100%;
    }

    .au-controls .category-select {
        min-width: 0;
    }
}

.auction-item .item-category {
    align-self: flex-start;
}

.auction-item .category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0,123,255,0.12);
    border: 1px solid rgba(0,123,255,0.25);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

[data-theme='dark'] .auction-item .category-badge {
    background: rgba(59,130,246,0.18);
    border-color: rgba(59,130,246,0.35);
    color: #bfdbfe;
}

.category-form {
    background: transparent;
    box-shadow: none;
    border: 0;
    padding: 0;
    margin-bottom: 16px;
}

.category-form .form-group {
    margin-bottom: 12px;
}

.category-form input[type="text"] {
    width: 100%;
}

.category-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
}

.category-list .name {
    font-weight: 600;
}

.category-list .count {
    color: var(--muted);
    font-size: 0.9rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.shop-settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-settings-form .form-group-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.shop-settings-form .form-group-row > div {
    flex: 1 1 160px;
    min-width: 160px;
}

.shop-settings-form .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 12px;
}

.shop-settings-form .preview-thumb {
    margin: 8px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    max-width: 320px;
}

.shop-settings-form .preview-thumb img {
    display: block;
    width: 100%;
}

.shop-settings-form .preview-map {
    margin: 12px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
    max-width: 100%;
}

.shop-settings-form .preview-map iframe {
    width: 100%;
    height: 260px;
    border: 0;
    display: block;
}

.shop-settings-form .preview-thumb--logo {
    max-width: 180px;
    background: var(--card-bg);
    padding: 12px;
    display: grid;
    place-items: center;
}

.shop-settings-form .preview-thumb--logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.shop-settings-form .shop-gallery-fieldset {
    margin-top: 20px;
    padding: 18px 20px 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.02);
}

.shop-settings-form .shop-gallery-fieldset legend {
    font-weight: 600;
    padding: 0 6px;
    font-size: 0.95rem;
}

.shop-settings-form .shop-gallery-grid {
    display: grid;
    gap: 16px;
    margin-top: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.shop-settings-form .shop-gallery-slot {
    background: var(--card-bg, #ffffff);
    border: 1px dashed rgba(15, 23, 42, 0.18);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
}

.shop-settings-form .shop-gallery-slot__preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.08);
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
}

.shop-settings-form .shop-gallery-slot__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shop-settings-form .shop-gallery-slot__placeholder {
    color: var(--muted);
    font-size: 0.85rem;
}

.shop-settings-form .shop-gallery-slot__label {
    font-weight: 600;
}

.shop-settings-form .form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

body.storefront-theme {
    --store-primary: #2563eb;
    --store-secondary: #111827;
    --store-tertiary: #f97316;
    --store-primary-contrast: #ffffff;
    --store-secondary-contrast: #ffffff;
    --store-tertiary-contrast: #111827;
    --store-muted: #6b7280;
    --store-surface: #1f2937;
    --store-border: rgba(17, 24, 39, 0.28);
    --store-nav-text: #ffffff;
    --store-hero-overlay: rgba(37, 99, 235, 0.82);
    --store-hero-overlay-soft: rgba(37, 99, 235, 0.55);
    --store-chip-bg: rgba(17, 24, 39, 0.16);
    --store-background-fade: rgba(37, 99, 235, 0.12);
    background-color: var(--store-primary);
    background-image: var(--store-background-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--store-secondary);
}

body.storefront-theme--standard {
    --store-standard-hero-overlay: rgba(59, 130, 246, 0.65);
    --store-standard-hero-overlay-soft: rgba(59, 130, 246, 0.35);
    --store-standard-chip-bg: rgba(15, 23, 42, 0.08);
    --store-standard-background-fade: rgba(59, 130, 246, 0.12);
}

html[data-theme='dark'] body.storefront-theme--standard {
    --store-standard-hero-overlay: rgba(15, 23, 42, 0.72);
    --store-standard-hero-overlay-soft: rgba(15, 23, 42, 0.5);
    --store-standard-chip-bg: rgba(255, 255, 255, 0.12);
    --store-standard-background-fade: rgba(59, 130, 246, 0.22);
}

body.storefront-theme .content-wrapper {
    background: transparent;
}

body.storefront-theme .content {
    padding: 112px 24px 160px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

body.storefront-theme .flash-container .flash {
    background: var(--store-secondary);
    color: var(--store-nav-text);
    border-color: transparent;
}

body.storefront-theme .topnav {
    background: var(--store-secondary);
    color: var(--store-nav-text);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.32);
}

body.storefront-theme .topnav a.nav-link,
body.storefront-theme .topnav .nav-label,
body.storefront-theme .topnav .theme-toggle {
    color: var(--store-nav-text);
}

body.storefront-theme .topnav a.nav-link:hover,
body.storefront-theme .topnav a.nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: var(--store-nav-text);
}

body.storefront-theme .topnav .nav-group .dropdown {
    background: var(--store-secondary);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

body.storefront-theme .topnav .nav-group .dropdown a {
    color: var(--store-nav-text);
}

body.storefront-theme .sidebar {
    background: var(--store-secondary);
    color: var(--store-nav-text);
}

body.storefront-theme .sidebar-nav a.nav-link,
body.storefront-theme .sidebar-user-toggle,
body.storefront-theme .sidebar .nav-link {
    color: var(--store-nav-text);
}

body.storefront-theme .sidebar-nav a.nav-link.active {
    background: rgba(255, 255, 255, 0.16);
}

body.storefront-theme .sidebar-toggle {
    background: var(--store-secondary);
    color: var(--store-nav-text);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.34);
}

body.storefront-theme .theme-toggle {
    color: var(--store-nav-text);
}

.storefront-shell {
    width: 100%;
}

.storefront {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(28px, 3vw, 48px);
    padding: clamp(28px, 4vw, 56px);
    border-radius: 36px;
    background: linear-gradient(150deg, var(--store-surface) 0%, var(--store-primary) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 52px 96px rgba(15, 23, 42, 0.38);
    overflow: hidden;
    color: var(--store-secondary);
}

.storefront a {
    color: inherit;
}

.storefront p {
    color: var(--store-secondary);
}

.storefront .muted {
    color: var(--store-muted);
}

.storefront .btn {
    background: var(--store-tertiary);
    color: var(--store-tertiary-contrast);
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.storefront .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 36px rgba(15, 23, 42, 0.34);
}

.storefront .btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.storefront .btn.btn-secondary {
    background: transparent;
    border: 1.6px solid var(--store-tertiary);
    color: var(--store-tertiary);
    box-shadow: none;
}

.storefront .btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.storefront-hero {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: stretch;
    background-size: cover;
    background-position: center;
}

.storefront-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--store-hero-overlay) 0%, rgba(0, 0, 0, 0.25) 70%);
    mix-blend-mode: multiply;
}

.storefront-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 3vw, 40px);
    padding: clamp(32px, 5vw, 56px);
}

.storefront-hero__identity {
    display: flex;
    gap: clamp(20px, 3vw, 36px);
    align-items: center;
    flex-wrap: wrap;
}

.storefront-hero__logo {
    width: 104px;
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: grid;
    place-items: center;
    padding: 12px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.35);
}

.storefront-hero__logo .avatar {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: contain;
    border: none;
    background: rgba(255, 255, 255, 0.92);
}

.storefront-hero__logo .avatar-fallback {
    background: rgba(255, 255, 255, 0.18);
    color: #0f172a;
    font-size: clamp(2.1rem, 4vw, 2.8rem);
}

[data-theme='dark'] .storefront-hero__logo .avatar-fallback {
    background: rgba(17, 24, 39, 0.55);
    color: #f8fafc;
}

.storefront-hero__titles h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 3rem);
}

.storefront-hero__eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    display: inline-block;
    margin-bottom: 6px;
    color: rgba(17, 24, 39, 0.7);
}

.storefront-hero__description {
    margin: 10px 0 0;
    max-width: 720px;
    color: var(--store-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.storefront-hero__summary {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(20px, 4vw, 40px);
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: clamp(20px, 4vw, 28px);
    backdrop-filter: blur(14px);
}

.storefront-hero__profile {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-width: 260px;
}

.storefront-hero__avatar {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    object-fit: cover;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
}

.storefront-hero__details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--store-secondary);
}

.storefront-hero__details strong {
    color: var(--store-secondary);
}

.storefront-hero__details a {
    color: var(--store-secondary);
    font-weight: 600;
    text-decoration: underline;
}

.storefront-hero__actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
    min-width: 220px;
}

.storefront-hero__map {
    flex: 1 1 320px;
    min-width: clamp(260px, 40vw, 420px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.storefront-hero__map iframe {
    width: 100%;
    height: 100%;
    min-height: 240px;
    border: 0;
}

.storefront-hero__map-link {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.7);
    color: var(--store-primary_contrast);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.2s ease, color 0.2s ease;
}

.storefront-hero__map-link:hover,
.storefront-hero__map-link:focus {
    background: rgba(15, 23, 42, 0.9);
    color: var(--store-primary_contrast);
}

.storefront-hero__map-link svg {
    width: 22px;
    height: 22px;
}

.storefront-hero__buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.storefront-hero__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.storefront-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--store-chip-bg);
    color: var(--store-secondary);
    border: 1px solid transparent;
    transition: transform 0.2s ease, background 0.2s ease;
}

.storefront-chip:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
}

.storefront-chip.is-active {
    background: var(--store-tertiary);
    color: var(--store-tertiary-contrast);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.28);
}

.storefront-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.68rem;
    font-weight: 600;
}

.storefront-about {
    margin: 36px 0 48px;
}

.storefront-about__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 36px;
    padding: clamp(26px, 4vw, 36px);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(17, 24, 39, 0.04));
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 30px 60px -40px rgba(15, 23, 42, 0.45);
    position: relative;
    overflow: hidden;
}

.storefront-about__card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 55%);
    opacity: 0.8;
    pointer-events: none;
}

.storefront-about__card > * {
    position: relative;
    z-index: 1;
}

.storefront-about__card--solo {
    grid-template-columns: minmax(0, 1fr);
}

.storefront-about__copy {
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}

.storefront-about__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(17, 24, 39, 0.55);
}

.storefront-about__title {
    margin: 0;
    font-size: clamp(1.8rem, 1.5vw + 1.3rem, 2.4rem);
    color: var(--store-secondary, #111827);
}

.storefront-about__text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(17, 24, 39, 0.82);
}

.storefront-about__text.muted {
    color: rgba(17, 24, 39, 0.6);
}

.storefront-about__meta {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: stretch;
}

.storefront-about__info {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.storefront-about__details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--store-secondary, #111827);
}

.storefront-about__details strong {
    color: var(--store-secondary, #111827);
}

.storefront-about__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.storefront-about__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.storefront-about__map {
    flex: 1 1 320px;
}

.storefront-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.storefront-gallery__viewport {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.9);
    aspect-ratio: 5 / 3;
    box-shadow: 0 26px 42px -32px rgba(15, 23, 42, 0.58);
}

.storefront-gallery__track {
    display: flex;
    width: 100%;
    height: 100%;
    transform: translateX(0);
    transition: transform 0.6s cubic-bezier(0.25, 0.85, 0.25, 1);
    will-change: transform;
}

.storefront-gallery__slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    margin: 0;
}

.storefront-gallery__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.storefront-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.00);
    color: var(--store-secondary, #111827);
    cursor: pointer;
    box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.55);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.storefront-gallery__nav svg {
    width: 22px;
    height: 22px;
}

.storefront-gallery__nav--prev {
    left: 18px;
}

.storefront-gallery__nav--next {
    right: 18px;
}

.storefront-gallery__nav:hover,
.storefront-gallery__nav:focus-visible {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 24px 44px -24px rgba(15, 23, 42, 0.65);
    outline: none;
}

.storefront-gallery__nav:focus-visible {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.45);
}

.storefront-gallery__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.storefront-gallery__dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: none;
    background: rgba(17, 24, 39, 0.25);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.storefront-gallery__dot.is-active {
    background: var(--store-tertiary, #f97316);
    transform: scale(1.15);
}

.storefront-gallery__dot:focus-visible {
    outline: 2px solid var(--store-secondary, #111827);
    outline-offset: 2px;
}

@media (max-width: 1100px) {
    .storefront-about__card {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 960px) {
    .storefront-about__card {
        gap: 26px;
    }
    .storefront-gallery__viewport {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 640px) {
    .storefront-about__card {
        padding: 20px;
    }
    .storefront-gallery__viewport {
        aspect-ratio: 3 / 2;
    }
    .storefront-gallery__nav {
        width: 42px;
        height: 42px;
    }
    .storefront-gallery__dots {
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .storefront-gallery__track,
    .storefront-gallery__nav,
    .storefront-gallery__dot,
    .storefront-card__carousel-track,
    .storefront-card__carousel-nav,
    .storefront-card__carousel-dot {
        transition: none !important;
    }
}

.storefront-categories {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    overflow-x: auto;
    padding: 4px 0;
}

.storefront-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: clamp(18px, 3.6vw, 26px);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
    min-width: 0;
}

.storefront-viewbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 16px 0 28px;
    padding: 0 6px;
    min-width: 0;
}

.storefront-viewbar .storefront-view-toggle {
    margin: 0;
}

.storefront-filters {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    flex: 1 1 auto;
    min-width: 0;
}

body.storefront-theme form.storefront-filters {
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    border: none;
    width: 100%;
    max-width: none;
    align-items: stretch;
}

.storefront-filters__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.storefront-filters__group label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--store-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.storefront-input {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0 36px;
    min-height: 52px;
    color: var(--store-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storefront-input input,
.storefront-input select {
    flex: 1 1 auto;
    border: none;
    background: transparent;
    color: var(--store-secondary);
    font-size: 1rem;
    padding: 0;
    outline: none;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storefront-input select {
    appearance: none;
    cursor: pointer;
}


.storefront-input__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--store-muted);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.storefront-input__icon svg,
.storefront-input__chevron svg {
    width: 20px;
    height: 20px;
}

.storefront-input__chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--store-muted);
    display: flex;
    align-items: center;
}

.storefront-input--select select {
    padding-right: 36px;
}

.storefront-apply {
    align-self: end;
}

.storefront-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.storefront-view-toggle__label {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--store-secondary);
    opacity: 0.85;
    white-space: nowrap;
}


.storefront-view-toggle__btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--store-secondary);
    border: 1px solid transparent;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.storefront-view-toggle__btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.storefront-view-toggle__btn.is-active {
    background: var(--store-tertiary);
    color: var(--store-tertiary-contrast);
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.28);
}

.storefront-results {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.storefront-results.is-list {
    grid-template-columns: 1fr;
}

.storefront-card {
    display: flex;
    flex-direction: column;
    background: var(--store-primary);
    background-image: linear-gradient(140deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)),
        linear-gradient(210deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0));
    color: var(--store-primary-contrast);
    border-radius: clamp(20px, 5vw, 28px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
    box-shadow: 0 28px 50px -32px rgba(15, 23, 42, 0.6);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.storefront-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 36px 70px -32px rgba(15, 23, 42, 0.65);
}

.storefront-results.is-list .storefront-card {
    flex-direction: column;
}

.storefront-card__media {
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    width: 100%;
    min-height: 0;
}

.storefront-card__carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.storefront-card__carousel-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    touch-action: pan-y;
}

.storefront-card__carousel-viewport:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 4px;
}

.storefront-card__carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transform: translateX(0);
    transition: transform 0.5s cubic-bezier(0.25, 0.85, 0.25, 1);
    will-change: transform;
}

.storefront-card__carousel-slide {
    min-width: 100%;
    height: 100%;
    margin: 0;
    position: relative;
}

.storefront-card__carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.storefront-card__carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.storefront-card__carousel-nav svg {
    width: 18px;
    height: 18px;
}

.storefront-card__carousel-nav--prev {
    left: 12px;
}

.storefront-card__carousel-nav--next {
    right: 12px;
}

.storefront-card__carousel-nav:hover,
.storefront-card__carousel-nav:focus-visible {
    transform: translateY(-50%) scale(1.06);
    background: rgba(17, 24, 39, 0.88);
    box-shadow: 0 24px 44px -20px rgba(15, 23, 42, 0.7);
    outline: none;
}

.storefront-card__carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.32);
}

.storefront-card__carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.storefront-card__carousel-dot.is-active {
    background: var(--store-tertiary, #f97316);
    transform: scale(1.2);
}

.storefront-card__carousel-dot:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.storefront-results.is-list .storefront-card__media {
    width: 100%;
}

.storefront-card__placeholder {
    color: var(--store-primary-contrast);
    opacity: 0.72;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
}


.storefront-card__content {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 4vw, 24px);
    padding: clamp(20px, 5vw, 30px) clamp(18px, 5vw, 32px) clamp(22px, 5vw, 32px);
    min-height: 0;
    flex: 1 1 auto;
}

.storefront-card__body {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 3.8vw, 18px);
    min-height: 0;
    color: inherit;
}

.storefront-card__header {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 3.4vw, 16px);
}

.storefront-card__eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    row-gap: 6px;
    justify-content: center;
}

.storefront-card__title {
    margin: 0;
    font-size: clamp(1.15rem, 4.4vw, 1.45rem);
    line-height: 1.2;
}

.storefront-badge {
    display: inline-flex;
    align-items: center;
    padding: clamp(4px, 1.2vw, 6px) clamp(10px, 3vw, 14px);
    border-radius: 999px;
    font-size: clamp(0.68rem, 2.8vw, 0.75rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: var(--store-primary-contrast);
    line-height: 1.1;
    word-break: break-word;
}

.storefront-badge--primary {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.45);
}

.storefront-badge--danger {
    background: rgba(185, 28, 28, 0.92);
    border-color: rgba(185, 28, 28, 0.92);
    color: #fff;
}

.storefront-card__description {
    margin: 0;
    color: var(--store-primary-contrast);
    opacity: 0.85;
    line-height: 1.6;
    font-size: clamp(0.95rem, 3.4vw, 1rem);
}

.storefront-card__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(14px, 4vw, 20px);
    margin-top: auto;
}

.storefront-card__price {
    flex: 1 1 auto;
    min-width: 160px;
}

.storefront-card__price span:not(.muted) {
    display: block;
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    font-size: clamp(1.25rem, 5vw, 1.45rem);
    letter-spacing: 0.045em;
    text-transform: uppercase;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--store-primary-contrast);
    text-shadow: none;
}

.storefront-card__price span.muted {
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--store-primary-contrast);
    opacity: 0.7;
}

.storefront-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-left: 0;
}

.storefront-card__actions form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.storefront-card__actions form button,
.storefront-card__actions form .btn {
    flex: 1 1 160px;
}

.storefront-card__actions input[type="number"] {
    flex: 1 1 110px;
    min-width: 96px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: transparent;
    color: var(--store-primary-contrast);
    padding: 6px 12px;
    font-weight: 600;
}

.storefront-card__actions .muted {
    color: var(--store-primary-contrast);
    opacity: 0.75;
}

.storefront-card__actions input[type="number"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

body.storefront-theme .storefront-card__actions .btn,
body.storefront-theme .storefront-card__actions button {
    width: auto;
    margin: 0;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    background: transparent;
    color: var(--store-primary-contrast);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

body.storefront-theme .storefront-card__actions .btn:hover,
body.storefront-theme .storefront-card__actions .btn:focus-visible,
body.storefront-theme .storefront-card__actions button:hover,
body.storefront-theme .storefront-card__actions button:focus-visible {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.storefront-empty {
    text-align: center;
    padding: 64px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 28px;
}

.storefront-empty h2 {
    margin-bottom: 12px;
}

.storefront-footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.storefront-cart-fab {
    position: fixed;
    right: 32px;
    bottom: 32px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--store-tertiary);
    color: var(--store-tertiary-contrast);
    padding: 14px 24px;
    border-radius: 999px;
    box-shadow: 0 28px 56px rgba(15, 23, 42, 0.34);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 50;
    text-decoration: none;
}

.storefront-cart-fab:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 32px 64px rgba(15, 23, 42, 0.4);
    text-decoration: none;
}

.storefront-cart-fab:focus-visible {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 32px 64px rgba(15, 23, 42, 0.4);
    text-decoration: none;
    outline: 3px solid rgba(255, 255, 255, 0.45);
    outline-offset: 4px;
}

.storefront-cart-fab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.storefront-cart-fab__icon svg {
    width: 22px;
    height: 22px;
}

.storefront-cart-fab__badge {
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--store-secondary);
    color: var(--store-secondary-contrast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0 8px;
}

body.storefront-theme.storefront-theme--standard .topnav {
    background: var(--surface, #ffffff);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

body.storefront-theme.storefront-theme--standard .topnav .nav-group .dropdown {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

body.storefront-theme.storefront-theme--standard .topnav .nav-group .dropdown a {
    color: var(--text);
}

body.storefront-theme.storefront-theme--standard .topnav a.nav-link,
body.storefront-theme.storefront-theme--standard .topnav .nav-label,
body.storefront-theme.storefront-theme--standard .topnav .theme-toggle {
    color: var(--text);
}

body.storefront-theme.storefront-theme--standard .topnav a.nav-link:hover,
body.storefront-theme.storefront-theme--standard .topnav a.nav-link.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

html[data-theme='dark'] body.storefront-theme.storefront-theme--standard .topnav a.nav-link:hover,
html[data-theme='dark'] body.storefront-theme.storefront-theme--standard .topnav a.nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

body.storefront-theme.storefront-theme--standard .sidebar {
    background: var(--surface, #ffffff);
    color: var(--text);
}

body.storefront-theme.storefront-theme--standard .sidebar-nav a.nav-link,
body.storefront-theme.storefront-theme--standard .sidebar-user-toggle,
body.storefront-theme.storefront-theme--standard .sidebar .nav-link {
    color: var(--text);
}

body.storefront-theme.storefront-theme--standard .sidebar-nav a.nav-link.active {
    background: rgba(0, 0, 0, 0.08);
}

html[data-theme='dark'] body.storefront-theme.storefront-theme--standard .sidebar-nav a.nav-link.active {
    background: rgba(255, 255, 255, 0.12);
}

body.storefront-theme.storefront-theme--standard .sidebar-toggle {
    background: var(--surface, #ffffff);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

html[data-theme='dark'] body.storefront-theme.storefront-theme--standard .sidebar-toggle {
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.45);
}

body.storefront-theme.storefront-theme--standard .flash-container .flash {
    background: var(--surface, #ffffff);
    color: var(--text);
    border-color: var(--border-color, rgba(0, 0, 0, 0.1));
}

body.storefront-theme.storefront-theme--standard .theme-toggle {
    color: var(--text);
}

body.storefront-theme .theme-toggle.theme-toggle--hidden {
    display: none !important;
}

@media (max-width: 992px) {
    body.storefront-theme .content {
        padding: 96px 20px 140px;
    }

    .storefront {
        border-radius: 28px;
    }

    .storefront-hero__summary {
        flex-direction: column;
        align-items: stretch;
    }

    .storefront-hero__actions {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .storefront-cart-fab {
        right: 16px;
        bottom: 16px;
        padding: 12px 18px;
        gap: 10px;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.32);
    }

    .storefront-cart-fab__label {
        font-size: 0.95rem;
    }

    .storefront-cart-fab__badge {
        min-width: 26px;
        height: 26px;
    }
}

@media (max-width: 768px) {
    body.storefront-theme .content {
        padding: 88px 16px 56px;
    }

    .storefront {
        padding: 24px;
        gap: 24px;
    }

    .storefront-hero__identity {
        flex-direction: column;
        align-items: flex-start;
    }

    .storefront-hero__summary {
        gap: 20px;
    }

    .storefront-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .storefront-viewbar {
        justify-content: flex-start;
        width: 100%;
        margin: 8px 0 18px;
        padding: 0;
    }

    .storefront-viewbar .storefront-view-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .storefront-results.is-list .storefront-card {
        flex-direction: column;
    }

    .storefront-results.is-list .storefront-card__media {
        aspect-ratio: 4 / 3;
        height: auto;
        max-width: none;
    }

    .storefront-results.is-list .storefront-card__content {
        padding: 24px;
    }

    .storefront-card__carousel-nav {
        width: 34px;
        height: 34px;
    }

    .storefront-card__carousel-nav--prev {
        left: 10px;
    }

    .storefront-card__carousel-nav--next {
        right: 10px;
    }

    .storefront-card__carousel-dots {
        bottom: 10px;
        gap: 6px;
        padding: 4px 8px;
    }
}

@media (min-width: 768px) {
    .storefront-card__actions {
        flex-wrap: nowrap;
    }

    .storefront-card__actions form {
        flex-wrap: nowrap;
        width: auto;
    }

    .storefront-card__actions form button,
    .storefront-card__actions form .btn {
        flex: 0 0 auto;
    }

    .storefront-card__actions input[type="number"] {
        flex: 0 0 84px;
        min-width: 84px;
    }
}


/* === Storefront toolbar: force single-line horizontal layout on desktop === */
@media (min-width: 992px) {
  .storefront-results.is-list .storefront-card {
    flex-direction: row;
    align-items: stretch;
    gap: clamp(20px, 2.4vw, 32px);
  }

  .storefront-results.is-list .storefront-card__media {
    flex: 0 0 clamp(240px, 26vw, 360px);
    max-width: clamp(240px, 26vw, 360px);
    aspect-ratio: auto;
    height: auto;
  }

  .storefront-results.is-list .storefront-card__content {
    padding: clamp(28px, 2.6vw, 40px);
  }

  .storefront-toolbar {
    overflow: visible;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .storefront-toolbar form.storefront-filters {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    min-width: 0;
  }

  .storefront-filters {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }

  .storefront-filters__group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
  }

  .storefront-filters__group--search {
    flex: 1 1 320px;
    min-width: 240px;
  }

  .storefront-filters__group--price {
    flex: 0 0 220px;
    min-width: 180px;
  }

  .storefront-filters input,
  .storefront-filters select,
  .storefront-filters button {
    width: auto !important;
    max-width: 100%;
    min-width: 0;
  }

  .storefront-input {
    height: 34px;
    min-height: 34px;
    padding: 0 36px;
    border-radius: 999px;
    min-width: 0;
  }

  .storefront-input input,
  .storefront-input select {
    height: 100%;
    line-height: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .storefront-filters__group--price input[type="range"] {
    width: 100% !important;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    outline: none;
  }

  .storefront-filters__group--price input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--store-secondary);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.6);
  }

  .storefront-filters__group--price input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--store-secondary);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.6);
  }

  .storefront-filters__group--category select,
  .storefront-filters__group--sort select {
    max-width: 220px;
  }

  .storefront-apply {
    margin-left: auto;
    height: 34px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .storefront-view-toggle {
    margin-left: 4px;
    flex-shrink: 0;
    padding: 4px 8px;
    gap: 6px;
  }

  .storefront-view-toggle__label {
    font-size: 0.75rem;
  }

  .storefront-view-toggle__btn {
    width: 34px;
    height: 34px;
  }
}

.lfg-container { display:flex; flex-direction:column; gap:1.5rem; padding-bottom:3rem; }
.lfg-header { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:1rem; }
.lfg-title { font-size:2rem; margin:0; }
.lfg-subtitle { color:var(--muted); margin:0.35rem 0 0; max-width:540px; }
.lfg-filters { padding:1.25rem; }
.lfg-filter-grid { display:grid; gap:1rem; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.form-field { display:flex; flex-direction:column; gap:0.35rem; }
.form-field input,
.form-field textarea,
.form-field select { border:1px solid var(--border-color); border-radius:10px; padding:0.6rem 0.75rem; background:var(--surface); color:var(--text); }
.form-field textarea { resize:vertical; }
.form-checkbox { display:flex; align-items:flex-end; padding-top:1.6rem; }
.form-checkbox label { display:flex; align-items:center; gap:0.5rem; font-weight:600; }
.lfg-results { display:grid; gap:1rem; }
.lfg-card { display:flex; flex-direction:column; gap:0.75rem; padding:1.25rem; border-radius:14px; background:var(--surface); box-shadow:var(--shadow); }
.lfg-card-header { display:flex; flex-wrap:wrap; align-items:center; gap:0.75rem; justify-content:space-between; }
.lfg-card-header h2 { margin:0; font-size:1.2rem; }
.lfg-card-meta { color:var(--muted); font-weight:600; }
.lfg-card-description { margin:0; line-height:1.5; }
.lfg-card-participants { margin:0; font-weight:600; }
.lfg-card-schedule { margin:0; color:var(--muted); }
.lfg-card-occurrences { list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; gap:0.5rem; }
.lfg-card-occurrences li { background:rgba(59,130,246,0.12); color:#1d4ed8; padding:0.35rem 0.6rem; border-radius:999px; font-size:0.85rem; }
.lfg-empty, .lfg-loading { padding:2rem; text-align:center; border-radius:14px; background:var(--surface); color:var(--muted); box-shadow:var(--shadow); }

.form-hint { margin:0; color:var(--muted); font-size:0.9rem; }
.lfg-schedule-group { display:flex; flex-direction:column; gap:1rem; margin-top:1rem; padding:1.25rem; border-radius:12px; border:1px solid var(--border-color, rgba(148,163,184,0.35)); background:var(--surface); }
.lfg-schedule-group h2 { margin:0; font-size:1.1rem; }
.lfg-schedule-group .schedule-section { display:flex; flex-direction:column; gap:0.75rem; }
.schedule-section--hidden { display:none !important; }
.lfg-form-layout { display:grid; gap:1.5rem; grid-template-columns:2fr 1fr; align-items:start; }
.lfg-form-card, .lfg-preview-card { padding:1.5rem; }
.lfg-preview-card { display:flex; flex-direction:column; gap:0.75rem; }
.lfg-preview-list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:0.5rem; }
.lfg-preview-item { padding:0.5rem 0.75rem; border-radius:10px; background:rgba(37,99,235,0.12); color:#1d4ed8; font-weight:600; }
.lfg-preview-empty { color:var(--muted); }
.lfg-errors { border-radius:10px; background:rgba(220,53,69,0.1); color:#b91c1c; padding:0.75rem 1rem; margin-bottom:0.75rem; }
.lfg-errors ul { margin:0; padding-left:1.2rem; }
.lfg-errors li { margin:0.15rem 0; }
.form-grid-two { display:grid; gap:1rem; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.weekday-grid { display:grid; gap:0.4rem; grid-template-columns:repeat(7,minmax(32px,1fr)); }
.weekday-pill { display:flex; }
.weekday-pill input { display:none; }
.weekday-pill { justify-content:center; align-items:center; border:1px solid var(--border-color); border-radius:999px; padding:0.4rem 0.6rem; font-weight:600; cursor:pointer; background:var(--surface); }
.weekday-pill input:checked + span,
.weekday-pill input:checked ~ span { background:rgba(59,130,246,0.12); color:#1d4ed8; border-color:#1d4ed8; }
.form-actions { display:flex; justify-content:flex-end; gap:0.75rem; margin-top:1.5rem; }

@media (max-width: 960px) {
  .lfg-form-layout { grid-template-columns:1fr; }
}

@media (max-width: 640px) {
  .lfg-filter-grid { grid-template-columns:1fr; }
  .weekday-grid { grid-template-columns:repeat(4,1fr); }
}
