:root {
    --bg-base:        #0d0d0f;
    --bg-surface:     #16181c;
    --bg-elevated:    #1e2128;
    --bg-hover:       #252830;
    --border:         #2a2d35;
    --border-focus:   #00bcd4;
    --text-primary:   #e8eaf0;
    --text-secondary: #8b8fa8;
    --text-muted:     #5a5e72;
    --accent:         #00bcd4;
    --accent-dim:     #00838f;
    --accent-glow:    rgba(0, 188, 212, 0.15);
    --success:        #4caf50;
    --warning:        #ff9800;
    --danger:         #f44336;
    --radius:         8px;
    --radius-lg:      12px;
    --radius-xl:      16px;
    --touch-min:      44px;
    --ease-out:       cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.6);
}

[data-theme="light"] {
    --bg-base:        #f5f5f7;
    --bg-surface:     #ffffff;
    --bg-elevated:    #f0f0f2;
    --bg-hover:       #e8e8ec;
    --border:         #d4d4d8;
    --border-focus:   #0097a7;
    --text-primary:   #1a1a2e;
    --text-secondary: #52526e;
    --text-muted:     #8e8ea0;
    --accent:         #0097a7;
    --accent-dim:     #00838f;
    --accent-glow:    rgba(0, 151, 167, 0.08);
    --success:        #2e7d32;
    --warning:        #f57c00;
    --danger:         #d32f2f;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.12);
}

[x-cloak] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── Layout ─────────────────────────────────────────────── */

.app-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.3s var(--ease-out);
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.app-header .logo svg {
    flex-shrink: 0;
}

.app-header .tagline {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

.main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
    animation: fadeIn 0.4s var(--ease-out);
}

/* ── Tabs ───────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.tab-btn {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Upload Zone ────────────────────────────────────────── */

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--bg-surface);
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragging {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    color: var(--text-muted);
}

.upload-zone h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.photo-preview-wrap {
    margin-top: 20px;
}

.photo-preview {
    max-width: 340px;
    max-height: 300px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    object-fit: cover;
    display: block;
    margin: 0 auto;
    animation: slideUp 0.3s var(--ease-out);
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover:not(:disabled) {
    background: var(--border-focus);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--border-focus);
    background: var(--bg-elevated);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    opacity: 0.85;
}

.btn-sm {
    min-height: var(--touch-min);
    padding: 0 12px;
    font-size: 0.8rem;
}

.btn-icon {
    min-height: var(--touch-min);
    width: var(--touch-min);
    padding: 0;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Analyze Button & Spinner ───────────────────────────── */

.analyze-row {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Result Card ────────────────────────────────────────── */

.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: slideUp 0.4s var(--ease-out);
    box-shadow: var(--shadow-md);
}

.result-photo-col {
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: 240px;
}

.result-photo {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.result-body {
    padding: 24px;
}

@media (min-width: 720px) {
    .result-card {
        display: grid;
        grid-template-columns: 300px 1fr;
    }
}

/* ── Fields ─────────────────────────────────────────────── */

.field-group {
    margin-bottom: 20px;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.field-label span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.field-value {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.2s;
}

.field-value:focus {
    outline: none;
    border-color: var(--accent);
}

textarea.field-value {
    resize: vertical;
    min-height: 90px;
    line-height: 1.55;
}

.price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── Tags / Specs chips ─────────────────────────────────── */

.chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    min-height: 36px;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: text;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.chip button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0 0 4px;
    font-size: 0.9rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.chip button:hover { color: var(--danger); }

.chips-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    min-width: 80px;
    flex: 1;
}

/* ── Condition Select ───────────────────────────────────── */

.condition-select {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.condition-btn {
    min-height: var(--touch-min);
    padding: 0 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
}

.condition-btn.selected,
.condition-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Copy Format Panel ──────────────────────────────────── */

.format-panel {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.format-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.format-tab {
    min-height: var(--touch-min);
    padding: 0 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
}

.format-tab.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.format-output {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.55;
    max-height: 240px;
    overflow-y: auto;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.format-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ── Toast ──────────────────────────────────────────────── */

.toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.25s var(--ease-out);
    pointer-events: auto;
    min-width: 200px;
}

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

/* ── History Gallery ────────────────────────────────────── */

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.history-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    animation: slideUp 0.3s var(--ease-out);
}

.history-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.history-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--bg-elevated);
    display: block;
}

.history-info {
    padding: 12px;
}

.history-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.history-price {
    color: var(--accent);
    font-weight: 600;
}

.history-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-card-wrap {
    position: relative;
}

.history-card-wrap:hover .history-delete {
    opacity: 1;
}

/* ── Empty state ────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ── Action row ─────────────────────────────────────────── */

.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ── Badge ──────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-cyan  { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent-dim); }

