:root {
    --bg: #090b12;
    --bg-soft: #121722;
    --panel: rgba(20, 27, 39, 0.9);
    --panel-strong: #182131;
    --card: rgba(24, 33, 49, 0.92);
    --card-hover: rgba(35, 48, 70, 0.95);
    --text: #eef4ff;
    --muted: #98a8c7;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #5da2ff;
    --accent-2: #6f7bff;
    --success: #3ddc97;
    --warning: #ffbf47;
    --danger: #ff6b6b;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(93, 162, 255, 0.16), transparent 30%),
        radial-gradient(circle at top right, rgba(111, 123, 255, 0.14), transparent 28%),
        linear-gradient(180deg, #080a11, #0c111b 46%, #0a0f19);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 92px;
}

.hidden { display: none !important; }

#loading {
    padding: 24px;
}

.loading-skeleton { display: grid; gap: 12px; }
.skeleton-line,
.skeleton-card {
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}
.skeleton-line { height: 16px; }
.skeleton-card { height: 90px; }
.w60 { width: 60%; }
.w70 { width: 70%; }
.w80 { width: 80%; }
.w40 { width: 40%; }
.w90 { width: 90%; }

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 14px;
    background: rgba(9, 12, 19, 0.86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.app-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

#main {
    padding-top: 4px;
    overflow-x: hidden;
}

.page {
    padding: 16px 16px 28px;
    display: grid;
    gap: 14px;
}

.page.is-loading { opacity: 0.75; pointer-events: none; }
h1 { margin: 0; font-size: 30px; line-height: 1.05; }
h3 {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
p { margin: 0; line-height: 1.45; }

.hero-panel,
.card,
.listing-card,
.order-card,
.stat-tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
}

.hero-kicker {
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-copy {
    color: var(--muted);
    margin-top: 8px;
    max-width: 42rem;
}

.card,
.listing-card,
.order-card,
.stat-tile {
    padding: 16px;
}

.glass-card {
    background: linear-gradient(180deg, rgba(25, 35, 54, 0.95), rgba(19, 26, 39, 0.92));
}

.stats-grid,
.section-grid,
.listing-grid {
    display: grid;
    gap: 12px;
}

.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-grid {
    grid-template-columns: 1fr;
}

.stat-tile {
    position: relative;
    overflow: hidden;
}

.stat-tile::after {
    content: "";
    position: absolute;
    inset: auto -20% -50% auto;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(93,162,255,0.25), transparent 70%);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 23px;
    font-weight: 700;
}

.emphasis .stat-value { color: var(--accent); }
.price-crossed { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: 0.9em; }
.price-effective { font-weight: 700; }
.positive .stat-value { color: var(--success); }
.negative .stat-value { color: var(--danger); }

.row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.label { color: var(--muted); }
.val { font-weight: 700; }

.muted { color: var(--muted); font-size: 13px; }

.toolbar-grid,
.form-stack,
.listing-actions,
.bulk-actions {
    display: grid;
    gap: 10px;
}

.form-stack.compact {
    margin: 10px 0 14px;
}

.preset-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}

.preset-chip {
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

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

.preset-chip.active {
    background: linear-gradient(135deg, rgba(93,162,255,0.25), rgba(111,123,255,0.22));
    border-color: rgba(93,162,255,0.55);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
    color: var(--text);
    padding: 13px 14px;
    outline: none;
    transition: border-color 0.2s, transform 0.2s;
}

/* Нативный выпадающий список: тёмная схема и явные цвета option (Windows/Chrome). */
select {
    color-scheme: dark;
    background-color: var(--bg-soft);
}
select option,
select optgroup {
    background-color: #1a2438;
    color: #e8ecf4;
}

textarea {
    resize: vertical;
    min-height: 92px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(93, 162, 255, 0.8);
    transform: translateY(-1px);
}

.ghost-btn,
.primary-inline-btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.primary-inline-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
}

.ghost-btn:hover,
.primary-inline-btn:hover { transform: translateY(-1px); }
.ghost-btn:active,
.primary-inline-btn:active { transform: scale(0.98); }

.bulk-actions-header,
.listing-card-head,
.order-card-head,
.feed-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.listing-grid {
    grid-template-columns: 1fr;
}

