/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Restore browser default centering for modal dialogs (universal reset zeros margin) */
dialog[open] { margin: auto; }

:root {
    --bg-base:        #0f0f1a;
    --bg-surface:     #1a1a2e;
    --bg-card:        #16213e;
    --accent:         #e8a020;
    --accent-hover:   #f0b840;
    --text-primary:   #e8e8f0;
    --text-secondary: #9090b0;
    --success:        #4caf7d;
    --danger:         #e05555;
    --border:         rgba(255,255,255,0.08);
    --radius:         8px;
    --font:           'Segoe UI', system-ui, sans-serif;
    --tip-bg:         #1e1e2e;
    --tip-text:       #f0f0f0;
}

[data-theme="light"] {
    --bg-base:        #f0f2f7;
    --bg-surface:     #ffffff;
    --bg-card:        #e8ecf4;
    --accent:         #c87010;
    --accent-hover:   #e8a020;
    --text-primary:   #1a1a2e;
    --text-secondary: #555577;
    --border:         rgba(0,0,0,0.10);
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100%;
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.5;
}

/* ===== TOP NAV ===== */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 52px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

@media (max-width: 768px) {
    .eff-bar { max-width: 60%; }
    .topnav {
        flex-wrap: wrap;
        height: auto;
        padding: 0;
    }
    .topnav .nav-left {
        padding: 0 8px 0 16px;
        height: 48px;
        display: flex;
        align-items: center;
        flex-shrink: 1;
        min-width: 0;
    }
    .topnav .chat-btn {
        flex-shrink: 0;
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .topnav .brand {
        padding: 0;
        height: 48px;
        display: flex;
        align-items: center;
    }
    .nav-tabs {
        order: 1;
        width: 100%;
        border-top: 1px solid var(--border);
        height: auto;
        justify-content: space-around;
        padding: 0;
    }
    .nav-tabs button,
    .nav-tab-link {
        flex: 1;
        padding: 14px 0 !important;
        font-size: 0.82rem;
        height: auto !important;
        justify-content: center;
    }
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.03em;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link--admin { color: var(--danger) !important; }
.nav-link--admin:hover { color: #f07070 !important; }

.nav-username {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.badge-pro {
    background: var(--accent);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}
.badge-pro--sm {
    font-size: 0.6rem;
    padding: 1px 4px;
    vertical-align: middle;
}

/* ===== BURGER MENU ===== */
[x-cloak] { display: none !important; }

.burger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.burger-btn:hover { background: rgba(255,255,255,0.07); }

.burger-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: background 0.15s;
}
.burger-btn:hover .burger-bar { background: var(--accent); }

.burger-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 200;
    padding: 6px 0;
}

.burger-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
}
.burger-username {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.burger-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.burger-item {
    display: block;
    padding: 9px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.burger-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}
.burger-item--admin { color: var(--danger); }
.burger-item--admin:hover { color: #f07070; }
.burger-item--mod { color: #64a0ff; }
.burger-item--mod:hover { color: #90bfff; }
.burger-item--logout { color: var(--text-secondary); }
.burger-item--login {
    color: var(--accent);
    font-weight: 600;
}
.burger-item--login:hover { color: var(--accent-hover); }

/* ===== MAIN ===== */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 16px;
}

@media (max-width: 640px) {
    main { padding-left: 0; padding-right: 0; }
}

/* ===== STATIC PAGES ===== */
.page-content {
    max-width: 720px;
}
.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.page-placeholder {
    color: var(--text-secondary);
}
.settings-section { margin-bottom: 2rem; }
.theme-toggle-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.theme-toggle-label { font-size: 0.9rem; color: var(--text-secondary); transition: color 0.2s; }
.theme-label--active { color: var(--text-primary); font-weight: 600; }
.theme-switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.theme-switch-track { position: absolute; inset: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 28px; cursor: pointer; transition: background 0.25s; }
.theme-switch-track::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--accent); border-radius: 50%; transition: transform 0.25s; }
.theme-switch input:checked + .theme-switch-track { background: var(--bg-card); }
.theme-switch input:checked + .theme-switch-track::after { transform: translateX(24px); }
.settings-heading { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin: 0 0 0.4rem; }
.settings-hint { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; margin: 0 0 1rem; }
.referral-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.referral-label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.referral-link-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.referral-link { font-family: monospace; font-size: 0.9rem; color: var(--text-primary); word-break: break-all; flex: 1; }
.referral-copy-btn { background: var(--accent); border: none; color: #000; font-weight: 700; font-size: 0.85rem; padding: 0.35rem 0.9rem; border-radius: 6px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.referral-copy-btn:hover { background: var(--accent-hover); }
.referral-code-row { display: flex; align-items: center; gap: 0.5rem; }
.referral-code-label { font-size: 0.8rem; color: var(--text-secondary); }
.referral-code { font-family: monospace; font-size: 1.1rem; font-weight: 700; color: var(--accent); letter-spacing: 0.15em; }

.help-section { margin-bottom: 28px; }
.help-heading { font-size: 1.05rem; font-weight: 700; color: var(--accent); margin: 0 0 8px; }
.help-section p { color: var(--text-secondary); line-height: 1.6; margin: 0 0 10px; }
.help-list { color: var(--text-secondary); line-height: 1.8; margin: 6px 0 0 18px; padding: 0; }
.help-list li { margin-bottom: 2px; }

/* ── Help search ── */
.help-search-wrap { position: relative; margin-bottom: 28px; }
.help-search__input {
    width: 100%; box-sizing: border-box;
    padding: 10px 14px; font-size: 0.95rem;
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--accent); border-radius: var(--radius);
    outline: none;
}
.help-search__input::placeholder { color: var(--text-secondary); }
.help-search__input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,160,32,0.15); }
.help-search__results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.help-search__result {
    display: block; padding: 10px 14px; text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.help-search__result:last-child { border-bottom: none; }
.help-search__result:hover { background: rgba(232,160,32,0.08); }
.help-search__q { display: block; font-weight: 600; font-size: 0.88rem; color: var(--text-primary); margin-bottom: 2px; }
.help-search__a { display: block; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.help-search__empty { padding: 12px 14px; font-size: 0.85rem; color: var(--text-secondary); }
.help-search__results mark { background: rgba(232,160,32,0.35); color: inherit; border-radius: 2px; padding: 0 1px; }
.help-section--highlight { animation: help-flash 2s ease-out; }
@keyframes help-flash {
    0%   { background: rgba(232,160,32,0.18); border-radius: var(--radius); }
    100% { background: transparent; }
}

/* ===== WELCOME (logged out) ===== */
.welcome {
    text-align: center;
    padding: 80px 20px;
}
.welcome h1 {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 16px;
}
.welcome p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block;
    background: var(--accent-hover);
    color: #000;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: var(--radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, color 0.15s;
}
.btn-primary:hover, .btn-primary:active {
    background: var(--accent);
    color: #fff;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
}
.btn-secondary:hover, .btn-secondary:active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== DASHBOARD ===== */
.dashboard { width: 100%; }

.nav-tabs {
    display: flex;
    align-items: stretch;
    height: 100%;
}
.nav-tabs button,
.nav-tab-link {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0 16px;
    cursor: pointer;
    font-size: 0.9rem;
    height: 100%;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.15s, border-color 0.15s;
}
.nav-tabs button:hover,
.nav-tab-link:hover { color: var(--text-primary); }
.nav-tabs button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tab-panel { min-height: 300px; }

/* ===== BATCH INVENTORY ===== */
.stock-total {
    font-weight: 600;
    color: var(--text-primary);
}
.batch-list {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.batch-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.batch-qty {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 20px;
}
.batch-expiry {
    color: var(--accent);
}
.batch-expiry--none {
    color: var(--text-secondary);
}
.batch-cost { color: var(--text-secondary); }
@media (max-width: 640px) { .batch-cost { display: none; } }
.avg-cost { font-size: 0.85rem; }
.cost-cell { white-space: nowrap; }

/* ===== TOOLTIPS ===== */
.tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-secondary);
    color: var(--bg-card);
    font-size: 0.6rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    flex-shrink: 0;
    vertical-align: middle;
    margin-left: 0.3rem;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    outline: none;
}
.tip::after {
    content: attr(data-tip);
    position: fixed;
    left: var(--tip-x, 50%);
    top: var(--tip-y, 0);
    bottom: auto;
    transform: translateX(-50%) translateY(calc(-100% - 7px));
    z-index: 200;
    background: var(--tip-bg);
    color: var(--tip-text);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.45;
    padding: 0.45rem 0.65rem;
    border-radius: 7px;
    white-space: normal;
    width: 230px;
    max-width: min(90vw, 260px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 3px 12px rgba(0,0,0,0.45);
    text-align: left;
}
/* keep tip on screen when near left/right edge */
.tip.tip--right::after { left: auto; right: 8px; transform: translateY(calc(-100% - 7px)); }
.tip.tip--left::after  { left: 8px; transform: translateY(calc(-100% - 7px)); }
/* open downward when near top of viewport */
.tip.tip--down::after  { top: var(--tip-y-down, auto); transform: translateX(-50%); }
.tip.tip--down.tip--left::after  { left: 8px; transform: none; }
.tip.tip--down.tip--right::after { left: auto; right: 8px; transform: none; }
.tip:hover::after,
.tip:focus::after,
.tip--active::after {
    opacity: 1;
}
/* JS overrides static positioning classes at open time */
@media (pointer: coarse) {
    .tip {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}
/* Shelf-life tip on market product names: plain emoji style, not a badge */
.tip--shelf {
    background: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    width: auto;
    height: auto;
    border-radius: 0;
    margin-left: 0;
}
.tip--shelf::after {
    width: 160px;
    font-size: 1.56rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

@media (max-width: 640px) {
    .card { padding: 0; }
}

.card-title {
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== KPI GRID ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

/* ===== SALES REPORT ===== */
.sales-report-bar { margin-top: -8px; margin-bottom: 8px; }
.sales-report-btn { font-weight: 600; }

.sales-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}
.sales-modal.sales-modal--open {
    display: flex;
}
.sales-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 0;
    width: min(560px, 96vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.sales-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sales-dialog-title { font-size: 1.1rem; font-weight: 700; color: var(--accent); }

.sales-report-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 1.25rem 1.25rem;
    flex: 1;
    min-height: 0;
}
.sales-report-loading { color: var(--text-secondary); padding: 1rem 0; }

.sales-date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0 0.75rem;
}
.sales-nav-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sales-nav-btn:disabled { opacity: 0.35; cursor: default; }
.sales-nav-btn:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.sales-date-label { font-size: 1rem; font-weight: 600; color: var(--text-primary); text-align: center; flex: 1; }

.sales-empty { color: var(--text-secondary); padding: 0.5rem 0 1rem; }

.sales-table-wrap { overflow-x: auto; }
.sales-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.sales-table th {
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.sales-table th.sales-col-num { text-align: right; }
.sales-table td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); }
.sales-table tbody tr:last-child td { border-bottom: none; }
.sales-table tfoot td { border-top: 2px solid var(--border); border-bottom: none; padding-top: 0.65rem; }
.sales-product-name { font-weight: 600; color: var(--text-primary); }
.sales-col-num { text-align: right; font-variant-numeric: tabular-nums; }
.sales-profit { color: #4caf50; }
.sales-profit--neg { color: #e05252; }
.sales-totals-row td { color: var(--text-primary); }

@media (max-width: 480px) {
    .sales-table { font-size: 0.9rem; }
    .sales-table th, .sales-table td { padding: 0.5rem 0.35rem; }
    .sales-date-label { font-size: 0.9rem; }
}

/* ===== STALL OPEN/CLOSE PULSE ===== */
@keyframes pulse-open {
    0%, 100% { border-color: rgba(80, 180, 120, 0.3); box-shadow: none; background-color: var(--bg-card); }
    50%       { border-color: rgba(80, 180, 120, 1);   box-shadow: 0 0 16px rgba(80, 180, 120, 0.4); background-color: rgba(80, 180, 120, 0.06); }
}
@keyframes pulse-close {
    0%, 100% { border-color: rgba(192, 112, 112, 0.3); box-shadow: none; background-color: var(--bg-card); }
    50%       { border-color: rgba(192, 112, 112, 1);   box-shadow: 0 0 16px rgba(192, 112, 112, 0.4); background-color: rgba(192, 112, 112, 0.06); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.stall-card--opening { animation: pulse-open  2s ease-in-out infinite; }
.stall-card--closing { animation: pulse-close 2s ease-in-out infinite; }

.competitor-open-dot.pending-open  { background: var(--success); animation: pulse-dot 1.5s ease-in-out infinite; }
.competitor-open-dot.pending-close { background: var(--danger);  animation: pulse-dot 1.5s ease-in-out infinite; }

/* ===== LOCATION ACTIVITY EVENTS ===== */
.location-events {
    margin: 12px 16px 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.location-events-scroll {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}
.location-events-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.location-event {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.78rem;
    line-height: 1.4;
}
.location-event:last-child { border-bottom: none; }
.location-event-icon  { flex-shrink: 0; }
.location-event-body  { flex: 1; min-width: 0; }
.location-event-title { font-weight: 600; color: var(--text-primary); margin-right: 3px; }
.location-event-content { color: var(--text-secondary); }
.location-event-time  { font-size: 0.68rem; color: var(--text-secondary); flex-shrink: 0; white-space: nowrap; opacity: 0.7; }
.location-events-empty { font-size: 0.75rem; color: var(--text-secondary); margin: 0; opacity: 0.6; }

/* ===== STALL CARD ===== */
.stall-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 16px;
    min-width: 0;
    overflow-x: hidden;
}

/* Collapse bar — shown when multiple stalls, hidden for single stall */
.stall-collapse-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.stall-collapse-bar:hover {
    background: rgba(255,255,255,0.04);
}

.stall-collapse-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.stall-collapse-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stall-collapse-status {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.stall-collapse-status--open    { background: rgba(80,180,120,0.2);  color: #50b478; }
.stall-collapse-status--closed  { background: rgba(180,80,80,0.15);  color: #c07070; }
.stall-collapse-status--pending { background: rgba(232,160,32,0.2);  color: var(--accent); }
.stall-collapse-status--transit { background: rgba(100,140,220,0.2); color: #7aabee; }

.stall-collapse-chevron {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.stall-collapse-chevron--up {
    transform: rotate(180deg);
}

/* Hide collapse bar when this is the only stall card in the list */
.stalls-list > .stall-card:only-child .stall-collapse-bar {
    display: none;
}

/* When collapse bar is hidden, restore card padding on the body */
.stalls-list > .stall-card:only-child .stall-collapse-bar + div {
    padding: 16px;
}

/* Padding for the collapsible body when bar is shown */
.stall-collapse-bar ~ div {
    padding: 16px;
}

.stall-body {
    margin-bottom: 16px;
}

.stall-body-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
    min-width: 0;
}

@media (max-width: 640px) {
    .stall-body-columns {
        grid-template-columns: 1fr;
    }
    .stall-col-image { order: -1; }
}

.stall-col-location {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.stall-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stall-col-image {
    display: flex;
    align-self: stretch;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.stall-location-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: block;
    padding: 25px;
    box-sizing: border-box;
}

.stall-info-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-bottom: 12px;
    align-items: start;
}

@media (max-width: 992px) {
    .stall-info-row {
        grid-template-columns: 1fr;
    }
}

.stall-info-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Activity card height is set by JS to match pricing card */
.stall-info-card:first-child {
    overflow: hidden;
}

.stall-info-card [id$="-demand"] {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stall-info-card .demand-log-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

@media (max-width: 992px) {
    .stall-info-card .demand-log-wrap {
        flex: none;
        max-height: 220px;
        overflow-y: auto;
    }
}

.stall-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}
.stall-name-text { flex: 1; min-width: 0; }
.stall-owner-medal { font-size: 1.1rem; margin-right: 4px; flex-shrink: 0; }

.stall-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

@media (max-width: 560px) {
}

.status-open  { color: var(--success); font-weight: 600; }
.status-closed { color: var(--danger); font-weight: 600; }
.status-pending { color: var(--accent); font-weight: 600; }

/* ===== LOADING ===== */
.loading {
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px 0;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-group input,
.form-group select {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 0.95rem;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== DELAY INDICATOR ===== */
.delay-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(232,160,32,0.12);
    padding: 2px 8px;
    border-radius: 20px;
}

/* ===== TABLES ===== */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge-category {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    padding: 1px 6px;
    border-radius: 4px;
}
.badge-risk { font-size: 0.75rem; padding: 2px 7px; border-radius: 4px; }
.badge-risk--low    { background: rgba(76,175,125,0.15); color: var(--success); }
.badge-risk--medium { background: rgba(232,160,32,0.15); color: var(--accent); }
.badge-risk--high   { background: rgba(224,85,85,0.15);  color: var(--danger); }

/* ===== STALL CONTROLS ===== */
.stall-controls { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.control-row { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.control-label { font-size: 1rem; color: var(--accent); min-width: 90px; font-weight: 600; }
.control-value { font-weight: 600; min-width: 50px; }
.inline-form { display: flex; align-items: center; gap: 6px; }

.stepper { display: flex; align-items: center; }
.stepper-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 36px;
    height: 32px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stepper-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stepper-btn:last-of-type { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper-btn:hover { border-color: var(--accent); color: var(--accent); }
.stepper-input {
    width: 60px;
    text-align: center;
    border-radius: 0;
    border-left: none;
    border-right: none;
    -moz-appearance: textfield;
}
.stepper-input::-webkit-inner-spin-button,
.stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-sm {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 5px 8px;
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.input-sm:focus { outline: none; border-color: var(--accent); }

select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23e8a020' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding: 5px 30px 5px 8px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}
select:focus { outline: none; border-color: var(--accent-hover); }

.btn-sm { padding: 5px 12px; font-size: 0.85rem; }

/* ===== PRODUCTS TABLE ===== */
.products-table { margin: 12px 0 10px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.products-table th { padding-left: 0; padding-right: 0; }
.products-table td { padding-left: 0; padding-right: 0; }
@media (max-width: 768px) {
    .products-table td:first-child { position: relative; padding-right: 2.8em; }
    .products-table td:first-child::after {
        content: '';
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        width: 2em;
        height: 2em;
        background-image: var(--product-bg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.8;
    }
}
.stock-fragment-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.stock-fragment-table th { text-align: left; padding: 5px 8px; font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border); }
.stock-fragment-table td { padding: 5px 8px; vertical-align: top; border-bottom: 1px solid var(--border); }
.stock-fragment-table tr:last-child td { border-bottom: none; }
@media (max-width: 640px) {
    .stock-fragment-table th { padding-left: 0; padding-right: 0; }
    .stock-fragment-table td { padding-left: 0; padding-right: 0; }
    .stock-fragment-table td:last-child .btn-sm { padding: 3px 6px; font-size: 0.7rem; }
}
/* ===== PRODUCT ICONS ===== */
.product-icon {
    width: 2.5em;
    height: 2.5em;
    vertical-align: middle;
    margin-right: 0.35em;
    opacity: 0.85;
    flex-shrink: 0;
}
.product-icon--peek {
    width: 1.1em;
    height: 1.1em;
}
@media (max-width: 768px) {
    .product-icon { display: none; }
}

/* ===== VIEW TOGGLE SWITCH ===== */
.view-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.view-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.view-toggle__track {
    display: inline-block;
    width: 34px;
    height: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}
.view-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 12px; height: 12px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.view-toggle input:checked + .view-toggle__track { background: var(--accent); border-color: var(--accent); }
.view-toggle input:checked + .view-toggle__track::after { transform: translateX(16px); background: #000; }
.view-toggle__label { font-size: 0.78rem; color: var(--text-secondary); }
.view-toggle--mobile-only { display: none; }
@media (max-width: 640px) {
    .view-toggle--mobile-only {
        display: inline-flex;
        gap: 10px;
        padding: 6px 10px;
        background: rgba(255,255,255,0.05);
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }
    .view-toggle--mobile-only .view-toggle__track {
        width: 52px;
        height: 28px;
        border-radius: 14px;
    }
    .view-toggle--mobile-only .view-toggle__track::after {
        width: 20px;
        height: 20px;
        top: 3px;
        left: 3px;
    }
    .view-toggle--mobile-only input:checked + .view-toggle__track::after {
        transform: translateX(24px);
    }
    .view-toggle--mobile-only::after {
        content: 'Show stalls';
        font-size: 0.85rem;
        color: var(--text-secondary);
        white-space: nowrap;
    }
    .view-toggle .view-toggle__track {
        width: 52px;
        height: 28px;
        border-radius: 14px;
    }
    .view-toggle .view-toggle__track::after {
        width: 20px;
        height: 20px;
        top: 3px;
        left: 3px;
    }
    .view-toggle input:checked + .view-toggle__track::after {
        transform: translateX(24px);
    }
    .view-toggle__label { font-size: 0.9rem; }
}

.market-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.market-table tbody tr:hover { background: rgba(255,255,255,0.04); cursor: default; }
@media (max-width: 640px) {
    .market-table tbody td { padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 768px) {
    .market-table td:first-child { position: relative; padding-right: 2.8em; }
    .market-table td:first-child::after {
        content: '';
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        width: 2em;
        height: 2em;
        background-image: var(--product-bg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.8;
    }
}
.market-category-row { background: rgba(255,255,255,0.03); }
.market-category-row:hover { background: rgba(255,255,255,0.03) !important; cursor: default !important; }
.market-category-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); padding: 2px 0; }

/* ===== PRICE DIALOG ===== */
.price-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text-primary);
    min-width: 240px;
}
@media (max-width: 640px) {
    .price-dialog {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        width: calc(100vw - 32px);
        max-width: 100%;
        padding: 24px 20px;
        box-sizing: border-box;
    }
    .price-dialog-form { gap: 20px; }
    .price-dialog .stepper-btn { width: 80px; height: 80px; font-size: 2.2rem; }
    .price-dialog .stepper-input { height: 80px; width: 120px; font-size: 2rem; text-align: center; }
    .inline-form .stepper-btn { width: 48px; height: 48px; font-size: 1.4rem; }
    .inline-form .stepper-input { height: 48px; width: 80px; font-size: 1.1rem; }
    .price-dialog-form .btn-primary { padding: 18px; font-size: 1.2rem; }
    .price-dialog-title { font-size: 2rem; line-height: 1.3; }
}
.price-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.price-dialog-form { display: flex; flex-direction: column; gap: 16px; }
.price-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.price-dialog-title { font-weight: 600; font-size: 0.9rem; }
.price-dialog-close {
    background: var(--text-secondary);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.price-dialog-close:hover { background: var(--text-primary); }
.price-dialog-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.price-dialog-hint { font-size: 0.78rem; color: var(--text-secondary); margin: 0.5rem 0 0; line-height: 1.4; }

.pricing-heading-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.pricing-row--inactive { opacity: 0.45; }
.inactive-badge { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; color: var(--text-secondary); background: var(--border); border-radius: 3px; padding: 1px 5px; vertical-align: middle; margin-left: 4px; }

.manage-products-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 420px;
    width: 100%;
}
.manage-products-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

.manage-products-list { display: flex; flex-direction: column; gap: 4px; }

.manage-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.manage-product-row:last-child { border-bottom: none; }

.manage-product-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.manage-product-name { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== PERFORMANCE TRENDS PANEL ===== */
.trends-panel { margin: 0 0 12px; border-top: 1px solid var(--border); padding-top: 4px; }

.market-share-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.market-share-label { font-size: 0.78rem; color: var(--text-secondary); }
.market-share-value { font-size: 0.9rem; font-weight: 700; color: var(--accent); }

.trend-direction { font-size: 0.78rem; font-weight: 600; padding: 4px 0 8px; }
.trend-direction--rising  { color: var(--accent); }
.trend-direction--falling { color: var(--accent); }
.trend-direction--stable  { color: var(--accent); }

.trends-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.trends-table th { text-align: left; padding: 4px 0; font-size: 0.72rem; color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border); }
.trends-table td { padding: 5px 0; vertical-align: middle; border-bottom: 1px solid var(--border); }
.trends-table tr:last-child td { border-bottom: none; }

.lost-badge { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.lost-badge--stock  { background: rgba(234,179,8,0.15); color: #ca8a04; }
.lost-badge--demand { background: rgba(239,68,68,0.15); color: var(--danger); }

.eff-bar-wrap { display: flex; align-items: center; gap: 6px; }
.eff-bar { height: 8px; border-radius: 4px; min-width: 2px; flex-shrink: 0; max-width: 75%; }
.eff-bar--green  { background: #22c55e; }
.eff-bar--amber  { background: #f59e0b; }
.eff-bar--red    { background: var(--danger); }
.eff-bar-label { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }

.card-value--warning { color: var(--danger) !important; }

/* ===== DEMAND LOG ===== */
.demand-log-wrap { max-height: 220px; overflow-y: auto; margin: 4px 0 0; }
.demand-log { list-style: none; }
.demand-log-entry { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.demand-log-entry:last-child { border-bottom: none; }
.demand-log-time { color: var(--text-secondary); min-width: 68px; flex-shrink: 0; font-size: 0.76rem; }
.demand-log-message { flex: 1; min-width: 0; overflow-wrap: break-word; }
.demand-log-entry--sold         .demand-log-message { color: var(--success); }
.demand-log-entry--missed_stock .demand-log-message { color: var(--danger); }
.demand-log-entry--price        .demand-log-message { color: var(--danger); }
.demand-log-entry--queue        .demand-log-message { color: #d4a017; }
.demand-log-entry--not_stocked  .demand-log-message { color: var(--text-secondary); }
.demand-log-entry--reporter      .demand-log-message { color: #a78bfa; font-weight: 600; }
.demand-log-entry--reporter_miss .demand-log-message { color: var(--danger); font-weight: 600; }
.demand-log-entry--volume_event  .demand-log-message { color: #f59e0b; font-weight: 600; }
.demand-log-empty { font-size: 0.82rem; color: var(--text-secondary); padding: 6px 0; }

/* ===== ADD PRODUCT PANEL ===== */
.add-product-panel { margin-top: 10px; }
.add-product-panel summary { cursor: pointer; list-style: none; }
.add-product-form { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; background: var(--bg-surface); border-radius: 0 0 var(--radius) var(--radius); }
.add-product-form select, .add-product-form input { flex: 1; min-width: 120px; }

/* ===== WALLET BAR ===== */
.weekly-achievement-banner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    width: 100%;
    box-sizing: border-box;
    margin-top: 15px;
}

.wallet-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    width: 100%;
}
.wallet-label { font-size: 0.85rem; color: var(--text-secondary); }
.wallet-balance { font-size: 1.1rem; font-weight: 600; color: var(--accent); }
.wallet-divider { color: var(--border); }
.net-position--negative { color: var(--danger, #c0392b) !important; }
.loan-btn { margin-left: auto; }

@media (max-width: 640px) {
    .wallet-bar {
        flex-wrap: wrap;
        gap: 6px 12px;
    }
    .wallet-divider { display: none; }
    .loan-btn { margin-left: 0; width: 100%; }
}
.loan-btn:disabled { opacity: 0.4; cursor: not-allowed; }
@keyframes loan-attention {
    0%, 100% { transform: scale(1); box-shadow: none; }
    50% { transform: scale(1.08); box-shadow: 0 0 10px 2px var(--accent); }
}
.loan-btn--attention { animation: loan-attention 1.6s ease-in-out infinite; }

/* ===== LOAN DIALOG ===== */
.loan-slider-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.loan-amount-label { font-size: 0.95rem; }
.loan-slider {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}
.loan-range-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }
.loan-net-worth { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; background: var(--bg-base); }
.loan-summary { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.loan-summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-secondary); }
.loan-summary-total { font-weight: 600; color: var(--text-primary); border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-bottom: 8px; }

/* ===== STALL TYPE INFO ===== */
.stall-type-info { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

/* ===== MOVE STOCK PANEL ===== */
.move-stock-panel { display: inline-block; }
.move-stock-panel summary { cursor: pointer; list-style: none; }
.move-stock-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 0 2px; }
.move-stock-form select { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.12); color: var(--text-primary); border-radius: var(--radius); padding: 3px 6px; font-size: 0.82rem; }
.transfer-badge { display: block; font-size: 0.75rem; color: var(--accent); margin-top: 2px; }

/* ===== STAFF TRAFFIC LIGHTS ===== */
.staff-lights { display: flex; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.staff-light-item { display: flex; align-items: center; gap: 5px; cursor: default; }
.staff-light-label { font-size: 0.75rem; color: var(--text-secondary); }
.traffic-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.traffic-dot--green  { background: #2ecc71; box-shadow: 0 0 5px rgba(46,204,113,0.6); }
.traffic-dot--amber  { background: #f39c12; box-shadow: 0 0 5px rgba(243,156,18,0.6); }
.traffic-dot--red    { background: #e74c3c; box-shadow: 0 0 5px rgba(231,76,60,0.6); }
.traffic-dot--none   { background: var(--border); }

/* ===== MARKET PANEL ===== */
.market-panel h2 { margin-bottom: 8px; }
.market-panel p { margin-bottom: 16px; color: var(--text-secondary); }
.error-banner { background: #3b1a1a; border: 1px solid var(--danger, #c0392b); color: #f0a0a0; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 0.9rem; }
.text-secondary { color: var(--text-secondary); }

.market-visit-tracker { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.market-wallet-row { display: flex; align-items: center; gap: 12px; }
.market-quota-banner {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 20px; text-align: center;
}
.market-quota-banner--limit {
    border-color: var(--danger, #c0392b);
    background: rgba(192, 57, 43, 0.08);
}
.market-quota-count {
    font-size: 2.8rem; font-weight: 700; line-height: 1;
    color: var(--accent);
}
.market-quota-banner--limit .market-quota-count { color: var(--danger, #c0392b); }
.market-quota-sep { font-size: 2rem; font-weight: 400; opacity: 0.6; margin: 0 2px; }
.market-quota-label { font-size: 0.85rem; color: var(--text-secondary); letter-spacing: 0.02em; }
.voucher-badge { font-size: 0.8rem; font-weight: 600; color: #F59E0B; background: rgba(245,158,11,0.12); border-radius: 4px; padding: 2px 7px; }
.voucher-row { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.voucher-label { font-size: 0.78rem; font-weight: 600; color: #F59E0B; letter-spacing: 0.02em; }
.voucher-select { width: 100%; color: #F59E0B; border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); appearance: auto; cursor: pointer; font-weight: 500; }
.voucher-select:focus { border-color: #F59E0B; outline: none; }

.buy-panel { display: inline-block; }
.buy-panel > summary { cursor: pointer; list-style: none; }
.buy-panel > summary::-webkit-details-marker { display: none; }
.buy-form { padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 4px; min-width: 160px; display: flex; flex-direction: column; gap: 6px; }
.buy-row { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.buy-row label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }

/* ===== PDA STOCK CARD ===== */
.pda-card {
    margin-top: 24px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}
.pda-card__header {
    background: var(--accent);
    color: #0f0f1a;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
}
.pda-card__header--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pda-carousel { position: relative; }
.pda-carousel__track {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pda-carousel__track::-webkit-scrollbar { display: none; }
.pda-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 6px 0 10px;
}
.pda-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s;
}
.pda-carousel__dot--active { background: var(--accent); }
.pda-stall {
    flex: 0 0 100%;
    scroll-snap-align: start;
    padding: 12px 14px;
    min-width: 0;
}
.pda-stall__name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.pda-stall__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--text-secondary);
    line-height: 1.6;
}
.pda-stall__row span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}
.pda-stall__row--low span:last-child { color: var(--danger); }

@media (min-width: 641px) {
    .pda-carousel__track {
        overflow-x: visible;
        scroll-snap-type: none;
    }
    .pda-stall {
        flex: 1;
        scroll-snap-align: none;
    }
    .pda-carousel__dots { display: none; }
}

@media (max-width: 640px) {
    .pda-stall__name { font-size: 1.4rem; }
    .pda-stall__row { font-size: 1.5rem; line-height: 2; }
    .stock-bar__label { font-size: 1.3rem; }
}

.stock-bar { margin-top: 8px; }
.stock-bar__track { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.stock-bar__fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.stock-bar__fill--ok     { background: #2ecc71; }
.stock-bar__fill--warn   { background: #f39c12; }
.stock-bar__fill--danger { background: var(--danger, #c0392b); }
.stock-bar__label { display: flex; justify-content: space-between; font-size: 0.72rem; font-family: monospace; color: var(--text-secondary); margin-top: 3px; }

.pda-card__body--table {
    display: block;
    padding: 0;
}
.pda-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    font-family: monospace;
}
.pda-history-table th {
    text-align: left;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.pda-history-table td {
    padding: 5px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.pda-history-table tbody tr:last-child td { border-bottom: none; }
.pda-history-table td:nth-child(3),
.pda-history-table td:nth-child(5),
.pda-history-table td:nth-child(6) { color: var(--text-primary); }
@media (max-width: 540px) {
    .pda-history-table thead { display: none; }
    .pda-history-table tbody tr {
        display: block;
        border-bottom: 1px solid var(--border);
        padding: 8px 12px;
    }
    .pda-history-table tbody tr:last-child { border-bottom: none; }
    .pda-history-table td {
        display: flex;
        justify-content: space-between;
        padding: 2px 0;
        border-bottom: none;
        white-space: normal;
    }
    .pda-history-table td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-secondary);
        opacity: 0.6;
        flex-shrink: 0;
        margin-right: 8px;
    }
}

/* ===== STALL MARKET ===== */
#trade-panel h2 { margin-bottom: 4px; }
#trade-panel > p { margin-bottom: 20px; }

.stock-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.stock-listings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 8px;
}
.stock-listings-table th {
    text-align: left;
    padding: 5px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.stock-listings-table td {
    padding: 7px 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}
.stock-listings-table tr:last-child td { border-bottom: none; }
@media (max-width: 640px) {
    .stock-listings-table th:nth-child(4),
    .stock-listings-table td:nth-child(4) { display: none; }
}

.trade-error-banner { background: rgba(224,85,85,0.12); border: 1px solid rgba(224,85,85,0.35); color: var(--danger); border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 0.88rem; }
.trade-section { margin-bottom: 28px; }
.trade-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.listing-card__name { font-weight: 600; font-size: 0.95rem; }
.listing-card__location { font-size: 0.8rem; color: var(--text-secondary); }
.listing-card__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}
.listing-stat { display: flex; flex-direction: column; }
.listing-stat__label { font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.listing-stat__value { font-size: 0.85rem; color: var(--text-primary); }
.listing-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.listing-card__price { font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.listing-card__seller { font-size: 0.75rem; color: var(--text-secondary); flex: 1; }
.listing-card__no-funds { font-size: 0.78rem; color: var(--text-secondary); font-style: italic; }
.listing-mine-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.trade-quota-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.trade-quota-pill {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 14px;
}
.trade-quota-pill--full { border-color: var(--accent); opacity: 0.6; }
.trade-quota-name { font-size: 0.85rem; font-weight: 600; }
.trade-quota-count { font-size: 0.75rem; color: var(--text-secondary); }

.trade-type-badge {
    display: inline-block; font-size: 0.7rem; font-weight: 700;
    padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em;
}
.trade-type-badge--sold { background: rgba(232,160,32,0.2); color: var(--accent); }
.trade-type-badge--bought { background: rgba(80,180,120,0.2); color: #50b478; }

.sell-stall-list { display: flex; flex-direction: column; gap: 10px; }
.sell-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    flex-wrap: wrap;
}
.sell-row__name { font-weight: 600; font-size: 0.9rem; }
.sell-row__sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.sell-row__action { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sell-row__action--blocked button[disabled] { opacity: 0.45; cursor: not-allowed; font-size: 0.78rem; }
.sell-row__listed-price { font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.sell-slider-wrap { display: flex; align-items: center; gap: 8px; }
.sell-slider { width: 110px; }
.sell-slider-value { font-size: 0.88rem; font-weight: 600; color: var(--accent); min-width: 60px; }
.sell-slider-range-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-secondary); width: 110px; margin-top: 2px; }

/* ===== STUB PANEL ===== */
.stub-panel { padding: 40px 0; text-align: center; color: var(--text-secondary); }
.stub-panel h2 { color: var(--text-primary); margin-bottom: 8px; }

/* ===== EMPTY STATE ===== */
.empty-state { padding: 60px 20px; text-align: center; color: var(--text-secondary); }
.empty-state p { margin-bottom: 20px; }

/* ===== DIALOG ===== */
.dialogCreateStall {
    display: block;
    z-index: 400;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0,0,0,0.75);
}
.dialog-inner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 440px;
    margin: 80px auto;
}
.dialog-inner h2 { margin-bottom: 20px; }
.dialog-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ===== HIDDEN ===== */
.hidden { display: none; visibility: hidden; }

/* ===== DESKTOP ENHANCEMENTS ===== */
@media (min-width: 900px) {
    main { padding: 28px 32px; }

    .dashboard-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 24px;
    }

    .sidebar {
        background: var(--bg-surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 16px;
        height: fit-content;
        position: sticky;
        top: 72px;
    }
}

/* ===== CONDITIONS BAR ===== */
#conditions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: visible;
    margin-bottom: 20px;
    width: 100%;
    min-width: 0;
}
.conditions-bar-scroll {
    display: flex;
    flex: 1;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.conditions-bar-scroll::-webkit-scrollbar { display: none; }

@media (min-width: 769px) {
    #conditions-bar {
        position: sticky;
        top: 52px;
        z-index: 90;
        background: var(--bg-base);
        padding-top: 10px;
        padding-bottom: 10px;
        margin-top: -10px;
    }
    .conditions-bar-scroll {
        padding-bottom: 0;
    }
}

.forecast-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    flex-shrink: 0;
    position: relative;
    min-width: 120px;
}

.forecast-card--locked {
    border-style: dashed;
    overflow: hidden;
}

.forecast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.forecast-card--locked .forecast-content {
    opacity: 0;
    pointer-events: none;
    user-select: none;
}

.forecast-lock {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: rgba(15, 15, 26, 0.65);
}
.forecast-lock-icon { font-size: 1.1rem; line-height: 1; }
.forecast-lock-label { font-size: 0.68rem; font-weight: 700; color: var(--accent); letter-spacing: 0.06em; }
.conditions-bar-tip { display: flex; align-items: center; padding: 0 4px; flex-shrink: 0; }

.weather-clock-wrap {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 34px;
    height: 34px;
}
.weather-clock {
    width: 34px;
    height: 34px;
}
.weather-clock-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}
.weather-clock-arc {
    fill: none;
    stroke: #4caf50;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s linear, stroke 0.4s;
}
.weather-clock-wrap.weather-clock--amber .weather-clock-arc { stroke: #ff9800; }
.weather-clock-wrap.weather-clock--red   .weather-clock-arc { stroke: #f44336; }
.weather-clock-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-secondary);
    pointer-events: none;
    line-height: 1;
}

.weather-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.forecast-info { display: flex; flex-direction: column; gap: 2px; }
.forecast-label { font-size: 0.68rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.forecast-weather { font-size: 0.83rem; font-weight: 500; }
.condition-badges { display: flex; align-items: center; gap: 6px; margin-top: 2px; }

.condition-effect { font-size: 0.75rem; font-weight: 700; }
.condition-effect--up   { color: var(--success); }
.condition-effect--down { color: var(--danger); }

/* Traffic light demand indicator */
.traffic-light {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}
.traffic-light__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s, box-shadow 0.3s;
}
.traffic-light--low    .traffic-light__dot--red    { background: #64b4ff; box-shadow: 0 0 6px #64b4ffaa; }
.traffic-light--medium .traffic-light__dot--amber  { background: var(--accent); box-shadow: 0 0 6px var(--accent)aa; }
.traffic-light--high   .traffic-light__dot--green  { background: var(--success); box-shadow: 0 0 6px var(--success)aa; }

/* ===== ADMIN PANEL ===== */
.admin-page { width: 100%; }
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.admin-header h1 { font-size: 1.4rem; color: var(--danger); }

.admin-panel { width: 100%; }

.admin-sticky-top {
    background: var(--bg-base);
    margin: -20px -16px 20px;
    padding: 20px 16px 0;
}

@media (min-width: 769px) {
    .admin-sticky-top {
        position: sticky;
        top: 52px;
        z-index: 50;
    }
    #products-table-wrap .admin-table-wrap {
        max-height: calc(100vh - 320px);
        overflow-y: auto;
    }
    #products-table-wrap thead th {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--bg-card);
    }
}

.sub-tab-bar {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.sub-tab-bar button {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 7px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.sub-tab-bar button:hover { color: var(--text-primary); }
.sub-tab-bar button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.sub-tab-panel { min-height: 200px; }

.admin-section-header { margin-bottom: 16px; }
.admin-section-header h2 { font-size: 1.1rem; margin-bottom: 4px; }

/* ── Admin weather control ─────────────────────────────────────────────── */
.admin-weather-control {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    background: var(--surface);
}
.admin-weather-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.admin-weather-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.admin-weather-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
    font-size: 0.78rem;
    transition: border-color 0.15s, background 0.15s;
    min-width: 72px;
}
.admin-weather-btn:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}
.admin-weather-btn--active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--bg));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.admin-weather-icon {
    width: 32px;
    height: 32px;
}
.admin-weather-name {
    font-weight: 600;
    font-size: 0.75rem;
}
.admin-weather-mod {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ===== SCRATCH CARD ===== */
.pro-trial-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-card));
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.pro-trial-banner--urgent {
    background: color-mix(in srgb, #e84040 12%, var(--bg-card));
    border-color: color-mix(in srgb, #e84040 40%, transparent);
}
.pro-trial-banner-text { flex: 1; color: var(--text-secondary); }
.pro-trial-banner-text strong { color: var(--text-primary); }
.pro-trial-link { color: var(--accent); text-decoration: none; margin-left: 8px; white-space: nowrap; }
.pro-trial-link:hover { text-decoration: underline; }
.pro-trial-dismiss { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1rem; padding: 2px 4px; line-height: 1; }
.pro-trial-dismiss:hover { color: var(--text-primary); }

.stall-sold-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    color: var(--text-primary);
    max-width: 360px;
    width: 95vw;
}
.stall-sold-dialog::backdrop { background: rgba(0,0,0,0.75); }
.stall-sold-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 24px; text-align: center; }
.stall-sold-icon { font-size: 2.5rem; line-height: 1; }
.stall-sold-title { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.stall-sold-body { margin: 0; font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; }
.stall-sold-body strong { color: var(--text-primary); }

.stall-arrival-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    max-width: 380px;
    width: 95vw;
}
.stall-arrival-dialog::backdrop { background: rgba(0,0,0,0.75); }
.stall-arrival-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 24px; text-align: center; }
.stall-arrival-icon { font-size: 2.5rem; line-height: 1; }
.stall-arrival-title { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.stall-arrival-body { margin: 0; font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; }
.stall-arrival-body strong { color: var(--text-primary); }
.stall-arrival-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }

.scratch-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    color: var(--text-primary);
    max-width: 380px;
    width: 95vw;
    overflow: hidden;
}
.scratch-dialog::backdrop { background: rgba(0,0,0,0.75); }
.scratch-dialog-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px 20px; }
.scratch-header { text-align: center; }
.scratch-title { display: block; font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.scratch-subtitle { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.scratch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}
.scratch-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}
.scratch-cell:hover:not(.scratch-cell--revealed) { border-color: var(--accent); }
.scratch-cell--winner { border-color: gold; box-shadow: 0 0 10px rgba(255,215,0,0.5); animation: scratch-pulse 0.6s ease; }
@keyframes scratch-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.scratch-blob {
    width: 80%;
    height: 80%;
    color: var(--accent);
    opacity: 0.7;
    transition: opacity 0.15s;
}
.scratch-product-icon { width: 72%; height: 72%; object-fit: contain; }
.scratch-result { text-align: center; font-size: 1rem; font-weight: 600; color: var(--accent); }
.scratch-result-text { margin: 0; }

/* ===== BONUS SPIN WHEEL ===== */
.bonus-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    color: var(--text-primary);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
}
.bonus-dialog::backdrop { background: rgba(0,0,0,0.6); }
.bonus-dialog-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 28px 24px; }
.bonus-header { text-align: center; position: relative; width: 100%; }
.bonus-dismiss { position: absolute; top: -4px; right: -4px; background: none; border: none; color: var(--text-secondary); font-size: 1rem; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.bonus-dismiss:hover { color: var(--text-primary); background: var(--bg-card); }
.bonus-title { display: block; font-size: 1.2rem; font-weight: 700; }
.bonus-subtitle { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }
.bonus-wheel-wrap {
    position: relative;
    width: 300px;
    height: 300px;
    margin-top: 12px;
    user-select: none;
}
.bonus-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    color: var(--text-primary);
    z-index: 3;
    line-height: 1;
}
.bonus-wheel {
    display: block;
    width: 300px;
    height: 300px;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.4));
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.bonus-wheel-svg-cap {
    fill: var(--bg-card);
    stroke: var(--border);
    stroke-width: 2.5;
}
.bonus-current-label { min-height: 1.4em; text-align: center; font-size: 1rem; font-weight: 600; color: var(--accent); margin: 8px 0 4px; }
.bonus-actions { width: 100%; text-align: center; padding-top: 12px; }
.bonus-result { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bonus-result-icon { font-size: 2rem; }
.bonus-result-text { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

/* ===== PRIZE SPIN WHEEL (weekly winners) ===== */
.prize-dialog { border-color: #c9a84c; box-shadow: 0 0 24px rgba(201,168,76,0.3); }
.prize-spins-counter { font-size: 0.9rem; font-weight: 600; color: #c9a84c; background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.3); border-radius: var(--radius); padding: 4px 12px; }
.prize-results { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 8px; max-height: 160px; overflow-y: auto; padding-right: 4px; }
.prize-result-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.prize-result-row .bonus-result-icon { font-size: 1.1rem; }

.btn-danger { background: var(--danger, #c0392b); color: #fff; border: none; border-radius: var(--radius); padding: 8px 18px; font-size: 0.9rem; cursor: pointer; }
.btn-danger:hover { background: #a93226; }

.danger-zone { border: 1px solid var(--danger, #c0392b); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; }
.danger-zone-header { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--danger, #c0392b); margin-bottom: 12px; }
.danger-zone-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.danger-zone-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.danger-zone-desc { font-size: 0.8rem; color: var(--text-secondary); }
.danger-confirm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.danger-confirm-msg { font-size: 0.85rem; color: var(--danger, #c0392b); }

.admin-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge--warn    { background: rgba(232,160,32,0.15);  color: var(--accent); }
.badge--ok      { background: rgba(76,175,125,0.15);  color: var(--success); }
.badge--danger  { background: rgba(224,85,85,0.15);   color: var(--danger); }
.share-flag-reviewed td { opacity: 0.5; }
.linked-flag-confirmed td { background: rgba(224,85,85,0.05); }

.modifiers-matrix td, .modifiers-matrix th { white-space: nowrap; }
.modifier-cell { padding: 4px 6px; }
.modifier-cell-inner { display: flex; align-items: center; gap: 4px; }
.modifier-cell--missing { background: rgba(192, 57, 43, 0.12); }
.modifier-input--missing::placeholder { color: var(--danger, #c0392b); font-weight: 700; }
.modifier-input::-webkit-outer-spin-button,
.modifier-input::-webkit-inner-spin-button,
.admin-no-spin::-webkit-outer-spin-button,
.admin-no-spin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.modifier-input, .admin-no-spin { -moz-appearance: textfield; }
.settings-groups {
    columns: 2;
    column-gap: 14px;
}

@media (max-width: 700px) {
    .settings-groups { columns: 1; }
}

.settings-group {
    break-inside: avoid;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 14px;
}

.settings-group-title {
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    background: rgba(232,160,32,0.07);
    border-bottom: 1px solid var(--border);
}
.settings-group-desc {
    padding: 8px 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}

.settings-group table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.settings-group td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.settings-group tr:last-child td { border-bottom: none; }
.setting-key-cell { width: 55%; }
.setting-key { font-family: monospace; font-size: 0.82rem; color: var(--text-secondary); }
.setting-time { font-size: 0.72rem; white-space: nowrap; }

.setting-key {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    padding: 1px 5px;
    border-radius: 3px;
}

.action-row { display: flex; gap: 6px; flex-wrap: wrap; }

.player-actions { position: relative; display: inline-block; }
.player-actions > summary { list-style: none; cursor: pointer; }
.player-actions > summary::-webkit-details-marker { display: none; }
.player-actions-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 200;
    background: var(--bg-card, #1e1e1e);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.player-actions-menu .btn-sm { width: 100%; text-align: left; }
.player-actions-menu form { display: flex; gap: 4px; align-items: center; }
.player-actions-menu .notify-form { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin-top: 4px; white-space: normal; }
.admin-add-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.admin-add-form input { flex: 1; min-width: 130px; }

.badge-flag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}
.badge-admin { background: rgba(224,85,85,0.2); color: var(--danger); }
.badge-mod  { background: rgba(100,160,255,0.18); color: #64a0ff; }
.badge-inactive { background: rgba(255,255,255,0.06); color: var(--text-secondary); font-size: 0.72rem; padding: 1px 5px; border-radius: 4px; }

/* ===== IMPERSONATION ===== */
.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(224,140,0,0.18);
    border-bottom: 1px solid rgba(224,140,0,0.45);
    color: #f0b030;
    font-size: 0.85rem;
    padding: 6px 1rem;
}
.btn-admin-view {
    background: rgba(224,140,0,0.2);
    color: #f0b030;
    border: 1px solid rgba(224,140,0,0.4);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.78rem;
    cursor: pointer;
}
.btn-admin-view:hover {
    background: rgba(224,140,0,0.35);
}

.phase-badge { font-size: 0.78rem; padding: 2px 7px; border-radius: 4px; font-weight: 600; }
.phase-low    { background: rgba(100,180,255,0.15); color: #64b4ff; }
.phase-medium { background: rgba(232,160,32,0.15);  color: var(--accent); }
.phase-high   { background: rgba(76,175,125,0.15);  color: var(--success); }

/* ===== SAFE AREA / PWA ===== */
.topnav { padding-top: env(safe-area-inset-top); }

/* ===== OPEN/CLOSE TOGGLE ===== */
.stall-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    color: inherit;
}
.stall-toggle--pending { cursor: default; }
.stall-toggle--disabled { cursor: not-allowed; opacity: 0.45; }

.toggle-track {
    width: 46px;
    height: 24px;
    padding: 0;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.25s;
}
.toggle-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    transition: left 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.stall-toggle--on .toggle-track  { background: var(--success); }
.stall-toggle--on .toggle-thumb  { left: 25px; }

.stall-toggle--off .toggle-track { background: rgba(255,255,255,0.14); }
.stall-toggle--off .toggle-thumb { left: 3px; }

.stall-toggle--pending .toggle-track { background: rgba(232,160,32,0.35); }
.stall-toggle--pending .toggle-thumb {
    left: 14px;
    animation: thumb-pulse 1.1s ease-in-out infinite;
}
@keyframes thumb-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.toggle-label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.stall-toggle--on  .toggle-label { color: var(--success); }
.stall-toggle--off .toggle-label { color: var(--text-secondary); }
.stall-toggle--pending .toggle-label {
    color: var(--accent);
    font-weight: 400;
    font-size: 0.78rem;
}

/* ===== TRANSIT / MOVE-LOCK ===== */
.transit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(232,160,32,0.10);
    border: 1px solid rgba(232,160,32,0.25);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 10px;
}
.transit-label { font-weight: 600; }
.transit-eta   { color: var(--text-secondary); font-size: 0.82rem; }

.stall-move-section {
    padding: 8px 0 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 8px;
}
.move-status {
    display: block;
    font-size: 0.82rem;
    padding: 4px 0;
    color: var(--text-secondary);
}
.move-status--transit { color: var(--accent); }
.move-status--locked  { color: var(--text-secondary); }
.move-status--open    { color: var(--text-secondary); font-style: italic; }

.move-panel { margin-top: 4px; }
.move-panel summary { cursor: pointer; display: inline-block; }

.store-options-panel { margin-top: 4px; }
.store-options-panel > summary { cursor: pointer; display: inline-block; }
.store-options-body {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 8px;
    margin-top: 6px;
}
.store-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.store-option-row:last-child { border-bottom: none; }
.store-option-label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--accent);
}

.store-options-panel > summary::after {
    content: ' ▾';
    font-size: 0.75rem;
}
.store-options-panel[open] > summary::after {
    content: ' ▴';
    font-size: 0.75rem;
}
.move-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 0 4px;
}
.move-form select {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ===== MARKET TREND ===== */
.trend-up   { color: var(--danger);  font-weight: 600; font-size: 0.85rem; }
.trend-down { color: var(--success); font-weight: 600; font-size: 0.85rem; }
.trend-flat { color: var(--text-secondary); font-size: 0.85rem; }

/* ===== CHAT PANEL ===== */

.chat-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    color: var(--text-primary);
    line-height: 1;
    margin-right: 0.25rem;
}

@keyframes chat-location-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.15); }
}
.chat-btn--has-messages {
    animation: chat-location-pulse 2.5s ease-in-out infinite;
}
.help-search-btn { text-decoration: none; }

/* ── Help page layout ─────────────────────────────────────────────────────── */
.help-layout { display: grid; grid-template-columns: 3fr 1fr; gap: 24px; align-items: start; }
.help-layout__main { min-width: 0; }
.help-layout__sidebar { position: sticky; top: 16px; }

/* ── Suggestion box ───────────────────────────────────────────────────────── */
.suggestion-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.suggestion-box__title { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }
.suggestion-box__hint { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 12px; }
.suggestion-box__select { width: 100%; padding: 7px 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--input-bg); color: var(--text); font-size: 0.85rem; margin-bottom: 8px; }
.suggestion-box__textarea { width: 100%; padding: 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--input-bg); color: var(--text); font-size: 0.85rem; resize: vertical; box-sizing: border-box; margin-bottom: 6px; }
.suggestion-box__footer { display: flex; align-items: center; justify-content: space-between; }
.suggestion-box__count { font-size: 0.75rem; color: var(--text-muted); }
.suggestion-box__count--warn { color: #e05c5c; }
.suggestion-box__thanks { font-size: 0.9rem; color: var(--success, #4caf50); padding: 8px 0; }
.suggestion-box__error { font-size: 0.8rem; color: #e05c5c; margin: 6px 0 0; }

/* ── Admin suggestions ────────────────────────────────────────────────────── */
.suggestion-row--new td { background: rgba(99, 179, 237, 0.05); }
.suggestion-row--done td { opacity: 0.55; }
.suggestion-row--declined td { opacity: 0.45; }
.suggestion-username { white-space: nowrap; }
.suggestion-body { font-size: 0.85rem; max-width: 420px; word-break: break-word; }
.suggestion-category { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; background: var(--border); }
.suggestion-category--bug { background: rgba(224,92,92,0.18); color: #e05c5c; }
.suggestion-category--ui { background: rgba(99,179,237,0.18); color: #63b3ed; }
.suggestion-category--feature { background: rgba(104,211,145,0.18); color: #68d391; }
.suggestion-status-select { padding: 4px 6px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--input-bg); color: var(--text); font-size: 0.8rem; }

@media (max-width: 640px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-layout__sidebar { position: static; }
}

.admin-help-queries-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.admin-help-queries-count { font-size: 0.85rem; color: var(--text-muted); }
.help-query-text { font-size: 0.9rem; max-width: 340px; word-break: break-word; }
.help-query-results { text-align: center; }
.help-query-results--zero { color: #e05c5c; font-weight: 600; }
.help-query-row--no-results td { background: rgba(224, 92, 92, 0.06); }

.chat-news-indicator {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 0.65rem;
    line-height: 1;
}
.chat-news-indicator--active {
    filter: drop-shadow(0 0 3px var(--accent));
}

.chat-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    font-size: 0.6rem;
    min-width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.chat-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 399;
}
@media (max-width: 640px) {
    .chat-backdrop { display: block; }
}

.chat-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100dvh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    transition: right 0.25s ease;
    z-index: 400;
    display: flex;
    flex-direction: column;
}

.chat-panel--open {
    right: 0;
}

@media (max-width: 400px) {
    .chat-panel { width: 100vw; right: -100vw; }
}

.chat-panel-header {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
    flex-shrink: 0;
}

.chat-tabs {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.chat-tab {
    background: none;
    border: none;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.chat-tab--active {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
}

.chat-close {
    background: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #fff;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.chat-close:hover { background: var(--text-primary); }

.chat-tab-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
    min-height: 0;
}

/* ── Messages ── */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.chat-msg {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 0.45rem 0.65rem;
    max-width: 92%;
}

.chat-msg--mine {
    background: rgba(232, 160, 32, 0.12);
    align-self: flex-end;
}

.chat-msg--announcement {
    background: rgba(232, 160, 32, 0.08);
    border-left: 3px solid var(--accent);
    max-width: 100%;
}

.chat-from--announcement {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.72rem;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.chat-from {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.weekly-medal {
    font-size: 1.5rem;
    line-height: 1;
}

.chat-content {
    font-size: 0.875rem;
    word-break: break-word;
    line-height: 1.4;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.2rem;
}

.chat-time {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

/* ── Reactions ── */
.react-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.2rem 0.55rem;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1.4;
}

.react-btn:hover { border-color: var(--accent); color: var(--accent); }
.react-btn.reacted { background: rgba(232,160,32,0.15); border-color: var(--accent); color: var(--accent); }

/* ── Favourite buttons ── */
.fav-add-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 17px;
    height: 17px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fav-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.fav-star { color: var(--accent); font-size: 0.8rem; }

/* ── Friends list ── */
.friends-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
}

.friend-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.friend-chat-btn {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1.4;
}

.friend-chat-btn:hover { filter: brightness(1.15); }

.unread-badge {
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    font-size: 0.6rem;
    min-width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.fav-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    line-height: 1;
}

.fav-remove-btn:hover { color: var(--danger); }

.friend-waiting { font-size: 0.78rem; color: var(--text-secondary); }

.admirers-section { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.admirers-heading { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 6px; }
.admirer-name { font-size: 0.85rem; color: var(--text-secondary); flex: 1; }
.fav-add-btn { background: none; border: 1px solid var(--border); cursor: pointer; color: var(--accent); font-size: 0.85rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 3px; line-height: 1; }
.fav-add-btn:hover { background: var(--accent); color: var(--bg-card); }

.my-walls-section { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.my-wall-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 5px 6px;
    border-radius: 5px;
    text-decoration: none;
    margin-bottom: 2px;
}
.my-wall-item:hover { background: var(--bg-surface); }
.my-wall-name {
    font-size: 0.88rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}
.my-wall-loc { font-size: 0.75rem; color: var(--text-secondary); }

/* ── DM ── */
.dm-header {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0 0.4rem;
    border-top: 1px solid var(--border);
    margin-top: 0.4rem;
}

.dm-friend-name { color: var(--text-primary); }

.dm-messages {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 180px;
    overflow-y: auto;
}

/* ── Input row ── */
.chat-input-row {
    display: flex;
    gap: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    margin-top: auto;
}

.chat-input-row input {
    flex: 1;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 0.6rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font);
}

.chat-input-row input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ── Popularity footer ── */
.chat-panel-footer {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-surface);
}

#chat-popularity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pop-score { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.pop-boost { font-size: 0.75rem; color: var(--accent); margin-left: auto; }

/* ── Misc ── */
.chat-empty, .chat-hint, .chat-loading {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem 0.5rem;
}

.friends-hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.friends-over-limit-banner {
    font-size: 0.8rem;
    color: var(--text-primary);
    background: rgba(224, 160, 32, 0.12);
    border: 1px solid rgba(224, 160, 32, 0.35);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.friends-over-limit-banner a { color: var(--accent); }

/* ===== LOCATION VIEW ===== */

.location-strip {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.75rem 1rem 0;
    scrollbar-width: none;
}

.location-strip::-webkit-scrollbar { display: none; }

.location-select-mobile { display: none; }

@media (max-width: 640px) {
    .location-strip { display: none; }
    .location-select-mobile {
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
        margin-left: 10px;
        margin-right: 10px;
        width: calc(100% - 20px);
    }
}

.location-strip-btn {
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.location-strip-btn.active,
.location-strip-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

/* ── Location hero ── */
.location-hero {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-top: 0.75rem;
}

@media (max-width: 600px) {
    .location-hero { height: 200px; }
}

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

.location-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 55%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
}

.location-hero-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
}

.location-hero-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.location-hero-meta .btn-primary { margin-left: auto; }

/* ── Weather overlay animations ──────────────────────────────────────────── */
.weather-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.location-hero-overlay { z-index: 2; }

/* ===== MARKET VOLUME EVENT BAR ===== */
.volume-event-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}
.volume-event-bar__label {
    white-space: nowrap;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.volume-event-bar__track {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}
.volume-event-bar__fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
    transition: width 0.4s ease;
    max-width: 100%;
}
.volume-event-bar__fill--done {
    background: var(--success);
}
.volume-event-bar__text {
    white-space: nowrap;
    color: var(--text-secondary);
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}
.volume-event-bar__done {
    color: var(--success);
    font-weight: 600;
}

/* Sun: warm golden radial glow pulsing gently */
.location-hero[data-weather="sun"] .weather-overlay {
    background: radial-gradient(ellipse 100% 75% at 72% 8%, rgba(255,220,60,0.72) 0%, rgba(255,180,20,0.25) 45%, transparent 70%);
    animation: weather-sun-pulse 3s ease-in-out infinite;
}
.location-hero[data-weather="sun"] .weather-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        5deg,
        transparent 0px, transparent 14px,
        rgba(255,210,80,0.32) 14px, rgba(255,210,80,0.32) 15px,
        transparent 15px, transparent 30px,
        rgba(255,210,80,0.16) 30px, rgba(255,210,80,0.16) 31px
    );
    background-size: 100px 100%;
    animation: weather-sun-pulse 3s ease-in-out infinite, weather-wind-streak 1.4s linear infinite;
}
@keyframes weather-sun-pulse {
    0%, 100% { opacity: 0.8; }
    50%       { opacity: 1.0; }
}

/* Cloud: grey-white mist drifting slowly across */
.location-hero[data-weather="cloud"] .weather-overlay {
    background-color: rgba(20,25,40,0.18);
    animation: weather-cloud-shadow 14s ease-in-out infinite;
}
/* Sun breaking through — fades in when shadow lifts, disappears as cloud returns */
.location-hero[data-weather="cloud"] .weather-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 90% 65% at 70% 10%, rgba(255,220,60,0.65) 0%, rgba(255,180,20,0.22) 45%, transparent 70%);
    opacity: 0;
    animation: weather-cloud-sun 14s ease-in-out infinite;
}

@keyframes weather-cloud-shadow {
    0%   { background-color: rgba(20,25,40,0.18); }
    22%  { background-color: rgba(20,25,40,0.42); }  /* cloud thickens */
    38%  { background-color: rgba(20,25,40,0.42); }
    52%  { background-color: rgba(20,25,40,0.04); }  /* sun breaks through */
    65%  { background-color: rgba(20,25,40,0.04); }
    80%  { background-color: rgba(20,25,40,0.34); }  /* clouds roll back */
    100% { background-color: rgba(20,25,40,0.18); }
}
@keyframes weather-cloud-sun {
    0%   { opacity: 0; }
    42%  { opacity: 0; }   /* hidden while cloud is thickest */
    54%  { opacity: 1; }   /* breaks through */
    64%  { opacity: 0.9; }
    76%  { opacity: 0; }   /* clouds return */
    100% { opacity: 0; }
}

/* Rain: individual diagonal drops — SVG tile per depth layer, like snow but elongated */
.location-hero[data-weather="rain"] .weather-overlay {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='28'%3E%3Cline x1='11' y1='2' x2='6' y2='14' stroke='%23aec2e0' stroke-width='1.5' stroke-linecap='round' stroke-opacity='.72'/%3E%3C/svg%3E");
    background-size: 16px 28px;
    animation: weather-rain-a 0.28s linear infinite;
}
.location-hero[data-weather="rain"] .weather-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='36'%3E%3Cline x1='15' y1='9' x2='10' y2='21' stroke='%23aec2e0' stroke-width='1' stroke-linecap='round' stroke-opacity='.44'/%3E%3C/svg%3E");
    background-size: 21px 36px;
    animation: weather-rain-b 0.45s linear infinite;
}
.location-hero[data-weather="rain"] .weather-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='19'%3E%3Cline x1='9' y1='5' x2='6' y2='12' stroke='%23aec2e0' stroke-width='1' stroke-linecap='round' stroke-opacity='.28'/%3E%3C/svg%3E");
    background-size: 13px 19px;
    animation: weather-rain-c 0.35s linear infinite;
}
@keyframes weather-rain-a { from { background-position: 0 0; } to { background-position: 0 28px; } }
@keyframes weather-rain-b { from { background-position: 0 0; } to { background-position: 0 36px; } }
@keyframes weather-rain-c { from { background-position: 0 0; } to { background-position: 0 19px; } }

/* Showers: same approach, sparser tiles and lighter */
.location-hero[data-weather="showers"] .weather-overlay {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='42'%3E%3Cline x1='16' y1='10' x2='11' y2='22' stroke='%23aec2e0' stroke-width='1.5' stroke-linecap='round' stroke-opacity='.48'/%3E%3C/svg%3E");
    background-size: 24px 42px;
    animation: weather-showers-a 0.44s linear infinite, weather-showers-burst 7s ease-in-out infinite;
}
.location-hero[data-weather="showers"] .weather-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='54'%3E%3Cline x1='22' y1='18' x2='16' y2='32' stroke='%23aec2e0' stroke-width='1' stroke-linecap='round' stroke-opacity='.26'/%3E%3C/svg%3E");
    background-size: 32px 54px;
    animation: weather-showers-b 0.64s linear infinite;
}
@keyframes weather-showers-a { from { background-position: 0 0; } to { background-position: 0 42px; } }
@keyframes weather-showers-b { from { background-position: 0 0; } to { background-position: 0 54px; } }
@keyframes weather-showers-burst {
    0%   { opacity: 1; }   /* raining */
    52%  { opacity: 1; }
    60%  { opacity: 0; }   /* fade out */
    82%  { opacity: 0; }   /* dry gap */
    90%  { opacity: 1; }   /* fade back in */
    100% { opacity: 1; }
}

/* Storm: dense rain + lightning flash */
/* Storm: dark sky + two rain layers at different angles and speeds */
.location-hero[data-weather="storm"] .weather-overlay {
    background-color: rgba(15,20,40,0.62);
    /* Heavy angled rain ~30° lean — fast */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='30'%3E%3Cline x1='17' y1='1' x2='11' y2='12' stroke='%2378a0d8' stroke-width='1.5' stroke-linecap='round' stroke-opacity='.72'/%3E%3Cline x1='5' y1='17' x2='1' y2='26' stroke='%2378a0d8' stroke-width='1' stroke-linecap='round' stroke-opacity='.48'/%3E%3C/svg%3E");
    background-size: 22px 30px;
    animation: weather-storm-a 0.17s linear infinite;
}
/* Second layer — shallower angle ~16°, different speed, offset start */
.location-hero[data-weather="storm"] .weather-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='38'%3E%3Cline x1='22' y1='3' x2='19' y2='13' stroke='%2378a0d8' stroke-width='1.5' stroke-linecap='round' stroke-opacity='.58'/%3E%3Cline x1='8' y1='20' x2='6' y2='30' stroke='%2378a0d8' stroke-width='1' stroke-linecap='round' stroke-opacity='.38'/%3E%3Cline x1='27' y1='12' x2='25' y2='22' stroke='%2378a0d8' stroke-width='1' stroke-linecap='round' stroke-opacity='.44'/%3E%3C/svg%3E");
    background-size: 30px 38px;
    background-position: 11px 19px;
    animation: weather-storm-b 0.27s linear infinite;
}
@keyframes weather-storm-a { from { background-position: 0 0; }     to { background-position: 0 30px; } }
@keyframes weather-storm-b { from { background-position: 11px 19px; } to { background-position: 11px 57px; } }
.location-hero[data-weather="storm"] .weather-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(235,242,255,0);
    animation: weather-lightning 5.5s ease-in-out infinite;
}
@keyframes weather-lightning {
    0%,  86%, 89%, 92%, 96%, 100% { background: rgba(235,242,255,0); }
    87%, 90.5%, 93%               { background: rgba(235,242,255,0.28); }
}

/* Wind: sparse streaks + occasional leaves blowing across */
.location-hero[data-weather="wind"] .weather-overlay {
    background-image: repeating-linear-gradient(
        5deg,
        transparent 0px, transparent 28px,
        rgba(195,212,240,0.18) 28px, rgba(195,212,240,0.18) 29px
    );
    background-size: 200px 100%;
    animation: weather-wind-streak 0.9s linear infinite;
}
/* Green leaf — large tile keeps them sparse, offset start staggers the grid */
.location-hero[data-weather="wind"] .weather-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='95'%3E%3Cg transform='translate(78,38) rotate(-25,7,5)'%3E%3Cpath d='M7,0 C13,0 14,5 7,10 C0,5 1,0 7,0Z' fill='%2378b040' fill-opacity='.82'/%3E%3Cline x1='7' y1='0' x2='7' y2='10' stroke='%23559922' stroke-width='.7'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 190px 95px;
    background-position: 55px 20px;
    animation: weather-leaf-a 3.4s linear infinite;
}
/* Amber leaf — different tile size and offset so the two grids don't align */
.location-hero[data-weather="wind"] .weather-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='130'%3E%3Cg transform='translate(148,72) rotate(20,7,5)'%3E%3Cpath d='M7,0 C13,0 14,5 7,10 C0,5 1,0 7,0Z' fill='%23c07830' fill-opacity='.78'/%3E%3Cline x1='7' y1='0' x2='7' y2='10' stroke='%23994a10' stroke-width='.7'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 260px 130px;
    background-position: 110px 60px;
    animation: weather-leaf-b 5.1s linear infinite;
}
@keyframes weather-wind-streak {
    from { background-position: 0 0; }
    to   { background-position: 200px 0; }
}
@keyframes weather-leaf-a {
    from { background-position: 55px 20px; }
    to   { background-position: 245px 24px; }
}
@keyframes weather-leaf-b {
    from { background-position: 110px 60px; }
    to   { background-position: 370px 55px; }
}

/* Hail: steep, chunky streaks */
/* Hail: small ice-pellet circles, three staggered layers, very fast */
.location-hero[data-weather="hail"] .weather-overlay {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='22'%3E%3Ccircle cx='9' cy='3' r='2' fill='%23ddeeff' fill-opacity='.88'/%3E%3Ccircle cx='3' cy='14' r='1.5' fill='%23ddeeff' fill-opacity='.62'/%3E%3C/svg%3E");
    background-size: 15px 22px;
    animation: weather-hail-a 0.06s linear infinite, weather-hail-burst1 5s ease-in-out infinite;
}
.location-hero[data-weather="hail"] .weather-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='30'%3E%3Ccircle cx='15' cy='7' r='1.5' fill='%23ddeeff' fill-opacity='.72'/%3E%3Ccircle cx='4' cy='21' r='1' fill='%23ddeeff' fill-opacity='.50'/%3E%3C/svg%3E");
    background-size: 21px 30px;
    background-position: 6px 12px;
    animation: weather-hail-b 0.08s linear infinite, weather-hail-burst2 7s ease-in-out infinite;
    animation-delay: 0s, -2.1s;
}
.location-hero[data-weather="hail"] .weather-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='17'%3E%3Ccircle cx='7' cy='4' r='1.5' fill='%23ddeeff' fill-opacity='.55'/%3E%3C/svg%3E");
    background-size: 11px 17px;
    background-position: 4px 8px;
    animation: weather-hail-c 0.07s linear infinite, weather-hail-burst3 4s ease-in-out infinite;
    animation-delay: 0s, -1.3s;
}
@keyframes weather-hail-a { from { background-position: 0 0; }       to { background-position: 0 22px; } }
@keyframes weather-hail-b { from { background-position: 6px 12px; }  to { background-position: 6px 42px; } }
@keyframes weather-hail-c { from { background-position: 4px 8px; }   to { background-position: 4px 25px; } }
@keyframes weather-hail-burst1 {
    0%   { opacity: 0; }
    8%   { opacity: 1; }
    55%  { opacity: 1; }
    68%  { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes weather-hail-burst2 {
    0%   { opacity: 1; }
    30%  { opacity: 1; }
    42%  { opacity: 0; }
    70%  { opacity: 0; }
    82%  { opacity: 1; }
    100% { opacity: 1; }
}
@keyframes weather-hail-burst3 {
    0%   { opacity: 0; }
    15%  { opacity: 1; }
    45%  { opacity: 1; }
    60%  { opacity: 0; }
    100% { opacity: 0; }
}

/* Snow: white dots drifting down with slight sideways drift */
/* Light snow: what heavy snow used to do */
.location-hero[data-weather="light-snow"] .weather-overlay {
    background-image:
        radial-gradient(circle 2px at 18% 25%, rgba(255,255,255,0.85) 0%, transparent 100%),
        radial-gradient(circle 2px at 58% 65%, rgba(255,255,255,0.85) 0%, transparent 100%),
        radial-gradient(circle 1.5px at 80% 18%, rgba(255,255,255,0.75) 0%, transparent 100%),
        radial-gradient(circle 2px at 38% 55%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(circle 1.5px at 72% 40%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(circle 2px at 8% 75%, rgba(255,255,255,0.85) 0%, transparent 100%);
    background-size: 55px 55px;
    animation: weather-snow-fall 1.8s linear infinite;
}
/* Heavy snow: dense multi-layer flakes */
.location-hero[data-weather="heavy-snow"] .weather-overlay {
    background-image:
        radial-gradient(circle 2.5px at 10% 20%, rgba(255,255,255,0.95) 0%, transparent 100%),
        radial-gradient(circle 2px   at 30% 60%, rgba(255,255,255,0.90) 0%, transparent 100%),
        radial-gradient(circle 2.5px at 50% 15%, rgba(255,255,255,0.95) 0%, transparent 100%),
        radial-gradient(circle 2px   at 70% 50%, rgba(255,255,255,0.90) 0%, transparent 100%),
        radial-gradient(circle 2.5px at 88% 30%, rgba(255,255,255,0.95) 0%, transparent 100%),
        radial-gradient(circle 2px   at 20% 80%, rgba(255,255,255,0.90) 0%, transparent 100%),
        radial-gradient(circle 1.5px at 42% 40%, rgba(255,255,255,0.80) 0%, transparent 100%),
        radial-gradient(circle 2px   at 62% 75%, rgba(255,255,255,0.90) 0%, transparent 100%),
        radial-gradient(circle 1.5px at 78% 65%, rgba(255,255,255,0.80) 0%, transparent 100%),
        radial-gradient(circle 2.5px at 5%  55%, rgba(255,255,255,0.95) 0%, transparent 100%);
    background-size: 35px 35px;
    animation: weather-snow-fall 1.1s linear infinite;
}
@keyframes weather-snow-fall {
    from { background-position: 0 -60px; }
    to   { background-position: 12px 60px; }
}

.location-status-badge,
.location-phase-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.location-status-badge.status-open  { background: var(--success); color: #000; }
.location-status-badge.status-closed { background: rgba(255,255,255,0.2); color: #fff; }
.location-phase-badge--low    { background: rgba(100,180,255,0.25); color: #64b4ff; }
.location-phase-badge--medium { background: rgba(232,160,32,0.25);  color: var(--accent); }
.location-phase-badge--high   { background: rgba(76,175,125,0.25);  color: var(--success); }

/* ── Sections ── */
.location-section {
    padding: 0 1rem;
    margin-top: 1.25rem;
}

.location-section-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.2rem 0 0.5rem;
}

.section-heading {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin: 1rem 0 0.6rem;
}

/* ── Competitor cards ── */
.competitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.5rem;
}

.competitor-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: stretch;
    overflow: hidden;
}

.competitor-card-img-col {
    flex-shrink: 0;
    width: 90px;
    display: flex;
    flex-direction: column;
}

.competitor-card-img {
    width: 90px;
    flex: 1;
    object-fit: contain;
    background: var(--bg-card);
    display: block;
}

.competitor-fav {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 1rem;
    padding: 4px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}
button.competitor-fav {
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}
button.competitor-fav:hover { color: var(--accent); }
span.competitor-fav { color: var(--accent); }

.competitor-card-img--placeholder {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
}

.competitor-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.6rem;
}

.competitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.competitor-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.competitor-header-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.competitor-open-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    flex-shrink: 0;
}

.competitor-open-dot.open { background: var(--success); }

.competitor-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    display: inline-block;
}

.online-dot--online {
    background: var(--success);
    box-shadow: 0 0 4px var(--success);
}

/* ── Section heading row ── */
.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0 0.6rem;
}

@media (max-width: 480px) {
    .section-heading-row {
        flex-wrap: wrap;
    }
    .section-heading-row .recon-remaining-label {
        width: 100%;
    }
}

.section-heading-row .section-heading {
    margin: 0;
    padding: 0;
}

.recon-remaining-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    font-weight: 500;
}
.recon-remaining-count {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

/* ── Recon peek button ── */
.recon-peek-btn {
    background: none;
    border: none;
    padding: 3px 4px;
    cursor: pointer;
    color: var(--accent);
    opacity: 0.8;
    border-radius: 3px;
    display: flex;
    align-items: center;
    transition: opacity 0.15s, background 0.15s;
}

.recon-peek-btn:hover:not(:disabled) {
    opacity: 1;
    background: rgba(232, 160, 32, 0.12);
}

.recon-peek-btn--disabled,
.recon-peek-btn:disabled {
    color: var(--text-secondary);
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Recon peek popup ── */
.recon-peek-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 900;
}

.recon-peek-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 901;
    background: var(--bg-surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    min-width: 220px;
    max-width: 320px;
    width: calc(100vw - 2rem);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recon-peek-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.recon-peek-stallname {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recon-peek-timer {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(232,160,32,0.12);
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.recon-peek-products {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.recon-peek-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.recon-peek-product {
    font-size: 1rem;
    color: var(--text-primary);
}

.recon-peek-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.recon-peek-empty {
    font-size: 0.9rem;
    text-align: center;
    padding: 0.25rem 0;
}

.recon-peek-close {
    align-self: flex-end;
}

/* ── Toast notifications ── */
.fs-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
}

.fs-toast--show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.fs-toast--warning { border-color: var(--warning, #e8a020); color: var(--warning, #e8a020); }
.fs-toast--error   { border-color: var(--error,   #e05050); color: var(--error,   #e05050); }

/* ===== RECON PANEL ===== */

.recon-controls {
    padding: 0.75rem 1rem 0.5rem;
}

.recon-controls select {
    width: 100%;
}

.recon-empty {
    padding: 2rem 1rem;
    text-align: center;
}

.recon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem 1rem 1rem;
}

.recon-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.recon-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.recon-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recon-card-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.recon-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin-top: 0.1rem;
}

.recon-stat {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.recon-stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.recon-stat-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.recon-products {
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
    padding-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.recon-product-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.recon-product-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recon-product-price {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ── No stall CTA ── */
.no-stall-cta {
    padding: 2rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* ===== LEAGUE ===== */
.league-page { padding: 0 15px; }
.league-header { margin-bottom: 4px; }
.league-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.league-loading, .league-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 24px 0;
}
.league-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    align-items: flex-end;
}
.league-tab-group {
    display: flex;
    flex-direction: column;
}
.league-tab-group__label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    padding: 0 4px 5px;
}
.league-tab-group__tabs {
    display: flex;
    gap: 0;
}
.league-tab {
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.league-tab--active { color: var(--accent); border-bottom-color: var(--accent); }
.league-tab:hover:not(.league-tab--active) { color: var(--text-primary); }

/* ===== LEADERBOARD UNIFIED NAV ===== */
.lb-tabs {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    gap: 4px;
    margin-bottom: 12px;
}
.lb-tab {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.lb-tab:hover:not(.lb-tab--active) { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.lb-tab--active { background: var(--accent); color: #111; }

.lb-subtabs { margin-bottom: 16px; }
.lb-toggle-wrap, .lb-sub-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-toggle-wrap .league-subtitle, .lb-sub-wrap .league-subtitle { margin: 0; text-align: center; }

.lb-toggle {
    display: flex;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 4px;
    gap: 0;
}
.lb-toggle__btn {
    padding: 12px 36px;
    background: transparent;
    border: none;
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.lb-toggle__btn:hover:not(.lb-toggle__btn--active) { color: var(--text-primary); }
.lb-toggle__btn--active { background: var(--accent); color: #111; }

.lb-sub-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lb-sub-btn {
    padding: 9px 22px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
}
.lb-sub-btn:hover:not(.lb-sub-btn--active) { border-color: var(--accent); color: var(--text-primary); }
.lb-sub-btn--active { background: var(--accent); border-color: var(--accent); color: #111; }

@media (max-width: 480px) {
    .lb-tab { font-size: 0.85rem; padding: 10px 4px; }
    .lb-toggle__btn { padding: 11px 24px; font-size: 0.9rem; }
}

/* Podium */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 28px;
}
.podium-slot {
    flex: 1;
    max-width: 180px;
    text-align: center;
    border-radius: var(--radius);
    padding: 16px 10px 14px;
    background: var(--bg-card);
    border: 2px solid var(--border);
}
.podium-slot--gold   { border-color: #FFD700; padding-top: 24px; }
.podium-slot--silver { border-color: #C0C0C0; }
.podium-slot--bronze { border-color: #CD7F32; }
.podium-medal { font-size: 1.6rem; line-height: 1; margin-bottom: 4px; }
.podium-rank {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.podium-rank--gold   { color: #FFD700; }
.podium-rank--silver { color: #C0C0C0; }
.podium-rank--bronze { color: #CD7F32; }
.podium-stalls {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.podium-stall-type {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 3px;
}
.league-stalls {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 1px;
}
.podium-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    margin-bottom: 4px;
}
.podium-worth {
    font-size: 1rem;
    font-family: monospace;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.podium-trend {
    font-size: 0.7rem;
    font-family: monospace;
    min-height: 1.2em;
}
.weekly-prize-label {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 700;
    margin-top: 6px;
    letter-spacing: 0.05em;
}
.share-winner-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(var(--accent-rgb, 212,175,55), 0.15), rgba(var(--accent-rgb, 212,175,55), 0.05));
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.share-winner-text {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}
.btn-share-win {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.03em;
}
.btn-share-win:hover {
    opacity: 0.85;
}
.prev-winners {
    margin-top: 24px;
}
.prev-winners summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 0;
    user-select: none;
}
.prev-winners summary:hover {
    color: var(--text-main);
}
.prev-winners-table {
    margin-top: 8px;
    font-size: 0.85rem;
}
.prev-winner-new-period td {
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px;
}
.prev-winner-period {
    white-space: nowrap;
    min-width: 90px;
    font-size: 0.78rem;
}
.prev-winner-medal {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}
@media (max-width: 520px) {
    .podium { flex-direction: column; align-items: stretch; }
    .podium-slot { max-width: 100%; }
    .podium-slot--gold   { order: 1; }
    .podium-slot--silver { order: 2; }
    .podium-slot--bronze { order: 3; }
}

/* Deadline countdown banner */
.league-deadline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(232,160,32,0.1);
    border: 1px solid rgba(232,160,32,0.3);
    border-radius: var(--radius);
    padding: 6px 14px;
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 16px;
}

/* Medal row highlights */
.league-row--gold   { background: rgba(255,215,0,0.07); }
.league-row--silver { background: rgba(192,192,192,0.07); }
.league-row--bronze { background: rgba(205,127,50,0.07); }
.league-prize-cell  { font-size: 0.78rem; color: var(--accent); text-align: right; white-space: nowrap; font-weight: 600; }

/* League table */
.league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.league-table th {
    text-align: left;
    padding: 6px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.league-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.league-table tbody tr:last-child td { border-bottom: none; }
.league-row--me { background: rgba(232,160,32,0.07); }
.league-rank-cell { font-family: monospace; color: var(--text-secondary); width: 36px; }
.league-name-cell { font-weight: 600; color: var(--text-primary); }
.league-worth-cell { font-family: monospace; text-align: right; color: var(--text-primary); font-weight: 700; }
.league-trend-cell { font-family: monospace; font-size: 0.75rem; text-align: right; white-space: nowrap; color: var(--text-secondary); }
.ta-right { text-align: right; }

/* Trend colours */
.trend-up     { color: var(--success); }
.trend-down   { color: var(--danger); }
.trend-static { color: var(--text-secondary); }

/* "you" badge */
.league-you {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--accent);
    color: #0f0f1a;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== STALL IMAGE PICKER ===== */
.stall-location-img--default { opacity: 0.6; }

.stall-img-picker { margin-top: 8px; }
.stall-img-picker__btn {
    font-size: 0.72rem;
    padding: 3px 8px;
    width: 100%;
}
.stall-img-picker[open] .stall-img-picker__btn { opacity: 0.7; }
.stall-img-picker__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.stall-img-option {
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    cursor: pointer;
    transition: border-color 0.15s;
    aspect-ratio: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stall-img-option:hover { border-color: var(--accent); }
.stall-img-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.stall-name .stall-img-picker { position: relative; flex-shrink: 0; margin-top: 0; }
.stall-name .stall-img-picker__grid {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 10;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    width: 180px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* ===== TRADE BADGE ===== */
.trade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1;
    pointer-events: none;
}

/* ===== REPORT BUTTON ===== */
.report-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.92rem;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.45;
    transition: opacity 0.15s, color 0.15s;
    line-height: 1;
}
.report-btn:hover { opacity: 1; color: var(--danger); }

/* ===== THREADED REPLIES ===== */
.chat-thread { display: flex; flex-direction: column; gap: 0; }

.chat-replies {
    margin-left: 1rem;
    border-left: 2px solid var(--border);
    padding-left: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
    margin-bottom: 0.15rem;
}

.chat-msg--reply {
    font-size: 0.85em;
    padding: 0.3rem 0.5rem;
}

.reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.92rem;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
    line-height: 1;
}
.reply-btn:hover { opacity: 1; color: var(--accent); }

.chat-reply-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    background: rgba(232, 160, 32, 0.08);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.chat-reply-indicator-label { flex: 1; }
.chat-reply-cancel {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 4px;
    opacity: 0.6;
}
.chat-reply-cancel:hover { opacity: 1; color: var(--danger); }

/* ===== BAN BADGES ===== */
.badge-banned {
    background: rgba(224, 85, 85, 0.18);
    color: #e05555;
    border: 1px solid rgba(224, 85, 85, 0.4);
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.badge-warn {
    background: rgba(232, 160, 32, 0.15);
    color: var(--accent);
    border: 1px solid rgba(232, 160, 32, 0.35);
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===== DANGER BUTTON ===== */
.btn-danger {
    background: rgba(224, 85, 85, 0.15);
    color: #e05555;
    border: 1px solid rgba(224, 85, 85, 0.4);
    border-radius: var(--radius);
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.btn-danger:hover { background: rgba(224, 85, 85, 0.28); }

/* ===== MODERATION PANEL ===== */
.moderation-list { display: flex; flex-direction: column; gap: 1rem; }

.moderation-report {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.moderation-report__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.moderation-report__meta { font-size: 0.9rem; }
.moderation-report__actions { display: flex; gap: 0.5rem; }
.moderation-report__message { margin: 0.5rem 0; }

.moderation-quote {
    margin: 0.25rem 0 0;
    padding: 0.4rem 0.75rem;
    border-left: 3px solid rgba(224, 85, 85, 0.5);
    background: rgba(224, 85, 85, 0.06);
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.moderation-transcript { margin-top: 0.5rem; }
.moderation-transcript summary {
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    user-select: none;
}
.moderation-transcript__body {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 220px;
    overflow-y: auto;
}


/* ===== LANDING PAGE ===== */

.landing {
    --l-max: 1040px;
    width: 100%;
    overflow-x: hidden;
}

/* — Hero — */
.l-hero {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: var(--l-max);
    margin: 0 auto;
    padding: 3.5rem 1.25rem 2.5rem;
    background:
        radial-gradient(ellipse 70% 60% at 20% 50%, rgba(232,160,32,0.05) 0%, transparent 70%),
        radial-gradient(ellipse 50% 70% at 85% 20%, rgba(76,175,125,0.025) 0%, transparent 60%);
}

.l-hero__left { flex: 1 1 460px; }

.l-hero__eyebrow {
    font-size: 0.73rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.l-hero__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.08;
    font-weight: normal;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
    letter-spacing: -0.01em;
}

.l-hero__title em {
    font-style: italic;
    color: var(--accent);
}

.l-hero__sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 2rem;
    max-width: 440px;
}

.l-hero__actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 2.25rem;
}

.l-cta-btn {
    font-size: 1rem;
    padding: 0.8rem 2.2rem;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.02em;
    box-shadow: 0 0 28px rgba(232,160,32,0.28);
    transition: box-shadow 0.25s ease, transform 0.15s ease;
}

.l-cta-btn:hover {
    box-shadow: 0 0 44px rgba(232,160,32,0.5);
    transform: translateY(-2px);
}

.l-hero__note {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.l-hero__stats {
    display: flex;
    align-items: center;
}

.l-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-right: 1.5rem;
}

.l-stat__num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.l-stat__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-secondary);
}

.l-stat-sep {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin-right: 1.5rem;
    flex-shrink: 0;
}

/* — Mock stall card — */
.l-hero__right { flex: 0 0 300px; }

.l-mock-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(232,160,32,0.18);
    border-radius: 12px;
    padding: 1.25rem;
    overflow: hidden;
    box-shadow: 0 8px 48px rgba(0,0,0,0.45);
    animation: l-cardrise 0.8s cubic-bezier(0.22,1,0.36,1) 0.15s both;
}

@keyframes l-cardrise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.l-mock-glow {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(232,160,32,0.1) 0%, transparent 65%);
    pointer-events: none;
}

.l-mock-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.l-mock-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.l-mock-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--success);
    letter-spacing: 0.06em;
}

.l-mock-card__sub {
    font-size: 0.73rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.l-mock-kpis {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.l-mock-kpi {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.l-mock-kpi__label {
    font-size: 0.77rem;
    color: var(--text-secondary);
}

.l-mock-kpi__val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.l-mock-stock { margin-bottom: 1rem; }

.l-mock-stock__label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.l-mock-stock__bar {
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.l-mock-stock__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 3px;
    animation: l-stockgrow 1.1s ease 0.5s forwards;
}

@keyframes l-stockgrow {
    to { width: 73%; }
}

.l-mock-products {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.l-mock-product {
    display: flex;
    justify-content: space-between;
    font-size: 0.79rem;
}

.l-mock-product__name { color: var(--text-secondary); }

.l-mock-product__price {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* — Ticker — */
.l-ticker {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    padding: 0.6rem 0;
}

.l-ticker__track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: l-scroll 40s linear infinite;
}

@keyframes l-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.l-ticker__item {
    font-size: 0.76rem;
    color: var(--text-secondary);
    padding: 0 1.25rem;
}

.l-ticker__dot {
    color: var(--accent);
    opacity: 0.4;
    font-size: 0.76rem;
    padding: 0 0.1rem;
}

/* — Features — */
.l-features-section {
    max-width: var(--l-max);
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
}

.l-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: var(--border);
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.l-feature {
    background: var(--bg-card);
    padding: 1.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.l-feature:hover {
    border-left-color: var(--accent);
    background: var(--bg-surface);
}

.l-feature__tag {
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.55rem;
}

.l-feature__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.55rem;
}

.l-feature__body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* — How it works — */
.l-steps {
    max-width: var(--l-max);
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.l-steps__heading {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.85rem;
    font-weight: normal;
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 2.5rem;
}

.l-steps__row {
    display: grid;
    grid-template-columns: 1fr 48px 1fr 48px 1fr;
    align-items: center;
}

.l-step { align-self: start; }

.l-step__line {
    align-self: stretch;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2.2rem;
}

.l-step__line::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        var(--border) 0,
        var(--border) 5px,
        transparent 5px,
        transparent 10px
    );
}

.l-step__num {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.l-step__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.l-step__body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* — Closing CTA — */
.l-close {
    text-align: center;
    padding: 3rem 1.25rem 5rem;
    border-top: 1px solid var(--border);
}

.l-close__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.4rem;
    font-weight: normal;
    color: var(--text-primary);
    margin: 0 0 1.75rem;
}

.l-close__note {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.l-close__note a {
    color: var(--accent);
    text-decoration: none;
}

.l-close__note a:hover { text-decoration: underline; }

/* — Product icons on feature cards — */
.l-feature__icon {
    width: 36px;
    height: 36px;
    margin-bottom: 0.875rem;
    opacity: 0.85;
    display: block;
}

/* — Tiny icons in mock card product list — */
.l-mock-product__icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 5px;
    opacity: 0.7;
}

/* — "What will you sell?" products strip — */
.l-products {
    border-top: 1px solid var(--border);
    padding: 2rem 1.25rem 2.25rem;
    background: var(--bg-card);
}

.l-products__inner {
    max-width: var(--l-max);
    margin: 0 auto;
}

.l-products__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
    text-align: center;
}

.l-products__row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.l-product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.72;
    transition: opacity 0.2s ease, transform 0.2s ease;
    cursor: default;
}

.l-product-item:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.l-product-item__icon {
    width: 44px;
    height: 44px;
}

.l-product-item__name {
    font-size: 0.63rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    text-align: center;
}

/* — Stall image grid — */
.l-stalls {
    border-top: 1px solid var(--border);
    padding: 2.5rem 1.25rem;
}

.l-stalls__inner {
    max-width: var(--l-max);
    margin: 0 auto;
}

.l-stalls__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
    text-align: center;
}

.l-stalls__row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.l-stall-thumb {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.l-stall-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.l-stall-thumb:hover img { transform: scale(1.05); }

/* — Responsive — */
@media (max-width: 768px) {
    .l-hero {
        flex-direction: column;
        padding: 2.5rem 1rem 2rem;
        gap: 2rem;
    }

    .l-hero__left  { flex: unset; width: 100%; }
    .l-hero__right { flex: unset; width: 100%; max-width: 340px; }
    .l-hero__sub   { max-width: 100%; }

    .l-steps__row {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .l-step__line { display: none; }
    .l-step { align-self: unset; }
}

@media (max-width: 520px) {
    .l-features { grid-template-columns: 1fr; }
    .l-hero__title { font-size: 2.2rem; }
    .l-close__title { font-size: 1.9rem; }
    .l-steps__heading { font-size: 1.55rem; }
    .l-stalls__row { grid-template-columns: repeat(2, 1fr); }
    .l-products__row { gap: 1rem; }
    .l-product-item__icon { width: 36px; height: 36px; }
}

/* — PWA install prompt (fixed bottom banner, logged-in users) — */
.pwa-install {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-top-color: var(--accent);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

.pwa-install__android,
.pwa-install__ios {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 560px;
    margin: 0 auto;
}

.pwa-install__text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    min-width: 0;
}

.pwa-install__share-icon {
    color: var(--text-primary);
    font-weight: 600;
}

.pwa-install__dismiss {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.pwa-install__dismiss:hover { color: var(--text-primary); }

/* ===== WELCOME DIALOG ===== */
.welcome-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    max-width: 480px;
    width: 90%;
    color: var(--text-primary);
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.welcome-dialog::backdrop {
    background: rgba(0,0,0,0.7);
}

.welcome-dialog-inner {
    padding: 2rem;
}

.welcome-dialog-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 0.4rem;
}

.welcome-dialog-sub {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

.welcome-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.welcome-steps li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.welcome-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
}

.welcome-steps li div { flex: 1; }

.welcome-steps li strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.welcome-steps li p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.welcome-steps li em {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

.welcome-links {
    margin: 1.25rem 0 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.welcome-links a { color: var(--accent); }

.welcome-dialog-close {
    width: 100%;
}

/* ===== CHAT INTRO DIALOG ===== */
.chat-intro-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    max-width: 480px;
    width: 90%;
    color: var(--text-primary);
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.chat-intro-dialog::backdrop { background: rgba(0,0,0,0.7); }
.chat-intro-inner { padding: 2rem; }
.chat-intro-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 0.4rem;
}
.chat-intro-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0 0 1.5rem;
}
.chat-intro-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.chat-intro-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.chat-intro-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.chat-intro-list li div { flex: 1; }
.chat-intro-list li strong { display: block; font-size: 0.95rem; margin-bottom: 0.2rem; }
.chat-intro-list li p { margin: 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }
.chat-intro-dialog .btn-primary { width: 100%; }

/* ===== PRO MEMBERSHIP PAGE ===== */
.pro-perks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.pro-perk-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.pro-perk-icon {
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.pro-perk-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 4px;
}

.pro-perk-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.pro-perk-desc strong {
    color: var(--text-primary);
}

/* ── Flash Sale Banner ──────────────────────────────────────────────────── */
.flash-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, rgba(232,160,32,0.15), rgba(232,160,32,0.08));
    border-bottom: 1px solid var(--accent);
    padding: 8px 16px;
    flex-wrap: wrap;
}

.flash-banner__label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: rgba(232,160,32,0.2);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.flash-banner__text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 0;
}

.flash-banner__btn {
    flex-shrink: 0;
}

.flash-banner--claimed {
    background: rgba(80,180,120,0.08);
    border-bottom-color: #50b478;
}

.flash-banner--claimed .flash-banner__text {
    color: #50b478;
}

.flash-banner--missed {
    background: rgba(180,80,80,0.08);
    border-bottom-color: var(--error, #c0392b);
}

.flash-banner--missed .flash-banner__text {
    color: var(--text-secondary);
}

.pro-subscribed-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.pro-cta-box {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.pro-cta-price {
    margin-bottom: 8px;
}

.pro-cta-amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
}

.pro-cta-period {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

.pro-cta-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.pro-cta-active {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0;
}

@media (min-width: 600px) {
    .pro-perks {
        gap: 16px;
    }
    .pro-perk-card {
        padding: 20px;
    }
}

/* ── Daily Achievements Leaderboard ─────────────────────────────────────── */
.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 900px) {
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.achievement-cat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.achievement-cat__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

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

.achievement-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.875rem;
}

.achievement-entry--gold   { background: rgba(212,175,55,0.10); }
.achievement-entry--silver { background: rgba(180,180,180,0.08); }
.achievement-entry--bronze { background: rgba(180,130,90,0.08); }

.achievement-rank {
    min-width: 24px;
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
}

.achievement-name {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.achievement-stall {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.achievement-value {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}

/* — Fair play / pricing — */
.l-fair {
    padding: 3rem 1.25rem;
    background:
        linear-gradient(rgba(13,18,26,0.80), rgba(13,18,26,0.80)),
        url('/img/locations/beach.jpg') center / cover no-repeat;
    border-top: 1px solid rgba(255,255,255,0.07);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.l-fair__inner {
    max-width: var(--l-max);
    margin: 0 auto;
    text-align: center;
}

.l-fair__badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    margin-bottom: 1rem;
}

.l-fair__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    font-weight: normal;
    color: var(--text);
    margin: 0 0 0.75rem;
}

.l-fair__body {
    color: var(--text-dim);
    font-size: 0.95rem;
    max-width: 520px;
    margin: 0 auto 1.5rem;
    line-height: 1.65;
}

.l-fair__pill {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.85rem 1.25rem;
    max-width: 560px;
    text-align: left;
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.55;
}

.l-fair__pill-label {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
}

.l-fair__link {
    color: var(--accent);
    text-decoration: none;
}

.l-fair__link:hover { text-decoration: underline; }


/* ===== STORE REVIEW (NEWSPAPER) ===== */
.newspaper-dialog {
    border: none;
    padding: 0;
    background: transparent;
    max-width: 560px;
    width: calc(100% - 32px);
}
.newspaper-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}
.newspaper {
    background: #f4ecd8;
    color: #1a1410;
    font-family: 'Georgia', 'Times New Roman', serif;
    padding: 24px 28px 22px;
    border: 1px solid #5a4a30;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border-radius: 2px;
}
.newspaper__masthead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5a4a30;
}
.newspaper__title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0;
    color: #1a1410;
    text-transform: none;
}
.newspaper__rule {
    border-top: 3px double #5a4a30;
    margin: 10px 0 16px;
}
.newspaper__headline {
    font-family: 'Georgia', serif;
    font-size: 1.65rem;
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 8px;
    color: #1a1410;
}
.newspaper__byline {
    font-size: 0.85rem;
    font-style: italic;
    color: #5a4a30;
    margin-bottom: 10px;
}
.newspaper__byline strong { font-weight: 700; font-style: normal; }
.newspaper__stars {
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    color: #b08020;
    margin-bottom: 14px;
}
.newspaper__star--on { color: #c87010; }
.newspaper__body {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 18px;
    column-count: 1;
}
.newspaper__body::first-letter {
    font-size: 2.2rem;
    font-weight: 700;
    float: left;
    line-height: 1;
    padding: 2px 6px 0 0;
    color: #5a4a30;
}
.newspaper__actions {
    display: flex;
    justify-content: flex-end;
}
.newspaper__actions .btn-primary {
    background: #1a1410;
    color: #f4ecd8;
    border: none;
    padding: 8px 22px;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 2px;
}
.newspaper__actions .btn-primary:hover { background: #3a2d1f; }
@media (max-width: 480px) {
    .newspaper { padding: 18px 18px 16px; }
    .newspaper__headline { font-size: 1.4rem; }
    .newspaper__title { font-size: 1.2rem; }
}

/* ── Traffic model ─────────────────────────────────────────────────────── */
.traffic-model-panel { padding-top: 12px; }
.traffic-model-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.traffic-model-meta strong { color: var(--accent); }
.num-col { text-align: right; white-space: nowrap; }
.traffic-zero { color: var(--text-disabled, #3f3f52); }
.traffic-low  { color: var(--text-secondary); }
.traffic-mid  { color: var(--text-primary); }
.traffic-high { color: var(--accent); font-weight: 600; }

/* ===== STALL PAGE ===== */
.stall-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

.stall-page-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 680px) {
    .stall-page-body {
        grid-template-columns: 1fr;
    }
}

.stall-page-back {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1rem;
}
.stall-page-back:hover { color: var(--text-primary); }

.stall-page-header {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.stall-page-image-wrap { flex-shrink: 0; }

.stall-page-img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: block;
}

.stall-page-img--placeholder {
    background: var(--bg-card);
}

.stall-page-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stall-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.stall-page-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.stall-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
}

.stall-status-badge--open {
    background: rgba(76, 175, 125, 0.15);
    color: var(--success);
    border: 1px solid rgba(76, 175, 125, 0.3);
}

.stall-status-badge--closed {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.stall-page-owner,
.stall-page-location,
.stall-page-visitors {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stall-page-visitors {
    color: var(--text-primary);
    font-size: 0.8rem;
    opacity: 0.7;
}

.stall-share-price {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    background: rgba(184, 151, 90, 0.1);
    border: 1px solid rgba(184, 151, 90, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    width: fit-content;
}

.stall-share-price-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.stall-share-price-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #c9a96e;
    font-variant-numeric: tabular-nums;
}

.share-chart-wrap {
    margin-top: 0.6rem;
    width: 100%;
    max-width: 420px;
}

.share-chart-controls {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.share-chart-btn {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.share-chart-btn.active,
.share-chart-btn:hover {
    background: rgba(184, 151, 90, 0.15);
    border-color: rgba(184, 151, 90, 0.4);
    color: #c9a96e;
}

.share-chart-canvas {
    width: 100%;
    height: 80px;
    display: block;
    border-radius: 4px;
}

.share-chart-empty {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 4px 0 0;
    opacity: 0.6;
}

.share-market-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
}
.share-market-status--open   { background: rgba(46,204,113,0.15); color: #2ecc71; }
.share-market-status--closed { background: rgba(231,76,60,0.12);  color: #e74c3c; }

.share-avail-block { margin: 10px 0 8px; }
.share-avail-track {
    display: flex;
    width: 100%;
    height: 22px;
    border-radius: 4px;
    overflow: hidden;
}
.share-avail-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: width 0.3s;
    min-width: 0;
}
.share-avail-segment--held { background: var(--accent); border-radius: 4px 0 0 4px; }
.share-avail-segment--free { background: rgba(46,204,113,0.25); border-radius: 0 4px 4px 0; }
.share-avail-segment-label {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    padding: 0 6px;
}
.share-avail-segment--held .share-avail-segment-label { color: #000; }
.share-avail-segment--free .share-avail-segment-label { color: #2ecc71; }

.share-trade-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 6px;
}
.share-holding-badge {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    flex: 1;
}
.share-market-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 6px 0 0;
    opacity: 0.7;
}

.share-holders { margin-top: 10px; }
.share-holders-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 6px;
}
.share-holders-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.share-holder-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 3px 0;
    border-bottom: 1px solid var(--border);
}
.share-holder-row:last-child { border-bottom: none; }
.share-holder-name { color: var(--text-primary); }
.share-holder-qty  { color: var(--text-secondary); }

/* ===== PORTFOLIO TAB ===== */
@media (max-width: 640px) {
    #stocks-panel { padding: 0 8px; }
}
.portfolio-empty {
    margin-top: 24px;
    text-align: center;
    padding: 40px 20px;
}
.portfolio-empty p { margin: 0 0 8px; }

.portfolio-summary {
    display: flex;
    gap: 12px;
    margin: 16px 0 20px;
    flex-wrap: wrap;
}
.portfolio-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 18px;
    min-width: 130px;
}
.portfolio-summary-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.portfolio-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}
.portfolio-pl--positive { color: #2ecc71; }
.portfolio-pl--negative { color: #e74c3c; }

/* Cards — shown on mobile, hidden on desktop */
.portfolio-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.portfolio-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}
.portfolio-card:hover { border-color: var(--accent); }
.portfolio-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.portfolio-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.portfolio-card-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.portfolio-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.portfolio-card-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.portfolio-card-stat-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.portfolio-card-stat-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Table — hidden on mobile, shown on desktop */
.portfolio-table-wrap { display: none; }

@media (min-width: 700px) {
    .portfolio-cards { display: none; }
    .portfolio-table-wrap {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .portfolio-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.85rem;
    }
    .portfolio-table th {
        text-align: left;
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding: 6px 10px;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }
    .portfolio-table td {
        padding: 10px 10px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
        white-space: nowrap;
    }
    .portfolio-table tr:last-child td { border-bottom: none; }
    .portfolio-table .num { text-align: right; }
    .portfolio-stall-link {
        color: var(--accent);
        text-decoration: none;
        font-weight: 600;
    }
    .portfolio-stall-link:hover { text-decoration: underline; }
}

.stall-page-section {
    margin-bottom: 1.75rem;
}

.stall-page-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Bio — owner edit */
.stall-bio-edit {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stall-bio-edit textarea {
    width: 100%;
    min-height: 140px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.stall-bio-edit textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.stall-bio-save-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stall-bio-saved {
    font-size: 0.8rem;
    color: var(--success);
}

.stall-bio-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.stall-bio-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Bio — non-owner display */
.stall-bio-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    white-space: pre-line;
}

/* For-sale banner */
.stall-for-sale-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
}
.stall-for-sale-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}
.stall-for-sale-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

/* Stock offers list */
.stall-offers-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.stall-offer-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.9rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0.45rem 0.75rem;
}
.stall-offer-product {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stall-offer-qty { color: var(--text-secondary); font-size: 0.82rem; }
.stall-offer-ppu { color: var(--text-secondary); font-size: 0.82rem; }
.stall-offer-total { font-weight: 600; color: var(--accent); font-size: 0.88rem; white-space: nowrap; }
.stall-offers-hint { font-size: 0.78rem; color: var(--text-secondary); }
.stall-offers-hint a { color: var(--accent); }

/* Other stalls by owner */
.stall-other-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.stall-other-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0.45rem 0.75rem;
}
.stall-other-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-decoration: none;
    min-width: 0;
}
.stall-other-link:hover .stall-other-name { text-decoration: underline; }
.stall-other-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stall-other-loc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Notification bell & panel ────────────────────────────────────────── */
.notif-btn {
    position: relative;
}
.notif-btn .chat-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    pointer-events: none;
}

#notif-nav-count {
    font-size: 1.1rem;
    line-height: 1;
}

.notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 95vw;
    height: 100dvh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.4);
}
.notif-panel--open {
    transform: translateX(0);
}
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-panel-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}
.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.notif-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    padding: 2rem 1rem;
}

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.notif-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item--unseen {
    background: rgba(var(--accent-rgb, 100, 149, 237), 0.07);
}
.notif-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.notif-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.notif-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.notif-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted, var(--text-secondary));
    opacity: 0.7;
    margin-top: 0.1rem;
}

/* "Visit page" link on competitor cards */
.stall-page-link {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.stall-page-link:hover { opacity: 1; text-decoration: underline; }
