/* ── Search-only tokens ── */
:root {
    --radius-lg: 14px;
}
.light-theme {
    --search-row-even: #f5f5f8;
    --search-row-odd: #ffffff;
    --search-row-hover: #eaeaef;
    --search-surface-1: #f0f0f4;
    --search-surface-2: #e4e4ea;
    --search-link: #3b6fd4;
    --search-text-dim: #454545;
    --search-result-dim: #bbb;
}
.dark-theme {
    --search-row-even: #13151a;
    --search-row-odd: #181b20;
    --search-row-hover: #252930;
    --search-surface-1: #181b20;
    --search-surface-2: #1f2328;
    --search-link: #5b8def;
    --search-text-dim: #b5b5b5;
    --search-result-dim: #555;
}


/* ═══ Layout: sidebar + main ═══ */
.search-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0;
    min-height: calc(100vh - var(--nav-height, 40px));
    margin-top: -40px;
    max-width: var(--page-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}


/* ═══ Search bar (spans full width above grid) ═══ */
/* --search-bar-h is used by the sidebar to clear the sticky bar */
.search-bar-sticky {
    position: sticky;
    top: var(--nav-height, 48px);
    z-index: 50;
    background: var(--background);
    padding-top: 6px;
    padding-bottom: 4px;
}

.search-input-row {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
}

.search-bar-wrap form,
.search-bar-wrap form.autocomplete {
    flex: 1;
    display: flex;
    min-width: 0;
    width: auto;
    position: relative;
}
.search-bar-wrap .search-input,
.search-bar-wrap input.search-input {
    flex: 1;
    padding: 14px 14px 14px 14px;
    border-radius: var(--radius-lg, 10px);
    border: 1px solid var(--border-moderate, rgba(255,255,255,0.12));
    background: var(--search-surface-1);
    color: var(--normal);
    font-size: var(--text-xl);
    outline: none;
    font-family: inherit;
    transition: border-color 0.12s;
    width: 100%;
    box-sizing: border-box;
}
.search-bar-wrap .search-input:focus {
    border-color: var(--search-link);
}
.search-bar-wrap .autocomplete:has(.autocomplete-items) .search-input {
    border-radius: var(--radius-lg, 10px) var(--radius-lg, 10px) 0 0;
    transition: border-radius 0.15s;
}
.search-bar-wrap .search-input::placeholder {
    color: var(--search-text-dim);
}

.search-actions {
    position: absolute;
    right: 6px; top: 50%; transform: translateY(-50%);
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: var(--surface-3);
    z-index: 1;
}
.search-action-btn {
    padding: 8px 12px;
    background: transparent; border: none;
    color: var(--activetext);
    cursor: pointer; text-decoration: none;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.search-action-btn svg {
    width: 20px; height: 20px;
}
.search-action-btn + .search-action-btn {
    border-left: 1px solid var(--border-subtle);
}
.search-action-btn:hover {
    background: var(--accent-muted);
    color: var(--ainfo);
    text-decoration: none;
}

.search-sort-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    flex-wrap: wrap;
    /*margin-right: 10%;*/
}

.search-sort-label {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--search-text-dim);
}

