/* ============================================================
   Albion Terminal – Design System
   ============================================================ */

:root {
    --bg-dark: #0a0a0f;
    --bg-surface: #12121a;
    --bg-card: #1a1a26;
    --bg-elevated: #222233;
    --border-color: #2a2a3d;
    --border-glow: rgba(212, 175, 55, 0.15);
    --text-primary: #e8e8f0;
    --text-secondary: #a2a2ba;
    /* 2026-09-06 audit: #555570 scored 2.2-2.8:1 against the site's backgrounds and
       produced 869 Lighthouse contrast failures. Both tones now clear 4.5:1 on the
       darkest surface while keeping a visible step between them. */
    --text-muted: #8a8aa8;
    --accent: #d4af37;
    --accent-light: #f0d060;
    --accent-dim: rgba(212, 175, 55, 0.08);
    --profit-green: #4ade80;
    --profit-green-dim: rgba(74, 222, 128, 0.1);
    --loss-red: #f87171;
    --loss-red-dim: rgba(248, 113, 113, 0.1);
    --blue: #60a5fa;
    --purple: #a78bfa;
    --black-market: #8b5cf6;
    --green: #4ade80;
    --red: #ef4444;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 1000;
    --z-toast: 10000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ====== HEADER ====== */
header {
    background: linear-gradient(135deg, #080810 0%, #14142a 50%, #0a0a14 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    min-width: 0;
}

.brand-mark {
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.35));
}

.brand-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
}

.brand-title {
    font-size: clamp(1.05rem, 2.2vw, 1.45rem);
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    line-height: 1.2;
    color: var(--text-primary);
    white-space: nowrap;
}

.brand-title strong {
    font-weight: 800;
    background: linear-gradient(135deg, #f4d872 0%, var(--accent) 45%, #b8860b 90%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 6s ease infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.brand-tagline {
    font-size: 0.68rem;
    color: var(--text-secondary);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ====== TOP BAR ====== */
.top-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.top-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.db-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
}

.db-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}

.db-status.has-data .db-status-dot {
    background: var(--profit-green);
    box-shadow: 0 0 6px var(--profit-green);
}

.live-sync-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
}

.live-sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}

.btn-scan-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: linear-gradient(135deg, var(--accent) 0%, #e0a96d 100%);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-scan-all:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
}

.btn-scan-all:active {
    transform: translateY(0);
}

button:disabled, .btn-primary:disabled, .btn-secondary:disabled, .btn-scan-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

/* ====== SCAN PROGRESS ====== */
.scan-progress-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem 1rem;
}

.scan-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.scan-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
}

.scan-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.scan-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: progressShine 1.5s ease infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ====== NAVIGATION ====== */
.main-nav {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown);
    display: flex;
    align-items: stretch;
}

.main-nav-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    /* The row did not fit a 1280px laptop, so the last tabs were unreachable.
       Wrapping rather than overflow-x:auto on purpose: this element is the
       positioning context for the dropdown menus, and any overflow value other
       than visible would clip them. */
    flex-wrap: wrap;
    padding: 0 0.5rem;
    gap: 0.15rem;
    align-items: stretch;
}

/* Nav group (dropdown container) */
.nav-group {
    position: relative;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.7rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-group-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-group-toggle.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-group-toggle svg:not(.nav-chevron) {
    opacity: 0.6;
}

.nav-group-toggle.active svg:not(.nav-chevron) {
    opacity: 1;
}

.nav-chevron {
    transition: transform 0.2s ease;
    opacity: 0.5;
    margin-left: 0.1rem;
}

.nav-group.open .nav-chevron {
    transform: rotate(180deg);
}

/* Dropdown menu */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: var(--z-sticky);
    flex-direction: column;
    padding: 0.25rem 0;
}

.nav-group.open .nav-dropdown {
    display: flex;
}

/* Nav tabs (both standalone and inside dropdowns) */
.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.7rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-tab svg {
    opacity: 0.6;
}

.nav-tab.active svg {
    opacity: 1;
}

/* Tabs inside dropdowns: different styling */
.nav-dropdown .nav-tab {
    border-bottom: none;
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    width: 100%;
    text-align: left;
    border-radius: 0;
}

.nav-dropdown .nav-tab:hover {
    background: rgba(255, 255, 255, 0.06);
}

.nav-dropdown .nav-tab.active {
    color: var(--accent);
    background: rgba(var(--accent-rgb, 59, 130, 246), 0.1);
}

/* ====== MAIN CONTENT ====== */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
    flex: 1;
    width: 100%;
}

/* ====== CONTROLS PANEL ====== */
.controls-panel {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select {
    padding: 0.6rem 0.8rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition);
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

.search-input-wrapper {
    position: relative;
    min-width: 220px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.6rem 0.8rem 0.6rem 2.2rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ====== AUTOCOMPLETE ====== */
.autocomplete-items {
    position: absolute;
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: var(--z-sticky);
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 260px;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.autocomplete-items div {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background var(--transition);
}

.autocomplete-items div:hover {
    background: rgba(212, 175, 55, 0.08);
    color: var(--accent);
}

.autocomplete-items div:last-child {
    border-bottom: none;
}

/* ====== BUTTONS ====== */
.btn-primary {
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.checkbox-group label {
    text-transform: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.fresh-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-bottom: 0.5rem;
}

.fresh-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fresh-toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: #fff;
}

.fresh-threshold-select {
    width: 80px;
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}

.fresh-threshold-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ====== BROWSER STATUS BAR ====== */
.browser-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.pagination, .pagination-bottom {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.pagination-bottom {
    justify-content: center;
    margin-top: 1.5rem;
}

.page-btn {
    padding: 0.35rem 0.7rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ====== RESULTS GRID ====== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* ====== ITEM CARD (BROWSER) ====== */
.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all var(--transition);
    animation: fadeInUp 0.3s ease-out both;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.item-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #000;
    flex-shrink: 0;
}

.item-card-info {
    flex: 1;
    min-width: 0;
}

.item-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-card-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

.tier-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    border: 1px solid rgba(212, 175, 55, 0.2);
}
.weight-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    background: rgba(100, 180, 255, 0.1);
    color: rgba(100, 180, 255, 0.8);
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    font-weight: 600;
}
.loot-item-weight {
    font-size: 0.7rem;
    color: rgba(100, 180, 255, 0.7);
    margin-left: auto;
    margin-right: 0.5rem;
    white-space: nowrap;
}

/* Loot Logger */
.loot-session-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition);
}
.loot-session-card:hover { border-color: var(--accent); }
.loot-session-card.active { border-color: var(--profit-green); }

.loot-player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.loot-player-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
}
.loot-player-header:hover { background: var(--bg-elevated); }
.loot-player-items {
    display: none;
    padding: 0 0.75rem 0.5rem;
}
.loot-player-card.expanded .loot-player-items { display: block; }

/* Dead CSS removed: .loot-log-item-row (not used in app.js or index.html) */

/* Accountability status */
.acc-deposited { opacity: 0.6; }
.acc-partial .acc-status-badge { color: #fbbf24; }
.acc-missing .acc-status-badge { color: var(--loss-red); font-weight: 600; }
.acc-deposited .acc-status-badge { color: var(--profit-green); }
.acc-status-badge {
    margin-left: auto;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* ====== LOOT LOGGER REVAMP (ll-*) ====== */

/* Live session toolbar */
.ll-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.ll-live-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}
.ll-live-toggle:hover { border-color: var(--profit-green); color: var(--profit-green); }
.ll-live-toggle.active {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--profit-green);
    color: var(--profit-green);
}
.ll-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--profit-green);
    font-weight: 600;
    margin-left: auto;
}
.ll-live-indicator.hidden { display: none; }

/* Auto-save checkbox */
.ll-autosave-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.ll-autosave-label input { accent-color: var(--accent); cursor: pointer; }

/* Session name input row */
.ll-session-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
    flex-wrap: wrap;
}
.ll-session-name-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.ll-session-name-input {
    flex: 1;
    min-width: 200px;
    max-width: 420px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
}
.ll-session-name-input:focus {
    outline: none;
    border-color: var(--accent);
}
.ll-autosave-status {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}
.ll-autosave-status.saved { color: var(--profit-green); }

/* Discord template dropdown (Phase 5 G9) */
.ll-discord-dropdown {
    position: relative;
    display: inline-block;
}
.ll-discord-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
    min-width: 180px;
    z-index: 100;
    padding: 0.25rem;
}
.ll-discord-menu.open { display: block; }
.ll-discord-menu button {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.45rem 0.7rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.78rem;
    border-radius: 4px;
    transition: background 0.1s ease;
}
.ll-discord-menu button:hover {
    background: var(--bg-elevated);
    color: var(--accent);
}

/* G13: Verdict reasoning expansion */
.loot-verdict-headline {
    font-size: 1rem;
    font-weight: 700;
}
.loot-verdict-why {
    display: inline-block;
    margin-top: 0.4rem;
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    opacity: 0.7;
    font-weight: 600;
    transition: opacity 0.1s ease, background 0.1s ease;
}
.loot-verdict-why:hover { opacity: 1; background: rgba(255, 255, 255, 0.05); }
.loot-verdict-reasoning {
    display: none;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px dashed currentColor;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-primary);
    opacity: 0.95;
}
.loot-verdict-reasoning.open { display: block; }
.verdict-bullets {
    margin: 0 0 0.5rem;
    padding-left: 1.2rem;
    list-style: disc;
}
.verdict-bullets li {
    margin-bottom: 0.3rem;
    line-height: 1.4;
}
.verdict-conclusion {
    margin: 0.5rem 0 0;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
}
.verdict-conclusion.good { background: rgba(74, 222, 128, 0.08); color: var(--profit-green); }
.verdict-conclusion.caution { background: rgba(251, 191, 36, 0.08); color: #fbbf24; }
.verdict-conclusion.bad { background: rgba(239, 68, 68, 0.08); color: var(--loss-red); }

/* F4: Global drag-drop overlay */
#global-drop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    backdrop-filter: blur(4px);
}
#global-drop-overlay.hidden { display: none; }
.global-drop-box {
    background: var(--bg-card);
    border: 3px dashed var(--accent);
    border-radius: 14px;
    padding: 2rem 3rem;
    text-align: center;
    color: var(--text-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: globalDropPulse 1.2s ease-in-out infinite;
}
@keyframes globalDropPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
.global-drop-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.3rem;
}
.global-drop-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* G2: Session Compare */
.compare-headers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0 2.4rem;
}
.compare-header-a, .compare-header-b {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: center;
    padding: 0.35rem 0.5rem;
    background: var(--bg-elevated);
    border-radius: 4px;
    word-break: break-word;
}
.compare-header-a { border-left: 3px solid var(--accent); }
.compare-header-b { border-left: 3px solid var(--blue, #60a5fa); }
.compare-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}
.compare-stats-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    width: 30%;
}
.compare-stats-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
}
.compare-stats-table td:last-child { width: 20%; text-align: right; }
.compare-delta-cell { font-size: 0.78rem; }
.compare-delta { font-weight: 700; }
.compare-delta.gain { color: var(--profit-green); }
.compare-delta.loss { color: var(--loss-red); }
.compare-delta.same { color: var(--text-muted); }
.compare-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.compare-subhead {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.compare-top-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.78rem;
    color: var(--text-primary);
}
.compare-top-list li { margin-bottom: 0.25rem; }
@media (max-width: 600px) {
    .compare-top-grid { grid-template-columns: 1fr; }
    .compare-headers { padding: 0; }
}

/* G14: Trip Summary modal */
.trip-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.7rem;
}
.trip-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.45rem;
}
.trip-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}
.trip-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.2rem 0.35rem;
    border-right: 1px solid var(--border-color);
}
.trip-stat:last-child { border-right: none; }
.trip-label {
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.trip-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.trip-val.gain { color: var(--profit-green); }
.trip-val.loss { color: var(--loss-red); }
.trip-tabs-list { display: flex; flex-direction: column; gap: 0.3rem; }
.trip-tab-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.5rem;
    background: var(--bg-elevated);
    border-radius: 4px;
    font-size: 0.78rem;
}
.trip-tab-name { font-weight: 500; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-tab-status {
    font-size: 0.62rem;
    padding: 0.08rem 0.4rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin: 0 0.5rem;
}
.trip-tab-status.status-open { background: rgba(212, 175, 55, 0.15); color: var(--accent); }
.trip-tab-status.status-partial { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.trip-tab-status.status-sold { background: rgba(74, 222, 128, 0.15); color: var(--profit-green); }
.trip-tab-net { font-weight: 700; }
.trip-tab-net.gain { color: var(--profit-green); }
.trip-tab-net.loss { color: var(--loss-red); }

/* G4 follow-up: shared-sessions banner above session list */
.ll-shared-banner {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius);
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.ll-shared-banner strong { color: var(--accent); }
.ll-shared-banner-hint { color: var(--text-muted); font-size: 0.72rem; }

/* G6: Per-player trend line on Loot Logger player cards */
.ll-player-trend {
    display: block;
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    letter-spacing: 0.01em;
    line-height: 1.35;
    width: 100%;
}
/* Where a player looted — shown in the card so locations are visible in the list. */
.ll-player-loot-zone {
    display: block;
    width: 100%;
    font-size: 0.68rem;
    color: var(--accent);
    margin-top: 0.15rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ll-loot-zone-more { color: var(--text-muted); }

/* G4: Shared session badge + public-share overlay */
.ll-session-shared-badge {
    font-size: 0.62rem;
    padding: 0.1rem 0.45rem;
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.18);
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-left: 0.3rem;
    text-transform: uppercase;
}
.ll-session-card.is-shared {
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.3);
}

#public-share-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9000;
    overflow-y: auto;
    padding: 0;
}
.public-share-banner {
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
    border-bottom: 1px solid var(--accent);
    padding: 0.65rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    backdrop-filter: blur(4px);
    z-index: 2;
}
.public-share-banner a.btn-small {
    color: var(--accent);
    text-decoration: none;
}
.public-share-container {
    max-width: 1100px;
    margin: 1rem auto;
    padding: 0 1rem 2rem;
}
.public-share-box {
    max-width: 480px;
    margin: 10vh auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: var(--text-primary);
}
.public-share-box h2 {
    color: var(--accent);
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}
.public-share-box p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin: 0.35rem 0;
}

/* A10: Inline rename input (appears inside session card title) */
.ll-inline-rename-input {
    background: var(--bg-primary);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 0.25rem 0.45rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    min-width: 220px;
    max-width: 360px;
    outline: none;
}
.ll-inline-rename-input:focus {
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

/* G3: Heatmap timeline */
.ll-timeline-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.4rem 0.7rem 0.3rem;
    margin-bottom: 0.75rem;
}
.ll-timeline-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.ll-timeline {
    display: flex;
    align-items: flex-end;
    height: 40px;
    gap: 2px;
}
.ll-timeline-bar {
    flex: 1;
    background: linear-gradient(to top, var(--accent), rgba(212, 175, 55, 0.55));
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    transition: filter 0.12s ease, transform 0.1s ease;
    cursor: default;
}
.ll-timeline-bar:hover {
    filter: brightness(1.3);
    transform: scaleY(1.08);
    transform-origin: bottom center;
}
.ll-timeline-bar.empty {
    background: var(--bg-elevated);
    opacity: 0.45;
}
.ll-timeline-bar.has-death {
    position: relative;
    background: linear-gradient(to top, var(--loss-red), rgba(248, 113, 113, 0.55));
}
.ll-timeline-bar.has-death::before {
    content: '💀';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    line-height: 1;
    pointer-events: none;
}
.ll-timeline-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Loot Buyer: tracked tabs summary header */
.loot-tracked-summary {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
}
.loot-tracked-summary .ll-summary-stat { border-right: 1px solid var(--border-color); padding: 0.1rem 0.6rem; }
.loot-tracked-summary .ll-summary-stat:nth-last-child(2) { border-right: none; }
.loot-tracked-summary .ll-summary-actions {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
@media (max-width: 600px) {
    .loot-tracked-summary { gap: 0.4rem; }
    .loot-tracked-summary .ll-summary-stat { padding: 0.1rem 0.35rem; }
    .loot-tracked-summary .ll-summary-actions { margin-left: 0; width: 100%; justify-content: flex-end; border-top: 1px solid var(--border-color); padding-top: 0.4rem; }
}

/* D2: Loot Logger mode pills */
.ll-mode-pills {
    display: flex;
    gap: 0.4rem;
    margin: 0 0 1rem;
    padding: 0.3rem;
    background: var(--bg-elevated);
    border-radius: 10px;
    width: fit-content;
    flex-wrap: wrap;
}
.ll-mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    transition: background 0.14s ease, color 0.14s ease;
    min-height: 34px;
}
.ll-mode-pill:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.03); }
.ll-mode-pill.active {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.ll-mode-pill.active:hover { background: var(--accent); color: #000; }
.ll-mode-icon { font-size: 0.95rem; line-height: 1; }
.ll-mode-label { line-height: 1; }
.ll-mode-count {
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font-size: 0.66rem;
    padding: 0.12rem 0.45rem;
    border-radius: 10px;
    font-weight: 700;
    line-height: 1.1;
    min-width: 1.2rem;
    text-align: center;
}
.ll-mode-pill:not(.active) .ll-mode-count {
    background: var(--bg-card);
    color: var(--accent);
}
@media (max-width: 520px) {
    .ll-mode-pills { width: 100%; }
    .ll-mode-pill { flex: 1; justify-content: center; padding: 0.45rem 0.5rem; }
    .ll-mode-label { font-size: 0.75rem; }
}

/* D6: Loot Logger landing cards (empty-state) */
.ll-landing {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
}
.ll-landing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.ll-landing-card:hover {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.04);
    transform: translateY(-1px);
}
.ll-landing-card .ll-landing-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.1rem;
}
.ll-landing-card .ll-landing-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
}
.ll-landing-card .ll-landing-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* G12: Favorite badge on Loot Logger + Loot Buyer item rows */
.ll-fav-badge {
    display: inline-block;
    font-size: 0.7rem;
    margin-left: 0.15rem;
    cursor: help;
    vertical-align: middle;
    line-height: 1;
}
.loot-item-favorite {
    background: linear-gradient(to right, rgba(212, 175, 55, 0.06), transparent 80%);
    box-shadow: inset 3px 0 0 rgba(212, 175, 55, 0.5);
}

/* F2: Sale cross-reference badge */
.ll-sold-badge {
    display: inline-block;
    font-size: 0.75rem;
    margin-left: 0.15rem;
    cursor: help;
    vertical-align: middle;
    line-height: 1;
    filter: drop-shadow(0 0 3px rgba(74, 222, 128, 0.4));
}

/* G5: Friendly-fire + A5: Top-value star */
.ll-ff-badge,
.ll-top-value-star {
    display: inline-block;
    font-size: 0.75rem;
    margin-left: 0.15rem;
    cursor: help;
    vertical-align: middle;
    line-height: 1;
}
.ll-item-top-value {
    background: linear-gradient(to right, rgba(212, 175, 55, 0.08), transparent 60%);
}
.ll-item-ff {
    border-left: 2px solid rgba(236, 72, 153, 0.45);
}

/* About: keyboard shortcuts reference grid */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.shortcut-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
}
.shortcut-group-title {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: var(--text-primary);
}
.shortcut-row:last-child { border-bottom: none; }
.shortcut-row kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0.12rem 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    color: var(--accent);
    min-width: 2rem;
    text-align: center;
    flex-shrink: 0;
}

/* A11: on-page keyboard shortcut hint chip */
.ll-shortcut-hint {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
    padding: 0.2rem 0.1rem;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}
.ll-shortcut-hint:hover { opacity: 1; }
.ll-shortcut-hint kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 3px;
    padding: 0.05rem 0.35rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.7rem;
    color: var(--accent);
    line-height: 1;
    min-width: 0.9rem;
    text-align: center;
}

/* A11: shortcut help modal rows */
.ll-shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}
.ll-shortcut-row:last-of-type { border-bottom: none; }
.ll-shortcut-row kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0.1rem 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    color: var(--accent);
    min-width: 1.5rem;
    text-align: center;
}