/* ── Scrollbar ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Extra Photos ───────────────────────────────────────── */

.extra-photos-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    align-items: flex-start;
}

.extra-thumb-wrap {
    position: relative;
}

.extra-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
    display: block;
}

.extra-thumb:hover {
    border-color: var(--accent);
}

.extra-thumb-del {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.add-photo-btn {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    transition: border-color 0.2s, color 0.2s;
}

.add-photo-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Detail Row (weight/color/dims/model) ───────────────── */

.detail-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.detail-field {
    flex: 1;
    min-width: 120px;
}

.detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
    .main {
        padding: 20px 16px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        padding-left: calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
    }
    .app-header {
        padding: 0 calc(16px + env(safe-area-inset-left));
        padding-top: env(safe-area-inset-top);
    }
    .app-header .tagline { display: none; }
    .price-row { grid-template-columns: 1fr; }

    .upload-zone { min-height: 200px; }

    .format-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .format-tab {
        flex-shrink: 0;
        min-height: 48px;
    }

    .btn, .tab-btn, .condition-btn {
        min-height: 48px;
    }

    .detail-field {
        min-width: 100px;
    }
}

/* ── Stats Row ─────────────────────────────────────────── */

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    animation: slideUp 0.3s var(--ease-out);
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s, transform 0.15s;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.stat-card.accent {
    border-color: var(--accent-dim);
    background: linear-gradient(135deg, var(--bg-surface), var(--accent-glow));
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card.accent .stat-value {
    color: var(--accent);
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── History Toolbar ───────────────────────────────────── */

.history-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 14px;
    flex: 1;
    min-width: 200px;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px 0;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Bulk Selection ────────────────────────────────────── */

.history-thumb-wrap {
    position: relative;
}

.bulk-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.bulk-check.checked {
    background: var(--accent);
    border-color: var(--accent);
}

.bulk-check svg {
    color: #fff;
}

.history-card.bulk-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ── Condition dots ────────────────────────────────────── */

.condition-dot {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
}

.condition-dot.cond-new { background: rgba(76,175,80,0.15); color: var(--success); }
.condition-dot.cond-like-new { background: rgba(0,188,212,0.15); color: var(--accent); }
.condition-dot.cond-good { background: rgba(255,193,7,0.12); color: #ffc107; }
.condition-dot.cond-fair { background: rgba(255,152,0,0.12); color: var(--warning); }
.condition-dot.cond-poor { background: rgba(244,67,54,0.12); color: var(--danger); }

/* ── Empty State (improved) ────────────────────────────── */

.empty-icon {
    margin-bottom: 16px;
    color: var(--text-muted);
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ── Settings Panel ────────────────────────────────────── */

.settings-panel {
    max-width: 680px;
    margin: 0 auto;
    animation: slideUp 0.3s var(--ease-out);
}

.settings-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.setting-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    min-height: var(--touch-min);
    min-width: 180px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.setting-select:focus {
    outline: none;
    border-color: var(--accent);
}

.setting-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    min-height: var(--touch-min);
    width: 80px;
    text-align: center;
    transition: border-color 0.2s;
}

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

/* ── Theme Toggle ──────────────────────────────────────── */

.theme-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 3px;
    border: 1px solid var(--border);
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.theme-btn.active {
    background: var(--accent);
    color: #000;
}

/* ── Platform Toggles ──────────────────────────────────── */

.platform-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}

.platform-toggle input {
    display: none;
}

.platform-toggle.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── About Card ────────────────────────────────────────── */

.about-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.about-logo {
    width: 48px;
    height: 48px;
    background: var(--accent-glow);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Header gradient accent ────────────────────────────── */

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dim), transparent);
    opacity: 0.5;
}

/* ── Responsive additions ──────────────────────────────── */

@media (max-width: 600px) {
    .stats-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 14px 10px;
    }
    .stat-value {
        font-size: 1.2rem;
    }
    .history-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        min-width: unset;
    }
    .toolbar-actions {
        justify-content: flex-end;
    }
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .setting-select, .setting-input {
        width: 100%;
    }
    .theme-toggle {
        width: 100%;
    }
    .theme-btn {
        flex: 1;
        justify-content: center;
    }
}