.search-sort-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px;
    border-radius: 8px;
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    color: var(--activetext);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    transition: all 0.12s;
}
.search-sort-pill svg {
    width: 16px;
    height: 16px;
}
.search-sort-pill:hover {
    border-color: var(--accent-border, rgba(91,141,239,0.25));
    color: var(--normal);
}
.search-sort-pill.active {
    background: var(--accent-muted, rgba(91,141,239,0.12));
    border-color: var(--accent-border, rgba(91,141,239,0.25));
    color: var(--search-link);
}
.search-sort-pill .search-sort-dir.asc { color: #22c55e; }
.search-sort-pill .search-sort-dir.desc { color: #ef4444; }

.search-result-divider {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-result-divider::before,
.search-result-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}
.search-result-count {
    font-size: var(--text-sm);
    color: var(--search-result-dim, #aaa);
    white-space: nowrap;
}

.search-opts-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--surface-3);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    color: var(--activetext);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}
.search-opts-link:hover {
    color: var(--normal);
    border-color: var(--accent-border, rgba(91,141,239,0.25));
    background: var(--surface-2);
}


/* ═══ Sidebar ═══ */
.search-sidebar {
    padding: 20px;
    position: sticky;
    top: var(--nav-height, 48px);
    align-self: start;
    max-height: calc(100vh - var(--nav-height, 48px));
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

.sidebar-body {
    flex: 1;
    min-height: 0;
    overflow: visible;
}
.sidebar-body::-webkit-scrollbar { width: 4px; }
.sidebar-body::-webkit-scrollbar-thumb {
    background: var(--surface-4, #323840);
    border-radius: 2px;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 12px 0 0;
}

/* ── Sidebar search bar ── */
.sidebar-search {
    margin: -20px -20px 8px;
    padding: 20px 20px 8px;
    position: sticky;
    top: -20px;
    background: var(--background);
    z-index: 1;
}
.sidebar-search form.autocomplete {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 8px;
}
.sidebar-search .search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--border-moderate);
    background: var(--search-surface-1);
    font-size: var(--text-lg);
    color: var(--normal);
    outline: none;
}
.sidebar-search .search-input:focus {
    border-color: var(--accent-border, rgba(91,141,239,0.4));
    box-shadow: 0 0 0 3px var(--accent-muted, rgba(91,141,239,0.12));
}
.sidebar-search .search-sort-row {
    padding-bottom: 8px;
}
.search-sort-actions {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.search-sort-settings {
    display: inline-flex;
    align-items: center;
    color: var(--search-text-dim);
    padding: 4px;
}
.search-sort-settings:hover {
    color: var(--normal);
}
.search-sort-settings svg {
    width: 16px;
    height: 16px;
}
.search-sidebar::-webkit-scrollbar { width: 4px; }
.search-sidebar::-webkit-scrollbar-thumb {
    background: var(--surface-4, #323840);
    border-radius: 2px;
}

.sidebar-img-wrap {
    position: relative;
    margin-bottom: 14px;
}
.sidebar-img-wrap.foil-wrap[data-foil="true"]::after {
    border-radius: var(--radius-lg);
}

.sidebar-card-img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    display: block;
    background: var(--search-surface-2);
}
.sidebar-img-wrap[data-set="LEA"] .sidebar-card-img {
    border-radius: 22px;
}
.sidebar-img-wrap[data-set="LEA"].foil-wrap[data-foil="true"]::after {
    border-radius: 22px;
}

.sidebar-printings {
    font-size: var(--text-base);
    color: var(--activetext);
    text-align: center;
    margin-bottom: 14px;
    line-height: 1.6;
    position: relative;
}
.sidebar-printings a { color: var(--search-link); text-decoration: none; }
.sidebar-printings a:hover { text-decoration: underline; }
.sidebar-printings i[class*="ss-"] { color: var(--normal); margin: 0 1px; }

/* Printings overflow filter input */
.sidebar-printings-filter {
    display: inline-block;
    box-sizing: border-box;
    width: 5em;
    padding: 0 7px;
    height: 2em;
    border-radius: 4px;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    background: none;
    color: var(--normal);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    vertical-align: middle;
    margin: 1px;
    outline: none;
    transition: color 0.1s, border-color 0.1s, width 0.15s;
}
.sidebar-printings-filter::placeholder {
    color: var(--search-text-dim);
    font-weight: 600;
    opacity: 1;
}
.sidebar-printings-filter:hover {
    border-color: var(--accent-border, rgba(91,141,239,0.25));
}
.sidebar-printings-filter:focus {
    width: 9em;
    border-color: var(--accent-border, rgba(91,141,239,0.35));
    color: var(--search-link);
}

.sidebar-printings a.sidebar-printings-hidden {
    display: none !important;
}

/* Printings overflow dropdown - flows down over content below */
.sidebar-printings-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    min-height: 120px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--search-surface-1);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: var(--radius-sm, 6px);
    padding: 8px;
    text-align: center;
    line-height: 1.6;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-4, #323840) transparent;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.sidebar-printings-dropdown::-webkit-scrollbar { width: 4px; }
.sidebar-printings-dropdown::-webkit-scrollbar-thumb {
    background: var(--surface-4, #323840);
    border-radius: 2px;
}
.sidebar-printings-dropdown.open {
    display: block;
}


/* Available In card */
.sidebar-products-card {
    margin-top: 8px;
    background: var(--search-surface-1);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: var(--radius-sm, 6px);
    overflow: hidden;
}
.sidebar-products-title {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--search-text-dim);
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    text-align: center;
}
.sidebar-products-list {
    padding: 8px 12px;
    font-size: var(--text-sm);
    text-align: center;
    max-height: 8em;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-4, #323840) transparent;
}
.sidebar-products-list::-webkit-scrollbar { width: 4px; }
.sidebar-products-list::-webkit-scrollbar-thumb {
    background: var(--surface-4, #323840);
    border-radius: 2px;
}
.sidebar-products-list h4,
.sidebar-products-list h5,
.sidebar-products-list h6 {
    font-size: inherit;
    font-weight: normal;
    margin: 0;
    padding: 0;
}
.sidebar-products-list a {
    color: var(--search-link);
    text-decoration: none;
    display: block;
    line-height: 1.5;
}
.sidebar-products-list a:hover { text-decoration: underline; }

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm, 6px);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    transition: all 0.12s;
    cursor: pointer;
    font-family: inherit;
}
.sidebar-action:hover {
    border-color: var(--accent-border, rgba(91,141,239,0.25));
}
.sidebar-action + .sidebar-products-card {
    margin-top: 8px;
}
.sidebar-action.primary {
    background: var(--accent-muted, rgba(91,141,239,0.12));
    border-color: var(--accent-border, rgba(91,141,239,0.25));
    color: var(--search-link);
}
.sidebar-action.success {
    background: rgba(63,185,80,0.1);
    border-color: rgba(63,185,80,0.2);
    color: var(--asuccess);
}
.sidebar-action.warning {
    background: rgba(210,153,34,0.1);
    border-color: rgba(210,153,34,0.2);
    color: var(--awarning);
}
.sidebar-action.default {
    background: var(--search-surface-2);
    color: var(--activetext);
}

.sidebar-action-row {
    display: flex;
    gap: 6px;
}
.sidebar-action-row > * { flex: 1; }

.sidebar-actions-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    background: var(--search-surface-1);
}