/* Item filter chips (Phase 5 G11) */
.ll-filter-chips {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0 0.2rem;
}
.ll-filter-chip {
    font-size: 0.72rem;
    padding: 0.25rem 0.65rem;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    font-weight: 500;
    white-space: nowrap;
}
.ll-filter-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}
.ll-filter-chip.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 700;
}
.ll-filter-chip.ll-chip-clear {
    color: var(--loss-red);
    border-color: rgba(239, 68, 68, 0.3);
}
.ll-filter-chip.ll-chip-clear:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--loss-red);
}

/* Deaths section (Phase 2) */
.ll-deaths-section {
    margin-bottom: 1rem;
}
.ll-deaths-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}
.ll-deaths-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ll-deaths-count {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}
.ll-deaths-friendly {
    color: var(--loss-red);
    font-size: 0.7rem;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}
.ll-deaths-enemy {
    color: var(--profit-green);
    font-size: 0.7rem;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}
.ll-death-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    padding: 0.6rem 0.85rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
/* SWAPPED 2026-04-18 — user wants friends=green, enemies=red, matching .ll-card-* convention.
   Previous semantics framed it as "outcome for our guild" (friendly died = loss = red). Now
   matches the player-card convention where the color represents the PERSON's side. */
.ll-death-friendly { border-left-color: var(--profit-green); }
.ll-death-enemy { border-left-color: var(--loss-red); }
.ll-death-card.active-filter {
    box-shadow: 0 0 0 2px var(--accent);
    background: rgba(212, 175, 55, 0.04);
}
.ll-death-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.ll-death-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.88rem;
    color: var(--text-primary);
}
.ll-death-icon { font-size: 1.05rem; }
.ll-death-victim { font-weight: 700; }
.ll-death-sep { color: var(--text-muted); font-size: 0.78rem; }
.ll-death-killer { color: var(--text-secondary); }
.ll-death-time { color: var(--text-muted); font-size: 0.72rem; margin-left: 0.15rem; }
.ll-death-badge {
    font-size: 0.58rem;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    background: rgba(160, 160, 184, 0.15);
    color: var(--text-muted);
    margin-left: 0.2rem;
}
.ll-death-friendly .ll-death-badge {
    background: rgba(74, 222, 128, 0.15);
    color: var(--profit-green);
}
.ll-death-enemy .ll-death-badge {
    background: rgba(239, 68, 68, 0.15);
    color: var(--loss-red);
}
.ll-death-value {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.ll-death-value.loss { color: var(--loss-red); }
.ll-death-value.gain { color: var(--profit-green); }
.ll-death-middle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}
.ll-death-items {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.ll-death-item {
    width: 36px;
    height: 36px;
    image-rendering: pixelated;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--bg-elevated);
    transition: transform 0.1s ease, border-color 0.15s ease;
}
/* B6: Equipment-at-death — distinguishable from "recovered loot" with a teal accent */
.ll-death-equipment-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.2rem 0 0.4rem;
    flex-wrap: wrap;
}
.ll-death-equipment-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.ll-death-item.ll-death-equip {
    border-color: rgba(99, 179, 237, 0.45);
    background: rgba(99, 179, 237, 0.06);
}
.ll-death-item:hover {
    transform: scale(1.15);
    border-color: var(--accent);
    z-index: 2;
    position: relative;
}
.ll-death-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}
.ll-death-looters {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border-color);
}
.ll-death-looters-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.3rem;
}
@media (max-width: 600px) {
    .ll-death-top { flex-direction: column; gap: 0.3rem; }
    .ll-death-value { align-self: flex-end; }
    .ll-death-item { width: 32px; height: 32px; }
}

/* Session summary strip */
.ll-summary-strip {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
}
.ll-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 72px;
    padding: 0.1rem 0.6rem;
    border-right: 1px solid var(--border-color);
}
.ll-summary-stat:last-of-type { border-right: none; }
.ll-summary-label {
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.ll-summary-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.ll-summary-value.accent { color: var(--accent); }
.ll-summary-value.loss { color: var(--loss-red); }
/* Guild-perspective picker in the summary strip — pick whose loot you're reviewing. */
.ll-summary-guild-select {
    margin-top: 0.1rem;
    max-width: 160px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.15rem 0.3rem;
    cursor: pointer;
}
.ll-summary-guild .ll-guild-custom {
    font-size: 0.58rem;
    color: var(--accent);
    letter-spacing: 0.03em;
}
.ll-summary-guild-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.ll-my-guild-star {
    flex: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.1rem;
    color: var(--text-muted);
}
.ll-my-guild-star:hover { color: var(--accent); }
.ll-my-guild-star.active { color: #f5c542; }
.ll-summary-actions {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
    align-items: center;
}
@media (max-width: 600px) {
    .ll-summary-stat { min-width: 60px; padding: 0.1rem 0.45rem; }
    .ll-summary-value { font-size: 0.95rem; }
    .ll-summary-label { font-size: 0.6rem; }
    .ll-summary-actions { margin-left: 0; width: 100%; justify-content: flex-end; border-top: 1px solid var(--border-color); padding-top: 0.4rem; }
}

/* Reusable hover tooltip */
.global-tooltip {
    position: fixed;
    z-index: 10001;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    min-width: 180px;
    max-width: 320px;
    font-size: 0.78rem;
    color: var(--text-primary);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    transition: opacity 0.12s ease;
}
.global-tooltip.hidden { display: none; opacity: 0; }
.tip-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.35rem;
}
.tip-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    image-rendering: pixelated;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--bg-elevated);
}
.tip-title-wrap { min-width: 0; flex: 1; }
.tip-title { font-weight: 600; color: var(--text-primary); line-height: 1.2; word-break: break-word; }
.tip-meta { font-size: 0.7rem; color: var(--accent); margin-top: 0.1rem; }
.tip-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 0;
}
.tip-row.muted { color: var(--text-muted); font-style: italic; }
.tip-label { color: var(--text-muted); font-size: 0.72rem; }
.tip-val { color: var(--text-primary); font-size: 0.76rem; font-weight: 500; text-align: right; }
.tip-simple { color: var(--text-primary); }

/* Upgrade flip badge */
.upgrade-flip-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(236,72,153,0.2));
    color: #c084fc;
    border: 1px solid rgba(192,132,252,0.4);
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-left: 0.4rem;
}

/* Inline rename pencil on session card */
.ll-session-rename-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem 0.45rem;
    min-width: 28px;
    min-height: 28px;
    border-radius: 4px;
    margin-left: 0.3rem;
}
.ll-session-rename-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.ll-session-rename-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Pulsing dot */
.ll-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--profit-green);
    flex-shrink: 0;
    animation: ll-pulse 1.5s ease-in-out infinite;
}
@keyframes ll-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.65); }
}

/* Chest capture panel */
.ll-capture-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}
.ll-capture-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.ll-capture-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: rgba(212, 175, 55, 0.08);
    color: var(--accent);
    cursor: pointer;
    transition: all var(--transition);
}
.ll-capture-toggle:hover { background: rgba(212, 175, 55, 0.15); }
.ll-capture-toggle.active {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--profit-green);
    color: var(--profit-green);
}
.ll-capture-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: var(--radius);
    font-size: 0.78rem;
    color: var(--profit-green);
    margin-bottom: 0.75rem;
}
.ll-capture-status-bar.hidden { display: none; }
.ll-capture-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 1.5rem;
}
.ll-capture-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    font-size: 0.75rem;
    color: var(--text-primary);
}
.ll-capture-chip .ll-chip-count {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Session list cards */
.ll-session-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: border-color var(--transition);
}
.ll-session-card:hover { border-color: var(--accent); }
.ll-session-card.active-live { border-color: var(--profit-green); }
.ll-session-info { flex: 1; min-width: 0; }
.ll-session-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ll-session-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Revamped player cards */
.ll-player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 0.55rem;
    overflow: hidden;
    transition: border-color var(--transition);
    border-left-width: 4px;
}
.ll-player-card:hover { border-color: rgba(212, 175, 55, 0.3); }
/* Role-based left border accent: enemy=red, friendly=green, unknown=grey */
.ll-card-enemy { border-left-color: var(--loss-red); }
.ll-card-enemy:hover { border-left-color: var(--loss-red); }
.ll-card-friendly { border-left-color: var(--profit-green); }
.ll-card-friendly:hover { border-left-color: var(--profit-green); }
.ll-card-unknown { border-left-color: var(--text-muted); }
.ll-card-unknown:hover { border-left-color: var(--text-muted); }
.ll-player-header {
    display: flex;
    /* flex-start so name/stats stay at the top of a tall card (many-icon
       previews); the icon strip grows downward without re-centering stats. */
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}
.ll-player-header:hover { background: var(--bg-elevated); }
.ll-item-preview {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
    /* No max-height / overflow: cards grow vertically to fit however many
       unique items the player has. Users asked cards to stretch dynamically
       rather than clip at row 1 (2026-04-21). */
}
.ll-preview-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--bg-elevated);
    transition: transform 0.1s ease, border-color 0.15s ease;
}
.ll-preview-icon:hover {
    transform: scale(1.12);
    border-color: var(--accent);
    z-index: 2;
    position: relative;
}
.ll-preview-overflow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-elevated);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}
.ll-item-clickable {
    cursor: pointer;
}
.ll-item-clickable:hover {
    background: rgba(212,175,55,0.08) !important;
}
.ll-player-info { flex: 1; min-width: 0; }
.ll-player-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ll-player-guild { font-size: 0.7rem; color: var(--text-muted); display: block; margin-top: 0.05rem; }
/* Alliance tag — occupies the far-left header slot the old .ll-player-avatar
   initials used, at comparable prominence (0.8rem bold on the gold accent, same
   as that avatar had before its rule was dropped in April).
   Deliberately NO align-self: .ll-player-header is align-items:flex-start, so
   the badge must top-align with the player name. `align-self: center` dropped it
   to the vertical middle of tall cards (the item-icon preview strip grows the
   card), which read as "not in the right place".
   min-width reserves the slot so every card's name starts at the same x-offset
   whether or not that player has a known alliance. */
.ll-alliance-badge {
    flex-shrink: 0;
    box-sizing: border-box;
    /* FIXED width, not min/max: Albion alliance tags are 5-char tickers, so this
       fits every real value while guaranteeing each card's name starts at the
       same x-offset. A variable width let a long value shove one card's name
       ~50px right of the rest. Anything longer ellipsizes (full text on hover). */
    width: 4.4rem;
    padding: 0.22rem 0.4rem;
    border-radius: 5px;
    /* 0.95rem, NOT the archived .ll-player-avatar rule's 0.8rem: that rule was
       deleted in f67fb9b (Apr 11) four months before the markup changed, so the
       initials the user actually remembers shipped UNSTYLED at the inherited
       16px — visibly larger than the 0.88rem player name. 0.68rem made the tag
       smaller than the name, which is why it read as recessive. */
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #111;
    background: linear-gradient(135deg, rgba(212,175,55,0.85) 0%, rgba(212,175,55,0.35) 100%);
    border: 1px solid rgba(212,175,55,0.35);
}
/* No alliance on record (chest-log-only depositors, events whose alliance field
   was empty): keep the reserved width so names stay aligned, and show a faint
   dash so the blank reads as "nothing recorded" rather than a broken element. */
.ll-alliance-badge.is-empty {
    background: none;
    border-color: transparent;
    color: var(--text-muted);
    opacity: 0.45;
    font-weight: 600;
}
.ll-player-stats {
    display: flex;
    gap: 1.1rem;
    align-items: center;
    flex-shrink: 0;
}
.ll-player-discord-actions {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.ll-player-discord-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.28rem 0.5rem;
    font-size: 0.68rem;
    line-height: 1.1;
}
.ll-player-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
}
.ll-stat-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.ll-stat-value {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
}
.ll-stat-value.accent { color: var(--accent); }
.ll-stat-value.green { color: var(--profit-green); }
.ll-stat-value.red { color: var(--loss-red); }
.ll-player-chevron {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.25rem;
}
.ll-player-card.expanded .ll-player-chevron { transform: rotate(180deg); }

/* Deposit progress bar */
.ll-deposit-bar {
    height: 3px;
    background: var(--bg-elevated);
}
.ll-deposit-fill {
    height: 100%;
    transition: width 0.4s ease;
}

/* Item list inside player card */
.ll-player-items {
    display: none;
    border-top: 1px solid var(--border-color);
}
.ll-player-card.expanded .ll-player-items { display: block; }

/* Item rows */
.ll-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.79rem;
    transition: background var(--transition);
}
.ll-item-row:last-child { border-bottom: none; }
.ll-item-row:hover { background: var(--bg-elevated); }
.ll-item-deposited { background: rgba(74, 222, 128, 0.04); }
.ll-item-deposited:hover { background: rgba(74, 222, 128, 0.08); }
.ll-item-missing { background: rgba(248, 113, 113, 0.05); }
.ll-item-missing:hover { background: rgba(248, 113, 113, 0.09); }
/* Missing-item hover tooltip (accountability check) */
.ll-item-row.ll-has-tooltip { position: relative; }
.ll-missing-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    font-size: 0.73rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 60;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    min-width: 180px;
}
.ll-item-row.ll-has-tooltip:hover .ll-missing-tooltip,
.ll-item-row.ll-has-tooltip.tt-active .ll-missing-tooltip { display: block; }
.ll-item-partial { background: rgba(251, 191, 36, 0.04); }
.ll-item-partial:hover { background: rgba(251, 191, 36, 0.08); }
.ll-item-died { opacity: 0.65; border-left: 2px solid var(--loss-red); background: rgba(239, 68, 68, 0.04); }
/* 2026-04-21 chest-log verification — pickup events cross-matched against a
   deposit record in the chest log get a green ring on the icon + check badge. */
.ll-item-verified-full {
    box-shadow: inset 2px 0 0 var(--profit-green);
}
.ll-item-verified-partial {
    box-shadow: inset 2px 0 0 #fbbf24;
}
.ll-item-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    image-rendering: pixelated;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ll-icon-verified {
    border-color: var(--profit-green) !important;
    box-shadow: 0 0 0 1px var(--profit-green), 0 0 6px rgba(74, 222, 128, 0.35);
}
.ll-verified-check {
    color: var(--profit-green);
    font-weight: 700;
    margin-left: 0.25rem;
    font-size: 0.78rem;
    cursor: help;
}
.ll-verify-banner {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    background: rgba(74, 222, 128, 0.07);
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.75rem;
    font-size: 0.83rem;
    color: var(--text-secondary);
}
.ll-verify-icon {
    font-size: 1.1rem;
    color: var(--profit-green);
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.ll-item-name {
    flex: 1;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ll-item-qty { font-weight: 600; color: var(--text-muted); flex-shrink: 0; min-width: 2.2rem; text-align: right; }
.ll-item-value { color: var(--accent); font-size: 0.74rem; flex-shrink: 0; min-width: 3.5rem; text-align: right; }
.ll-item-weight { font-size: 0.7rem; color: rgba(100, 180, 255, 0.7); flex-shrink: 0; min-width: 3.2rem; text-align: right; }
.ll-item-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ll-dot-deposited { background: var(--profit-green); }
.ll-dot-missing { background: var(--loss-red); }
.ll-dot-partial { background: #fbbf24; }
.ll-dot-died { background: var(--loss-red); opacity: 0.6; }
.ll-dot-none { background: transparent; border: 1px solid var(--border-color); }
.ll-remove-player {
    position: absolute; top: 0.3rem; right: 0.3rem; background: none; border: none;
    color: var(--text-muted); font-size: 1.1rem; cursor: pointer; opacity: 0; transition: opacity 0.15s;
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.ll-player-card:hover .ll-remove-player { opacity: 0.7; }
.ll-remove-player:hover { opacity: 1 !important; color: var(--loss-red); background: rgba(239,68,68,0.1); }
.ll-remove-player:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; opacity: 1; }
.ll-player-card { position: relative; }
.ll-drop-zone {
    display: flex; align-items: center; padding: 0.6rem 1rem;
    border: 2px dashed var(--border-color); border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}
.ll-drop-zone.dragover {
    border-color: var(--accent); background: rgba(99, 102, 241, 0.06);
}

/* Accountability summary box */
.ll-acc-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

/* Session viewer back-button row */
.ll-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.ll-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.ll-filter-bar .search-input-wrapper input {
    font-size: 0.78rem;
    padding: 0.45rem 0.7rem 0.45rem 2rem;
}
.ll-filter-bar select {
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
}

/* Multi-guild picker — a dropdown to add a guild + a removable chip per selection.
   Replaces the old Ctrl+click <select multiple>; selected guilds act as one group. */
.ll-guild-picker {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 170px;
    max-width: 250px;
}
.ll-gp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.ll-gp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.3rem 0.18rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(91, 141, 239, 0.16);
    border: 1px solid rgba(91, 141, 239, 0.4);
    border-radius: 999px;
    max-width: 100%;
}
.ll-gp-chip-x {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.85rem;
    line-height: 1;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
.ll-gp-chip-x:hover { color: #fff; background: rgba(224, 108, 117, 0.7); }
.ll-gp-add-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ll-gp-add {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.75rem;
}
.ll-gp-alladded {
    flex: 1 1 auto;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.35rem 0.2rem;
}
.ll-gp-clear {
    flex: none;
    font-size: 0.66rem;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ll-gp-clear:hover { text-decoration: underline; }

/* Upload Share-unavailable state: keep the action visible + retryable. */
.ll-share-error {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.ll-share-error-text {
    font-size: 0.7rem;
    color: #fbbf24;
    max-width: 22rem;
}

@media (max-width: 600px) {
    .ll-player-stats { gap: 0.6rem; }
    .ll-player-stat:nth-child(n+3) { display: none; }
    .ll-toolbar { flex-direction: column; align-items: flex-start; }
    .ll-capture-header { flex-direction: column; gap: 0.5rem; }
    .ll-item-weight { display: none; }
    .ll-filter-bar { flex-direction: column; align-items: stretch; }
    .ll-filter-bar .search-input-wrapper { min-width: unset; width: 100%; }
    .ll-guild-picker { max-width: unset; min-width: 0; width: 100%; }
    /* Touch-friendly: always-visible remove button with bigger tap target */
    .ll-remove-player { opacity: 0.9; width: 32px; height: 32px; font-size: 1.2rem; }
    .ll-player-card:hover .ll-remove-player { opacity: 1; }
}
@media (max-width: 420px) {
    .ll-toolbar button { font-size: 0.75rem; padding: 0.35rem 0.5rem; min-height: 36px; }
    .ll-session-name-row { flex-direction: column; align-items: stretch; }
    .ll-session-name-input { min-width: 0; max-width: none; width: 100%; }
    .ll-summary-strip { padding: 0.45rem 0.55rem; gap: 0.45rem; }
    .ll-summary-stat { border-right: none; min-width: 0; padding: 0.1rem 0.35rem; }
    .ll-preview-icon { width: 28px; height: 28px; }
    .ll-item-icon { width: 36px; height: 36px; }
    .ll-player-header { padding: 0.55rem 0.7rem; gap: 0.5rem; }
    /* Narrow screens: keep the reserved gutter (so names still line up) but give
       the horizontal space back to the player name. */
    .ll-alliance-badge { width: 3.3rem; font-size: 0.72rem; padding: 0.18rem 0.3rem; }
    /* Mobile: preview also uncapped — card stretches to fit all items. */
}

/* Toast notifications */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 380px;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
}
.toast.show { transform: translateX(0); }
.toast-error { border-left: 3px solid var(--loss-red); color: var(--loss-red); }
.toast-success { border-left: 3px solid var(--profit-green); color: var(--profit-green); }
.toast-warn { border-left: 3px solid #fbbf24; color: #fbbf24; }
.toast-info { border-left: 3px solid var(--accent); }
.toast-confirm { border-left: 3px solid var(--accent); transform: translateX(0); }

/* Stale data badge */
.stale-data-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    font-style: normal;
    margin-bottom: 0.3rem;
    display: inline-block;
}
.stale-data-badge.mild {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
}

.item-card-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.price-cell {
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.price-cell .pc-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.price-cell .pc-value {
    font-family: monospace;
    font-weight: 600;
}

.price-cell .pc-city {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.item-card-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: auto;
}

.btn-card-action {
    flex: 1;
    padding: 0.4rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.btn-card-action:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.btn-copy-shopping-list:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: var(--accent-dim);
}

.btn-haul-refresh:hover, .btn-haul-refresh-all:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: var(--accent-dim);
}

/* ====== LIVE FLIPS ====== */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: livePulse 2s infinite;
}

.live-dot.connected {
    background: #22c55e;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.live-dot.connected {
    animation-name: livePulseGreen;
}

@keyframes livePulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.flips-feed-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flip-card {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    padding: 0.65rem 0.85rem;
    transition: all 0.2s ease;
    animation: flipSlideIn 0.3s ease both;
}

.flip-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.1);
}

.flip-card.new {
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.12);
}

@keyframes flipSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flip-card .flip-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--border-dim);
}

