/* Hintavertailusivun (index.php) tyylit. Ladataan index.php:ssa filemtime-versiolla.
   Haulikko-/luotikohtaiset mobiilisäännöt rajataan taulukon luokalla (.shotgun-table / .bullet-table). */
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --bg: #0f1117;
            --surface: #1a1d27;
            --surface2: #22263a;
            --border: #2d3352;
            --accent: #4f8ef7;
            --accent-dim: #2a4a8a;
            --green: #22c55e;
            --green-dim: #14532d;
            --red: #ef4444;
            --yellow: #f59e0b;
            --text: #e2e8f0;
            --text-muted: #8090a5;
            --text-dim: #94a3b8;
            --gold: #f59e0b;
            --radius: 10px;
            --radius-sm: 6px;
        }

        [data-theme="light"] {
            --bg: #f5f7fa;
            --surface: #ffffff;
            --surface2: #eef0f5;
            --border: #dde2ea;
            --accent: #2563eb;
            --accent-dim: #dbeafe;
            --green: #16a34a;
            --green-dim: #dcfce7;
            --red: #dc2626;
            --yellow: #d97706;
            --text: #111827;
            --text-muted: #6b7280;
            --text-dim: #374151;
            --gold: #d97706;
        }

        .theme-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-dim);
            cursor: pointer;
            font-size: 16px;
            transition: background .15s, border-color .15s;
            flex-shrink: 0;
        }
        .theme-toggle:hover { background: var(--surface2); border-color: var(--accent); }
        .header-submit-icon { display: none; }
        .auth-trigger.is-authenticated { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
        .account-menu-wrap { position: relative; display: inline-flex; }
        .account-menu {
            position: absolute; top: calc(100% + 8px); right: 0; z-index: 950;
            width: 210px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
            background: var(--surface); box-shadow: 0 12px 28px rgba(0,0,0,.24);
        }
        .account-menu-item {
            display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
            padding: 9px 10px; border: 0; border-radius: 4px; background: transparent;
            color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
        }
        .account-menu-item:hover, .account-menu-item:focus-visible { background: var(--surface2); outline: none; }
        .account-menu-item svg { width: 16px; height: 16px; color: var(--text-muted); flex: 0 0 16px; }
        .account-menu-separator { height: 1px; margin: 6px 4px; background: var(--border); }
        .account-menu-item.account-menu-logout { color: var(--red); }
        .account-menu-item.account-menu-logout svg { color: var(--red); }
        .auth-success-notice {
            position: fixed; right: 16px; bottom: 16px; z-index: 1100;
            display: flex; align-items: flex-start; gap: 10px;
            width: min(340px, calc(100vw - 32px)); box-sizing: border-box;
            padding: 13px 12px; border: 1px solid var(--green); border-radius: var(--radius-sm);
            background: var(--surface); color: var(--text); box-shadow: 0 12px 28px rgba(0,0,0,.24);
            transition: opacity .2s ease, transform .2s ease;
        }
        .auth-success-notice.is-hiding { opacity: 0; transform: translateY(8px); pointer-events: none; }
        .auth-success-notice-icon { color: var(--green); font-size: 18px; line-height: 1.2; }
        .auth-success-notice strong, .auth-success-notice span { display: block; }
        .auth-success-notice strong { font-size: 14px; }
        .auth-success-notice span { margin-top: 2px; color: var(--text-muted); font-size: 12px; }
        .auth-success-notice-close { margin-left: auto; padding: 0 2px; border: 0; background: transparent; color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; }

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

        a { color: inherit; text-decoration: none; }

        /* ── Layout ── */
        .page {
            max-width: 1100px;
            margin: 0 auto;
            padding: 0 16px 48px;
        }

        /* ── Header ── */
        .header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 28px 0 24px;
            border-bottom: 1px solid var(--border);
            margin-bottom: 28px;
            gap: 16px;
            flex-wrap: wrap;
        }

        .header-left { display: flex; align-items: center; gap: 14px; }

        .logo {
            width: 40px; height: 40px;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }

        .site-title {
            font-size: 22px;
            font-weight: 700;
            letter-spacing: -0.3px;
        }

        .site-subtitle {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 1px;
        }

        .header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

        .btn {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 8px 16px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            border: none;
            transition: opacity .15s, background .15s;
        }
        .btn:hover { opacity: .85; }
        .btn-primary { background: var(--accent); color: #fff; }
        .btn-ghost {
            background: transparent;
            color: var(--text-dim);
            border: 1px solid var(--border);
        }
        .btn-ghost:hover { background: var(--surface2); opacity: 1; }

        /* ── Auth modal ── */
        .auth-modal-backdrop {
            position: fixed; inset: 0;
            background: rgba(0,0,0,.55);
            backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
            display: none; align-items: center; justify-content: center;
            z-index: 1000; padding: 24px; overflow-y: auto;
        }
        .auth-modal-backdrop.open { display: flex; }
        body.modal-open { overflow: hidden; }
        .auth-modal {
            background: var(--surface); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 36px 40px;
            width: 100%; max-width: 380px; position: relative;
            max-height: calc(100vh - 48px); overflow-y: auto;
            margin: auto;
            transition: max-width .15s;
        }
        .auth-modal.wide { max-width: 640px; }
        .auth-modal-close {
            position: absolute; top: 10px; right: 10px;
            width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
            background: transparent; border: none; color: var(--text-dim);
            font-size: 18px; cursor: pointer; border-radius: var(--radius-sm);
        }
        .auth-modal-close:hover { background: var(--surface2); }
        .auth-view .title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
        .auth-view .field { margin-bottom: 16px; }
        .auth-view .field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
        .auth-view .field input {
            width: 100%; background: var(--bg); border: 1px solid var(--border);
            border-radius: var(--radius-sm); padding: 9px 12px; color: var(--text);
            font-size: 14px; box-sizing: border-box; font-family: inherit;
        }
        .auth-view .btn {
            position: relative;
            width: 100%; background: var(--accent); color: #fff; border: none;
            border-radius: var(--radius-sm); padding: 10px; font-size: 14px;
            cursor: pointer; margin-top: 8px; justify-content: center;
        }
        .auth-view .btn.is-loading { color: transparent; pointer-events: none; }
        .auth-view .btn.is-loading::after {
            content: '';
            position: absolute; left: 50%; top: 50%;
            width: 16px; height: 16px; margin: -8px 0 0 -8px;
            border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
            border-radius: 50%;
            animation: btn-spin .6s linear infinite;
        }
        @keyframes btn-spin { to { transform: rotate(360deg); } }
        .auth-view .msg { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
        .auth-view .msg.error { background: rgba(239,68,68,.12); color: var(--red); }
        .auth-view .msg.success { background: var(--green-dim); color: var(--green); }
        .auth-view .msg.notice { background: var(--accent-dim); color: var(--accent); }
        .auth-switch { margin-top: 16px; font-size: 13px; text-align: center; }
        .auth-switch a { color: var(--accent); }
        .auth-resend { margin-top: 12px; text-align: center; }
        .auth-resend button { appearance: none; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 4px; text-decoration: underline; }
        .auth-resend button:disabled { cursor: wait; opacity: .65; }
        .auth-oauth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--text-muted); font-size: 12px; }
        .auth-oauth-divider::before, .auth-oauth-divider::after { content: ''; height: 1px; background: var(--border); flex: 1; }
        .auth-google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; box-sizing: border-box; background: #fff; color: #202124; border: 1px solid #dadce0; border-radius: var(--radius-sm); padding: 10px; font-size: 14px; font-weight: 600; text-decoration: none; }
        .auth-google-btn img { width: 18px; height: 18px; flex: 0 0 18px; }
        .auth-google-btn:hover { background: #f8f9fa; }

        /* ── Virheilmoituslomake (jakaa auth-modal-backdrop/auth-modal-mekanismin) ── */
        .report-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
        .report-modal-product { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
        .report-modal-options { display: flex; flex-direction: column; gap: 8px; }
        .report-modal-option {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
            font-size: 14px; color: var(--text); cursor: pointer;
            transition: border-color .15s, background .15s;
        }
        .report-modal-option:hover { border-color: var(--text-muted); }
        .report-modal-option:has(input:checked) { border-color: var(--accent); background: rgba(79,142,247,.08); }
        .report-modal-option input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
        .report-modal-field { margin-top: 16px; }
        .report-modal-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
        .report-modal-field textarea {
            width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--border);
            border-radius: var(--radius-sm); color: var(--text); font-size: 14px; font-family: inherit;
            padding: 9px 12px; resize: vertical; min-height: 64px;
        }
        .report-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
        .report-modal-actions .btn { width: auto; margin-top: 0; }
        @media (max-width: 700px) {
            .auth-modal-backdrop.report-modal-backdrop { align-items: flex-end; padding: 0; }
            .auth-modal.report-modal {
                width: 100%; max-width: 100%; margin: 0;
                border-radius: var(--radius) var(--radius) 0 0;
                max-height: 85vh;
                animation: report-modal-slide-up .22s ease-out;
            }
            @keyframes report-modal-slide-up {
                from { transform: translateY(100%); }
                to   { transform: translateY(0); }
            }
        }

        .acc-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
        .acc-filters .f { display: flex; flex-direction: column; gap: 4px; }
        .acc-filters .f-check { display: flex; flex-direction: row; align-items: center; align-self: flex-end; gap: 6px; padding-bottom: 8px; }
        .acc-filters .f-check label { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; }
        .acc-filters label { font-size: 11px; color: var(--text-muted); }
        .acc-filters select, .acc-filters input[type=text] {
            background: var(--bg); border: 1px solid var(--border);
            border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
            padding: 7px 10px; font-family: inherit;
        }
        .acc-filter-toggle { position: relative; display: inline-flex; cursor: pointer; }
        .acc-filter-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
        .acc-filter-toggle span {
            display: inline-flex; align-items: center; min-height: 32px; box-sizing: border-box;
            padding: 6px 10px; background: var(--surface); border: 1px solid var(--border);
            border-radius: var(--radius-sm); color: var(--text-dim); font-size: 12px; font-weight: 500;
        }
        .acc-filter-toggle input:checked + span {
            border-color: var(--accent); color: var(--accent); background: rgba(79,142,247,.08);
        }
        .acc-filter-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
        .acc-cheapest { font-size: 13px; margin: 0 0 14px; color: var(--text-dim); }
        .acc-cheapest strong { color: var(--accent); }
        .acc-add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 20px; }
        .acc-add-row input, .acc-add-row select {
            background: var(--bg); border: 1px solid var(--border);
            border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
            padding: 7px 10px; font-family: inherit;
        }
        .acc-add-row .btn { width: auto; margin-top: 0; }
        .acc-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0 18px; }
        .acc-list-title { font-size: 13px; font-weight: 600; color: var(--text-dim); margin: 0 0 10px; }
        .acc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
        .acc-table th, .acc-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
        .acc-table .muted { color: var(--text-muted); }
        .acc-event-product { font-weight: 600; color: var(--text); }
        .acc-event-meta { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
        .acc-event-link { color: var(--accent); font-size: 12px; white-space: nowrap; }
        .acc-load-more { margin-top: 10px; width: 100%; }
        .acc-load-more[hidden] { display: none !important; }
        @media (max-width: 560px) {
            .auth-modal { padding: 24px 18px; }
            .acc-table thead { display: none; }
            .acc-table, .acc-table tbody, .acc-table tr, .acc-table td { display: block; width: 100%; }
            .acc-table tr {
                border: 1px solid var(--border); border-radius: var(--radius-sm);
                padding: 10px 12px; margin-bottom: 10px;
            }
            .acc-table td { border-bottom: none; padding: 3px 0; }
            .acc-table td[data-label]::before {
                content: attr(data-label); display: block;
                font-size: 11px; color: var(--text-muted);
            }
            .acc-table td:last-child { padding-top: 8px; }
        }
        .acc-btn-del {
            background: rgba(239,68,68,.12); color: var(--red); border: none;
            border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12px; cursor: pointer;
        }
        .settings-password-form { display: flex; flex-direction: column; gap: 10px; max-width: 280px; margin-top: 14px; }
        .settings-section-title { margin-top: 18px; font-size: 13px; font-weight: 600; }
        .settings-password-form .f { display: flex; flex-direction: column; gap: 4px; }
        .settings-password-form label { font-size: 11px; color: var(--text-muted); }
        .settings-password-form input {
            background: var(--bg); border: 1px solid var(--border);
            border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
            padding: 7px 10px; font-family: inherit;
        }
        .settings-password-form .btn { width: auto; align-self: flex-start; margin-top: 2px; }

        /* ── Caliber tabs ── */
        .caliber-nav {
            display: grid;
            grid-template-columns: repeat(var(--cal-cols, 5), 1fr);
            gap: 1px;
            background: var(--border);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
            margin-bottom: 20px;
        }

        .caliber-btn {
            display: block;
            padding: 9px 8px;
            font-size: 13px;
            font-weight: 500;
            border: none;
            background: var(--surface);
            color: var(--text-muted);
            cursor: pointer;
            transition: all .15s;
            text-align: center;
            text-decoration: none;
            line-height: 1.3;
        }
        .caliber-btn:hover { color: var(--text); background: var(--surface2); }
        .caliber-btn.active { background: var(--accent); color: #fff; }
        /* Mobiilin ensinäkymän elementit: piilossa desktopissa */
        .caliber-all-btn, .page-title-count, .mobile-submit-link { display: none; }
        .page-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }

        /* ── Kaikki kaliiperit -paneeli (bottom sheet, ks. report-modal) ── */
        .auth-modal.cal-sheet { padding: 8px 16px 24px; }
        .cal-sheet:focus { outline: none; }
        .cal-sheet .auth-modal-close { top: 6px; right: 6px; width: 40px; height: 40px; }
        .cal-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 6px auto 12px; }
        .cal-sheet-title { font-size: 16px; font-weight: 700; }
        .cal-sheet-sec {
            font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
            color: var(--text-muted); margin: 14px 0 2px;
        }
        .cal-sheet-link {
            display: block; padding: 12px 4px; border-bottom: 1px solid var(--border);
            color: var(--text); font-size: 15px;
        }
        .cal-sheet-link:hover, .cal-sheet-link:focus-visible { background: var(--surface2); outline: none; }
        .cal-sheet-link.active { color: var(--accent); font-weight: 600; }

        /* ── Kauppadialogi (sisältö kauppa.php?osa=1:stä, ks. renderShopContent) ── */
        .auth-modal.kauppa-dialog { max-width: 560px; padding: 8px 24px 24px; }
        .kauppa-dialog:focus { outline: none; }
        .kauppa-dialog .auth-modal-close { top: 6px; right: 6px; width: 40px; height: 40px; }
        .kauppa-dialog .shop-header { display: flex; align-items: center; gap: 12px; margin: 4px 40px 4px 0; }
        .kauppa-dialog .shop-header img { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }
        .kauppa-dialog .shop-header h2 { font-size: 20px; font-weight: 700; line-height: 1.3; }
        .kauppa-dialog .shop-desc { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin: 8px 0 0; }
        .kauppa-dialog .site-link {
            display: inline-flex; align-items: center; min-height: 44px; margin: 16px 0;
            padding: 0 16px; border-radius: var(--radius-sm);
            background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
        }
        .kauppa-dialog .site-link:hover { filter: brightness(1.1); }
        .kauppa-dialog .shop-links { display: flex; flex-wrap: wrap; gap: 0 10px; }
        .kauppa-dialog .site-link.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
        .kauppa-dialog .site-link.btn-secondary:hover { filter: none; background: var(--accent-dim); }
        .kauppa-dialog .contact-card {
            background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
            padding: 4px 16px; margin-bottom: 16px;
        }
        .kauppa-dialog .contact-row { display: flex; gap: 10px; padding: 10px 0; font-size: 14px; }
        .kauppa-dialog .contact-row + .contact-row { border-top: 1px solid var(--border); }
        .kauppa-dialog .contact-label { color: var(--text-muted); min-width: 100px; flex-shrink: 0; }
        .kauppa-dialog .contact-row a, .kauppa-dialog .shop-page-link { color: var(--accent); }
        .kauppa-dialog .shipping-card { padding: 12px 16px 10px; }
        .kauppa-dialog .shipping-card .contact-label { min-width: 130px; }
        .kauppa-dialog .shipping-title { font-size: 14px; font-weight: 700; padding-bottom: 4px; }
        .kauppa-dialog .shipping-checked { font-size: 12px; color: var(--text-muted); padding-top: 8px; border-top: 1px solid var(--border); }
        .kauppa-dialog .map-frame {
            width: 100%; height: 260px; border: 1px solid var(--border);
            border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
        }
        .kauppa-dialog .map-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
        .kauppa-dialog .shop-page-link { display: block; width: fit-content; font-size: 14px; padding: 4px 0; }
        .kauppa-dialog-status { padding: 16px 0 8px; color: var(--text-muted); font-size: 14px; }
        @media (max-width: 700px) {
            .auth-modal.kauppa-dialog { max-width: 100%; padding: 8px 16px 24px; }
            .kauppa-dialog .map-frame { height: 220px; }
            .kauppa-dialog .contact-label { min-width: 90px; }
        }

        /* ── Table wrapper ── */
        .table-wrap {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
        }
        .table-scroll {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .table-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 20px;
            border-bottom: 1px solid var(--border);
            gap: 12px;
            flex-wrap: wrap;
        }
        .table-header-filters {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .table-header-meta {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        /* Toggle — piilotettu oletuksena */
        .mobile-top-controls { display: contents; }
        .mobile-sort-wrap { display: none; position: relative; }
        .mobile-sort-trigger {
            display: flex; align-items: center; gap: 5px;
            font-size: 13px; font-family: inherit;
            padding: 6px 10px;
            background: var(--surface2); border: 1px solid var(--border);
            border-radius: var(--radius-sm); color: var(--text-muted);
            cursor: pointer; white-space: nowrap;
        }
        .mobile-sort-chevron { font-size: 10px; opacity: .6; transition: transform .15s; }
        .mobile-sort-trigger.open .mobile-sort-chevron { transform: rotate(180deg); }
        #mobileSortDirIcon { font-size: 13px; color: var(--accent); }
        .mobile-sort-dropdown {
            display: none; position: absolute; top: calc(100% + 4px); left: 0;
            background: var(--surface); border: 1px solid var(--border);
            border-radius: var(--radius); min-width: 140px;
            box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 200; padding: 4px;
        }
        .mobile-sort-dropdown.open { display: block; }
        .mobile-sort-option {
            display: flex; align-items: center; justify-content: space-between;
            width: 100%; padding: 8px 10px; gap: 8px;
            font-size: 13px; font-family: inherit; text-align: left;
            background: none; border: none; border-radius: var(--radius-sm);
            color: var(--text-dim); cursor: pointer;
        }
        .mobile-sort-option:hover { background: var(--surface2); color: var(--text); }
        .mobile-sort-option.active { color: var(--accent); }
        .mobile-sort-option .opt-dir { font-size: 12px; }
        .mobile-filter-toggle {
            display: none; align-items: center; justify-content: space-between;
            font-size: 13px; font-weight: 500; color: var(--text-muted);
            background: var(--surface2); border: 1px solid var(--border);
            border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer;
            font-family: inherit; width: 100%;
        }
        .mobile-filter-toggle.open { color: var(--text); border-color: var(--text-muted); }
        .mobile-filter-toggle .mobile-filter-arrow { transition: transform .2s; display: inline-block; }
        .mobile-filter-toggle.open .mobile-filter-arrow { transform: rotate(180deg); }
        /* Overflow-tila (JS lisää filter-overflow + filters-open luokat) */
        .mobile-filter-active-count { color: var(--accent); font-variant-numeric: tabular-nums; }
        #productSearch {
            width: 160px; font-size: 12px; padding: 5px 10px;
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            background: var(--surface); color: var(--text); outline: none;
        }
        .mft-label-mobile { display: none; }
        .table-header.filter-overflow { flex-wrap: wrap; }
        .table-header.filter-overflow .mobile-filter-toggle { display: flex; width: auto; order: 1; }
        .table-header.filter-overflow #productSearch { order: 0; }
        .table-header.filter-overflow .table-header-meta { order: 2; margin-left: auto; }
        .table-header.filter-overflow .table-header-filters {
            display: none; width: 100%; flex-basis: 100%; order: 3;
            padding-top: 12px; border-top: 1px solid var(--border);
        }
        .table-header.filter-overflow.filters-open .table-header-filters { display: flex; }

        .table-title {
            font-size: 15px;
            font-weight: 600;
        }

        .count-badge {
            font-size: 12px;
            color: var(--text-muted);
            background: var(--surface2);
            padding: 3px 10px;
            border-radius: 999px;
        }

        .toggle-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-muted);
            transition: all .15s;
            font-family: inherit;
        }
        .toggle-btn:hover { border-color: var(--accent); color: var(--text); }
        .toggle-btn.active {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
        }
        .toggle-dot {
            width: 14px; height: 14px;
            border-radius: 999px;
            border: 1.5px solid currentColor;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .toggle-btn.active .toggle-dot::after {
            content: '';
            display: block;
            width: 7px; height: 7px;
            border-radius: 999px;
            background: #fff;
        }

        /* ── Filters ── */
        .filter-group { display: flex; gap: 6px; flex-wrap: wrap; }

        .btn-show-more {
            padding: 9px 24px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid var(--border);
            background: var(--surface2);
            color: var(--text-muted);
            transition: background .15s, color .15s;
        }
        .btn-show-more:hover { background: var(--surface3, var(--border)); color: var(--text); }

        .filter-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px 6px 12px;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid var(--border);
            background: var(--surface2);
            color: var(--text-muted);
            transition: all .15s;
            font-family: inherit;
            position: relative;
        }
        .filter-btn::after {
            content: '';
            display: inline-block;
            width: 0; height: 0;
            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
            border-top: 5px solid currentColor;
            opacity: .5;
            transition: transform .15s;
            margin-left: 2px;
        }
        .filter-btn.open::after { transform: rotate(180deg); opacity: 1; }
        .filter-btn-toggle::after { display: none; }
        .filter-btn:hover { border-color: var(--text-muted); color: var(--text); }
        .filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(79,142,247,.08); }
        .filter-btn .filter-count {
            background: var(--accent);
            color: #fff;
            border-radius: 999px;
            font-size: 10px;
            font-weight: 700;
            padding: 1px 6px;
            display: none;
        }
        .filter-btn.active .filter-count { display: inline; }

        .filter-wrap { position: relative; }
        .table-header.filter-overflow .filter-label { display: none; }

        .filter-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            z-index: 100;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 6px;
            min-width: 180px;
            max-height: 260px;
            overflow-y: auto;
            box-shadow: 0 8px 24px rgba(0,0,0,.4);
        }
        .filter-dropdown.open { display: block; }

        .filter-option {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            color: var(--text-dim);
            user-select: none;
            transition: background .1s;
        }
        .filter-option[hidden] { display: none !important; }
        .filter-option:hover { background: var(--surface2); color: var(--text); }
        .filter-option input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

        .filter-clear {
            display: block;
            width: 100%;
            padding: 6px 8px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .4px;
            color: var(--text-muted);
            background: none;
            border: none;
            border-bottom: 1px solid var(--border);
            margin-bottom: 4px;
            cursor: pointer;
            text-align: left;
            font-family: inherit;
        }
        .filter-clear:hover { color: var(--text); }

        .reset-filters-btn {
            font-size: 11px;
            font-weight: 600;
            color: var(--red);
            background: none;
            border: 1px solid rgba(239,68,68,.3);
            border-radius: var(--radius-sm);
            padding: 4px 10px;
            cursor: pointer;
            font-family: inherit;
            transition: all .15s;
        }
        .reset-filters-btn:hover { background: var(--red-dim); }

        /* ── Valitut suodattimet siruina ── */
        .filter-chips {
            display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
            padding: 10px 20px; border-bottom: 1px solid var(--border);
        }
        .filter-chips[hidden] { display: none; }
        .filter-chip {
            display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
            min-height: 32px; padding: 4px 6px 4px 12px; border-radius: 999px;
            background: var(--surface2); border: 1px solid var(--border); color: var(--text);
            font-family: inherit; font-size: 13px; line-height: 1.2; cursor: pointer;
        }
        .filter-chip:hover { border-color: var(--text-muted); }
        .filter-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
        .filter-chip-key { color: var(--text-muted); white-space: nowrap; }
        .filter-chip-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .filter-chip-x {
            display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
            width: 22px; height: 22px; border-radius: 50%; color: var(--text-muted); font-size: 16px; line-height: 1;
        }
        .filter-chip:hover .filter-chip-x { color: var(--text); background: var(--border); }
        /* Desktopissa .reset-filters-btn-ulkoasu; mobiilissa kevyt tekstilinkki */
        .filter-chips-reset { margin-left: 4px; }
        @media (max-width: 700px) {
            .filter-chips { padding: 8px 12px; }
            .filter-chips-reset {
                min-height: 32px; padding: 0 8px; background: none; border: 0; border-radius: 0;
                color: var(--accent); font-size: 13px; font-weight: 400; margin-left: 0;
            }
            .filter-chips-reset:hover { background: none; text-decoration: underline; }
        }

        /* ── Table ── */
        .price-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }

        .price-table thead th {
            padding: 11px 16px;
            text-align: left;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .6px;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border);
            white-space: nowrap;
            user-select: none;
        }

        .price-table thead th.sortable { cursor: pointer; }
        .price-table thead th.sortable:hover { color: var(--text); }
        .price-table thead th.sort-active { color: var(--accent); }

        .sort-icon {
            display: inline-block;
            margin-left: 4px;
            font-size: 10px;
            opacity: .5;
        }
        th.sort-active .sort-icon { opacity: 1; }

        .price-table tbody tr {
            position: relative;
            border-bottom: 1px solid var(--border);
            cursor: pointer;
            transition: background .1s;
        }
        .price-table tbody tr:last-child { border-bottom: none; }
        .price-table tbody tr:hover { background: var(--surface2); }

        .price-table tbody td {
            padding: 13px 16px;
            vertical-align: middle;
        }

        /* ── Cell styles ── */
        .cell-retailer {
            font-weight: 500;
            color: var(--text);
            white-space: nowrap;
        }
        /* Kaupan tiedot -kuvake: avaa kauppadialogin, muu solu kuuluu rivin klikkaukseen */
        .shop-info-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            margin-left: 2px;
            vertical-align: middle;
            border-radius: var(--radius-sm);
            color: var(--text-muted);
            opacity: .6;
            transition: opacity .15s, color .15s, background .15s;
        }
        .shop-info-btn:hover,
        .shop-info-btn:focus-visible {
            opacity: 1;
            color: var(--text);
            background: var(--surface2);
        }
        /* Kosketukseen isompi napautusalue; negatiivinen marginaali pitää rivin korkeuden ennallaan */
        @media (pointer: coarse) {
            .shop-info-btn { width: 34px; height: 34px; margin: -6px 0; }
        }
        /* Hiirellä kuvake näkyy vasta rivin päällä (näppäimistöllä fokuksessa) */
        @media (hover: hover) and (pointer: fine) {
            .shop-info-btn { opacity: 0; }
            tr.clickable-row:hover .shop-info-btn { opacity: .6; }
            tr.clickable-row .shop-info-btn:hover,
            tr.clickable-row .shop-info-btn:focus-visible { opacity: 1; }
        }
        /* Mobiilikortti: ei kuvaketta, kaupan nimi avaa dialogin (vääriä klikkauksia ei juuri ole) */
        /* Visuaalisesti piilotettu, ei display:none: ruudunlukija ja näppäimistö löytävät linkin
           ja fokus palaa siihen dialogin sulkeutuessa */
        @media (max-width: 700px) {
            .shop-info-btn {
                position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
                overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
            }
        }

        /* Kaupan favicon hintarivillä (aiemmin inline-style jokaisella rivillä) */
        .shop-fav { border-radius: 3px; vertical-align: middle; margin-right: 6px; flex-shrink: 0; }
        .shop-fav-white { background: #fff; }

        .cell-product .name {
            font-weight: 500;
            color: var(--text);
            max-width: 220px;
        }
        .cell-product .detail {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 2px;
        }
        .shot-mobile-meta { display: none; }

        .cell-qty {
            font-variant-numeric: tabular-nums;
            color: var(--text-dim);
            white-space: nowrap;
        }

        .cell-unit {
            font-variant-numeric: tabular-nums;
            font-weight: 700;
            font-size: 15px;
            white-space: nowrap;
        }

        .cell-unit.best {
            color: var(--green);
        }

        .best-badge {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            font-size: 10px;
            font-weight: 700;
            background: var(--green-dim);
            color: var(--green);
            padding: 2px 7px;
            border-radius: 999px;
            margin-left: 6px;
            vertical-align: middle;
            text-transform: uppercase;
            letter-spacing: .4px;
        }

        .cell-total {
            font-variant-numeric: tabular-nums;
            color: var(--text-dim);
            white-space: nowrap;
        }

        /* Status */
        .status-dot {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            white-space: nowrap;
        }
        .status-dot::before {
            content: '';
            display: block;
            width: 7px; height: 7px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .status-dot.available { color: var(--green); }
        .status-dot.available::before { background: var(--green); box-shadow: 0 0 6px var(--green); }
        .status-dot.unavailable { color: var(--red); }
        .status-dot.unavailable::before { background: var(--red); }

        /* Tila-sarakkeeseen varataan tilaa lipputunnistenapille, ettei se peity tekstin alle */
        .cell-status { padding-right: 46px; }

        /* ── Ilmoita virheestä -lippunappi ── */
        .report-issue-btn {
            position: absolute;
            top: 6px;
            right: 8px;
            width: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            border: none;
            border-radius: var(--radius-sm);
            background: transparent;
            color: var(--text-muted);
            opacity: .5;
            cursor: pointer;
            transition: opacity .15s, color .15s, background .15s;
            z-index: 2;
        }
        .report-issue-btn:hover,
        .report-issue-btn:focus-visible {
            opacity: 1;
            color: var(--text);
            background: var(--surface2);
            outline: none;
        }
        .report-issue-btn svg { width: 15px; height: 15px; }

        /* Loppuneet rivit himmennetään */
        tr.row-unavailable { opacity: .45; border-left: 3px solid var(--red); }
        tr.row-unavailable:hover { opacity: .7; }

        /* ── No data ── */
        .no-data {
            padding: 60px 20px;
            text-align: center;
            color: var(--text-muted);
        }
        .no-data-icon { font-size: 36px; margin-bottom: 12px; }
        .no-data-text { font-size: 15px; }

        /* ── Footer ── */
        .footer {
            margin-top: 32px;
            padding-top: 20px;
            border-top: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            font-size: 13px;
            color: var(--text-muted);
        }

        .footer-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

        .footer a { color: var(--text-dim); }
        .footer a:hover { color: var(--text); }

        /* ── Responsive ── */
        @media (max-width: 700px) {
            .page { padding: 0 12px 32px; }
            .header { position: relative; padding: 8px 0 6px; margin-bottom: 8px; }
            .header-left { gap: 10px; }
            .logo, .logo svg { width: 30px; height: 30px; }
            .header-submit-btn { display: none; }
            .header-submit-icon { display: inline-flex; background: var(--accent); border-color: var(--accent); color: #fff; }
            .header-submit-icon:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.1); }
            .site-title { font-size: 18px; }
            .page-title-row {
                display: flex; align-items: baseline; justify-content: space-between;
                gap: 8px; margin: 4px 0 8px;
            }
            .page-title { font-size: 18px; margin-bottom: 0; }
            .page-title-count {
                display: inline; font-size: 13px; color: var(--text-muted);
                white-space: nowrap; font-variant-numeric: tabular-nums;
            }
            .mobile-submit-link { display: block; margin-top: 16px; text-align: center; }
            .mobile-submit-link a {
                display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
                border: 1px solid var(--border); border-radius: var(--radius-sm);
                color: var(--accent); font-size: 14px;
            }
            .site-subtitle { display: none; }
            .btn { font-size: 12px; padding: 7px 12px; }
            .account-menu-wrap { position: static; }
            .account-menu { top: calc(100% + 4px); right: 0; left: 0; width: auto; }

            /* 6 suosituinta + nykyinen 3-sarakkeisena, loput "Kaikki kaliiperit" -paneelissa */
            .caliber-nav { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
            .caliber-btn { padding: 8px 4px; font-size: 13px; }
            .caliber-btn.cal-mobile-extra { display: none; }
            .caliber-all-btn {
                display: flex; grid-column: 1 / -1; justify-content: center; align-items: center; gap: 6px;
                padding: 8px; font-size: 13px; font-family: inherit; color: var(--accent);
                background: var(--surface2); border: 0; cursor: pointer;
            }

            .table-header { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 12px; }
            /* Mobiililla aina toggle-moodi: haku + Suodata + lajittelu samalla rivillä.
               16px fontti estää iOS:n automaattisen zoomauksen hakukenttään. */
            /* width:100%: wrap-tilassa venytys seuraisi muuten sisällön leveyttä ja rivi vuotaisi yli */
            .mobile-top-controls { display: flex; gap: 6px; align-items: stretch; width: 100%; }
            #productSearch {
                flex: 1 1 auto; width: auto; min-width: 0; min-height: 44px;
                font-size: 16px; padding: 10px 12px; border-radius: 8px;
            }
            .mobile-filter-toggle {
                display: flex; flex: 0 0 auto; width: auto; gap: 4px;
                min-height: 44px; padding: 0 12px; font-size: 14px;
            }
            .mft-label-desktop { display: none; }
            .mft-label-mobile { display: inline; }
            .mobile-filter-active-count:empty { display: none; }
            .mobile-sort-wrap { display: block; flex: 0 0 auto; }
            .mobile-sort-trigger { min-height: 44px; height: 100%; padding: 0 10px; font-size: 14px; }
            .mobile-sort-dropdown { left: auto; right: 0; }
            .filter-label { display: none; }
            .table-header-filters { display: none; width: 100%; }
            .table-header-meta { display: none; width: 100%; justify-content: space-between; }
            .table-header.filters-open .table-header-filters { display: flex; }
            .table-header.filters-open .table-header-meta { display: flex; }

            /* Pakota block-layout mobiililla — muuten table laskee oman leveytensä */
            .price-table { display: block; width: 100%; }
            .price-table tbody { display: block; width: 100%; }

            /* Hide table header entirely on mobile */
            .price-table thead { display: none; }

            /* Turn each row into a card */
            .price-table tbody tr {
                display: flex;
                flex-wrap: wrap;
                align-items: center;
                padding: 12px 14px;
                gap: 4px 12px;
                border-bottom: 1px solid var(--border);
            }

            .cell-product .name {
                font-size: 13px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                max-width: 100%;
            }
            .cell-product .detail { display: none; }
            .cell-unit { font-size: 17px; }
            .best-badge { display: none; }

            /* ── Shotgun: 3-row card layout ─────────────────────────── */
            /* Hide material/size/weight columns and status (shown combined in shot-mobile-meta) */
            .shotgun-table tbody td:nth-child(4),
            .shotgun-table tbody td:nth-child(5),
            .shotgun-table tbody td:nth-child(6),
            .shotgun-table tbody td:nth-child(10) { display: none; }

            /* Flex row breaks via pseudo-elements */
            .shotgun-table tbody tr::before,
            .shotgun-table tbody tr::after {
                content: '';
                display: block;
                flex: 0 0 100%;
                height: 0;
                padding: 0;
            }
            .shotgun-table tbody tr::before { order: 25; } /* break after row 1 */
            .shotgun-table tbody tr::after  { order: 45; } /* break after row 2 */

            /* Row 1: Kauppa (left) + Määrä (right) */
            .shotgun-table tbody td:nth-child(1) { order: 10; flex: 1; font-size: 12px; color: var(--text-muted); padding: 0; }
            .shotgun-table tbody td:nth-child(7) { order: 20; font-size: 12px; color: var(--text-muted); padding: 0; }

            /* Row 2: Tuote (left) + €/kpl (right) */
            .shotgun-table tbody td:nth-child(2) { order: 30; flex: 1; padding: 0; min-width: 0; }
            .shotgun-table tbody td:nth-child(8) { order: 40; padding: 0 34px 0 0; text-align: right; }

            /* Row 3: Tyyppi·Materiaali·Koko·Lataus (left) + Yht. (right) */
            .shotgun-table tbody td:nth-child(3) { order: 50; flex: 1; padding: 0; font-size: 12px; color: var(--text-muted); }
            .shotgun-table tbody td:nth-child(9) { order: 60; padding: 0 34px 0 0; text-align: right; font-size: 12px; color: var(--text-muted); }

            .shot-type-desktop { display: none; }
            .shot-mobile-meta  { display: inline; }


            /* ── Non-shotgun: 3-row card layout ──────────────────────── */
            /* Hide Merkki (3) and Tila (8) */
            .bullet-table tbody td:nth-child(3),
            .bullet-table tbody td:nth-child(8) { display: none; }

            /* Flex row breaks via pseudo-elements */
            .bullet-table tbody tr::before,
            .bullet-table tbody tr::after {
                content: '';
                display: block;
                flex: 0 0 100%;
                height: 0;
                padding: 0;
            }
            .bullet-table tbody tr::before { order: 25; } /* break after row 1 */
            .bullet-table tbody tr::after  { order: 45; } /* break after row 2 */

            /* Row 1: Kauppa (left) + Määrä (right) */
            .bullet-table tbody td:nth-child(1) { order: 10; flex: 1; font-size: 12px; color: var(--text-muted); padding: 0; }
            .bullet-table tbody td:nth-child(5) { order: 20; font-size: 12px; color: var(--text-muted); padding: 0; }

            /* Row 2: Tuote (left) + €/kpl (right) */
            .bullet-table tbody td:nth-child(2) { order: 30; flex: 1; padding: 0; min-width: 0; }
            .bullet-table tbody td:nth-child(6) { order: 40; padding: 0 34px 0 0; text-align: right; }

            /* Row 3: Paino (left) + Yht. (right) */
            .bullet-table tbody td:nth-child(4) { order: 50; flex: 1; padding: 0; font-size: 12px; color: var(--text-muted); }
            .bullet-table tbody td:nth-child(7) { order: 60; padding: 0 34px 0 0; text-align: right; font-size: 12px; color: var(--text-muted); }

            /* Lipputunnistenappi: alaoikealle, ei ylös (siellä on kpl-määrä) eikä hinnan päälle
               (yllä €/kpl- ja Yht.-soluihin varattu 34px tilaa oikealle) */
            .report-issue-btn {
                top: auto;
                bottom: 6px;
                right: 6px;
                transform: none;
            }
            /* Kosketukseen isompi napautusalue kortin kulmaan; kuvake pysyy samana.
               44 px ulottuisi Yht.-hinnan viereen, 36 px jättää selvän välin. */
            @media (pointer: coarse) {
                .report-issue-btn { width: 36px; height: 36px; right: 0; bottom: 0; }
            }

            /* Loppunut tuote: himmennys siirretty riviltä sen sisältöön, jotta "Loppu"-merkki
               (mobiilissa ei Tila-saraketta) jää kirkkaaksi; ulkoasu muuten ennallaan */
            tr.row-unavailable { opacity: 1; border-left-color: rgba(239,68,68,.45); }
            tr.row-unavailable > td { opacity: .45; }
            tr.row-unavailable > td.cell-retailer { opacity: 1; }
            tr.row-unavailable > td.cell-retailer > * { opacity: .45; }
            tr.row-unavailable > td.cell-retailer::after {
                content: 'Loppu'; display: inline-block; margin-left: 8px; padding: 1px 7px;
                border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
                color: #fff; background: var(--red); vertical-align: 1px;
            }

            .footer { flex-direction: column; align-items: flex-start; gap: 6px; }
            .footer-left { gap: 10px; }
            .footer-updated { display: none; }
            .footer-sep-updated { display: none; }
            .footer-sep-sponsor { display: none; }
            .footer-sponsor { width: 100%; }
        }

    /* ── Hintakaavio ── */
    .price-bar {
        display: flex; align-items: center; height: 54px;
        background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius-sm); margin-bottom: 0;
    }
    .price-bar.panel-open { border-radius: var(--radius-sm) var(--radius-sm) 0 0; border-bottom-color: transparent; }
    .price-bar-spark {
        padding: 0 16px; height: 100%; display: flex; align-items: center; flex-shrink: 0;
    }
    .price-bar-stats { display: flex; align-items: center; flex: 1; overflow: hidden; padding-left: 4px; }
    .price-bar-stat {
        display: flex; flex-direction: column; justify-content: center;
        gap: 2px; padding: 0 18px; white-space: nowrap; flex-shrink: 0;
    }
    .pbs-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
    .pbs-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1; }
    .pbs-val.green { color: var(--green); }
    .pbs-trend { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; line-height: 1.2; display: inline-block; }
    .pbs-trend.down { background: var(--green-dim); color: var(--green); }
    .pbs-trend.up   { background: rgba(239,68,68,.15); color: var(--red); }
    .pbs-trend.flat { background: var(--surface2); color: var(--text-muted); }
    .price-bar-toggle {
        display: flex; align-items: center; gap: 5px;
        padding: 0 14px; height: 36px; margin: 0 9px 0 auto;
        font-size: 12px; font-weight: 500; color: var(--text-muted);
        cursor: pointer; background: var(--surface2);
        border: 1px solid var(--border); border-radius: var(--radius-sm);
        font-family: inherit; flex-shrink: 0; white-space: nowrap; transition: all .15s;
    }
    .price-bar-toggle:hover { color: var(--text); border-color: var(--text-dim); }
    .price-bar-toggle.open { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
    .toggle-chevron { transition: transform .2s; display: inline-block; font-size: 10px; }
    .price-bar-toggle.open .toggle-chevron { transform: rotate(180deg); }
    .price-chart-panel {
        background: var(--surface); border: 1px solid var(--border); border-top: none;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
        overflow: hidden; max-height: 0;
        transition: max-height .35s cubic-bezier(.4,0,.2,1);
        margin-bottom: 8px;
    }
    .price-chart-panel.open { max-height: 270px; }
    .pcp-inner { padding: 12px 18px 14px; }
    .pcp-period { display: flex; gap: 4px; align-items: center; }
    .pcp-period-btn {
        font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
        border: 1px solid var(--border); background: transparent; color: var(--text-muted);
        cursor: pointer; font-family: inherit; transition: all .12s;
    }
    .pcp-period-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
    .pcp-canvas-wrap { position: relative; }
    #priceMainChart { max-width: 100%; display: block; }
    #priceHoverLayer { position: absolute; top: 0; left: 0; pointer-events: none; }
    .pcp-tooltip {
        position: absolute; background: var(--surface2); border: 1px solid var(--border);
        border-radius: var(--radius-sm); padding: 5px 9px; font-size: 11px;
        pointer-events: none; display: none; z-index: 10; white-space: nowrap;
    }
    .pcp-tooltip-date { color: var(--text-muted); margin-bottom: 1px; }
    .pcp-tooltip-price { font-weight: 700; color: var(--accent); }
    @media (max-width: 580px) {
        .price-bar-spark { display: none; }
        .price-bar-stat--low90 { display: none; }
        .price-bar-stat--trend { display: none; }
        .price-bar-stat { padding: 0 11px; }
        .pbs-val { font-size: 13px; }
    }
    .pbs-label-m, .toggle-arrow-m { display: none; }
    /* Mobiili: hintapalkki yhdelle matalalle riville ("Halvin nyt X · alin 30 pv Y · Hintakehitys ›") */
    @media (max-width: 700px) {
        .price-bar { height: auto; min-height: 44px; padding-left: 12px; }
        .price-bar-spark, .price-bar-stat--low90, .price-bar-stat--trend { display: none; }
        .price-bar-stats { padding-left: 0; flex-wrap: wrap; column-gap: 6px; min-width: 0; }
        .price-bar-stat { flex-direction: row; align-items: baseline; gap: 5px; padding: 0; }
        .price-bar-stat--low30::before { content: '·'; color: var(--text-muted); }
        .pbs-label { font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; }
        .pbs-label-d { display: none; }
        .pbs-label-m { display: inline; }
        .pbs-val { font-size: 14px; }
        .price-bar-toggle {
            height: 44px; margin: 0 0 0 auto; padding: 0 12px 0 8px;
            border: 0; background: transparent; color: var(--accent); font-size: 13px;
        }
        .price-bar-toggle:hover, .price-bar-toggle.open { background: transparent; color: var(--accent); }
        .price-bar-toggle .toggle-chevron { display: none; }
        .toggle-arrow-m { display: inline-block; transition: transform .2s; }
        .price-bar-toggle.open .toggle-arrow-m { transform: rotate(90deg); }
        .price-chart-panel { margin-bottom: 6px; }
    }

/* Takaisin ylös -nappi */
#backToTop {
    position: fixed; bottom: 24px; right: 24px; z-index: 999;
    width: 40px; height: 40px; border-radius: 8px;
    background: var(--accent); color: #fff; border: none;
    font-size: 18px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3);
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
#backToTop.visible { opacity: 1; pointer-events: auto; }