.sidebar-compact-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-compact-row .sidebar-action {
    padding: 6px 12px;
    font-size: var(--text-sm);
}

.sidebar-compact-label {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--search-text-dim);
    white-space: nowrap;
    min-width: 3.5em;
}

.sidebar-section-label {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--search-text-dim);
    margin-bottom: 2px;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    margin: 12px 0;
}

.sidebar-legend {
    font-size: var(--text-sm);
    color: var(--search-text-dim);
    line-height: 1.6;
}
.sidebar-legend a {
    color: var(--search-text-dim);
    text-decoration: none;
}


/* ═══ Landing page (no query) ═══ */
.search-landing {
    padding: 0 24px 80px;
}


/* ═══ Results main area ═══ */
.search-results {
    padding: 10px 18px 80px;
}


/* ── Card spacing ── */
.result-body {
    margin-bottom: 0;
}
.result-body::after {
    content: "";
    display: block;
    grid-column: 1 / -1;
    height: 20px;
    border-left: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-right: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    margin: 0 -1px;
}
.result-body.result-last-body::after {
    display: none;
}

/* Card header — sticky */
.result-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0 10px;
    padding: 10px 14px;
    background: var(--search-surface-1);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 0;
    position: sticky;
    top: calc(var(--nav-height, 48px) + 21px);
    z-index: 2;
}
.result-header.result-first {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: calc(-1 * var(--radius-lg, 12px)) 0 0 var(--background), var(--radius-lg, 12px) 0 0 var(--background);
}
.result-body.result-last-body {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.result-header-cover {
    position: sticky;
    top: var(--nav-height, 48px);
    z-index: 2;
    height: 21px;
    margin-bottom: -21px;
    background: var(--background);
    margin-left: -18px;
    margin-right: -18px;
    pointer-events: none;
}

.result-set-link {
    grid-column: 1;
    display: flex;
    align-items: center;
}

.result-set-icon {
    font-size: var(--text-7xl);
    color: var(--normal);
}

.result-card-info {
    grid-column: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.result-card-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.result-card-name {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--normal);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-card-name:hover { color: var(--search-link); }

.result-set-title {
    font-size: var(--text-sm);
    color: var(--search-text-dim);
}
.result-set-title a {
    color: inherit;
    text-decoration: none;
}
.result-set-title a:hover { color: var(--activetext); }

.result-card-extra {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px 6px;
    background: var(--search-surface-1);
    border-left: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-right: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}
.result-card-extra:empty {
    display: none;
}

.result-variant {
    font-size: var(--text-md);
    color: var(--search-text-dim);
    font-style: italic;
}

.result-badges { display: flex; gap: 4px; }
.result-badge {
    font-size: var(--text-xs);
    padding: 2px 6px;
    border-radius: var(--radius-sm, 6px);
    font-weight: 600;
}
.result-badge.rl {
    background: rgba(210,153,34,0.1);
    color: var(--awarning);
}
.result-badge.stocks {
    background: rgba(91,141,239,0.1);
    color: var(--search-link);
}
.result-badge.news {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}
.result-badge.foil {
    background: rgba(253, 239, 138, 0.15);
    color: #fdef8a;
    border: 1px solid rgba(253, 239, 138, 0.3);
}
.light-theme .result-badge.foil {
    background: rgba(180, 160, 60, 0.12);
    color: #8a7a20;
    border-color: rgba(180, 160, 60, 0.3);
}
.result-badge.etched {
    background: linear-gradient(135deg, #a6dced, #c9b1ff);
    color: #222;
}
.result-badge.altfoil {
    background: linear-gradient(135deg, #ea8d66, #fdef8a, #8bcc93, #a6dced);
    color: #222;
}
.result-badge.treatment {
    background: rgba(255, 255, 255, 0.08);
    color: var(--search-text-dim);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.light-theme .result-badge.treatment {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}

.result-quick-icons {
    grid-column: 3;
    display: flex;
    gap: 6px;
    align-items: center;
}
.result-quick-icons a,
.result-quick-icons span {
    font-size: var(--text-2xl);
    color: var(--search-text-dim);
    text-decoration: none;
    transition: color 0.1s;
    cursor: pointer;
}
.result-quick-icons a:hover,
.result-quick-icons span:hover { color: var(--search-link); }
.result-quick-icons img { width: 22px; height: auto; vertical-align: middle; }

.result-source-sealed {
    font-size: var(--text-sm);
    color: var(--search-text-dim);
}
.result-source-sealed a { color: var(--search-link); text-decoration: none; }


/* ── Sellers + Buyers two-column grid ── */
.result-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-left: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-right: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 0;
    overflow: hidden;
}

.result-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.result-col::after {
    content: "";
    flex: 1;
}
.result-col + .result-col {
    border-left: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.result-col-header {
    padding: 4px 12px;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--search-text-dim);
    background: var(--search-surface-2);
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    text-align: center;
}


/* ── Price row ── */
.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--price-row-h, 42px);
    padding: 0 12px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    font-size: var(--text-lg);
    transition: background 0.1s;
}
.price-row:hover { background: var(--search-row-hover); }

.price-row-locked {
    background: var(--search-surface-2);
    opacity: 0.7;
}
.price-row-locked:hover {
    opacity: 1;
}
.locked-cta {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.locked-btn {
    padding: 2px 10px;
    border-radius: var(--radius-sm, 6px);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    color: var(--search-link);
    background: var(--accent-muted, rgba(91,141,239,0.12));
    white-space: nowrap;
    transition: all 0.12s;
}
.locked-btn:hover {
    background: rgba(91,141,239,0.2);
    text-decoration: none;
}
.locked-btn-join {
    background: rgba(63,185,80,0.1);
    border-color: rgba(63,185,80,0.25);
    color: var(--asuccess);
}
.locked-btn-join:hover {
    background: rgba(63,185,80,0.2);
}

.price-row .store-name {
    color: var(--search-link);
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.price-row .store-name:hover { text-decoration: underline; }
.price-row .store-name.dim { color: var(--search-text-dim); }

/* Right-side grid: consistent price + qty alignment */
.price-right {
    display: grid;
    grid-template-columns: 7em 5em;
    align-items: baseline;
    flex-shrink: 0;
    gap: 0 4px;
}

/* Seller rows with secondary pricing (e.g. Low / Market) */
.price-right.has-secondary {
    grid-template-columns: 7em 5em;
}

/* Buyer rows with ratio/credit extra + qty */
.price-right.has-buylist-extra {
    grid-template-columns: 7em 5em 3em;
}

.buylist-extra {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--search-text-dim);
    text-align: center;
    justify-self: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Sealed INDEX: 3 value columns (EV, Sim Median, Sim StdDev) */
.price-right.index-cols {
    grid-template-columns: 6em 6em 6em;
}

.price-row .price {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--normal);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 0 0.25em;
    justify-self: end;
}
.price-row .price .cur {
    color: var(--search-text-dim);
}
.price-row .price .amt {
    text-align: right;
}

.price-row .price-warn {
    color: var(--adanger);
    position: relative;
    cursor: help;
}
.price-row .price-best {
    color: var(--asuccess);
}
.price-row .price-warn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: var(--radius-sm, 6px);
    background: var(--search-surface-1);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    color: var(--normal);
    font-size: var(--text-sm);
    font-weight: 400;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.price-row .secondary {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--normal);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 0 0.25em;
    justify-self: center;
}
.price-row .qty {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--search-text-dim);
    text-align: center;
    justify-self: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.price-cond-header {
    display: flex;
    align-items: center;
    height: calc(var(--price-row-h, 42px) / 2);
    padding: 0 12px;
    box-sizing: border-box;
    font-size: var(--text-sm);
    color: var(--search-text-dim);
    font-style: italic;
    background: var(--search-surface-1);
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

/* Sealed INDEX: 4-column sub-header */
.price-index-header {
    background: var(--search-surface-1);
    padding: 5px 12px;
    font-size: var(--text-sm);
    align-items: center;
}
.price-index-header .price {
    color: var(--search-text-dim);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.2;
}

.no-offers {
    padding: 16px;
    text-align: center;
    font-size: var(--text-base);
    color: var(--search-text-dim);
    font-style: italic;
}


/* ═══ Pagination ═══ */
.search-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
}
.search-pagination a,
.search-pagination span {
    padding: 6px 12px;
    border-radius: 5px;
    font-size: var(--text-md);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.12s;
}
.search-pagination a {
    background: var(--search-surface-2);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    color: var(--activetext);
}
.search-pagination a:hover {
    border-color: var(--accent-border, rgba(91,141,239,0.25));
    color: var(--normal);
}
.search-pagination .cur {
    background: var(--accent-muted, rgba(91,141,239,0.12));
    border: 1px solid var(--accent-border, rgba(91,141,239,0.25));
    color: var(--search-link);
    font-weight: 600;
}
.search-pagination .pg-info {
    font-size: var(--text-md);
    color: var(--search-text-dim);
}


/* ═══ Chart container ═══ */
.chart-container {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
}
.dark-theme .chart-container {
    background: rgba(24, 27, 32, 0.7);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 8px;
}
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-sm);
    color: var(--normal);
    background: none;
    border: none;
    border-left: 2px solid;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: opacity 0.12s;
}
.chart-legend-item.hidden {
    opacity: 0.35;
    text-decoration: line-through;
}
.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.chart-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    color: var(--activetext);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    transition: all 0.12s;
}
.chart-pill:hover {
    border-color: var(--accent-border, rgba(91,141,239,0.25));
    color: var(--search-link, var(--normal));
}
.chart-pill-warning {
    border-color: var(--awarning);
    color: var(--awarning);
}
.chart-pill-warning:hover {
    background: rgba(255,165,0,0.1);
}
.chart-pill-danger {
    border-color: var(--adanger);
    color: var(--adanger);
}
.chart-pill-danger:hover {
    background: rgba(255,0,0,0.1);
}