.flip-card .flip-route {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.flip-card .flip-profit {
    text-align: right;
}

.flip-card .flip-profit .amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--profit-green, #22c55e);
}

.flip-card .flip-profit .roi {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Tab notification for new flips */
.nav-tab.has-new {
    color: #22c55e !important;
    animation: tabFlash 0.5s ease 3;
}

@keyframes tabFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ====== TRADE CARD (ARBITRAGE) ====== */
.trade-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
    animation: fadeInUp 0.3s ease-out both;
}

.trade-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.item-icon {
    width: 44px;
    height: 44px;
    background: #000;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.header-titles {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-quality {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.trade-route {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.city {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sell-city {
    text-align: right;
}

.route-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.city-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
}

.price {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 600;
}

.arrow {
    color: var(--text-muted);
    font-size: 1.3rem;
}

.profit-section {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.profit-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profit-row.total {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border-color);
    font-size: 1.05rem;
    color: var(--text-primary);
}

.roi-row {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.85rem;
}

.text-green { color: var(--profit-green); }
.text-red { color: var(--loss-red); }
.text-accent { color: var(--accent); }

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.btn-refresh-item {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.btn-refresh-item:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: rotate(180deg);
}

.btn-refresh-item.loading {
    animation: spin 0.8s linear infinite;
}

.btn-graph {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.45rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-graph:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* ====== CITY COMPARISON TABLE ====== */
.compare-container {
    overflow-x: auto;
}

.compare-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.compare-header img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #000;
}

.compare-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.compare-table th {
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    color: var(--accent);
    font-weight: 700;
    text-align: center;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.compare-table th:first-child {
    text-align: left;
}

.compare-table td {
    padding: 0.6rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: monospace;
}

.compare-table td:first-child {
    text-align: left;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-secondary);
}

.compare-table tr:last-child td {
    border-bottom: none;
}

.compare-table td.best-price {
    color: var(--profit-green);
    font-weight: 700;
    background: var(--profit-green-dim);
}

.compare-table td.worst-price {
    color: var(--loss-red);
    font-weight: 700;
    background: var(--loss-red-dim);
}

.compare-table .updated-row td {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: inherit;
}

/* ====== CRAFTING CARD ====== */
.craft-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
    animation: fadeInUp 0.3s ease-out both;
}

.craft-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.craft-materials {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border: 1px dashed var(--border-color);
}

.craft-materials-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.mat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

.mat-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mat-icon {
    width: 22px;
    height: 22px;
    border-radius: 2px;
}

.mat-city {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.total-mat-cost {
    text-align: right;
    font-weight: 700;
    border-top: 1px solid var(--border-color);
    padding-top: 0.4rem;
    margin-top: 0.3rem;
    color: var(--loss-red);
    font-size: 0.9rem;
}

.craft-sell-route {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.craft-sell-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.profit-gauge {
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.profit-gauge-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.profit-gauge-fill.positive {
    background: linear-gradient(90deg, var(--profit-green), #22c55e);
}

.profit-gauge-fill.negative {
    background: linear-gradient(90deg, var(--loss-red), #ef4444);
}

/* ====== RESULT COUNT BAR ====== */
.result-count-bar {
    grid-column: 1 / -1;
    text-align: center;
    padding: 0.5rem 0.75rem;
    background: var(--accent-dim);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.result-count-bar strong {
    color: var(--accent);
}

/* ====== LOADING / ERROR ====== */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error-message {
    background: var(--loss-red-dim);
    border: 1px solid var(--loss-red);
    color: var(--loss-red);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ====== TAB PANES ====== */
.tab-pane {
    display: block;
}

.tab-pane.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

/* ====== MODAL ====== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: flex-start;   /* was: center — flex-start lets tall content scroll */
    overflow-y: auto;           /* modal container is the scroll surface */
    padding: 2rem 1rem;         /* breathing room top/bottom */
    box-sizing: border-box;
    z-index: var(--z-modal);
    backdrop-filter: blur(6px);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: var(--shadow);
    /* modal-content itself is NOT the scroll container — the .modal wrapper scrolls,
       keeping the close-btn always reachable at the top of the content box */
}

.close-btn {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    transition: color var(--transition);
}

.close-btn:hover {
    color: var(--loss-red);
}

.ll-image-report-modal {
    max-width: 940px;
    padding: 1.25rem;
}
.ll-image-report-preview {
    width: 100%;
    max-height: min(68vh, 760px);
    overflow: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
}
.ll-image-report-preview img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 180px;
    border-radius: 6px;
    background: var(--bg-elevated);
}

.chart-container {
    margin-top: 1.5rem;
    width: 100%;
    height: 380px;
}

/* ====== EMPTY STATE ====== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
}

.empty-state .hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ====== ANIMATIONS ====== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== FOOTER ====== */
footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ====== STATUS BAR TIMERS ====== */
.topbar-timers {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .brand-title {
        font-size: 0.95rem;
        letter-spacing: 1.2px;
        white-space: normal;
    }

    .brand-tagline {
        display: none;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    header {
        padding: 0.65rem 1rem;
    }

    .top-bar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .top-bar-left {
        flex-wrap: wrap;
    }

    .btn-scan-all {
        width: 100%;
        justify-content: center;
    }

    main {
        padding: 1rem 0.75rem 2rem;
    }

    .controls-panel {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .control-group {
        width: 100%;
    }

    .search-input-wrapper {
        min-width: unset;
        width: 100%;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .main-nav-inner {
        flex-wrap: wrap;
        gap: 0;
    }

    .nav-group {
        position: static;
    }

    .nav-group-toggle {
        padding: 0.6rem 0.6rem;
        font-size: 0.75rem;
    }

    .nav-dropdown {
        position: fixed;
        top: auto;
        left: 0.5rem;
        right: 0.5rem;
        min-width: auto;
    }

    .nav-tab {
        padding: 0.6rem 0.6rem;
        font-size: 0.75rem;
    }

    .nav-tab svg,
    .nav-group-toggle svg:not(.nav-chevron) {
        display: none;
    }

    .trade-route {
        flex-direction: column;
        gap: 0.3rem;
    }

    .sell-city {
        text-align: left;
    }

    .arrow {
        transform: rotate(90deg);
    }

    .modal-content {
        width: 95%;
        padding: 1rem;
    }

    .chart-container {
        height: 250px;
    }

    .compare-table {
        font-size: 0.75rem;
    }

    .browser-status-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ====== ENCHANTMENT BADGES ====== */
.enchantment-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.8);
    border: 2px solid var(--bg-card);
    z-index: 10;
}

.ench-1 { background: linear-gradient(135deg, #22c55e, #166534); box-shadow: 0 0 8px rgba(34,197,94,0.6); }
.ench-2 { background: linear-gradient(135deg, #3b82f6, #1e3a8a); box-shadow: 0 0 8px rgba(59,130,246,0.6); }
.ench-3 { background: linear-gradient(135deg, #a855f7, #581c87); box-shadow: 0 0 8px rgba(168,85,247,0.6); }
.ench-4 { background: linear-gradient(135deg, #eab308, #854d0e); box-shadow: 0 0 8px rgba(234,179,8,0.6); color: #222; }

/* Detail rows in compare table */
.compare-table .detail-row td {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

/* ====== CRAFTING CALCULATOR ====== */
.craft-settings-panel {
    margin-top: -0.5rem;
    background: var(--bg-elevated);
    border-color: rgba(212, 175, 55, 0.15);
}

.btn-secondary {
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-1px);
}

.btn-scan-all:hover {
    background: #2a2a2a;
    border-color: #555;
}

.scan-progress-wrap {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.2);
}

/* Summary Card */
.craft-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease-out both;
}

.craft-summary-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.craft-summary-header h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0;
}

.craft-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-box {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
}

.stat-box.highlight {
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.05);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: monospace;
}

/* Detail Sections */
.craft-detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease-out both;
}

.craft-detail-section h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.craft-detail-info {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rrr-badge {
    display: inline-flex;
    padding: 0.25rem 0.6rem;
    background: rgba(74, 222, 128, 0.1);
    color: var(--profit-green);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.focus-badge {
    display: inline-flex;
    padding: 0.25rem 0.6rem;
    background: rgba(168, 85, 247, 0.1);
    color: var(--purple);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Cost Table */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.craft-cost-table {
    font-size: 0.8rem;
    min-width: 700px;
}

.craft-cost-table th {
    font-size: 0.7rem;
    white-space: nowrap;
}

.craft-cost-table td {
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.8rem;
}

.mat-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit !important;
    white-space: normal !important;
}

.mat-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.total-row td {
    border-top: 2px solid var(--border-color);
    font-weight: 700;
    padding-top: 0.6rem;
}

/* Number inputs in crafting settings */
.craft-settings-panel input[type="number"] {
    padding: 0.6rem 0.5rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

.craft-settings-panel input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .craft-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .craft-cost-table {
        min-width: 500px;
    }
}

/* ====== ALBION IN-GAME MARKET MODAL OVERRIDES ====== */
.albion-market-modal {
    background: #cbbca2;
    border: 3px solid #4a3e31;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 60px rgba(139, 107, 72, 0.4);
    color: #3e3527;
    max-width: 850px;
    padding: 1.5rem;
    font-family: Arial, sans-serif;
    position: relative;
    background-image: linear-gradient(to right, rgba(0,0,0,0.05) 0%, transparent 10%, transparent 90%, rgba(0,0,0,0.05) 100%);
}

.albion-market-modal .close-btn {
    color: #4a3e31;
    text-shadow: none;
    top: 5px;
    right: 15px;
    font-size: 2rem;
    font-weight: bold;
    opacity: 0.7;
}

.albion-market-modal .close-btn:hover {
    color: #b63628;
    opacity: 1;
}

.market-header {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 10;
}

.market-city-select {
    background: #e2d1b7;
    border: 1px solid #8e7c65;
    color: #3e3527;
    padding: 0.3rem 0.6rem;
    border-radius: 2px;
    font-weight: bold;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.order-book-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.order-column {
    flex: 1;
}

.order-column h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #3e3527;
    border-bottom: 1px solid transparent;
}

.order-table-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #725b44;
    text-transform: uppercase;
    font-weight: bold;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #a38d72;
    margin-bottom: 0.5rem;
}

.order-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(163, 141, 114, 0.5);
    font-weight: bold;
    font-size: 0.95rem;
}

.order-row:hover {
    background: rgba(255, 255, 255, 0.2);
}

.order-row span.price {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.order-row span.amount {
    color: #3e3527;
}

.order-divider {
    width: 2px;
    background: linear-gradient(to bottom, transparent, #a38d72, transparent);
    margin: 0 1rem;
}

.history-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #3e3527;
}

.chart-wrapper {
    background: rgba(189, 169, 146, 0.4);
    border: 1px solid #b19472;
    border-radius: 4px;
    padding: 1rem;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

.chart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-weight: bold;
}

.time-toggles {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #5a4b38;
}

.time-toggles label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    font-weight: bold;
    color: #3e3527;
    text-transform: none;
    letter-spacing: normal;
}

.time-toggles input[type="radio"] {
    accent-color: #5a4b38;
}

.avg-price-display {
    font-size: 0.95rem;
    color: #3e3527;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ====== FRESHNESS INDICATORS ====== */
.freshness-dot {
    font-size: 0.6rem;
    vertical-align: middle;
    margin-right: 2px;
}
.freshness-dot.fresh {
    animation: freshPulse 2s ease-in-out infinite;
}
@keyframes freshPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ====== CONFIDENCE BADGES ====== */
.confidence-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.confidence-high {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}
.confidence-mid {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
}
.confidence-low {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ====== TREND BADGES ====== */
.trend-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    letter-spacing: 0.2px;
    vertical-align: middle;
    white-space: nowrap;
}
.trend-up {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}
.trend-down {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}
.trend-neutral {
    background: rgba(140, 124, 104, 0.15);
    color: #8e7c65;
    border: 1px solid rgba(140, 124, 104, 0.3);
}

/* ====== VOLATILE BADGE ====== */
.volatile-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    letter-spacing: 0.2px;
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.35);
    text-transform: uppercase;
}

.liquidity-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}
.liquidity-badge.high {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.28);
}
.liquidity-badge.mid {
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.28);
}
.liquidity-badge.low,
.liquidity-badge.unknown {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.28);
}

/* ====== CHART TABS ====== */
.chart-tab-bar {
    display: flex;
    gap: 0;
    margin: 0.6rem 0 0.75rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    width: fit-content;
}
.chart-tab-btn {
    padding: 0.4rem 1.1rem;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}
.chart-tab-btn:hover { color: var(--text-secondary); background: var(--bg-elevated); }
.chart-tab-btn.active {
    background: var(--accent);
    color: #000;
}

/* ====== ANALYTICS LEGEND ====== */
.analytics-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.4rem 0.2rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.analytics-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.analytics-legend-dot {
    display: inline-block;
    width: 12px;
    height: 3px;
    border-radius: 2px;
}

/* ====== TIER BADGES ====== */
.tier-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 8px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}
.tier-bronze {
    background: rgba(205, 127, 50, 0.15);
    color: #cd7f32;
    border: 1px solid rgba(205, 127, 50, 0.3);
}
.tier-silver {
    background: rgba(192, 192, 192, 0.15);
    color: #c0c0c0;
    border: 1px solid rgba(192, 192, 192, 0.3);
}
.tier-gold {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}
.tier-diamond {
    background: rgba(185, 242, 255, 0.15);
    color: #b9f2ff;
    border: 1px solid rgba(185, 242, 255, 0.3);
    text-shadow: 0 0 6px rgba(185, 242, 255, 0.4);
}

/* ====== COMMUNITY TAB ====== */
.community-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1rem auto;
    max-width: 600px;
}
.community-stats-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.community-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent);
}
.community-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.community-stat-box {
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.community-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}
.community-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tier-progress-wrapper {
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}
.tier-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.tier-progress-bar {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}
.tier-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width 0.5s ease;
}

/* ====== LEADERBOARD ====== */
.community-leaderboard {
    max-width: 700px;
    margin: 1.5rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.leaderboard-row:hover {
    background: var(--bg-elevated);
}
.leaderboard-row + .leaderboard-row {
    border-top: 1px solid var(--border-color);
}
.leaderboard-rank {
    font-weight: 800;
    font-size: 1rem;
    width: 2rem;
    text-align: center;
    color: var(--text-muted);
}
.leaderboard-rank.top-1 { color: #ffd700; font-size: 1.2rem; }
.leaderboard-rank.top-2 { color: #c0c0c0; font-size: 1.1rem; }
.leaderboard-rank.top-3 { color: #cd7f32; font-size: 1.05rem; }
.leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}
.leaderboard-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.leaderboard-scans {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    white-space: nowrap;
}

/* ====== ABOUT TAB ====== */
.about-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 0;
}
.about-section {
    margin-bottom: 2.5rem;
}
.about-heading {
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color var(--transition), transform var(--transition);
}
.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}
.feature-card h3 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.feature-card p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Changelog */
.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.changelog-entry {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    border-left: 3px solid var(--accent);
}
.changelog-date {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}
.changelog-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}
.changelog-entry ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.changelog-entry li {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.6;
    padding-left: 1rem;
    position: relative;
}
.changelog-entry li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}
.changelog-entry code {
    background: var(--bg-elevated);
    color: var(--accent-light);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.78rem;
}

/* ====== TRANSPORT TAB ====== */
.transport-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.transport-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.08);
}
.transport-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.transport-card-header .item-icon {
    width: 40px;
    height: 40px;
}
.transport-card-header .header-titles {
    flex: 1;
}
.transport-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.transport-stat {
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    text-align: center;
}
.transport-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}
.transport-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.transport-stat-value.profit { color: var(--profit-green); }
.transport-stat-value.loss { color: var(--loss-red); }
.transport-stat-value.accent { color: var(--accent); }
.transport-route-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.transport-route-bar .city-tag {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.6rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
}
.transport-trip-summary {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.05), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.transport-trip-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.transport-trip-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--profit-green);
}
.transport-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

/* ====== HAUL PLANS (Collapsible cards) ====== */
.haul-plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
}
.haul-plan-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}
.haul-plan-card.expanded {
    border-color: var(--accent);
}
.haul-plan-summary {
    padding: 1rem 1.25rem;
    user-select: none;
}
.haul-plan-summary:hover {
    background: var(--bg-elevated);
}
.haul-plan-detail {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border-color);
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 2000px; }
}
.haul-plan-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-main);
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.haul-items-list {
    padding-top: 0.25rem;
}
.haul-item-row:hover {
    background: var(--bg-elevated);
}
.haul-item-row:last-child {
    border-bottom: none;
}

/* ====== NEW FEATURES: SHARED STYLES ====== */

/* Table scroll wrapper */
.table-scroll-wrapper {
    overflow-x: auto;
    margin-top: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.table-scroll-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

/* RRR Calculator */
.rrr-rate-display {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.rrr-rate-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.rrr-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-elevated);
    border-radius: 6px;
    margin-top: 1rem;
    overflow: hidden;
}

.rrr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--profit-green));
    border-radius: 6px;
    transition: width 0.4s ease;
}

/* Favorites chips */
.fav-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.fav-chip img {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
}

.fav-chip-remove {
    background: none;
    border: none;
    color: var(--loss-red);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.2rem;
}

/* Portfolio summary cards */
.portfolio-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.portfolio-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.portfolio-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Build cards */
/* BENCHED: Community Builds
.build-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    transition: border-color var(--transition);
}

.build-card:hover {
    border-color: var(--accent);
}

.build-slot-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.build-tag {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.65rem;
    white-space: nowrap;
}
END BENCHED: Community Builds */

/* Mount type headers */
/* BENCHED: Mounts Database
.mount-type-header {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}
END BENCHED: Mounts Database */

/* ============================================================
   LANDING PAGE OVERLAY
   ============================================================ */

#landing-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-toast);
    background: #05050a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
    opacity: 1;
    visibility: visible;
}

#landing-overlay.dismissed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animated mesh grid */
#landing-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212, 175, 55, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 1;
    pointer-events: none;
}

/* Glowing orbs */
.landing-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.landing-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.landing-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.18) 0%, transparent 70%);
    top: -180px;
    right: -150px;
    animation: orbDrift1 12s ease-in-out infinite alternate;
}

.landing-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(88, 101, 242, 0.18) 0%, transparent 70%);
    bottom: -180px;
    left: -150px;
    animation: orbDrift2 15s ease-in-out infinite alternate;
}

.landing-orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.12) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbDrift3 10s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, 30px) scale(1.15); }
}
@keyframes orbDrift2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -40px) scale(1.1); }
}
@keyframes orbDrift3 {
    0%   { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.7; }
}

/* Content wrapper */
.landing-inner {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 680px;
    width: 100%;
    animation: landingFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes landingFadeUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Logo icon box */
.landing-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.04));
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.75rem;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 40px rgba(212, 175, 55, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.5);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset, 0 0 30px rgba(212,175,55,0.15), 0 8px 32px rgba(0,0,0,0.5); }
    50%       { box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, 0 0 55px rgba(212,175,55,0.28), 0 8px 40px rgba(0,0,0,0.6); }
}