.toolbar-compact { padding: 10px 14px; }
.toolbar-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.toolbar-inline input,
.toolbar-inline select { flex: 1; min-width: 100px; max-width: 180px; }
.bulk-actions-inline { display: flex; gap: 8px; align-items: center; }
.listing-grid-compact { grid-template-columns: 1fr; gap: 10px; max-width: 100%; }
.listing-card-compact {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}
.listing-card-compact .listing-card-head-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.listing-card-compact .listing-title-one-line {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.listing-card-compact .listing-card-head-row .pill { flex-shrink: 0; white-space: nowrap; }
.listing-card-compact .listing-actions-bottom .primary-inline-btn { white-space: nowrap; }
.listing-card-compact .listing-metrics { margin: 8px 0; flex-shrink: 0; }
.listing-card-compact .listing-actions-bottom {
    margin-top: auto;
    flex-shrink: 0;
}
.listing-card-compact .listing-card-inner { display: flex; flex-direction: column; height: 100%; }
.listing-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-right: 6px; vertical-align: middle; }
.listing-metrics-icon { width: 8px; height: 8px; display: inline-block; text-align: center; line-height: 1; font-size: 12px; }
.listing-status-dot.expired { background: #9c6bff; }
.listing-status-dot.sold { background: #f0c14b; }
.listing-status-dot.approved { background: #4caf50; }
.listing-status-dot.blocked { background: #e74c3c; }
.listing-status-dot.other { background: var(--muted); }
.listing-priority-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.listing-sub-row .listing-priority-badge { margin-right: 6px; }
.listing-priority-badge.premium { background: linear-gradient(135deg, rgba(255,193,7,0.25), rgba(255,152,0,0.2)); color: #ffc107; }
.listing-priority-badge.default { background: rgba(255,255,255,0.06); color: var(--muted); }
.listing-metrics-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
    font-size: 12px;
}
.listing-metrics-compact .metric-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
}
.listing-metrics-compact .metric-label {
    flex-shrink: 0;
    opacity: 0.9;
    white-space: nowrap;
}
.listing-metrics-compact .metric-value-cell {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
    gap: 5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-wrap: nowrap;
}
.listing-metrics-compact .metric-num {
    text-align: right;
    white-space: nowrap;
    min-width: 0;
}
.listing-metrics-compact .metric-currency {
    flex: 0 0 1.1em;
    text-align: right;
    opacity: 0.95;
}
.order-card-compact { display: flex; flex-direction: column; min-height: 140px; }
.order-card-compact .order-card-inner { display: flex; flex-direction: column; height: 100%; gap: 6px; }
.order-card-compact .order-card-actions { margin-top: auto; flex-shrink: 0; }
.order-card-compact .listing-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card { border-radius: var(--radius); padding: 14px 16px; }
.order-card-inner { display: flex; flex-direction: column; gap: 8px; }
.order-card-head-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.order-card-head-row .order-status-dot {
    flex-shrink: 0;
}
.order-title-wrap { flex: 1; min-width: 0; }
.order-title-full { font-size: 14px; line-height: 1.4; word-wrap: break-word; white-space: normal; display: block; }
.order-card-compact .order-title-one-line {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.order-card-compact .order-title-one-line strong { font-weight: 700; }
.order-card-head-row .pill { flex-shrink: 0; }
.order-card-head-row .order-price-pill { white-space: nowrap; }
.order-btn-full { width: 100%; }
.order-actions-confirm-refund { display: flex; gap: 8px; }
.order-btn-half { flex: 1; min-width: 0; }
.order-card-sub-row { margin-top: 2px; }
.order-sub-inline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.order-card-meta { font-size: 11px; color: var(--muted); }
.order-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.order-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-right: 6px; vertical-align: middle; }
.order-status-dot.order-paid { background: #5da2ff; }
.order-status-dot.order-sent { background: #ffc107; }
.order-status-dot.order-confirmed { background: #4caf50; }
.order-status-dot.order-refund { background: #e74c3c; }
.order-status-dot.order-other { background: var(--muted); }
.order-status-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-right: 6px; flex-shrink: 0; }
.order-status-badge.order-paid { background: rgba(93, 162, 255, 0.25); color: #5da2ff; }
.order-status-badge.order-sent { background: rgba(255, 193, 7, 0.25); color: #ffc107; }
.order-status-badge.order-confirmed { background: rgba(76, 175, 80, 0.25); color: #4caf50; }
.order-status-badge.order-refund { background: rgba(231, 76, 60, 0.25); color: #e74c3c; }
.order-status-badge.order-other { background: rgba(255,255,255,0.06); color: var(--muted); }
.order-card-compact .order-card-metrics.listing-metrics-compact {
    margin: 8px 0;
    flex-shrink: 0;
}
.listing-metrics-compact .metric-label-emoji {
    font-size: 14px;
    line-height: 1;
    min-width: 1.35em;
    text-align: center;
    opacity: 0.95;
}
.order-actions-row { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.order-card-actions .refund-btn { color: #e74c3c; }
.order-card-actions .refund-btn:hover { background: rgba(231, 76, 60, 0.15); }

.listing-card,
.order-card {
    background: linear-gradient(180deg, rgba(25, 35, 54, 0.92), rgba(18, 25, 38, 0.94));
}

.task-card {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.task-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.listing-card:hover,
.order-card:hover {
    background: var(--card-hover);
}

.listing-title {
    font-size: 16px;
    font-weight: 700;
}

.listing-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.pill,
.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.pill {
    background: rgba(93, 162, 255, 0.12);
    color: var(--accent);
}

.badge {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

.badge.info { color: var(--accent); }
.badge.error { color: var(--danger); }
.badge.warning { color: var(--warning); }

.listing-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.listing-metrics > div {
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.checkbox-wrap {
    display: inline-flex;
    align-items: center;
}

.checkbox-wrap input { display: none; }
.checkbox-wrap span {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.checkbox-wrap input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
}
.checkbox-wrap input:checked + span::after {
    content: "✓";
    color: white;
    font-size: 12px;
}

.listing-title-wrap { flex: 1; }
.detail-grid {
    display: grid;
    gap: 12px;
}
.slim { padding: 14px; }

.switch-row {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--text);
}

.message-stack {
    display: grid;
    gap: 10px;
}

.message-bubble {
    background: rgba(255,255,255,0.05);
    border-radius: 16px 16px 16px 6px;
    padding: 10px 12px;
}

.message-bubble.own {
    background: rgba(93, 162, 255, 0.14);
    border-radius: 16px 16px 6px 16px;
}

.message-bubble.event {
    border: 1px dashed rgba(255,255,255,0.15);
}

.message-meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.micro-chart {
    height: 150px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16px, 1fr));
    gap: 8px;
    align-items: end;
}

.micro-chart.tall { height: 180px; }

.bar {
    display: grid;
    justify-items: center;
    gap: 6px;
    height: 100%;
}

.bar span {
    width: 100%;
    min-height: 8px;
    border-radius: 999px 999px 4px 4px;
    display: block;
    align-self: end;
}

.bar.positive span { background: linear-gradient(180deg, #71f0b7, #24986a); }
.bar.negative span { background: linear-gradient(180deg, #ff9e9e, #d84c4c); }
.bar small { font-size: 10px; color: var(--muted); }

.feed-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.feed-item:last-child { border-bottom: 0; }

.rate-list,
.log-list { display: grid; gap: 4px; }

.nav {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    border-radius: 22px;
    background: rgba(12, 16, 25, 0.84);
    border: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.nav-btn {
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    padding: 10px 6px;
    display: grid;
    justify-items: center;
    gap: 4px;
    cursor: pointer;
    transition: background 0.18s, transform 0.18s, color 0.18s;
}

.nav-btn.active {
    color: white;
    background: linear-gradient(135deg, rgba(93,162,255,0.22), rgba(111,123,255,0.22));
}

.nav-icon { font-size: 18px; }
.nav-label { font-size: 11px; }

#toastRoot {
    position: fixed;
    left: 16px;
    right: 16px;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    z-index: 50;
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.toast {
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
    background: rgba(15, 21, 31, 0.96);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-danger { border-left-color: var(--danger); }

#modalRoot { position: relative; z-index: 60; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 10, 0.74);
    display: grid;
    align-items: end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-sheet {
    background: linear-gradient(180deg, #141c2a, #0d1320);
    border-radius: 24px 24px 0 0;
    border: 1px solid var(--line);
    padding: 16px;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: sheetIn 0.24s ease;
}

.modal-sheet .detail-modal-layout { max-height: 82vh; overflow-y: auto; }
.detail-modal-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 2px 0;
}
.detail-section { display: flex; flex-direction: column; gap: 8px; }
.detail-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.detail-input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font-size: 14px; }
.detail-input-sm { width: 100px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font-size: 14px; }
.detail-textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font-size: 14px; resize: vertical; min-height: 144px; }
.detail-textarea-wide { min-width: 100%; box-sizing: border-box; }
.detail-tabs { display: flex; gap: 4px; }
.detail-tab { padding: 8px 14px; border-radius: 8px; border: 0; background: rgba(255,255,255,0.06); color: var(--muted); font-size: 13px; cursor: pointer; transition: all 0.15s; }
.detail-tab:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.detail-tab.active { background: rgba(93,162,255,0.2); color: var(--accent); }
.detail-pane { display: none; }
.detail-pane.active { display: block; }
.detail-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.detail-field label { font-size: 12px; color: var(--muted); }
.detail-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.detail-row-price { align-items: flex-end; }
.detail-row-muted { font-size: 12px; color: var(--muted); }
.detail-cell { display: flex; flex-direction: column; gap: 4px; }
.detail-cell-price .detail-price-val { min-height: 36px; display: flex; align-items: center; }
.detail-cell label { font-size: 12px; color: var(--muted); }
.detail-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-inline input, .detail-inline select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font-size: 14px; }
.detail-switches { display: flex; flex-wrap: wrap; gap: 12px; }
.detail-save-btn { width: 100%; margin-top: 4px; padding: 12px; }

@keyframes sheetIn {
    from { transform: translateY(14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header,
.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.modal-header { margin-bottom: 12px; }
.modal-footer { margin-top: 14px; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.modal-footer .modal-footer-lead { margin-right: auto; }
.modal-title { font-size: 18px; font-weight: 700; }

.modal-order-action-hint { font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
.modal-field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.modal-order-action-textarea { min-height: 120px; margin-bottom: 4px; }

.order-detail-card .val.mono { font-weight: 600; font-size: 12px; word-break: break-all; }
.order-detail-external {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.link-accent {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.link-accent:hover { text-decoration: underline; }

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 0;
    background: rgba(255,255,255,0.06);
    color: white;
    cursor: pointer;
}

.wizard-steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wizard-steps .wizard-step { opacity: 0.6; }
.wizard-steps .wizard-step.active { opacity: 1; font-weight: 600; color: var(--accent); }
.wizard-steps .wizard-step.done { opacity: 0.85; }

.fade-in {
    animation: fadeIn 0.24s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* recon / market intelligence */
.idea-card {
    background: linear-gradient(180deg, rgba(28, 38, 58, 0.94), rgba(18, 25, 38, 0.96));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.idea-card:hover {
    transform: translateY(-2px);
    border-color: rgba(93,162,255,0.3);
}

.idea-card::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(93,162,255,0.15), transparent 70%);
    pointer-events: none;
}

.idea-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 8px;
}

.idea-type.niche { background: rgba(61,220,151,0.15); color: var(--success); }
.idea-type.pricing { background: rgba(255,191,71,0.15); color: var(--warning); }
.idea-type.naming { background: rgba(93,162,255,0.15); color: var(--accent); }
.idea-type.expansion { background: rgba(111,123,255,0.15); color: var(--accent-2); }

.idea-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 10px 0;
    font-size: 13px;
}

.idea-meta-item {
    display: flex;
    gap: 6px;
    align-items: center;
}

.idea-meta-item .meta-label { color: var(--muted); }
.idea-meta-item .meta-val { font-weight: 700; }

.confidence-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    margin: 8px 0;
}

.confidence-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--success), var(--accent));
    transition: width 0.3s ease;
}

.scan-item-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
}

.scan-item-row:last-child { border-bottom: 0; }

.game-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: background 0.16s, border-color 0.16s, transform 0.16s;
}

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

.game-chip.selected {
    background: linear-gradient(135deg, rgba(93,162,255,0.2), rgba(111,123,255,0.18));
    border-color: rgba(93,162,255,0.5);
}

.game-chip-name { font-weight: 700; font-size: 14px; }
.game-chip-count { color: var(--muted); font-size: 12px; }

.tips-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.tips-list li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--muted);
}

.tips-list li::before {
    content: "💡 ";
}

@media (min-width: 600px) {
    .listing-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
    .page { padding: 22px 28px 34px; }
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .listing-grid-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .idea-meta { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
    .listing-grid-compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