/* ═══ Chart tooltip (glass) ═══ */
.chart-tooltip {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 11px;
    color: rgba(0,0,0,0.85);
    transition: opacity 0.15s ease;
    z-index: 10;
    min-width: 140px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    white-space: nowrap;
}
.dark-theme .chart-tooltip {
    background: rgba(12, 14, 20, 0.82);
    border-color: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.chart-tooltip-title {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.dark-theme .chart-tooltip-title {
    border-bottom-color: rgba(255,255,255,0.08);
}
.chart-tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}
.chart-tooltip-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}


/* ═══ Options page ═══ */

.opts-page {
    padding: calc(var(--nav-height, 40px) + 28px) 0 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}
.opts-page > .opts-page-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 24px;
}
.opts-page > .opts-page-header h1 {
    font-size: var(--text-7xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
}
.opts-page > .opts-page-header .opts-desc {
    font-size: var(--text-md);
    color: var(--activetext);
    margin: 0;
}
.opts-page > .opts-page-header .opts-desc a {
    color: var(--search-link);
    text-decoration: none;
}
.opts-page > .opts-page-header .opts-back {
    margin-left: auto;
    font-size: var(--text-md);
    color: var(--search-link);
    text-decoration: none;
    white-space: nowrap;
}
.opts-page > .opts-page-header .opts-back:hover {
    text-decoration: underline;
}

/* Option card */
.opts-card {
    margin-bottom: 16px;
    overflow: hidden;
}
.opts-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}
.opts-card-header-text { flex: 1; }
.opts-card-header-text h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin: 0 0 3px;
}
.opts-card-header-text p {
    font-size: var(--text-base);
    color: var(--activetext);
    margin: 0;
    line-height: 1.4;
}
.opts-card-header-text p strong {
    color: var(--normal);
    font-weight: 600;
}
.opts-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}
.opts-card-body {
    padding: 16px 20px;
}