/* Titles */
.landing-title {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 40%, #e0a96d 75%, #fff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 6s ease infinite;
    margin-bottom: 0.9rem;
}

.landing-tagline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: 0.3px;
    line-height: 1.6;
}

/* Feature pills row */
.landing-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2.25rem;
}

.feature-pill {
    padding: 0.3rem 0.85rem;
    background: rgba(212, 175, 55, 0.07);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 20px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.feature-pill:hover {
    background: rgba(212, 175, 55, 0.14);
    border-color: rgba(212, 175, 55, 0.35);
}

/* Auth card */
.landing-auth-card {
    background: rgba(15, 15, 24, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 20px;
    padding: 2.25rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: landingFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.landing-auth-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.55rem;
    letter-spacing: 0.3px;
}

.landing-auth-card > p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    line-height: 1.65;
}

/* Discord CTA button */
.btn-discord-landing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #5865F2 0%, #4752c4 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 10px;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-discord-landing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.btn-discord-landing:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(88, 101, 242, 0.5);
    background: linear-gradient(135deg, #6977f4 0%, #5865F2 100%);
}

.btn-discord-landing:active {
    transform: translateY(0);
}

/* Divider */
.landing-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.landing-divider::before,
.landing-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.landing-why {
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 0 !important;
    line-height: 1.6 !important;
    text-align: center;
    margin-top: 0.75rem !important;
}

/* Landing page spinner */
.landing-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(212, 175, 55, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: landingSpin 0.8s linear infinite;
}

.landing-spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: landingSpin 0.8s linear infinite;
    display: inline-block;
}

@keyframes landingSpin {
    to { transform: rotate(360deg); }
}

/* Auth checking state */
.landing-auth-checking {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.landing-auth-checking p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
    animation: checkingPulse 1.5s ease-in-out infinite;
}

@keyframes checkingPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* Auth error banner */
.landing-auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    animation: landingFadeUp 0.3s ease both;
}

.landing-auth-error svg {
    flex-shrink: 0;
    stroke: #f87171;
}

/* Discord button loading state */
.btn-discord-landing.loading .discord-icon,
.btn-discord-landing.loading .btn-discord-label {
    display: none;
}

.btn-discord-landing.loading .btn-discord-loading {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
}

.btn-discord-landing.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Guest browse button */
.btn-guest-landing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.92rem;
    font-family: inherit;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-guest-landing:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

.btn-guest-landing:active {
    transform: translateY(0);
}

/* Auth tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
}

.auth-tab.active {
    color: var(--accent, #d4a843);
    background: rgba(212, 168, 67, 0.1);
    box-shadow: inset 0 -2px 0 var(--accent, #d4a843);
}

/* Auth forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.auth-input-group input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.auth-input-group input:focus {
    border-color: var(--accent, #d4a843);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

.auth-input-group input::placeholder {
    color: var(--text-muted, #666);
}

.btn-auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent, #d4a843), #b8942e);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.3rem;
}

.btn-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
    filter: brightness(1.1);
}

.btn-auth-submit:active {
    transform: translateY(0);
}

.btn-auth-submit:disabled {
    opacity: 0.6;
    pointer-events: none;
}

.btn-auth-register {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.btn-auth-register:hover {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Auth success message */
.landing-auth-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 8px;
    color: #4ade80;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    animation: landingFadeUp 0.3s ease both;
}

.landing-auth-success svg {
    flex-shrink: 0;
    stroke: #4ade80;
}

/* Footer note */
.landing-footer-note {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.landing-footer-note a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.landing-footer-note a:hover {
    color: var(--accent);
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */

.profile-page {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-verify-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: #eab308;
    font-size: 0.85rem;
}

.profile-verify-banner svg { flex-shrink: 0; stroke: #eab308; }

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.profile-header-card {
    padding: 1.5rem;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.profile-identity {
    flex: 1;
    min-width: 0;
}

.profile-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.profile-badge-green {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.25);
}

.profile-card-title {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.profile-stat-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-dark);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.profile-stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.profile-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.profile-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-setting-row:last-child { border-bottom: none; }

.profile-setting-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-setting-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-left: 0.5rem;
}

.profile-setting-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0 0.75rem 0;
}

.profile-input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}

.profile-input:focus { border-color: var(--accent); }

.btn-small {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-small:hover { border-color: var(--text-primary); color: var(--text-primary); }
.btn-small:disabled { opacity: 0; pointer-events: none; width: 0; padding: 0; border: none; margin: 0; overflow: hidden; }

.btn-small-accent {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-small-accent:hover { filter: brightness(1.15); }

.btn-small-danger {
    background: transparent;
    color: var(--loss-red);
    border: 1px solid var(--loss-red);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-small-danger:hover { background: rgba(248, 113, 113, 0.1); }

.btn-small-accent:disabled, .btn-small-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.profile-msg {
    font-size: 0.78rem;
    min-height: 1rem;
}

.profile-msg.success { color: var(--profit-green); }
.profile-msg.error { color: var(--loss-red); }

/* Transport mode toggle */
.transport-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.transport-mode-btn:hover { color: var(--text-secondary); background: var(--bg-elevated); }

.transport-mode-btn.active {
    background: var(--accent);
    color: #000;
}

.transport-mode-btn.active svg { stroke: #000; }

/* Loot Buyer capture cards — compact grid with scroll */
#loot-captures-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px; /* prevent scrollbar overlap */
}

.loot-capture-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    transition: all 0.2s ease;
}

.loot-capture-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.1);
}

.loot-capture-card.loot-multi-selected {
    border-color: rgba(251, 191, 36, 0.7);
    background: rgba(251, 191, 36, 0.05);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}

.loot-capture-card .loot-multi-check {
    flex-shrink: 0;
    cursor: pointer;
}

.loot-capture-card .loot-card-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loot-capture-card .loot-card-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Collapsible items card for loot buyer */
.loot-items-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.loot-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    transition: background var(--transition);
}
.loot-items-header:hover { background: var(--bg-elevated); }
.loot-items-summary { display: flex; flex-direction: column; gap: 0.15rem; }
.loot-items-title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.loot-items-stats { font-size: 0.72rem; color: var(--text-muted); }
.loot-items-chevron {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}
.loot-items-card.expanded .loot-items-chevron { transform: rotate(180deg); }
.loot-items-grid {
    display: none;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
}
.loot-items-card.expanded .loot-items-grid { display: block; }
.loot-items-search-wrap {
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}
.loot-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
}
.loot-item-row:last-child { border-bottom: none; }
.loot-item-icon { width: 40px; height: 40px; flex-shrink: 0; image-rendering: pixelated; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 4px; background: var(--bg-elevated); }
.loot-item-name {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.loot-item-qty {
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}
.loot-item-row:hover { background: var(--bg-elevated); }
.loot-item-detail {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-elevated);
}
.loot-item-detail-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    flex-wrap: wrap;
}
.loot-detail-prices {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.loot-detail-link {
    color: var(--accent);
    cursor: pointer;
    font-size: 0.72rem;
    white-space: nowrap;
    text-decoration: none;
}
.loot-detail-link:hover { text-decoration: underline; }

#loot-results .flip-card {
    padding: 0.4rem 0.65rem;
    gap: 0.5rem;
}

#loot-results .flip-icon {
    width: 28px;
    height: 28px;
}

@media (max-width: 768px) {
    #loot-captures-list { grid-template-columns: 1fr; }
}

/* ====== LOOT BUYER ANALYSIS ====== */