/* Action buttons */
.opts-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm, 6px);
    font-size: var(--text-base);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.12s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-family: inherit;
}
.opts-btn-save {
    background: rgba(63, 185, 80, 0.12);
    color: var(--asuccess);
    border: 1px solid rgba(63, 185, 80, 0.2);
}
.opts-btn-save:hover { background: rgba(63, 185, 80, 0.22); }
.opts-btn-clear {
    background: rgba(210, 153, 34, 0.12);
    color: var(--awarning);
    border: 1px solid rgba(210, 153, 34, 0.2);
}
.opts-btn-clear:hover { background: rgba(210, 153, 34, 0.22); }
.opts-btn-select {
    background: var(--search-surface-2);
    color: var(--activetext);
    border: 1px solid var(--border-moderate, rgba(255,255,255,0.12));
}
.opts-btn-select:hover {
    color: var(--normal);
    border-color: var(--accent-border, rgba(91,141,239,0.25));
}

/* Checkbox grid */
.opts-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2px;
}
.opts-check-grid label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm, 6px);
    font-size: var(--text-md);
    color: var(--activetext);
    cursor: pointer;
    transition: background 0.1s;
    line-height: 1.4;
}
.opts-check-grid label:hover {
    background: var(--search-row-hover);
    color: var(--normal);
}
.opts-check-grid input[type="checkbox"] {
    accent-color: var(--search-link);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 2px;
}
.opts-check-grid .sealed-tag {
    font-size: var(--text-xs);
    font-style: italic;
    color: var(--search-text-dim);
}

/* Two-column layout */
.opts-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.opts-col-label {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--search-text-dim);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

/* Radio list */
.opts-radio-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.opts-radio-list label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm, 6px);
    font-size: var(--text-md);
    color: var(--activetext);
    cursor: pointer;
    transition: background 0.1s;
    line-height: 1.4;
}
.opts-radio-list label:hover {
    background: var(--search-row-hover);
    color: var(--normal);
}
.opts-radio-list input[type="radio"] {
    accent-color: var(--search-link);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 2px;
}
.opts-radio-list .radio-note {
    font-size: var(--text-sm);
    color: var(--search-text-dim);
    font-style: italic;
    padding-left: 33px;
    margin-top: -4px;
    margin-bottom: 2px;
}

/* Dropdown group */
.opts-dropdown-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.opts-dropdown-item label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--search-text-dim);
    margin-bottom: 6px;
}
.opts-dropdown-item select {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border-moderate, rgba(255,255,255,0.12));
    background: var(--search-surface-2);
    color: var(--normal);
    font-size: var(--text-md);
    font-family: inherit;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.12s;
}
.opts-dropdown-item select:focus {
    border-color: var(--search-link);
}


/* ═══ Responsive ═══ */
@media (max-width: 900px) {
    .search-layout { grid-template-columns: 1fr; }
    .search-sidebar {
        position: sticky;
        top: var(--nav-height, 48px);
        max-height: none;
        overflow: visible;
        padding: 12px 16px 0;
        z-index: 150;
        background: var(--background);
    }
    .search-sidebar > *:not(.sidebar-search) { display: none; }
    .result-body { grid-template-columns: 1fr; }
    .result-col + .result-col {
        border-left: none;
        border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    }
    .search-bar-wrap { padding: 12px 16px 0; }
    .search-results { padding: 16px 16px 60px; }
    .result-header { padding: 8px 10px; gap: 6px; }
    .price-row { --price-row-h: 34px; padding: 0 10px; }
}

@media (max-width: 900px) {
    .opts-page { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .opts-page { padding-left: 3%; padding-right: 3%; }
    .opts-card-header { flex-direction: column; gap: 10px; }
    .opts-card-actions { width: 100%; justify-content: flex-start; }
    .opts-two-col { grid-template-columns: 1fr; }
    .opts-dropdown-group { grid-template-columns: 1fr; }
    .opts-check-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    /* Symmetric padding on tablet/mobile */
    .search-layout { padding-left: 0; padding-right: 0; }

    /* Sort pills: touch-friendly sizing */
    .search-sort-pill { padding: 8px 14px; font-size: var(--text-md); }
    .search-sort-label { padding: 8px 0; }

    /* Pagination: bigger touch targets */
    .search-pagination a,
    .search-pagination span { padding: 10px 16px; font-size: var(--text-lg); }

    /* Chart canvas responsive */
    .chart-container canvas { width: 100% !important; height: auto !important; }
    .chart-container { padding: 10px; }
    .chart-controls { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    /* Price rows: tighter layout */
    .price-row { --price-row-h: 36px; padding: 0 8px; gap: 4px; font-size: var(--text-md); }
    .price-row .store-name { font-size: var(--text-md); }
    .price-row .price { font-size: var(--text-md); }
    .price-row .qty { font-size: var(--text-sm); }
    .price-row .secondary { font-size: var(--text-md); }
    .price-right { grid-template-columns: 6em 4em; }
    .price-right.has-secondary { grid-template-columns: 6em 6em; }
    .price-right.has-buylist-extra { grid-template-columns: 6em 4em 2.5em; }
    .price-right.index-cols { grid-template-columns: 5em 5em 5em; }

    /* Result headers: tighter */
    .result-card-name { font-size: var(--text-lg); }
    .result-header { padding: 8px 8px; gap: 4px; }

    /* Options page: full-width padding */
    .opts-page { padding-left: 16px; padding-right: 16px; }

    /* Sealed index columns tighter */
    .price-index-header { font-size: var(--text-xs); gap: 4px; padding: 4px 8px; }
}

@media (max-width: 600px) {
    .search-input-row { flex-wrap: wrap; }
    .search-actions { width: 100%; justify-content: center; }
    .result-quick-icons { width: 100%; justify-content: flex-start; }
    .result-set-title { margin-left: 0; width: 100%; }
}

/* === Search landing panes === */

.search-landing {
    max-width: var(--page-max-width);
    margin: 0.5rem auto 0 auto;
}

.search-landing-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    .search-landing-grid {
        grid-template-columns: 1fr;
    }
}

.landing-pane {
    display: flex;
    flex-direction: column;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 0.5em;
    overflow: hidden;
    min-height: 50vh;
}

.landing-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6em 0.85em;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    font-weight: 600;
    color: var(--normal);
}

.landing-pane-title {
    font-size: 1.05em;
}

.landing-pane-actions {
    display: flex;
    gap: 0.5em;
}

.landing-pane-btn {
    background: transparent;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.12));
    color: var(--normal);
    padding: 0.25em 0.6em;
    border-radius: 0.25em;
    cursor: pointer;
    font-size: 0.85em;
}

.landing-pane-btn:hover {
    background: var(--surface-3);
}

.landing-pane-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3em;
    line-height: 1;
}
.landing-pane-btn-icon i,
.landing-pane-btn-icon svg {
    width: 16px;
    height: 16px;
}

.landing-pane-body {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.landing-pane-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
    padding: 0.5em;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.landing-page-btn {
    background: transparent;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.12));
    color: var(--normal);
    padding: 0.15em 0.6em;
    border-radius: 0.25em;
    cursor: pointer;
}

.landing-page-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.landing-page-label {
    font-size: 0.9em;
    color: var(--normaltext);
}

.landing-empty {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--greytext);
    font-style: italic;
    padding: 2em 1em;
}