/* Verdict banner */
.loot-verdict {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}
.loot-verdict.good  { background: rgba(74, 222, 128, 0.12); color: var(--profit-green); border: 1px solid rgba(74, 222, 128, 0.3); }
.loot-verdict.caution { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.loot-verdict.bad   { background: rgba(248, 113, 113, 0.12); color: var(--loss-red); border: 1px solid rgba(248, 113, 113, 0.3); }

/* Risk/status badges on per-item rows */
.risk-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.risk-badge.danger  { background: rgba(248, 113, 113, 0.2); color: var(--loss-red); }
.risk-badge.warning { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.risk-badge.ok      { background: rgba(74, 222, 128, 0.15); color: var(--profit-green); }

/* City trip card (Where to Sell mode) */
.loot-city-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.loot-city-group h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.loot-city-group:hover {
    border-color: var(--accent);
}

/* ====== SELL PLAN (Phase 2 Sell Optimizer) ====== */

/* Summary bar at top of sell plan */
.sell-plan-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.sell-plan-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.sell-route-hint {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Trip card header */
.sell-trip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.sell-trip-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-right: 0.4rem;
}
.sell-trip-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.sell-trip-total {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--profit-green);
}

/* Item rows inside a trip */
.sell-plan-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sell-plan-item {
    display: grid;
    grid-template-columns: 24px 1fr auto auto auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
}
.sell-plan-item:last-child { border-bottom: none; }
.sell-plan-icon {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    flex-shrink: 0;
}
.sell-plan-name {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.sell-plan-qty {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}
.sell-plan-price {
    text-align: right;
    color: var(--text-secondary);
    white-space: nowrap;
}
.sell-plan-total {
    text-align: right;
    font-weight: 600;
    color: var(--profit-green);
    white-space: nowrap;
}

/* Sell method badges (instant / market) */
.sell-method-badge {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.sell-method-badge.instant { background: rgba(74, 222, 128, 0.15); color: var(--profit-green); }
.sell-method-badge.market  { background: rgba(96, 165, 250, 0.15); color: var(--blue); }

/* Copy All button */
.loot-copy-all-btn {
    font-size: 0.75rem;
}

@media (max-width: 600px) {
    .sell-plan-item {
        grid-template-columns: 24px 1fr auto auto;
    }
    .sell-plan-price { display: none; }
}

/* Flip type badge */
.flip-type-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.flip-type-badge.instant {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.flip-type-badge.cross-city {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.flip-type-badge.unverified {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.28);
}

@media (max-width: 768px) {
    .profile-stats-grid { grid-template-columns: 1fr; }
    .profile-avatar-lg { width: 48px; height: 48px; }
    .profile-inline-form { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   PREMIUM REDESIGN — Enhanced visual polish for main app
   ============================================================ */

/* Richer header gradient + subtle ambient glow */
header {
    background: linear-gradient(160deg, #06060e 0%, #10102a 45%, #080814 100%);
    box-shadow: 0 1px 0 rgba(212, 175, 55, 0.08), 0 4px 40px rgba(0, 0, 0, 0.6);
}

/* Glassmorphism on top bar */
.top-bar {
    background: rgba(12, 12, 22, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

/* Glassy nav bar */
.main-nav {
    background: rgba(10, 10, 20, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Nav dropdown gets glass too */
.nav-dropdown {
    background: rgba(22, 22, 38, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.12);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

/* Controls panel glass */
.controls-panel {
    background: rgba(20, 20, 32, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 175, 55, 0.09);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Enhanced item cards */
.item-card {
    background: rgba(22, 22, 34, 0.8);
    border: 1px solid rgba(42, 42, 61, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
}

.item-card:hover {
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(212, 175, 55, 0.15) inset,
        0 0 20px rgba(212, 175, 55, 0.08);
    transform: translateY(-3px);
}

/* Enhanced trade cards */
.trade-card {
    background: rgba(22, 22, 34, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(42, 42, 61, 0.8);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
}

.trade-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.45),
        0 0 24px rgba(212, 175, 55, 0.07);
    transform: translateY(-4px);
}

/* Glowing primary button */
.btn-primary {
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.2);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
    transform: translateY(-2px);
}

/* Glowing Discord login button in header */
.btn-discord {
    box-shadow: 0 2px 12px rgba(88, 101, 242, 0.25);
    transition: all 0.2s ease !important;
    position: relative;
    overflow: hidden;
}

.btn-discord:hover {
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4) !important;
    transform: translateY(-1px);
    background: #4752c4 !important;
}

/* Inputs glow on focus */
select:focus,
.search-input-wrapper input:focus {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
}

/* Scan all button enhanced glow */
.btn-scan-all:hover {
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.4), 0 0 0 1px rgba(212, 175, 55, 0.2);
}

/* Section headings subtle glow */
.section-title {
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

/* Stat cards glass effect */
.stat-card,
.section-card {
    background: rgba(20, 20, 32, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(212, 175, 55, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Profit highlight pulse animation */
@keyframes profitPulse {
    0%, 100% { text-shadow: 0 0 8px rgba(74, 222, 128, 0.3); }
    50%       { text-shadow: 0 0 16px rgba(74, 222, 128, 0.5); }
}

.profit-value.highlight {
    animation: profitPulse 2s ease-in-out infinite;
}

/* Tier badges enhanced */
.tier-bronze {
    background: rgba(205, 127, 50, 0.12);
    color: #e8943a;
    border: 1px solid rgba(205, 127, 50, 0.25);
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.1);
}

.tier-silver {
    background: rgba(192, 192, 192, 0.1);
    color: #d4d4d4;
    border: 1px solid rgba(192, 192, 192, 0.25);
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.08);
}

.tier-gold {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.25);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
}

.tier-diamond {
    background: rgba(185, 242, 255, 0.1);
    color: #b9f2ff;
    border: 1px solid rgba(185, 242, 255, 0.25);
    box-shadow: 0 0 12px rgba(185, 242, 255, 0.15);
}

/* Footer glass */
footer {
    background: rgba(6, 6, 14, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(212, 175, 55, 0.06);
}

/* Smooth page transitions for tab panes */
.tab-pane.active {
    animation: tabFadeIn 0.3s ease-out both;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.35);
}

/* Selection highlight */
::selection {
    background: rgba(212, 175, 55, 0.25);
    color: var(--text-primary);
}

/* ====== SALE NOTIFICATIONS (auto-detected from mail) ====== */

.sale-notif-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.4rem;
}
.sale-notif-icon { width: 28px; height: 28px; border-radius: 4px; flex-shrink: 0; }
.sale-notif-info { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.sale-notif-item { font-size: 0.8rem; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sale-notif-price { font-size: 0.72rem; color: var(--profit-green); }
.sale-notif-meta { font-size: 0.68rem; color: var(--text-muted); flex-shrink: 0; text-align: right; }

/* ====== LOOT TAB LIFECYCLE TRACKER (Phase 3) ====== */

.loot-tracked-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    cursor: pointer;
    transition: border-color 0.15s;
}
.loot-tracked-card:hover {
    border-color: var(--accent);
}

.loot-tracked-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.loot-tracked-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
@media (max-width: 600px) {
    .loot-tracked-stats { grid-template-columns: repeat(2, 1fr); }
}

.loot-tracked-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.loot-tracked-stat-label {
    font-size: 0.67rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.loot-tracked-stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.loot-tracked-progress-bar {
    height: 5px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: visible; /* allow the break-even tick to render a bit above */
    position: relative;
    margin-bottom: 0.2rem;
}
.loot-tracked-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
/* Break-even tick marker at the 100% position on the progress bar */
.loot-tracked-break-even-tick {
    position: absolute;
    right: 0;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}
/* Days-held age badge on tab card header */
.loot-tab-age-badge {
    font-size: 0.62rem;
    padding: 0.08rem 0.4rem;
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.loot-tab-age-badge.stale {
    background: rgba(239, 68, 68, 0.15);
    color: var(--loss-red);
}

/* Small inline badges for city and status */
.loot-tab-badge {
    font-size: 0.67rem;
    color: var(--text-muted);
    padding: 0.1rem 0.35rem;
    background: var(--bg-elevated);
    border-radius: 8px;
    white-space: nowrap;
}

.loot-tab-status {
    font-size: 0.64rem;
    padding: 0.1rem 0.45rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    white-space: nowrap;
}
.loot-tab-status.status-open    { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.loot-tab-status.status-partial { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.loot-tab-status.status-sold    { background: rgba(74, 222, 128, 0.15); color: var(--profit-green); }

/* Status dropdown in detail view */
.loot-status-select {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
}
.loot-status-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ====== LOOT MANUAL ENTRY ====== */
.loot-manual-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}
.loot-manual-item-name {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.loot-manual-item-qty {
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}
.loot-manual-remove {
    background: none;
    border: none;
    color: var(--loss-red);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity var(--transition);
}
.loot-manual-remove:hover { opacity: 1; }

/* ====== INLINE SALE FORM ====== */
.sale-inline-form {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sale-form-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sale-form-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 50px;
    flex-shrink: 0;
}
.sale-form-select,
.sale-form-input {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}
.sale-form-select:focus,
.sale-form-input:focus {
    outline: none;
    border-color: var(--accent);
}
.sale-form-qty { max-width: 80px; }
.sale-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* ====== MOBILE: NEWER FEATURES ====== */
@media (max-width: 600px) {
    .sale-inline-form { padding: 0.5rem; }
    .sale-form-row { flex-wrap: wrap; }
    .sale-form-label { min-width: 100%; margin-bottom: -0.25rem; }
    .sale-form-select, .sale-form-input { font-size: 0.85rem; }

    .loot-manual-item { font-size: 0.78rem; gap: 0.35rem; }

    .sell-trip-total { font-size: 0.85rem; }
    .sell-route-hint { font-size: 0.72rem; }

    .loot-capture-card { padding: 0.5rem; }
    .loot-card-title { font-size: 0.82rem; }
    .loot-card-meta { font-size: 0.68rem; }
}

/* ====== FEEDBACK FAB & MODAL ====== */
.feedback-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.feedback-fab:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.08);
}
.feedback-modal-content {
    max-width: 480px;
}
.feedback-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.feedback-modal-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.feedback-textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 110px;
    transition: border-color var(--transition);
}
.feedback-textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.feedback-char-count {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.feedback-status {
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    text-align: center;
}
.feedback-status.hidden { display: none; }
.feedback-status.success {
    background: var(--profit-green-dim);
    color: var(--profit-green);
    border: 1px solid rgba(74, 222, 128, 0.25);
}
.feedback-status.error {
    background: var(--loss-red-dim);
    color: var(--loss-red);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

/* ====== NEWS BANNER ====== */
#news-banner {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    text-align: center;
    font-weight: 500;
    position: relative;
    z-index: 101;
}
#news-banner.banner-info { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border-bottom: 1px solid rgba(59, 130, 246, 0.3); }
#news-banner.banner-success { background: rgba(34, 197, 94, 0.15); color: #86efac; border-bottom: 1px solid rgba(34, 197, 94, 0.3); }
#news-banner.banner-warning { background: rgba(234, 179, 8, 0.15); color: #fde047; border-bottom: 1px solid rgba(234, 179, 8, 0.3); }
#news-banner.banner-error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-bottom: 1px solid rgba(239, 68, 68, 0.3); }
#news-banner a { color: var(--accent); text-decoration: underline; }
#news-banner .banner-close { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; opacity: 0.6; }
#news-banner .banner-close:hover { opacity: 1; }

/* ====== MOBILE NAVIGATION ====== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }

    .main-nav-inner {
        flex-wrap: wrap;
        position: relative;
    }
    .main-nav-inner .nav-group,
    .main-nav-inner .nav-tab:not(.mobile-menu-btn) {
        display: none;
    }
    .main-nav-inner.mobile-open .nav-group,
    .main-nav-inner.mobile-open .nav-tab {
        display: flex;
        width: 100%;
    }

    /* Shrink header on mobile */
    .site-header h1 { font-size: 1.2rem; }
    .site-header .tagline { font-size: 0.7rem; }
    .header-right { display: none; }

    /* Stack controls */
    .controls-panel { flex-wrap: wrap; gap: 0.5rem; }
    .control-group { min-width: 120px; flex: 1 1 45%; }
    .search-group { flex: 1 1 100%; }

    /* Smaller cards */
    .item-card { padding: 0.75rem; }
    .item-card .card-header { flex-wrap: wrap; gap: 0.5rem; }

    /* Landing overlay mobile */
    .landing-card { padding: 1.5rem 1rem; max-width: 95vw; }
    .landing-features { display: none; }

    /* Loot Logger mobile */
    .ll-filter-bar { flex-wrap: wrap; }
    .ll-player-card { padding: 0.5rem; }
}

/* Cmd+K search */
.cmdk-item:hover { background: rgba(99, 102, 241, 0.1); }
.cmdk-item:first-child { background: rgba(99, 102, 241, 0.06); }

/* Consumed flip */
.flip-consumed { opacity: 0.4; position: relative; }
.flip-consumed::after { content: 'TAKEN'; position: absolute; top: 0.3rem; right: 0.3rem; font-size: 0.6rem; padding: 0.1rem 0.3rem; background: rgba(100,100,100,0.3); color: var(--text-muted); border-radius: 4px; }

/* Per-item mark-off checklist */
.item-check-row { display:flex; align-items:center; gap:0.4rem; padding:0.3rem 0.3rem; border-bottom:1px solid rgba(255,255,255,0.04); font-size:0.78rem; cursor:pointer; transition:opacity 0.15s; }
.item-check-icon { width:24px; height:24px; image-rendering:pixelated; border-radius:3px; flex-shrink:0; }
.item-sold .item-check-icon { opacity:0.35; }
.item-check-row:hover { background:rgba(255,255,255,0.03); }
.item-check-box { width:18px; height:18px; border:1px solid var(--border-color); border-radius:3px; display:flex; align-items:center; justify-content:center; font-size:0.68rem; color:var(--profit-green); flex-shrink:0; }
.item-check-name { color:var(--text-primary); }
.item-sold .item-check-box { background:rgba(16,185,129,0.15); border-color:var(--profit-green); }
.item-sold .item-check-name { text-decoration:line-through; opacity:0.5; }

/* C4: Crafter stats strip */
.crafter-strip { display:flex; align-items:center; gap:0.5rem; padding:0.5rem 0.75rem; background:var(--bg-secondary); border-radius:8px; border:1px solid var(--border-color); margin-bottom:0.75rem; flex-wrap:wrap; }
.crafter-strip-label { font-size:0.72rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.04em; font-weight:600; margin-right:0.25rem; }
.crafter-chip { font-size:0.78rem; color:var(--text-primary); background:rgba(255,255,255,0.04); padding:0.2rem 0.5rem; border-radius:4px; cursor:default; }
.crafter-chip strong { color:var(--accent); margin-left:0.25rem; }
.crafter-more { color:var(--text-muted); font-size:0.72rem; }

/* Sale row actions */
.sale-actions { display:flex; gap:0.2rem; opacity:0; transition:opacity 0.15s; }
.sale-row:hover .sale-actions { opacity:1; }
.btn-icon { background:none; border:none; cursor:pointer; font-size:0.72rem; padding:0.15rem 0.3rem; border-radius:4px; color:var(--text-muted); transition:color 0.15s, background 0.15s; }
.btn-icon:hover { color:var(--accent); background:rgba(255,255,255,0.06); }
.btn-icon-danger:hover { color:var(--loss-red); }
@media (max-width: 600px) { .sale-actions { opacity:1; } }

/* Session merge checklist */
.merge-session-item { display:flex; align-items:center; gap:0.5rem; padding:0.4rem 0.5rem; border-bottom:1px solid var(--border-color); font-size:0.8rem; cursor:pointer; }
.merge-session-item:hover { background:rgba(255,255,255,0.03); }
.merge-session-cb { accent-color:var(--accent); width:16px; height:16px; }

/* G1: Guild Leaderboard */
.lb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lb-section { background: var(--bg-secondary); border-radius: 8px; padding: 0.75rem; border: 1px solid var(--border-color); }
.lb-title { color: var(--accent); font-size: 0.92rem; margin: 0 0 0.5rem; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.lb-table th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--border-color); }
.lb-table td { padding: 0.35rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.lb-rank { color: var(--text-muted); width: 2rem; text-align: center; }
.lb-val { text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.lb-guild { color: var(--text-muted); font-size: 0.72rem; margin-left: 0.25rem; }
.lb-top3 td { color: var(--text-primary); font-weight: 500; }
.lb-top3 .lb-val { color: var(--accent); }
@media (max-width: 600px) {
    .lb-grid { grid-template-columns: 1fr; }
}

/* Disabled buttons */
.btn-small:disabled, .btn-small-accent:disabled, button:disabled {
    opacity: 0.5; cursor: not-allowed; pointer-events: none;
}

/* ============================================================
 * LOOT LOGGER REDESIGN — Apr 18, 2026 (items 5-12)
 * Sessions grouping, compact deaths, bigger icons, timeline hover
 * ============================================================ */

/* Sessions grouped into <details> buckets — Today / Yesterday / This Week / Older */
.ll-sessions-bucket {
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.ll-sessions-bucket-summary {
    cursor: pointer;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    list-style: none;
    user-select: none;
}
.ll-sessions-bucket-summary::-webkit-details-marker { display: none; }
.ll-sessions-bucket-summary::before {
    content: '▸';
    color: var(--accent);
    transition: transform 0.15s;
    width: 0.8rem;
    display: inline-block;
}
.ll-sessions-bucket[open] > .ll-sessions-bucket-summary::before { transform: rotate(90deg); }
.ll-sessions-bucket-label { flex: 1 1 auto; color: var(--text-primary); }
.ll-sessions-bucket-count {
    background: var(--accent);
    color: #0a0a0a;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}
.ll-sessions-bucket-body {
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Deaths section — single <details> container + nested <details> per death row */
.ll-deaths-section {
    margin: 0.6rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
.ll-deaths-summary {
    cursor: pointer;
    padding: 0.55rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    list-style: none;
    user-select: none;
    background: rgba(255, 255, 255, 0.02);
}
.ll-deaths-summary::-webkit-details-marker { display: none; }
.ll-deaths-summary::before {
    content: '▸';
    color: var(--accent);
    transition: transform 0.15s;
    width: 0.8rem;
    display: inline-block;
}
.ll-deaths-section[open] > .ll-deaths-summary::before { transform: rotate(90deg); }
.ll-deaths-title-text { color: var(--text-primary); }
.ll-deaths-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}
.ll-deaths-friendly-count {
    color: var(--profit-green);
    font-size: 0.75rem;
    font-weight: 700;
}
.ll-deaths-enemy-count {
    color: var(--loss-red);
    font-size: 0.75rem;
    font-weight: 700;
}

.ll-deaths-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.3rem;
    max-height: 600px;
    overflow-y: auto;
}

/* 2026-04-21 deaths redesign — split into friendly/enemy sub-groups so a
   ZvZ with 70+ enemy kills doesn't dominate the accountability view. */
.ll-deaths-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.3rem 0.2rem;
}
.ll-deaths-subgroup {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
}
.ll-deaths-subgroup-friendly {
    border-left: 3px solid var(--profit-green);
}
.ll-deaths-subgroup-enemy {
    border-left: 3px solid var(--loss-red);
    /* No opacity dim — rows should be as crisp as friendly. The sub-group
       is already collapsed by default; if the user expanded it they want
       to read it. */
}
/* Constrain the enemy list so it's always scrollable within a bounded box
   instead of pushing the rest of the Accountability view down when a ZvZ
   has 50+ kills. Friendly list stays uncapped — it's usually 1-10 rows. */
.ll-deaths-subgroup-enemy .ll-deaths-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(239, 68, 68, 0.4) transparent;
}
.ll-deaths-subgroup-enemy .ll-deaths-list::-webkit-scrollbar {
    width: 8px;
}
.ll-deaths-subgroup-enemy .ll-deaths-list::-webkit-scrollbar-track {
    background: transparent;
}
.ll-deaths-subgroup-enemy .ll-deaths-list::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.35);
    border-radius: 4px;
}
.ll-deaths-subgroup-enemy .ll-deaths-list::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.55);
}
/* Friendly list — uncapped but still shows a scrollbar if needed. */
.ll-deaths-subgroup-friendly .ll-deaths-list {
    max-height: none;
    overflow: visible;
}
/* Keep summary rows single-line so long guild names don't break the grid
   into two rows and bloat the list. */
.ll-death-row-summary > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Column-header row — same 7-column grid as .ll-death-row-summary so labels
   ("Time", "Victim", "Killer", "Value") sit exactly above their data. */
.ll-death-row-header {
    padding: 0.25rem 0.6rem;
    display: grid;
    grid-template-columns: 24px 50px 1fr auto 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0 0.3rem;
    font-weight: 600;
}
.ll-death-col-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Mobile: header collapses in lock-step with .ll-death-row-summary so columns stay aligned. */
@media (max-width: 640px) {
    .ll-death-row-header {
        grid-template-columns: 20px 1fr auto auto;
    }
    .ll-death-row-header > span:nth-child(2),
    .ll-death-row-header > span:nth-child(4),
    .ll-death-row-header > span:nth-child(5) { display: none; }
}
.ll-deaths-subgroup-summary {
    cursor: pointer;
    padding: 0.45rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    list-style: none;
    user-select: none;
    background: rgba(255, 255, 255, 0.03);
}
.ll-deaths-subgroup-summary::-webkit-details-marker { display: none; }
.ll-deaths-subgroup-summary::before {
    content: '▸';
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.12s ease;
    flex-shrink: 0;
}
.ll-deaths-subgroup[open] .ll-deaths-subgroup-summary::before {
    transform: rotate(90deg);
}
.ll-deaths-subgroup-icon { font-size: 1rem; line-height: 1; }
.ll-deaths-subgroup-title { color: var(--text-primary); }
.ll-deaths-subgroup-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.ll-deaths-subgroup-value {
    margin-left: 0.3rem;
    font-size: 0.74rem;
    color: var(--accent);
    font-weight: 500;
}
.ll-deaths-subgroup-friendly .ll-deaths-subgroup-value { color: var(--loss-red); }
.ll-deaths-subgroup-enemy .ll-deaths-subgroup-value { color: var(--profit-green); }
.ll-deaths-subgroup-hint {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}
.ll-deaths-subgroup[open] .ll-deaths-subgroup-hint { display: none; }

/* Individual death row — compact one-liner that expands on click */
.ll-death-row {
    border-left: 3px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    overflow: hidden;
    transition: background 0.12s;
    /* Inside a flex-column list with a fixed max-height, 50 collapsed <details>
       children were being flex-shrunk to ~8px each and the summary content
       got clipped. Pin each row to its content height so overflow:auto on the
       parent actually scrolls instead of squashing. */
    flex-shrink: 0;
}
.ll-death-row.ll-death-friendly { border-left-color: var(--profit-green); }
.ll-death-row.ll-death-enemy { border-left-color: var(--loss-red); }
.ll-death-row:hover { background: rgba(255, 255, 255, 0.04); }
.ll-death-row.active-filter { background: rgba(240, 192, 64, 0.08); border-left-color: var(--accent); }

.ll-death-row-summary {
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    display: grid;
    grid-template-columns: 24px 50px 1fr auto 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.82rem;
    list-style: none;
}
.ll-death-row-summary::-webkit-details-marker { display: none; }
.ll-death-row-icon { font-size: 1rem; }
.ll-death-row-time { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 0.75rem; }
.ll-death-row-victim { font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-death-row-sep { color: var(--text-muted); }
.ll-death-row-killer { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-death-row-value {
    color: var(--accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    min-width: 60px;
    text-align: right;
}
.ll-death-row .ll-death-badge {
    padding: 0.08rem 0.45rem;
    border-radius: 10px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.ll-death-row-body {
    padding: 0.5rem 0.8rem 0.75rem 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.ll-death-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0.35rem 0 0.2rem 0;
    font-weight: 600;
}
.ll-death-looters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.ll-looter-chip {
    background: rgba(255, 255, 255, 0.04);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* 2026-04-21 expanded death view — per-looter grouping with readable item rows.
   Old layout was an anonymous 36px icon strip; users had to hover each icon to
   learn what was looted. Now: one group per looter, each item on its own line
   with icon · name · qty · silver value. */
.ll-death-looter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.3rem;
}
.ll-death-looter-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.4rem 0.55rem 0.5rem;
}
.ll-death-looter-header {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
}
.ll-death-looter-name {
    font-weight: 600;
    color: var(--text-primary);
}
.ll-death-looter-guild {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.ll-death-looter-stats {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.ll-death-looter-items {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.ll-death-item-row {
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.2rem 0.3rem;
    border-radius: 4px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.015);
    transition: background 0.12s ease;
}
.ll-death-item-row:hover {
    background: rgba(255, 255, 255, 0.05);
}
.ll-death-item-icon {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    border-radius: 3px;
    background: var(--bg-elevated);
}
.ll-death-item-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.ll-death-item-qty {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.78rem;
    min-width: 2ch;
    text-align: right;
}
.ll-death-item-value {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
    min-width: 4.5ch;
    text-align: right;
}
.ll-death-empty {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    padding: 0.35rem 0.3rem;
}
.ll-death-equipment-group {
    margin-bottom: 0.45rem;
    border-left: 2px solid rgba(99, 179, 237, 0.35);
    padding-left: 0.5rem;
}
.ll-death-equipment-summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.ll-death-equipment-summary::-webkit-details-marker { display: none; }
.ll-death-equipment-summary::before {
    content: '▸';
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.12s ease;
}
.ll-death-equipment-group[open] .ll-death-equipment-summary::before {
    transform: rotate(90deg);
}

/* Mobile compaction for the summary grid */
@media (max-width: 640px) {
    .ll-death-row-summary {
        grid-template-columns: 20px 1fr auto auto;
        font-size: 0.78rem;
    }
    .ll-death-row-time, .ll-death-row-sep, .ll-death-row-killer { display: none; }
    .ll-death-item-row {
        grid-template-columns: 24px 1fr auto;
        font-size: 0.75rem;
    }
    .ll-death-item-icon { width: 24px; height: 24px; }
    .ll-death-item-value { display: none; }
}

/* Timeline rich tooltip (floating above bars on hover) */
.ll-timeline-rich-tip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: var(--text-primary);
    min-width: 180px;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.ll-timeline-rich-tip .ll-timeline-tip-title {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}
.ll-timeline-rich-tip .ll-timeline-tip-events {
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* Player-card loot preview icons — BIGGER (user request), wrap all of them */
.ll-preview-slot {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}
.ll-preview-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}
.ll-preview-slot:hover .ll-preview-icon {
    transform: scale(1.1);
    border-color: var(--accent);
}
.ll-preview-qty-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--accent);
    color: #0a0a0a;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.05rem 0.25rem;
    border-radius: 8px;
    pointer-events: none;
    min-width: 16px;
    text-align: center;
}
/* Header strip should wrap so all icons are shown */
.ll-player-card .ll-header-preview,
.ll-player-card .ll-icon-strip {
    flex-wrap: wrap !important;
    gap: 3px !important;
    max-width: 100%;
}

/* Accountability header preview — same .ll-preview-slot base, but with status
   overlays per item so the header strip surfaces deposited/missing at a glance.
   Mirrors the regular session view's icon strip; differentiation is via border
   color + a subtle status dot in the corner. */
.ll-acc-preview-deposited .ll-preview-icon {
    border-color: rgba(74, 222, 128, 0.55) !important;
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.18);
}
.ll-acc-preview-partial .ll-preview-icon {
    border-color: rgba(251, 191, 36, 0.6) !important;
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.22);
}
.ll-acc-preview-missing .ll-preview-icon {
    border-color: rgba(239, 68, 68, 0.7) !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.28), 0 0 0 1px rgba(239, 68, 68, 0.12);
}
.ll-acc-preview-died {
    opacity: 0.55;
    filter: grayscale(55%);
    transition: opacity 0.12s, filter 0.12s;
}
.ll-acc-preview-died .ll-preview-icon {
    border-color: rgba(239, 68, 68, 0.55) !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.22);
}
.ll-acc-preview-died:hover { opacity: 1; filter: grayscale(0); }
.ll-acc-preview-enemy .ll-preview-icon {
    border-color: rgba(239, 68, 68, 0.45) !important;
}
/* Prominent corner status badge — replaces the old tiny dot. Top-right so it
   doesn't fight with the qty badge at bottom-right. Glyph + bg color makes
   deposited/missing impossible to miss when scanning a card. */
.ll-acc-status-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 0 0 1.5px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.5);
    text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}
.ll-acc-status-badge-deposited { background: var(--profit-green); }
.ll-acc-status-badge-partial   { background: #fbbf24; color: #1a1a1a; text-shadow: none; }
.ll-acc-status-badge-missing   { background: var(--loss-red); }
.ll-acc-status-badge-died      { background: rgba(0,0,0,0.85); font-size: 0.6rem; }
/* Reinforce the missing-state by glowing the icon — pulls the eye even when a
   card has dozens of slots side by side. */
.ll-acc-preview-missing .ll-preview-icon {
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45), 0 0 0 1px rgba(239, 68, 68, 0.18), 0 0 6px rgba(239, 68, 68, 0.35);
}
.ll-acc-preview-deposited .ll-preview-icon {
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.4), 0 0 0 1px rgba(74, 222, 128, 0.12);
}

/* Rich accountability tooltip — status banner + pickup list */
.tip-acc-status {
    margin: 0.4rem 0;
    padding: 0.35rem 0.55rem;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.tip-acc-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
}
.tip-acc-deposited { background: rgba(74, 222, 128, 0.15); color: var(--profit-green); }
.tip-acc-partial   { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.tip-acc-missing   { background: rgba(239, 68, 68, 0.18); color: var(--loss-red); }
.tip-acc-died      { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.tip-acc-enemy     { background: rgba(239, 68, 68, 0.10); color: var(--loss-red); }
.tip-acc-verified {
    margin: -0.15rem 0 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: 5px;
    font-size: 0.74rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(74, 222, 128, 0.10);
    color: var(--profit-green);
    border: 1px solid rgba(74, 222, 128, 0.28);
}
.tip-acc-verified-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--profit-green);
    color: #0a0a0a;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}
.tip-pickups-section {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.tip-pickups-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 700;
}
.tip-pickup-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.74rem;
    padding: 0.12rem 0;
    color: var(--text-secondary);
}
.tip-pickup-time {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
}
.tip-pickup-from { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-pickup-guild { color: var(--text-muted); font-size: 0.7rem; }
.tip-pickup-muted { color: var(--text-muted); font-style: italic; }
.tip-pickup-loc { color: var(--accent); font-size: 0.7rem; white-space: nowrap; }
.tip-pickup-more {
    margin-top: 0.2rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}
/* Tooltip needs more room now that pickups can have 8 rows + section headers */
.global-tooltip { max-width: 360px; }

/* "Died with" preview slots — shown after the normal loot icons for players
   who died. Greyed + red-bordered so they read as "these are the items they
   lost". Full opacity on hover so the icon stays recognizable. The divider
   between the two sections is a 💀 glyph with a dashed left border. */
.ll-preview-died {
    opacity: 0.55;
    filter: grayscale(55%);
    transition: opacity 0.12s, filter 0.12s;
}
.ll-preview-died .ll-preview-icon {
    border-color: rgba(239, 68, 68, 0.55) !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.22);
}
.ll-preview-died:hover {
    opacity: 1;
    filter: grayscale(0);
}
.ll-preview-died:hover .ll-preview-icon {
    border-color: var(--loss-red) !important;
}
.ll-preview-died-divider {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin: 0 4px;
    padding: 0 6px;
    color: var(--loss-red);
    font-size: 1rem;
    border-left: 1px dashed rgba(239, 68, 68, 0.45);
    cursor: default;
}

/* "Died with" section inside the expanded player card — mirrors the preview
   strip but as full-width rows so users can see item name / qty / value. */
.ll-died-with-section {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed rgba(239, 68, 68, 0.35);
}
.ll-died-with-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.2rem 0.4rem 0.25rem;
    color: var(--loss-red);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.ll-died-with-subtitle {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 400;
    margin-left: auto;
    text-align: right;
}
/* Visible death-location pin inside the died-with line. */
.ll-died-with-loc {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}
/* When a player died but no corpse loot was captured, the line is the whole
   header — keep it left-aligned next to the skull instead of pushed right. */
.ll-died-with-noitems .ll-died-with-subtitle {
    margin-left: 0.25rem;
    text-align: left;
}

/* "Lost" stat value — total market value of items looted off this player's
   corpse. Red to echo the died-with visual language. */
.ll-stat-lost {
    color: var(--loss-red) !important;
}

/* Item state dots (used in both normal and accountability views).
   Consistent color semantics:
   - green  = deposited (in the guild chest)
   - yellow = partial   (some deposited, some still out)
   - red    = missing   (should be deposited but isn't)
   - blue   = picked up by another player
   - grey   = lost to death / other */
.ll-item-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.35rem;
    flex-shrink: 0;
}
.ll-dot-deposited { background: var(--profit-green); box-shadow: 0 0 4px rgba(74, 222, 128, 0.6); }
.ll-dot-partial   { background: #fbbf24; box-shadow: 0 0 4px rgba(251, 191, 36, 0.6); }
.ll-dot-missing   { background: var(--loss-red); box-shadow: 0 0 4px rgba(239, 68, 68, 0.6); }
.ll-dot-taken     { background: #5b8def; box-shadow: 0 0 4px rgba(91, 141, 239, 0.6); }
.ll-dot-died      { background: var(--text-muted); }

/* Accountability legend/strip inside accountability mode */
.ll-accountability-legend {
    display: flex;
    gap: 0.7rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    flex-wrap: wrap;
}
.ll-accountability-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ============================================================
 * AUDIT REMEDIATION — Apr 18, 2026
 * Live Flips dismiss button, Favorites hub, Alerts wizard
 * ============================================================ */
.flip-card { position: relative; }
.flip-dismiss-btn {
    position: absolute;
    top: 2px;
    right: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
}
.flip-card:hover .flip-dismiss-btn { opacity: 0.6; }
.flip-dismiss-btn:hover { opacity: 1 !important; background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Favorites row action buttons */
.fav-row-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.fav-row-actions button {
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s;
}
.fav-row-actions button:hover {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
}

/* "Add to favorites" star button (appears on all item cards site-wide) */
.item-fav-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0c040;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.12s;
    z-index: 2;
}
.item-fav-btn:hover { opacity: 1; background: var(--accent); color: #0a0a0a; }
.item-fav-btn.is-fav { opacity: 1; background: #f0c040; color: #0a0a0a; }

/* Alerts setup wizard */
.alerts-wizard {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.06), rgba(240, 192, 64, 0.04));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
}
.alerts-wizard h4 { margin: 0 0 0.4rem 0; color: var(--accent); font-size: 0.95rem; }
.alerts-wizard ol {
    margin: 0.25rem 0 0.5rem 1.2rem;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.alerts-wizard ol li { margin-bottom: 0.25rem; }
.alerts-wizard .wizard-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.alerts-preview {
    background: rgba(88, 101, 242, 0.08);
    border-left: 3px solid #5865f2;
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Profile client-setup wizard */
.profile-wizard {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin: 0.75rem 0;
}
.profile-wizard-step {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.profile-wizard-step:last-child { border-bottom: none; }
.profile-wizard-step .step-num {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #0a0a0a;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.profile-wizard-step .step-body { flex: 1 1 auto; font-size: 0.85rem; color: var(--text-secondary); }
.profile-wizard-step .step-body strong { color: var(--text-primary); }

/* Loot Buyer Phase 2 accordion on tracked tab */
.tracked-tab-accordion {
    margin-top: 0.5rem;
    border-top: 1px dashed var(--border);
    padding-top: 0.4rem;
}
.tracked-tab-accordion summary {
    cursor: pointer;
    padding: 0.3rem 0;
    font-weight: 600;
    color: var(--accent);
    font-size: 0.82rem;
    list-style: none;
}
.tracked-tab-accordion summary::-webkit-details-marker { display: none; }
.tracked-tab-accordion summary::before { content: '▸ '; margin-right: 0.25rem; transition: transform 0.15s; display: inline-block; }
.tracked-tab-accordion[open] summary::before { transform: rotate(90deg); }
.tracked-tab-accordion .accordion-body { padding: 0.5rem 0 0 0; }

/* Loot Logger Viewer UX enhancements */
.ll-viewer-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}
.ll-viewer-toolbar .control-group { margin: 0; }
.ll-player-table {
    width: 100%;
    border-collapse: collapse;
}
.ll-player-table th,
.ll-player-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    text-align: left;
}
.ll-player-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    user-select: none;
    cursor: pointer;
}
.ll-player-table th:hover { color: var(--accent); }
.ll-player-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.ll-player-table .player-name { font-weight: 600; color: var(--text-primary); }
.ll-player-table .player-guild { font-size: 0.7rem; color: var(--text-muted); margin-left: 0.3rem; }
.ll-player-table .value-cell { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================================================
 * CRAFTING REVAMP v2 — Apr 18, 2026
 * City Heatmap, Sub-recipe Tree, Inverse Calc, Refining Lab,
 * Top-N Ranker, Crafter Profiles
 * ============================================================ */

/* Inline badge on craft summary header (specialty auto-applied, premium, Quality EV) */
.badge-specialty {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background: #1e40af;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 12px;
    margin-left: 0.35rem;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* City Heatmap cells — emphasise the best-profit cell, dim the negatives */
.city-heatmap td {
    text-align: center;
    vertical-align: middle;
}
.city-heatmap td small {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: normal;
}
.city-heatmap .best-price {
    background: rgba(34, 197, 94, 0.12);
    outline: 1px solid rgba(34, 197, 94, 0.4);
}

/* Sub-recipe tree view */
.subtree-view {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    max-height: 420px;
    overflow-y: auto;
}
.subtree-node { padding: 0.2rem 0; border-left: 2px solid transparent; }
.subtree-node[data-mat-id] { border-left: 2px solid rgba(255, 255, 255, 0.08); padding-left: 0.4rem; }
.subtree-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding: 0.25rem 0;
}
.subtree-row .mat-icon-sm { width: 28px; height: 28px; flex-shrink: 0; }
.subtree-qty { color: var(--accent); font-weight: 700; min-width: 3rem; text-align: right; }
.subtree-name { flex: 1 1 12rem; color: var(--text-primary); }
.subtree-cost { color: var(--accent); font-weight: 700; min-width: 5rem; text-align: right; }
.subtree-toggle {
    padding: 0.18rem 0.55rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.72rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.subtree-toggle:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
.subtree-toggle.active {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
    font-weight: 700;
}
.subtree-savings {
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 0.3rem;
}
.subtree-buy-only { font-style: italic; }

/* Inverse calc panel */
.inverse-panel { padding: 0.5rem 0; }
.inverse-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.inverse-controls input[type="range"] {
    width: 220px;
    accent-color: var(--accent);
}
.inverse-controls #craft-inverse-margin-value {
    color: var(--accent);
    font-weight: 700;
    min-width: 3rem;
    display: inline-block;
}

/* Top-N Ranker */
.topn-hero {
    background: linear-gradient(135deg, rgba(240, 192, 64, 0.08), rgba(109, 40, 217, 0.08));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.topn-hero h3 { margin: 0 0 0.35rem 0; color: var(--accent); font-size: 1.1rem; }
.topn-hero p { margin: 0 0 0.75rem 0; color: var(--text-secondary); font-size: 0.85rem; }
.topn-filters {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.topn-filters .control-group { margin: 0; }
.topn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.6rem;
}
.topn-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.topn-card:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--accent); transform: translateY(-1px); }
.topn-card-header { display: flex; align-items: center; gap: 0.5rem; }
.topn-card-header img { width: 42px; height: 42px; }
.topn-card-header .topn-name { flex: 1 1 auto; font-weight: 600; font-size: 0.85rem; line-height: 1.2; }
.topn-card-header .topn-rank { font-size: 0.7rem; color: var(--accent); font-weight: 700; }
.topn-card-body { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; flex-wrap: wrap; }
.topn-card-body .topn-stat { display: flex; flex-direction: column; min-width: 40%; }
.topn-card-body .topn-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.topn-card-body .topn-stat-value { font-weight: 700; color: var(--text-primary); }
.topn-card-body .topn-stat-value.text-green { color: var(--accent-green, #22c55e); }
.topn-card-body .topn-stat-value.text-red { color: var(--loss-red, #ef4444); }
.topn-badges { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.topn-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    background: rgba(240, 192, 64, 0.15);
    color: var(--accent);
    font-weight: 700;
}
.topn-badge.topn-badge-specialty { background: #1e40af; color: #fff; }
.topn-badge.topn-badge-volatile { background: #ea580c; color: #fff; }
.topn-badge.topn-badge-illiquid { background: #6b7280; color: #fff; }
.topn-badge.topn-badge-liquidity.high { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.topn-badge.topn-badge-liquidity.mid { background: rgba(250, 204, 21, 0.16); color: #fde68a; }
.topn-badge.topn-badge-liquidity.low,
.topn-badge.topn-badge-liquidity.unknown { background: rgba(107, 114, 128, 0.28); color: #d1d5db; }

/* Refining Lab tab */
.refine-mode-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    padding: 0.35rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}
.refine-mode-btn {
    flex: 1 1 auto;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    font-size: 0.85rem;
}
.refine-mode-btn:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-primary); }
.refine-mode-btn.active {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
}
.refine-planner {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
}
.refine-planner .plan-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 0.4rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    align-items: center;
}
.refine-planner .plan-row.header { font-weight: 700; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; }
.refine-planner .plan-row .plan-budget { color: var(--accent); font-weight: 700; }

/* Crafter profiles nav pill */
.crafter-profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.7rem;
    background: rgba(109, 40, 217, 0.25);
    border: 1px solid rgba(109, 40, 217, 0.5);
    color: #c4b5fd;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 14px;
    margin-left: 0.5rem;
    cursor: pointer;
}
.crafter-profile-pill:hover { background: rgba(109, 40, 217, 0.4); }

/* Profile modal */
.crafter-profile-modal-content { max-width: 560px; padding: 1.25rem; }
.crafter-profile-modal-content h3 { margin: 0 0 0.5rem 0; color: var(--accent); }
.crafter-profile-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.75rem; }
.crafter-profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.crafter-profile-item.active { border-color: var(--accent); background: rgba(240, 192, 64, 0.08); }
.crafter-profile-item .profile-name { font-weight: 600; }
.crafter-profile-item .profile-specs { font-size: 0.72rem; color: var(--text-muted); }
.crafter-profile-item .profile-actions { display: flex; gap: 0.3rem; }

/* Monte-Carlo simulator */
.craft-sim-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem;
    margin-top: 0.75rem;
}
.craft-sim-chart {
    height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 0.5rem;
    overflow: hidden;
}
.craft-sim-bar {
    flex: 1 1 auto;
    background: linear-gradient(to top, var(--accent), #6d28d9);
    border-radius: 2px 2px 0 0;
    min-width: 2px;
    transition: height 0.3s;
}
.craft-sim-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.6rem;
}

/* Mobile polish */
@media (max-width: 768px) {
    .topn-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .refine-planner .plan-row { grid-template-columns: 2fr 1fr 1fr; }
    .refine-planner .plan-row .plan-hide-mobile { display: none; }
    .inverse-controls input[type="range"] { width: 100%; }
    .subtree-name { flex: 1 1 100%; }
    .subtree-row { font-size: 0.8rem; }
}

/* ============================================================
   CRAFT RUNS TAB
   ============================================================ */

.cr-run-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.cr-run-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    cursor: default;
}

.cr-run-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.cr-run-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cr-status-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mini flow strip inside run card */
.cr-flow-steps {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.cr-flow-step {
    font-size: 1rem;
    color: var(--text-secondary);
    white-space: nowrap;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.cr-flow-step.done {
    color: var(--profit-green);
    opacity: 0.7;
}

.cr-flow-step.active {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    font-weight: 600;
}

.cr-flow-arrow {
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.4;
}

/* Run card stats row */
.cr-run-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.cr-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cr-stat-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cr-stat-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cr-run-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border);
}

/* Detail view — progress bar */
.cr-progress-bar {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 0.75rem;
    overflow-x: auto;
    gap: 0;
}

.cr-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.cr-progress-icon {
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.cr-progress-step.done .cr-progress-icon {
    border-color: var(--profit-green);
    background: rgba(34, 197, 94, 0.1);
}

.cr-progress-step.active .cr-progress-icon {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.08);
}

.cr-progress-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: center;
}

.cr-progress-step.done .cr-progress-label { color: var(--profit-green); }
.cr-progress-step.active .cr-progress-label { color: #fbbf24; font-weight: 600; }

.cr-progress-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    min-width: 16px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.cr-progress-line.done { background: var(--profit-green); opacity: 0.5; }

/* P&L dashboard */
.cr-pnl-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.cr-pnl-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cr-pnl-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cr-pnl-val {
    font-size: 1.05rem;
    font-weight: 700;
}

/* Transaction table */
.cr-txn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.cr-txn-table th {
    padding: 0.4rem 0.6rem;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.cr-txn-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-txn-table tr:hover td { background: rgba(255,255,255,0.03); }

.cr-txn-type-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.07);
    white-space: nowrap;
}

/* Hideout inputs in Crafting Profits */
#craft-hideout-group {
    display: none;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#craft-hideout-group.visible {
    display: flex;
}

@media (max-width: 768px) {
    .cr-run-list { grid-template-columns: 1fr; }
    .cr-run-stats { grid-template-columns: 1fr 1fr; }
    .cr-pnl-dashboard { grid-template-columns: 1fr 1fr; }
    .cr-txn-table th, .cr-txn-table td { font-size: 0.73rem; padding: 0.35rem 0.4rem; }
    .cr-progress-label { font-size: 0.62rem; }
}

/* === GUILD SYPHON CHECK === */
.syphon-card {
    flex: 1;
    min-width: 130px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
}
.syphon-card-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.syphon-card-value {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Consolas', monospace;
}

.syphon-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.85rem;
}
.syphon-table th {
    padding: 0.5rem 0.7rem;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.syphon-table td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
    font-family: 'Consolas', monospace;
}
.syphon-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.syphon-table td:first-child, .syphon-table th:first-child { font-family: inherit; }

@media (max-width: 768px) {
    .syphon-card { min-width: 45%; }
    .syphon-table th, .syphon-table td { font-size: 0.75rem; padding: 0.4rem 0.5rem; }
}


/* ============================================================
   BUILD FINDER (.bf-*)
   ============================================================ */

.bf-beta-badge, .bf-nav-badge {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em;
    background: var(--accent-dim); color: var(--accent);
    border: 1px solid var(--accent); border-radius: 4px;
    padding: 0.1rem 0.35rem; vertical-align: middle; margin-left: 0.35rem;
}
.bf-nav-badge { font-size: 0.55rem; padding: 0.05rem 0.28rem; }

.bf-note {
    font-size: 0.78rem; color: var(--text-secondary);
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 0.5rem 0.8rem; margin: 0 0 0.8rem 0;
}

.bf-table {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); overflow: hidden;
}
.bf-row {
    display: grid;
    grid-template-columns: 2.2rem minmax(180px, 1.4fr) minmax(120px, 1fr) 5rem 6.5rem 4.5rem 5rem 4.5rem 2rem;
    align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer; transition: background 0.15s;
}
.bf-row:hover { background: var(--bg-elevated); }
.bf-row-head {
    cursor: default; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); background: var(--bg-surface); position: sticky; top: 0;
}
.bf-row-head:hover { background: var(--bg-surface); }
/* victim contexts render 3 fewer stat columns — grid auto-flows, keep alignment tolerable */
.bf-c-rank { color: var(--text-muted); font-weight: 700; }
.bf-c-gear { display: flex; gap: 2px; }
.bf-c-weapon { font-size: 0.85rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-c-num { font-size: 0.82rem; text-align: right; color: var(--text-secondary); display: flex; flex-direction: column; align-items: flex-end; }
.bf-c-num strong { color: var(--text-primary); }
.bf-c-exp { color: var(--text-muted); text-align: center; }
.bf-good { color: var(--profit-green) !important; }
.bf-bad { color: var(--loss-red) !important; }
.bf-adj { color: var(--text-muted); font-size: 0.68rem; }
.bf-emerging {
    font-size: 0.6rem; color: var(--blue); border: 1px solid var(--blue);
    border-radius: 4px; padding: 0 0.25rem; margin-left: 0.35rem; vertical-align: middle;
}

.bf-slot {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 6px;
}
.bf-slot img { width: 36px; height: 36px; }
.bf-slot-empty { opacity: 0.3; }

.bf-detail { border-bottom: 1px solid var(--border-color); background: var(--bg-surface); }
.bf-detail-inner { padding: 0.8rem 1rem 1rem 3rem; display: flex; flex-direction: column; gap: 0.8rem; }
.bf-detail-section h4 { margin: 0 0 0.4rem 0; font-size: 0.78rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.bf-extra-slot { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.bf-extra-label { font-size: 0.75rem; color: var(--text-secondary); min-width: 5.2rem; }
.bf-extra-item { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: var(--text-primary); }
.bf-extra-item img { width: 24px; height: 24px; }
.bf-extra-item small { color: var(--text-muted); }
.bf-ctx-row {
    display: flex; justify-content: space-between; gap: 1rem;
    font-size: 0.8rem; color: var(--text-secondary); padding: 0.15rem 0;
}
.bf-ctx-row span:first-child { color: var(--text-primary); }
.bf-cost-btn { font-size: 0.8rem; padding: 0.35rem 0.8rem; }
.bf-cost-result { margin-top: 0.5rem; max-width: 440px; }
.bf-cost-total { border-top: 1px solid var(--border-color); margin-top: 0.3rem; padding-top: 0.4rem !important; }

/* victim-mined contexts (gathering/pve) have no win-rate columns */
.bf-row-victim {
    grid-template-columns: 2.2rem minmax(180px, 1.4fr) minmax(120px, 1fr) 6.5rem 4.5rem 2rem;
}

@media (max-width: 900px) {
    .bf-table { overflow-x: auto; }
    .bf-row { min-width: 640px; }
}

/* ============================================================
   LOOT LOGGER — BATTLE REPORTS BAR (.bb-*)
   ============================================================ */

.bb-bar {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.07), rgba(212, 175, 55, 0.02));
    border: 1px solid var(--accent-dim);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.75rem;
}
.bb-title {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--accent); white-space: nowrap;
}
.bb-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.76rem; color: var(--text-primary); text-decoration: none;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 6px; padding: 0.25rem 0.6rem;
    transition: border-color 0.15s, background 0.15s;
}
.bb-chip:hover { border-color: var(--accent); background: var(--bg-elevated); }
.bb-chip-time { color: var(--text-secondary); font-size: 0.7rem; }
.bb-chip-all { border-color: var(--accent-dim); color: var(--accent-light); }
.bb-ext { color: var(--text-muted); font-size: 0.7rem; }
.bb-none { font-size: 0.74rem; color: var(--text-muted); }
.bb-bar-empty { border-left-color: var(--border-color); }
.bb-bar-loading .bb-none::after { content: ''; animation: bb-dots 1.2s steps(4, end) infinite; }
@keyframes bb-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ====== COMBAT METER (dm-*) — 2026-07-09 UI prototype ====== */
.dm-demo-banner { display:flex; align-items:center; gap:0.6rem; padding:0.55rem 0.8rem; margin-bottom:0.75rem;
    background:linear-gradient(90deg, rgba(251,191,36,0.10), rgba(251,191,36,0.03)); border:1px solid rgba(251,191,36,0.35);
    border-radius:8px; font-size:0.8rem; color:#fce9b8; }
.dm-demo-banner .btn-small { margin-left:auto; white-space:nowrap; }
.dm-demo-dot { width:9px; height:9px; border-radius:50%; background:#fbbf24; flex-shrink:0;
    animation:dmPulse 1.6s ease-in-out infinite; }
@keyframes dmPulse { 0%,100% { opacity:1; box-shadow:0 0 0 0 rgba(251,191,36,0.5);} 50% { opacity:0.55; box-shadow:0 0 0 5px rgba(251,191,36,0);} }
.dm-toolbar { display:flex; gap:0.75rem; align-items:center; flex-wrap:wrap; }
.dm-mode-switch { display:flex; background:var(--bg-elevated); border:1px solid var(--border-color); border-radius:8px; overflow:hidden; }
.dm-mode-btn { background:none; border:none; color:var(--text-secondary); padding:0.4rem 0.85rem; cursor:pointer;
    font-size:0.8rem; font-weight:600; transition:all 0.15s; }
.dm-mode-btn:hover { color:var(--text-primary); }
.dm-mode-btn.active { background:rgba(212,175,55,0.16); color:var(--accent); }
.dm-encounter-chips { display:flex; gap:0.4rem; flex-wrap:wrap; }
/* The encounter list holds full-width map groups, so it stacks rather than
   wrapping (the session strip above it stays a wrapping row of chips). */
#dm-encounter-chips { flex-direction:column; align-items:stretch; }
/* Loose chips in that column (the session aggregate, the trash expander) keep
   their natural width instead of stretching to the group boxes. */
#dm-encounter-chips > .dm-enc-chip { align-self:flex-start; }
.dm-enc-chip { background:var(--bg-elevated); border:1px solid var(--border-color); color:var(--text-secondary);
    border-radius:16px; padding:0.3rem 0.8rem; font-size:0.74rem; cursor:pointer; transition:all 0.15s; }
.dm-enc-chip:hover { border-color:var(--accent); color:var(--text-primary); }
.dm-enc-chip.active { background:rgba(212,175,55,0.16); border-color:var(--accent); color:var(--accent); font-weight:700; }
/* Two stacked rows — time on top, the damage/healing/taken block directly
   beneath it, so the three combat totals read as one group under the clock. */
.dm-summary { display:flex; flex-direction:column; gap:0.6rem; margin:0.75rem 0; }
.dm-sum-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:0.6rem; }
.dm-sum-card[title] { cursor:help; }
.dm-sum-card { background:var(--bg-card); border:1px solid var(--border-color); border-radius:10px; padding:0.6rem 0.85rem; }
.dm-sum-label { font-size:0.66rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); margin-bottom:0.2rem; }
.dm-sum-value { font-size:1.15rem; font-weight:800; color:var(--text-primary); }
.dm-sum-value.gold { color:var(--accent); }
/* Timeline is its own full-width row above the table now, so the meter takes the
   full width and the remaining side cards sit beside it. */
/* Timeline full width on top, ranked table full width beneath it, supporting
   cards in a strip below that — the Warcraft Logs / FFLogs reading order. The
   table used to be squeezed into 1.6fr of a two-column grid by a side panel that
   held the chart; the chart is its own row now, so the table gets the width. */
.dm-layout { display:block; }
.dm-chart-card { margin-bottom:0.9rem; }
.dm-meter { background:var(--bg-card); border:1px solid var(--border-color); border-radius:12px; padding:0.9rem; }
.dm-meter-wrap .dm-meter { border-top-left-radius:0; border-top-right-radius:0; border-top:0; }
/* Sortable column header. Total leads and is the default sort; the rates and
   uptime sit beside it so the user picks the framing instead of us guessing. */
/* Same track list as .dm-row, with the icon+rank columns spanned by a spacer,
   so header and body columns line up exactly whatever the gap resolves to.
   Horizontal padding = .dm-meter padding (0.9rem) + .dm-row inset (0.3rem).
   Metric hierarchy: TOTAL is the one wide primary column (big number with its
   rate + share as a secondary line inside the same cell), then Active DPS and
   Active % — the wall-clock rate and share no longer own columns. */
.dm-meter-head { display:grid; grid-template-columns:28px 40px minmax(0,1fr) 108px 84px 74px 72px; gap:0.6rem;
    align-items:center; background:var(--bg-card); border:1px solid var(--border-color); border-bottom:0;
    border-radius:12px 12px 0 0; padding:0.55rem 1.2rem 0.45rem; }
.dm-meter-head .dm-th-spacer { grid-column:1 / 4; }
.dm-th { background:none; border:0; padding:0; text-align:right; cursor:pointer; font-family:inherit;
    font-size:0.62rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted); }
.dm-th:hover { color:var(--text-secondary); }
.dm-th.dm-th-on { color:var(--accent); }
.dm-row { display:grid; grid-template-columns:28px 40px minmax(0,1fr) 108px 84px 74px 72px; gap:0.6rem; align-items:center;
    padding:0.42rem 0.3rem; border-radius:8px; transition:background 0.15s; }
/* Solo fights (half the real corpus): the share fragment of the total cell is
   suppressed in markup — a share that is always 100.0% is chrome, not
   information — and the track lists stay identical to the party ones. */
.dm-row:hover { background:rgba(255,255,255,0.03); }
.dm-cell { text-align:right; font-variant-numeric:tabular-nums; font-size:0.82rem; font-weight:700; color:var(--text-primary); }
.dm-cell-total { font-size:0.95rem; font-weight:800; }
.dm-total-num { display:block; font-size:1.05rem; font-weight:800; line-height:1.15; }
.dm-total-sub { display:block; font-size:0.62rem; font-weight:500; color:var(--text-muted); white-space:nowrap; }
/* Session view spells the denominator out ("… /s wall") because the aggregate
   divides by wall clock, not combat time — the same player reads ~10x lower one
   chip-click away. The extra token has to fit the SAME fixed total track
   (108px desktop / 96px at <=720px, see .dm-row above) and the line is nowrap,
   so the session variant runs one step smaller rather than overflowing left
   over the name+bar column. */
.dm-total-sub-wall { font-size:0.58rem; letter-spacing:-0.01em; }
.dm-unstable { font-size:0.62rem; color:var(--text-muted); margin-left:0.12rem; }
.dm-cell-uptime { font-weight:600; font-size:0.76rem; color:var(--text-secondary); }
.dm-cell-uptime.dm-up-low { color:#f0a63c; }
.dm-up-bar { height:3px; border-radius:2px; background:rgba(255,255,255,0.09); margin-top:3px; overflow:hidden; }
.dm-up-bar i { display:block; height:100%; border-radius:2px; }
/* Your own row stays findable in a 20-player list, using a treatment that is
   NOT the series colour so it survives every re-sort (Skada's `showself`). */
.dm-row.dm-row-self { box-shadow:inset 3px 0 0 var(--accent); }
/* …and when it sorts below the fold, a sticky copy holds the viewport's bottom
   edge until the real row scrolls into view (the pinned-self pattern). */
.dm-row.dm-row-pinned { position:sticky; bottom:0.4rem; z-index:2; background:var(--bg-elevated);
    border:1px solid rgba(212,175,55,0.45); box-shadow:0 -6px 16px rgba(0,0,0,0.45), inset 3px 0 0 var(--accent); }

/* --- Per-ability / per-target drill-down (client v1.6.8+) ------------------ */
.dm-caret { display:inline-block; font-size:0.6rem; color:var(--text-muted); margin-right:0.15rem;
    transition:transform 0.15s; }
.dm-caret.open { transform:rotate(90deg); color:var(--accent); }
.dm-row.dm-row-open { background:rgba(255,255,255,0.04); }
.dm-drill { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:0.7rem;
    margin:0 0.3rem 0.5rem; padding:0.7rem 0.8rem; background:rgba(0,0,0,0.22);
    border:1px solid var(--border-color); border-radius:10px; }
.dm-dd-panel { min-width:0; }
.dm-dd-title { font-size:0.66rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted);
    font-weight:700; margin-bottom:0.4rem; display:flex; align-items:center; gap:0.25rem; }
.dm-dd-csv { margin-left:auto; background:none; border:1px solid var(--border-color); border-radius:6px;
    color:var(--text-muted); font-family:inherit; font-size:0.6rem; font-weight:700; letter-spacing:0.04em;
    padding:0.08rem 0.4rem; cursor:pointer; }
.dm-dd-csv:hover { border-color:var(--accent); color:var(--accent); }
.dm-dd-csv:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.dm-dd-count { background:rgba(255,255,255,0.07); border-radius:8px; padding:0 0.3rem; margin-left:0.25rem;
    font-weight:600; }
/* Ability panel: Name · Damage · Healing · Hits · Avg · %.
   Target panel drops Healing and Avg, so it scopes its own track list. */
.dm-dd-head, .dm-dd-row { display:grid; grid-template-columns:minmax(0,1fr) 62px 62px 42px 52px 48px;
    gap:0.4rem; align-items:center; }
.dm-dd-avg { text-align:right; font-variant-numeric:tabular-nums; color:var(--text-secondary); font-weight:600; }
.dm-dd-tgt .dm-dd-head, .dm-dd-tgt .dm-dd-row { grid-template-columns:minmax(0,1fr) 62px 42px 48px; }
.dm-dd-head { font-size:0.58rem; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted);
    font-weight:700; padding-bottom:0.25rem; border-bottom:1px solid var(--border-color); margin-bottom:0.15rem; }