/* Recents pane: scrolls instead of paginating on desktop */
.landing-pane-recent .landing-pane-body {
    /* ~8 rows tall before the body starts to scroll */
    max-height: 41em;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-4, #323840) transparent;
}
.landing-pane-recent .landing-pane-body::-webkit-scrollbar {
    width: 4px;
}
.landing-pane-recent .landing-pane-body::-webkit-scrollbar-thumb {
    background: var(--surface-4, #323840);
    border-radius: 2px;
}

/* Recents pane: tighter rows so card names fit in the 260px column */
.landing-pane-recent .landing-item {
    gap: 0.6em;
    padding: 0.7em 0.7em;
}
.landing-pane-recent .landing-item-thumb {
    width: 2.6em;
    height: 3.6em;
}
.landing-pane-recent .landing-item-thumb i.ss {
    font-size: 1.8em;
}

/* Favorites pane: 2-column grid of card-style tiles */
.landing-pane-favorites .landing-pane-body {
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 0.4em;
    padding: 0.5em;
    align-content: start;
}

.landing-pane-favorites .landing-item-fav {
    position: relative;
    align-items: flex-start;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 0.5em;
    background: var(--surface-2);
    padding: 0.6em;
    transition: border-color 150ms, box-shadow 150ms;
}
.landing-pane-favorites .landing-item-fav:hover {
    border-color: var(--accent-border, rgba(91,141,239,0.25));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.landing-pane-favorites .landing-item-fav .landing-item-thumb {
    width: 5.6em;
    height: 7.84em;
    background: transparent;
    border-radius: 0.35em;
}

.landing-pane-favorites .landing-item-fav .landing-item-line1 {
    width: 100%;
    align-items: center;
    padding-bottom: 0.45em;
    margin-bottom: 0.5em;
    background: linear-gradient(90deg, transparent, var(--border-subtle, rgba(255,255,255,0.12)) 20%, var(--border-subtle, rgba(255,255,255,0.12)) 80%, transparent) bottom / 100% 1px no-repeat;
}

.landing-pane-favorites .landing-item-fav .landing-item-set {
    color: var(--search-link);
    font-weight: 600;
    font-size: 0.85em;
}

.landing-pane-favorites .landing-item-fav .landing-item-prices {
    grid-template-columns: 1fr max-content;
    row-gap: 0.5em;
}

.landing-pane-favorites .landing-item-fav .landing-item-delete {
    position: absolute;
    top: 0.35em;
    right: 0.35em;
}

/* === Favorites empty state === */
.landing-empty-fav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2em 1.75em 2.5em;
}

.landing-empty-headline {
    text-align: center;
    margin-bottom: 1.75em;
    animation: landing-empty-fade 0.4s ease both;
}

.landing-empty-headline h3 {
    margin: 0 0 0.4em;
    font-size: 1rem;
    font-weight: 600;
    color: var(--normal);
}

.landing-empty-headline p {
    margin: 0 auto;
    max-width: 24em;
    font-size: 0.8125rem;
    color: var(--greytext);
}

.landing-empty-flow {
    display: grid;
    grid-template-columns: 1fr 3.75em 1fr;
    gap: 0.75em;
    align-items: start;
}

.landing-empty-side {
    animation: landing-empty-fade 0.5s ease both;
}
.landing-empty-side:nth-child(1) { animation-delay: 0.15s; }
.landing-empty-side:nth-child(3) { animation-delay: 0.45s; }

.landing-empty-side-label {
    margin-bottom: 0.5em;
    text-align: center;
    font-size: 0.625rem;
    color: var(--greytext);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.landing-empty-mini-result {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 0.5em;
    overflow: hidden;
}

.landing-empty-mini-result-head {
    display: flex;
    align-items: center;
    gap: 0.625em;
    padding: 0.625em 0.75em;
}

.landing-empty-mini-seticon {
    flex-shrink: 0;
    color: var(--normal);
    line-height: 1;
}

.landing-empty-mini-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}

.landing-empty-mini-title-row {
    display: flex;
    align-items: center;
    gap: 0.4em;
    flex-wrap: wrap;
}

.landing-empty-mini-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--normal);
}

.landing-empty-mini-meta {
    font-size: 0.6875rem;
    color: var(--greytext);
}

.landing-empty-mini-tools {
    margin-left: auto;
    display: flex;
}

.landing-empty-star {
    color: var(--darkeryellow, gold);
    fill: var(--darkeryellow, gold);
    filter: drop-shadow(0 0 0.4em color-mix(in srgb, var(--darkeryellow, gold) 60%, transparent));
    animation: landing-empty-pulse 2s ease-in-out infinite;
    animation-delay: 1.5s;
}

.landing-empty-mini-fav {
    display: flex;
    gap: 0.75em;
    padding: 0.625em;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 0.5em;
}

.landing-empty-mini-fav-thumb {
    width: 3.5em;
    height: 4.9em;
    flex-shrink: 0;
    border-radius: 0.25em;
    overflow: hidden;
    background: var(--surface-2);
}

.landing-empty-mini-fav-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.landing-empty-mini-fav-name-row {
    display: flex;
    align-items: center;
    gap: 0.4em;
    flex-wrap: wrap;
}

.landing-empty-mini-fav-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
}

.landing-empty-mini-fav-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--normal);
}

.landing-empty-mini-fav-set {
    margin: 0.125em 0 0.375em;
    font-size: 0.625rem;
    letter-spacing: 0.4px;
    color: var(--search-link);
    font-weight: 600;
}

.landing-empty-mini-fav-prices {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 1px;
    column-gap: 0.5em;
    font-size: 0.6875rem;
}

.landing-empty-mini-fav-prices .sell {
    color: var(--asuccess);
    font-variant-numeric: tabular-nums;
}
.landing-empty-mini-fav-prices .buy {
    color: var(--awarning);
    font-variant-numeric: tabular-nums;
}

.landing-empty-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--search-link);
    opacity: 0.55;
    margin-top: 1.5em;
    animation: landing-empty-fade 0.5s ease both;
    animation-delay: 0.3s;
}

.landing-empty-tooltip {
    position: relative;
    margin-top: 0.625em;
    padding: 0.5em 0.625em;
    border-radius: 0.5em;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--greytext);
    background: color-mix(in srgb, var(--search-link) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--search-link) 25%, transparent);
}

.landing-empty-tooltip::before {
    content: '';
    position: absolute;
    top: -0.375em;
    left: 1.25em;
    width: 0.625em;
    height: 0.625em;
    background: color-mix(in srgb, var(--search-link) 8%, var(--surface-1));
    border-left: 1px solid color-mix(in srgb, var(--search-link) 25%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--search-link) 25%, transparent);
    transform: rotate(45deg);
}

@keyframes landing-empty-fade {
    from { opacity: 0; transform: translateY(0.5em); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes landing-empty-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.18); }
}

@media (max-width: 520px) {
    .landing-empty-flow {
        grid-template-columns: 1fr;
        gap: 0.5em;
    }
    .landing-empty-arrow {
        transform: rotate(90deg);
        margin-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-empty-fav,
    .landing-empty-fav * {
        animation: none !important;
    }
}

.landing-item {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 0.85em 1em;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
    color: var(--normal);
    text-decoration: none;
}

.landing-item:hover {
    background: var(--surface-2);
}

.landing-item:last-child {
    border-bottom: none;
}

.landing-item-thumb {
    flex: 0 0 auto;
    width: 3.5em;
    height: 4.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: 0.25em;
    overflow: hidden;
}

.landing-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.landing-item-thumb:has(.ss) {
    background: transparent;
}

.landing-item-thumb i.ss {
    font-size: 2.5em;
    color: var(--normal);
}

.landing-item-thumb-placeholder {
    font-size: 1.5em;
    opacity: 0.6;
    color: var(--normaltext);
}

.landing-item-info {
    flex: 1 1 auto;
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35em;
}

.landing-item-line1 {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    flex-wrap: wrap;
    margin-bottom: 0.1em;
}

.landing-item-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.landing-item-set {
    font-size: 0.8em;
    color: var(--greytext);
}

.landing-item-prices {
    display: grid;
    grid-template-columns: var(--landing-price-label-w, 14em) max-content;
    column-gap: 1em;
    row-gap: 0.15em;
    align-items: baseline;
    font-size: 0.88em;
}

.landing-item-price-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.landing-item-price-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.landing-item-price-label.sell,
.landing-item-price-value.sell { color: var(--asuccess); }

.landing-item-price-label.buy,
.landing-item-price-value.buy { color: var(--awarning); }

.landing-item-query {
    font-size: 0.95em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    color: var(--normal);
}

.landing-item-arrow {
    flex: 0 0 auto;
    color: var(--greytext);
}

.landing-item-delete {
    display: none;
    background: transparent;
    border: none;
    color: var(--greytext);
    cursor: pointer;
    padding: 0.3em;
    border-radius: 0.25em;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.landing-item:hover .landing-item-delete {
    display: inline-flex;
}

.landing-item:hover .landing-item-arrow {
    display: none;
}

.landing-item-delete:hover {
    color: var(--adanger);
    background: var(--surface-2);
}

.landing-syntax-link {
    margin-top: 1em;
    text-align: center;
    color: var(--greytext);
    font-size: 0.9em;
}

.landing-syntax-link a {
    color: var(--anormal);
}

/* === Toast (mirrors .m-toast for desktop refresh feedback) === */

.search-toast {
    position: fixed;
    bottom: 1em;
    right: -100%;
    padding: 0.6em 1em;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(22, 22, 22, 0.85);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    color: var(--green);
    border: 1px solid var(--green);
    border-radius: 8px;
    z-index: 600;
    transition: right 300ms ease;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.light-theme .search-toast {
    background: rgba(252, 252, 252, 0.85);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.search-toast.show {
    right: 1em;
}

.search-toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: var(--green);
    opacity: 0.5;
    transform-origin: left;
    transform: scaleX(0);
}

.search-toast.show::after {
    animation: searchToastTimer 2s linear forwards;
}

@keyframes searchToastTimer {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* === Favorite star button on desktop result rows === */

.result-quick-icons .fav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.15em;
    color: var(--greytext);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.result-quick-icons .fav-btn:hover {
    color: var(--normal);
}

.result-quick-icons .fav-btn.active {
    color: var(--darkeryellow, gold);
}

.result-quick-icons .fav-btn.active svg {
    fill: var(--darkeryellow, gold);
}

/* === Pin button on landing items === */
.landing-item-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0.3em;
    background: transparent;
    border: 0;
    color: var(--greytext, #888);
    cursor: pointer;
    opacity: 0;
    transition: opacity 120ms, color 120ms;
}
.landing-item:hover .landing-item-pin,
.landing-item-pin.pinned { opacity: 1; }
.landing-item-pin:hover { color: var(--accent, #5b8def); }
.landing-item-pin.pinned { color: var(--accent, #5b8def); }

/* Pin sits left of the trash button on favorite tiles (both absolutely positioned) */
.landing-pane-favorites .landing-item-fav .landing-item-pin {
    position: absolute;
    top: 0.35em;
    right: 2.2em;
}

/* === Favorites sort pills (inline in pane header next to action buttons) === */
.landing-pane-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    padding-right: 0.55em;
    margin-right: 0.25em;
    border-right: 1px solid var(--border-subtle, rgba(255,255,255,0.12));
}
.fav-sort-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15em;
    padding: 0.3em;
    background: transparent;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.12));
    border-radius: 0.25em;
    color: var(--normal);
    cursor: pointer;
    font: inherit;
    line-height: 1;
}
.fav-sort-pill:hover { color: var(--text, currentColor); background: var(--surface-3); }
.fav-sort-pill.active {
    color: var(--accent, #5b8def);
    border-color: var(--accent-border, rgba(91,141,239,0.35));
}
.fav-sort-pill i,
.fav-sort-pill svg { width: 16px; height: 16px; }
.fav-sort-pill .fav-sort-dir.asc { color: #22c55e; }
.fav-sort-pill .fav-sort-dir.desc { color: #ef4444; }