.dm-dd-head div:not(:first-child) { text-align:right; }
.dm-dd-row { position:relative; padding:0.28rem 0; font-size:0.76rem;
    border-bottom:1px solid rgba(255,255,255,0.04); }
.dm-dd-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-primary);
    font-weight:600; }
.dm-dd-n { text-align:right; font-variant-numeric:tabular-nums; color:var(--text-primary); font-weight:600; }
.dm-dd-dim { color:var(--text-muted); font-weight:500; }
/* Raw spell index kept beside every resolved name — the mapping is derived,
   so what it was derived from stays visible. */
.dm-dd-id { color:var(--text-muted); font-weight:500; font-size:0.62rem; margin-left:0.3rem; }
.dm-dd-heal { color:#5ee08d; }
.dm-dd-bar { position:absolute; left:0; bottom:0; height:2px; border-radius:1px; opacity:0.55; }
.dm-dd-rest { opacity:0.72; font-style:italic; }
.dm-dd-primary { background:rgba(232,176,75,0.06); }
.dm-dd-star { color:var(--accent); margin-right:0.2rem; }
.dm-dd-primary-line { font-size:0.74rem; color:var(--text-secondary); margin-bottom:0.4rem; }
.dm-dd-note { font-size:0.66rem; color:var(--text-muted); margin-top:0.45rem; line-height:1.4; }
.dm-drill-hint { font-size:0.7rem; color:var(--text-muted); text-align:center; padding:0.6rem 0.3rem 0.1rem;
    border-top:1px solid rgba(255,255,255,0.05); margin-top:0.4rem; }
@media (max-width: 720px) {
    .dm-drill { grid-template-columns:1fr; }
    /* Both panels collapse to 4 tracks; the ability panel drops Healing to get
       there (damage is the reason you opened the row). */
    .dm-dd-head, .dm-dd-row,
    .dm-dd-tgt .dm-dd-head, .dm-dd-tgt .dm-dd-row { grid-template-columns:minmax(0,1fr) 56px 40px 44px; }
    /* Ability panel drops Healing (3rd head cell) and Avg (5th) to reach four
       visible tracks; at 375px a fifth column leaves ~69px for the name. */
    .dm-dd-panel:not(.dm-dd-tgt) .dm-dd-head div:nth-child(3),
    .dm-dd-panel:not(.dm-dd-tgt) .dm-dd-head div:nth-child(5),
    .dm-dd-panel:not(.dm-dd-tgt) .dm-dd-heal,
    .dm-dd-panel:not(.dm-dd-tgt) .dm-dd-avg { display:none; }
}

/* --- Fight identity header ------------------------------------------------ */
.dm-enc-header { background:var(--bg-card); border:1px solid var(--border-color); border-radius:12px;
    padding:0.75rem 1rem; margin:0.75rem 0 0; }
.dm-badges { display:flex; gap:0.4rem; flex-wrap:wrap; margin-bottom:0.4rem; }
.dm-badge { font-size:0.62rem; font-weight:700; letter-spacing:0.05em; text-transform:uppercase;
    padding:0.15rem 0.5rem; border-radius:6px; }
.dm-badge-content { background:rgba(192,132,252,0.15); color:#c9a6fb; border:1px solid rgba(192,132,252,0.3); }
.dm-badge-place { background:rgba(232,176,75,0.13); color:var(--accent); border:1px solid rgba(232,176,75,0.32); }
.dm-enc-title { font-size:1.35rem; font-weight:800; letter-spacing:-0.01em; color:var(--text-primary); margin-bottom:0.2rem; }
.dm-enc-meta { display:flex; gap:0.45rem; flex-wrap:wrap; align-items:center; font-size:0.76rem; color:var(--text-secondary); }
.dm-dot, .dm-dim { color:var(--text-muted); }
.dm-dim { font-size:0.72rem; }
.dm-enemy { display:inline-flex; align-items:center; gap:0.35rem; background:var(--bg-elevated);
    border:1px solid var(--border-color); border-radius:999px; padding:0.12rem 0.6rem 0.12rem 0.2rem; }
.dm-enemy-av { width:18px; height:18px; border-radius:50%; display:grid; place-items:center; font-size:0.6rem;
    background:linear-gradient(135deg,#7c3aed,#c084fc); }
.dm-sum-sub { font-size:0.66rem; color:var(--text-secondary); margin-top:0.1rem; }
.dm-side-head { display:flex; justify-content:space-between; align-items:flex-start; gap:0.5rem; }
.dm-smooth-btn { flex-shrink:0; }
.dm-smooth-btn.active { border-color:var(--accent); color:var(--accent); }
/* Weight bar under each fight chip — the list reads as a ranking, not a flat
   strip, so the fights that carry the damage are obvious at a glance. */
.dm-enc-chip { position:relative; overflow:hidden; }
.dm-chip-weight { position:absolute; left:0; bottom:0; height:2px; background:var(--accent); opacity:0.5; }
.dm-trash-chip { border-style:dashed; opacity:0.75; }
.dm-trash-chip:hover { opacity:1; }

/* --- Fights grouped by map / dungeon -------------------------------------- */
.dm-zone-group { width:100%; border:1px solid var(--border-color); border-radius:10px;
    background:rgba(255,255,255,0.02); overflow:hidden; }
.dm-zone-group + .dm-zone-group { margin-top:0.35rem; }
.dm-zone-head { display:flex; align-items:center; gap:0.5rem; width:100%; background:none; border:0;
    padding:0.45rem 0.7rem; cursor:pointer; color:inherit; font:inherit; text-align:left; }
.dm-zone-head:hover { background:rgba(255,255,255,0.035); }
.dm-zone-caret { font-size:0.6rem; color:var(--text-muted); transition:transform 0.15s; flex-shrink:0; }
.dm-zone-group.open .dm-zone-caret { transform:rotate(90deg); color:var(--accent); }
.dm-zone-name { font-size:0.82rem; font-weight:700; color:var(--text-primary);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dm-zone-sub { font-size:0.66rem; color:var(--text-muted); background:rgba(255,255,255,0.05);
    border-radius:6px; padding:0.05rem 0.35rem; white-space:nowrap; flex-shrink:0; }
.dm-zone-meta { margin-left:auto; font-size:0.68rem; color:var(--text-muted); white-space:nowrap;
    flex-shrink:0; font-variant-numeric:tabular-nums; }
.dm-zone-body { display:flex; flex-wrap:wrap; gap:0.35rem; padding:0 0.7rem 0.6rem; }
@media (max-width: 720px) { .dm-zone-sub { display:none; } }

/* --- Empty state (replaces the old generated demo run) -------------------- */
.dm-empty { text-align:center; padding:2.4rem 1.2rem; background:var(--bg-card);
    border:1px dashed var(--border-color); border-radius:14px; margin:0.75rem 0; }
.dm-empty-icon { font-size:2.1rem; margin-bottom:0.5rem; opacity:0.85; }
.dm-empty-title { font-size:1.05rem; font-weight:700; color:var(--text-primary); margin-bottom:0.4rem; }
.dm-empty-text { font-size:0.8rem; color:var(--text-secondary); max-width:52ch; margin:0 auto 0.9rem;
    line-height:1.55; }
.dm-empty-text code { background:rgba(255,255,255,0.06); border-radius:4px; padding:0.05rem 0.3rem;
    font-size:0.74rem; }
.dm-empty-btn { font-size:0.85rem; padding:0.45rem 1rem; }
.dm-rank { font-size:0.8rem; font-weight:800; color:var(--text-muted); text-align:center; }
.dm-row:first-child .dm-rank { color:var(--accent); }
.dm-weapon-icon { width:40px; height:40px; border-radius:8px; background:var(--bg-elevated); }
.dm-bar-wrap { min-width:0; }
.dm-bar-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:0.22rem; gap:0.5rem; }
.dm-player { font-size:0.86rem; font-weight:700; color:var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dm-player .dm-role { font-size:0.62rem; font-weight:600; border-radius:4px; padding:0.05rem 0.35rem; margin-left:0.4rem; vertical-align:middle; }
.dm-role-tank { background:rgba(96,165,250,0.15); color:#93c5fd; }
.dm-role-healer { background:rgba(74,222,128,0.15); color:#86efac; }
/* No .dm-role-dps: _dmRoleFor returns only 'healer' | 'tank' | '' (app.js), and
   badging 80% of rows DPS is noise, not information. */
.dm-bar-track { height:14px; background:rgba(255,255,255,0.05); border-radius:7px; overflow:hidden; }
/* No background here: the row markup always writes the player's own colour
   inline (app.js renderRow), which wins over the stylesheet on every row. */
.dm-bar-fill { height:100%; border-radius:7px; transition:width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }

/* Respect the OS setting. The pulsing dots and the bar tween were unconditional. */
@media (prefers-reduced-motion: reduce) {
  .dm-bar-fill, .dm-caret, .dm-zone-caret, .dm-row, .dm-focus-btn, .dm-tf-chip,
  .dm-demo-dot, .dm-chip-live-dot, .dm-rec-dot { transition:none !important; animation:none !important; }
}
/* Supporting cards sit in a strip UNDER the table now that the chart has its own
   full-width row above it; they used to be a column beside the table. */
.dm-side { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:0.9rem; margin-top:0.9rem; align-items:start; min-width:0; }
.dm-side-card { background:var(--bg-card); border:1px solid var(--border-color); border-radius:12px; padding:0.9rem; }
.dm-side-title { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); margin-bottom:0.55rem; font-weight:700; }
.dm-side-card canvas { width:100%; height:auto; display:block; }
.dm-side-legend { display:flex; gap:0.35rem; flex-wrap:wrap; margin-top:0.5rem; font-size:0.68rem; color:var(--text-secondary); }
.dm-side-legend span::before { content:''; display:inline-block; width:8px; height:8px; border-radius:2px; margin-right:0.3rem; background:var(--dm-c, #ef4444); }
/* Our own chart legend (Chart.js's is off). Chart.js's version cost a large
   share of the plot box in a big fight and only repeated the name + colour the
   table already carries. These are real <button>s, so Tab / Enter / Space work
   with no key handling of our own, and the swatch is the player's OWN colour
   rather than the dataset's -- under graph focus the dataset line greys out,
   but the chip must still match that player's bar in the table. */
.dm-legend-chip { display:inline-flex; align-items:center; gap:0.35rem; font:inherit; font-size:0.68rem;
    background:var(--bg-elevated); border:1px solid var(--border-color); border-radius:999px;
    padding:0.15rem 0.55rem; color:var(--text-secondary); cursor:pointer;
    transition:opacity 0.15s, color 0.15s, border-color 0.15s; }
.dm-legend-chip::before { content:''; width:8px; height:8px; border-radius:2px; background:var(--dm-c, #ef4444); flex-shrink:0; }
.dm-legend-chip:hover { color:var(--text-primary); }
.dm-legend-chip.is-on { color:var(--text-primary); border-color:var(--dm-c, var(--border-color)); }
.dm-legend-chip[aria-pressed="false"] { opacity:0.45; text-decoration:line-through; }
.dm-legend-chip:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
/* Chart tool rail: the Rate/Cumulative/Share switcher plus the smoothing and
   bar-order toggles. Mirrors .dm-mode-switch/.dm-mode-btn one size down. */
.dm-chart-tools { display:flex; align-items:center; gap:0.4rem; flex-wrap:wrap; justify-content:flex-end; flex-shrink:0; }
.dm-view-switch { display:flex; background:var(--bg-elevated); border:1px solid var(--border-color); border-radius:8px; overflow:hidden; }
.dm-view-btn { background:none; border:none; color:var(--text-secondary); padding:0.22rem 0.5rem; cursor:pointer;
    font-family:inherit; font-size:0.68rem; font-weight:600; white-space:nowrap; transition:all 0.15s; }
.dm-view-btn:hover { color:var(--text-primary); }
.dm-view-btn.active { background:rgba(212,175,55,0.16); color:var(--accent); }
.dm-view-btn:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.dm-agg-sort-btn { flex-shrink:0; }
.dm-agg-sort-btn.active { border-color:var(--accent); color:var(--accent); }
@media (max-width: 720px) { .dm-view-btn { padding:0.22rem 0.4rem; font-size:0.64rem; } }
.dm-how ol { margin:0; padding-left:1.1rem; font-size:0.78rem; color:var(--text-secondary); display:flex; flex-direction:column; gap:0.45rem; }
/* Combat Meter — live mode (Phase 1, 2026-07-09) */
.dm-demo-banner.dm-live { border-color:rgba(74,222,128,0.45); }
.dm-demo-banner.dm-live .dm-demo-dot { background:#4ade80; box-shadow:0 0 8px rgba(74,222,128,0.8); }
.dm-player .dm-self { background:rgba(251,191,36,0.15); color:#fcd34d; }

/* The player name is the drillable row's activation control (a real <button>,
   sibling to the graph-focus button rather than the row div wrapping both --
   a role="button" element must not contain another control). Strip the UA
   button chrome and restate the two type properties .dm-player sets, so the
   name renders exactly as it did when it was a <span>. */
button.dm-player { font-family:inherit; font-size:0.86rem; font-weight:700; line-height:inherit;
    background:none; border:0; padding:0; margin:0; display:block; min-width:0; max-width:100%;
    text-align:left; color:var(--text-primary); cursor:pointer; }
button.dm-player:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
.dm-weapon-blank { display:flex; align-items:center; justify-content:center; font-size:1rem; opacity:0.85; }
/* Combat Meter — Phase 2: live chip + share */
.dm-enc-chip.dm-live-chip { border-color:rgba(74,222,128,0.55); color:#86efac; }
.dm-chip-live-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:#4ade80; margin-right:0.35rem; animation:dmPulse 1.2s ease-in-out infinite; vertical-align:middle; }
@keyframes dmPulse { 0%,100% { opacity:1; } 50% { opacity:0.35; } }
/* Combat Meter — sessions + delete + Chart.js graph (2026-07-09) */
.dm-enc-chip.dm-session-chip { background:rgba(139,92,246,0.10); border-color:rgba(139,92,246,0.35); }
.dm-enc-chip.dm-session-chip.active { border-color:#a78bfa; color:#c4b5fd; }
.dm-enc-chip.dm-agg-chip { font-weight:700; }
.dm-chip-x { display:inline-block; margin-left:0.45rem; padding:0 0.3rem; border-radius:4px; color:var(--text-muted); font-size:0.68rem; }
.dm-chip-x:hover { background:rgba(248,113,113,0.2); color:#fca5a5; }
.dm-chip-x.armed { background:rgba(248,113,113,0.25); color:#fca5a5; font-weight:700; }
/* Taller than the old side-widget: this is the primary read of a fight now. */
.dm-chart-wrap { position:relative; height:280px; }
@media (max-width: 720px) { .dm-chart-wrap { height:190px; } }
.dm-chart-wrap canvas { height:100% !important; }
/* Combat Meter — recording control + graph focus (2026-07-10) */
.dm-rec-btn { display:inline-flex; align-items:center; gap:0.4rem; white-space:nowrap; }
.dm-rec-btn.dm-rec-on { border-color:rgba(248,113,113,0.5); color:#fca5a5; }
.dm-rec-btn.dm-rec-off { color:var(--text-secondary); }
.dm-rec-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#f87171; animation:dmPulse 1.6s ease-in-out infinite; }
.dm-row { cursor:pointer; }
.dm-row:hover { background:rgba(255,255,255,0.03); border-radius:8px; }
.dm-row.dm-row-focus { background:rgba(251,191,36,0.06); border-radius:8px; box-shadow:inset 0 0 0 1px rgba(251,191,36,0.35); }
/* Shared hover: hovering the chart marks the matching row, and vice versa. It is
   an OUTLINE, not a box-shadow, so it composes with .dm-row-self's inset accent
   bar and .dm-row-focus's ring instead of replacing them. rgba(212,175,55,…) is
   --accent's own RGB — the idiom this file already uses for accent-with-alpha
   (.dm-row-pinned, .dm-mode-btn.active, .dm-enc-chip.active); there is no
   color-mix() anywhere in style.css and this patch does not introduce one. */
.dm-row.dm-row-hi { background:rgba(255,255,255,0.05); border-radius:8px;
    outline:1px solid rgba(212,175,55,0.55); outline-offset:-1px; }
/* Drill-down affordance: the caret lights up on row hover so an expandable row
   reads as expandable before the first click. */
.dm-row:hover .dm-caret:not(.open) { color:var(--accent); transform:translateX(2px); }
/* Deaths line under the fight header (💀 markers on the timeline match). */
.dm-death-line { display:flex; gap:0.7rem; flex-wrap:wrap; margin-top:0.35rem;
    font-size:0.72rem; color:var(--text-secondary); }
.dm-death-line b { font-variant-numeric:tabular-nums; }
.dm-deaths { color:#fca5a5; cursor:help; }
/* Top Stats side card — peak windows + best fight (2026-08-02). */
.dm-ts-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:0.5rem; align-items:baseline;
    padding:0.3rem 0; font-size:0.78rem; border-bottom:1px solid rgba(255,255,255,0.04); }
.dm-ts-label { color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dm-ts-value { font-weight:800; font-variant-numeric:tabular-nums; color:var(--text-primary); }
.dm-ts-holder { color:var(--text-muted); font-size:0.7rem; max-width:12ch; overflow:hidden;
    text-overflow:ellipsis; white-space:nowrap; }
.dm-ts-best:hover { background:rgba(255,255,255,0.03); }
/* Session currency strip (SAT-style) — totals + /h since the client started. */
.dm-sum-row-currency .dm-cur-card { border-color:rgba(212,175,55,0.28); }
.dm-sum-row-currency .dm-sum-value { color:var(--accent); }
/* Designated looter — pickups excluded from the accountability check (2026-07-10) */
.ll-dot-looter { background: var(--accent, #fbbf24); }
.ll-item-looter { opacity: 0.75; }
.ll-item-looter .ll-item-name { color: var(--accent, #fbbf24); }
.ll-acc-preview-looter .ll-preview-icon { outline: 1px dashed rgba(251,191,36,0.6); outline-offset: -1px; opacity: 0.85; }
.ll-acc-status-badge-looter { background: rgba(251,191,36,0.9); color: #1a1408; font-size: 0.6rem; }
.ll-acc-looter { background: rgba(251,191,36,0.03); }
.ll-looter-toggle { white-space: nowrap; }
.ll-looter-toggle.active { border-color: rgba(251,191,36,0.55); color: var(--accent, #fbbf24); }
/* Trade credit — item handed off in a player trade (looter -> banker) (2026-07-11) */
.ll-dot-traded { background: #7dd3fc; }
.ll-item-traded { opacity: 0.9; }
.ll-item-traded .ll-item-name { color: #7dd3fc; }
.ll-acc-preview-traded .ll-preview-icon { outline: 1px solid rgba(125,211,252,0.6); outline-offset: -1px; }
.ll-acc-status-badge-traded { background: rgba(125,211,252,0.9); color: #06232e; font-size: 0.6rem; }

/* Max Hit column (added 2026-09-07). Drops out on narrow screens — the total,
   the rate and Active % are what matter on a phone. */
.dm-cell-maxhit { text-align:right; font-variant-numeric:tabular-nums; color:var(--text-secondary); font-size:0.82rem; }

/* --- Boss % column (audit 09 §6.4) ------------------------------------------
   An optional EIGHTH track. It only exists when the fight actually carries
   per-target damage, and one class on the shared .dm-meter-wrap switches the
   header and the rows together so the two grids can never fall out of step.
   The narrow-screen blocks below repeat the .dm-has-boss selector for exactly
   one reason: a descendant selector outranks a bare .dm-row, so without it the
   desktop eight-track list would beat every phone track list. */
.dm-has-boss .dm-meter-head,
.dm-has-boss .dm-row { grid-template-columns:28px 40px minmax(0,1fr) 108px 84px 74px 72px 62px; }
.dm-cell-boss { text-align:right; font-variant-numeric:tabular-nums; font-size:0.82rem; font-weight:700;
    color:var(--text-secondary); }
.dm-cell-boss.dm-boss-hi { color:#4ade80; }              /* nearly all of it went into the ★ target */
.dm-cell-boss.dm-boss-lo { color:#f0a63c; }              /* most of it went somewhere else */
.dm-cell-boss.dm-boss-none { color:var(--text-muted); font-weight:500; }  /* unknown, not zero */
/* A filtered total is a different number from the same row's number one click
   earlier, so it keeps one quiet mark of its own -- the only thing that still
   says "filtered" in a screenshot cropped past the rail above. */
.dm-cell-total.dm-cell-filtered .dm-total-num { border-bottom:1px dashed rgba(212,175,55,0.55); }

/* --- Table-level target filter (audit 09 §5.6, S5) --------------------------
   Its own strip above the header rather than a row inside it: the header is a
   column ruler whose track list has to keep matching the rows, and a control
   bar in it would have to fake a column. */
.dm-tfilter { display:flex; align-items:center; flex-wrap:wrap; gap:0.35rem;
    background:var(--bg-card); border:1px solid var(--border-color); border-radius:12px;
    padding:0.5rem 0.75rem; margin-bottom:0.55rem; }
.dm-tf-label { font-size:0.62rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em;
    color:var(--text-muted); margin-right:0.15rem; }
.dm-tf-chip { display:inline-flex; align-items:center; gap:0.3rem; font:inherit; font-size:0.68rem; font-weight:600;
    background:var(--bg-elevated); border:1px solid var(--border-color); border-radius:999px;
    padding:0.15rem 0.6rem; color:var(--text-secondary); cursor:pointer;
    transition:color 0.15s, border-color 0.15s, background 0.15s; }
.dm-tf-chip:hover { color:var(--text-primary); }
.dm-tf-chip.is-on { color:var(--accent); border-color:var(--accent); background:rgba(212,175,55,0.14); }
.dm-tf-chip:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.dm-tf-n { font-variant-numeric:tabular-nums; color:var(--text-muted); font-weight:500; }
.dm-tf-chip.is-on .dm-tf-n { color:inherit; }
.dm-tf-more { font-size:0.64rem; color:var(--text-muted); }
/* The honesty line: what the filter changed, and what it deliberately did not. */
.dm-tf-note { flex-basis:100%; font-size:0.66rem; line-height:1.45; color:var(--text-muted); margin-top:0.15rem; }
.dm-tf-note b { color:var(--text-secondary); font-weight:600; }
/* …and its twin under the chart, which the filter cannot reach at all. */
.dm-chart-note { margin-top:0.5rem; padding:0.4rem 0.6rem; border-radius:8px;
    background:rgba(240,166,60,0.10); border:1px solid rgba(240,166,60,0.30);
    font-size:0.68rem; line-height:1.45; color:var(--text-secondary); }
.dm-chart-note b { color:#f0a63c; font-weight:700; }

/* --- Per-row graph-focus button (audit 09 D3) --------------------------------
   Focusing the graph used to be welded to expanding the drill-down. It is its
   own control now, and a real <button>, so the keyboard reaches it without the
   row's key handler doing anything. Quiet until the row is hovered or the
   button is focused; always lit while it is the active focus. */
.dm-focus-btn { flex:none; align-self:center; background:none; border:1px solid transparent;
    border-radius:6px; padding:0 0.22rem; font-size:0.72rem; line-height:1.5; cursor:pointer;
    color:inherit; opacity:0.3; transition:opacity 0.15s, border-color 0.15s, background 0.15s; }
.dm-row:hover .dm-focus-btn { opacity:0.8; }
.dm-focus-btn:hover { opacity:1; border-color:var(--accent); }
.dm-focus-btn.is-on { opacity:1; border-color:var(--accent); background:rgba(212,175,55,0.16); }
.dm-focus-btn:focus-visible { opacity:1; outline:2px solid var(--accent); outline-offset:1px; }

/* Keyboard operability (audit 09 D9). Rows that can be activated are real
   tab stops with role=button + aria-expanded; these give that focus a ring the
   mouse never needed. */
.dm-row:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; border-radius:8px; }
.dm-th:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }

/* ---- Narrow-screen meter rows (P0-5, spec 09 §5.2, fixes D6) --------------
   One place owns every narrow-screen track list.
     721px+   the full seven-column desktop grid (see .dm-row above)
     641-720  six columns: Max Hit drops, Active % STAYS. Hiding Active % on a
              phone was half of D6 — it is the metric the desktop calls
              first-class, and its sort button was unreachable too.
     <=640    five numbers plus a readable name cannot share one line. The row
              goes two-line (§5.2). At 375px the old single-line grid left
              48.2px for the name AND the bar together
              (375 - 24 main - 28.8 .dm-meter - 9.6 .dm-row - 226 fixed
               - 38.4 gaps); this leaves ~151px for the name and ~164px for
              the bar. */
@media (max-width: 720px) {
  .dm-meter-head, .dm-row,
  .dm-has-boss .dm-meter-head, .dm-has-boss .dm-row { grid-template-columns:24px 32px minmax(0,1fr) 96px 74px 56px; }
  /* .dm-weapon-icon is a fixed 40px box; in a 32px track it overflowed onto the
     name column on every phone. Size it to its track. */
  .dm-weapon-icon { width:32px; height:32px; }
  .dm-cell-maxhit, .dm-th[data-dm-sort="maxhit"],
  .dm-cell-boss, .dm-th[data-dm-sort="boss"] { display:none; }
  /* 96px total track at this width, so the session sub-line loses one more step. */
  .dm-total-sub-wall { font-size:0.55rem; }
}
@media (max-width: 640px) {
  /* The header stops being a column ruler — the rows are two-line, nothing can
     line up — and becomes a right-aligned sort strip. Every sort still shown
     stays clickable, which is new: Active % could not be sorted on a phone. */
  .dm-meter-head { display:flex; flex-wrap:wrap; justify-content:flex-end;
      gap:0.4rem 0.75rem; padding:0.5rem 0.9rem 0.45rem; }
  .dm-meter-head .dm-th-spacer { display:none; }

  .dm-row,
  .dm-has-boss .dm-row {
      grid-template-columns:24px 28px minmax(0,1fr) max-content max-content;
      grid-template-areas:
          "rank icon name name  total"
          "bar  bar  bar  rate  up";
      row-gap:0.25rem; column-gap:0.45rem;
  }
  .dm-rank { grid-area:rank; }
  .dm-weapon-icon { grid-area:icon; width:28px; height:28px; }
  /* The name and the bar are nested two levels deep inside .dm-bar-wrap >
     .dm-bar-head. .dm-bar-wrap dissolves so both become grid items and can sit
     on different lines; it paints nothing (min-width:0), so nothing is lost.
     .dm-bar-head stays a flex box and takes the name area itself, because it now
     holds the graph-focus button beside the name -- dissolving it too would drop
     that button into auto-placement and grow the row a third line. */
  .dm-bar-wrap { display:contents; }
  .dm-bar-head { grid-area:name; min-width:0; margin-bottom:0; gap:0.3rem; }
  .dm-bar-track { grid-area:bar; height:10px; }
  .dm-cell-total { grid-area:total; }
  .dm-cell-active { grid-area:rate; }
  .dm-cell-uptime { grid-area:up; }
  .dm-up-bar { display:none; }   /* the % text carries it at this width */
}

/* ====== STUDIO HEADER (2026-09-08, rebuilt) ======
   The first cut was six identical bordered pills beside three identical
   rectangles — every element the same weight, so it read as a status bar rather
   than a header, and its gold-filled active mode competed with the primary
   action button below it. This version gives the strip one job per zone:
   identity, then a segmented switcher, then the setup as quiet running text. */
.craft-hub {
    display:flex; align-items:center; gap:1rem; flex-wrap:wrap;
    padding:0.55rem 0.9rem; margin-bottom:1rem;
    background:linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-dark) 100%);
    border:1px solid var(--border-color);
    border-top:2px solid var(--accent);
    border-radius:var(--radius);
}
.craft-hub-left { display:flex; align-items:center; gap:0.8rem; flex-wrap:wrap; }

/* Identity: the studio you are standing in. */
.craft-hub-studio {
    font-size:0.68rem; font-weight:700; letter-spacing:0.12em; text-transform:uppercase;
    color:var(--accent); white-space:nowrap;
}

/* Segmented switcher — one control, not three buttons. The active segment is a
   recessed surface with gold text, which reads as "selected" without borrowing
   the solid-gold treatment the page uses for its primary action. */
.craft-hub-seg {
    display:inline-flex; border:1px solid var(--border-color);
    border-radius:var(--radius-sm); overflow:hidden; background:var(--bg-dark);
}
.craft-hub-mode {
    font:inherit; font-size:0.8rem; font-weight:500; cursor:pointer;
    padding:0.34rem 0.85rem; border:0; background:transparent;
    color:var(--text-secondary); white-space:nowrap; transition:var(--transition);
    border-right:1px solid var(--border-color);
}
.craft-hub-mode:last-child { border-right:0; }
.craft-hub-mode:hover { color:var(--text-primary); background:rgba(255,255,255,0.03); }
.craft-hub-mode.is-on {
    background:var(--bg-card); color:var(--accent-light); font-weight:600;
    box-shadow:inset 0 2px 0 var(--accent);
}
.craft-hub-mode:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }

/* Setup: one quiet line of running text. Values carry the emphasis, labels do not. */
.craft-hub-right { display:flex; align-items:center; gap:0.7rem; margin-left:auto; flex-wrap:wrap; }
.craft-hub-setup {
    font-size:0.76rem; color:var(--text-muted); white-space:nowrap;
    font-variant-numeric:tabular-nums;
}
.craft-hub-setup b { color:var(--text-primary); font-weight:600; }
.craft-hub-setup .warn { color:#e0a13c; font-weight:600; }
.craft-hub-setup s { color:var(--border-color); text-decoration:none; margin:0 0.35rem; }

.craft-hub-edit, .craft-hub-bridge {
    font:inherit; font-size:0.74rem; cursor:pointer; white-space:nowrap;
    padding:0.25rem 0.6rem; border-radius:var(--radius-sm);
    border:1px solid var(--border-color); background:var(--bg-card);
    color:var(--text-secondary); transition:var(--transition); text-decoration:none;
}
.craft-hub-edit:hover, .craft-hub-bridge:hover { border-color:var(--accent); color:var(--accent-light); }
.craft-hub-edit:focus-visible, .craft-hub-bridge:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.craft-hub-bridge { border-style:dashed; }

@media (max-width: 860px) {
    .craft-hub { gap:0.6rem; padding:0.5rem 0.65rem; }
    .craft-hub-right { margin-left:0; width:100%; }
    .craft-hub-setup { white-space:normal; }
    .craft-hub-mode { font-size:0.75rem; padding:0.3rem 0.6rem; }
}

/* Third figure on a sub-recipe row: the same sub-craft costed without focus.
   Green when it still beats buying (so it needs none of your focus budget),
   amber when it only wins because focus was spent on it. */
.subtree-nofocus {
    font-size:0.7rem; padding:0.1rem 0.4rem; border-radius:var(--radius-sm);
    white-space:nowrap; font-variant-numeric:tabular-nums;
}
.subtree-nofocus.is-ok { color:var(--profit-green); background:var(--profit-green-dim); }
.subtree-nofocus.is-focus-only { color:#e0a13c; background:rgba(224,161,60,0.10); }

/* One-click jump from a refined material inside a craft into the Refining
   Studio, with its family and tier already selected. */
.subtree-refine {
    font:inherit; font-size:0.7rem; cursor:pointer; white-space:nowrap;
    padding:0.1rem 0.42rem; border-radius:var(--radius-sm);
    border:1px dashed var(--border-color); background:transparent;
    color:var(--text-muted); transition:var(--transition);
}
.subtree-refine:hover { border-color:var(--accent); color:var(--accent-light); }
.subtree-refine:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
