:root {
    --ink: #182033;
    --muted: #6f7788;
    --line: #e5e9f1;
    --surface: #ffffff;
    --canvas: #f3f6fb;
    --blue: #1468ff;
    --blue-deep: #0b4ed3;
    --violet: #7657ff;
    --green: #198754;
    --orange: #dc6c16;
    --shadow: 0 14px 40px rgba(32, 46, 77, .08);
}

html { color-scheme: light; }
html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #eef3ff;
    --muted: #a8b2c5;
    --line: #2b364a;
    --surface: #151e2d;
    --canvas: #0d1420;
    --blue: #67a0ff;
    --blue-deep: #397ee9;
    --violet: #8a72ff;
    --green: #42c98b;
    --orange: #f1a05a;
    --shadow: 0 14px 40px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.site-header {
    height: 76px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 0 max(24px, calc((100vw - 1240px) / 2));
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 38px; height: 38px; display: grid; place-items: center;
    border-radius: 12px; color: white; font-weight: 800;
    background: linear-gradient(145deg, var(--blue), var(--violet));
    box-shadow: 0 8px 20px rgba(20,104,255,.22);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand small { color: var(--muted); margin-top: 2px; font-size: 11px; }
.main-nav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.main-nav a { padding: 12px 20px; border-radius: 12px; color: #586174; font-size: 16px; font-weight: 850; letter-spacing: -.01em; }
.main-nav a:hover { color: var(--blue); background: #f1f5fd; }
.main-nav .main-nav-active { color: white; background: var(--ink); }
.main-nav .main-nav-active:hover { color: white; background: var(--ink); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 7px; }
.header-admin { padding: 9px 11px; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
.header-admin:hover { color: var(--blue); background: #f1f5fd; }
.theme-toggle { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; color: #586174; background: #f4f6fa; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; transition: color .15s ease, background-color .15s ease, border-color .15s ease, transform .15s ease; }
.theme-toggle:hover { transform: translateY(-1px); color: var(--blue); border-color: #c8d3e7; background: #edf3ff; }
.theme-toggle:focus-visible { outline: 3px solid rgba(20,104,255,.22); outline-offset: 2px; }
.theme-toggle-icon { width: 16px; font-size: 17px; line-height: 1; text-align: center; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: inline-block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }

.page-shell { max-width: 1240px; margin: 0 auto; padding: 44px 24px 72px; }

.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.detail-header h1 { margin: 0; max-width: 780px; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -.04em; }

.dashboard-overview { display: flex; align-items: stretch; gap: 9px; margin-bottom: 14px; }
.sync-card { min-width: 220px; display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.sync-card small, .sync-card strong, .sync-card span { display: block; }
.sync-card small { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.sync-card strong { font-size: 14px; }
.sync-card div > span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.sync-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #aab1c0; box-shadow: 0 0 0 4px #edf0f5; }
.sync-ok .sync-dot { background: #24a66a; box-shadow: 0 0 0 4px #e2f7ed; }
.sync-warn .sync-dot { background: #e29021; box-shadow: 0 0 0 4px #fff2dc; }

.stats-grid { flex: 1; display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); gap: 9px; }
.stat { display: block; min-height: 76px; padding: 13px 15px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.stat:hover { transform: translateY(-2px); border-color: #c8d2e3; box-shadow: 0 10px 24px rgba(32,46,77,.08); }
.stat:focus-visible { outline: 3px solid rgba(20,104,255,.22); outline-offset: 2px; }
.stat-active:not(.stat-total) { border-color: #b9c4d7; background: #fbfcfe; box-shadow: inset 0 0 0 1px rgba(24,32,51,.05); }
.stat::after { content: ""; position: absolute; right: -18px; bottom: -25px; width: 86px; height: 86px; border-radius: 50%; background: #eef2f9; }
.stat span, .stat strong { display: block; position: relative; z-index: 1; }
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { margin-top: 6px; font-size: 23px; }
.stat-total { color: white; border: 0; background: linear-gradient(135deg, #1769ff, #7159f4); }
.stat-total:hover { border-color: transparent; box-shadow: 0 12px 28px rgba(56,76,214,.22); }
.stat-total span { color: rgba(255,255,255,.8); }
.stat-total::after { background: rgba(255,255,255,.11); }
.stat-seo::after { background: #eaf1ff; }
.stat-photo::after { background: #fff1df; }
.stat-combined::after { background: #eee9ff; }

.toolbar { padding: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; box-shadow: 0 8px 26px rgba(32,46,77,.04); }
.search-form { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(330px, 360px) auto; align-items: stretch; gap: 9px; }
.search-box { min-width: 260px; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fc; }
.search-box span { color: var(--muted); font-size: 22px; }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.date-range-filter { min-width: 330px; height: 52px; display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8px; position: relative; margin: 0; padding: 22px 8px 4px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fc; }
.date-range-filter legend { position: absolute; top: 3px; left: 50%; padding: 0; color: #4f586b; font-size: 13px; font-weight: 650; line-height: 1; transform: translateX(-50%); white-space: nowrap; }
.date-picker-control { min-width: 0; height: 25px; display: flex; align-items: center; justify-content: space-between; position: relative; padding: 0 4px 0 8px; border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; transition: color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.date-picker-control:hover { color: var(--ink); background: #f0f3f8; box-shadow: inset 0 0 0 1px #dde3ed; }
.date-picker-control:focus-within { color: var(--blue); box-shadow: 0 0 0 3px rgba(20,104,255,.10); }
.date-picker-control.date-picker-selected { color: var(--blue); background: #edf3ff; }
.date-picker-control .date-edge-label { color: currentColor; font-size: 12px; font-weight: 700; }
.date-picker-icon { width: 27px; height: 25px; display: grid; place-items: center; pointer-events: none; }
.date-picker-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.date-picker-control input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; opacity: 0; cursor: pointer; }
.search-form button, .external-link { border: 0; border-radius: 12px; background: var(--blue); color: white; padding: 0 22px; font-weight: 700; cursor: pointer; }
.search-form > button { min-width: 120px; font-size: 14px; }
.search-form button:hover, .external-link:hover { background: var(--blue-deep); }
.clear-date { display: grid; place-items: center; padding: 0 12px; border-radius: 12px; color: var(--muted); background: #f2f4f8; font-size: 11px; font-weight: 700; }
.clear-date:hover { color: var(--blue); }
.sort-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.results-heading { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 16px; }
.results-heading div { display: flex; align-items: baseline; gap: 10px; }
.results-heading h2 { margin: 0; font-size: 20px; }
.results-heading span { color: var(--muted); font-size: 12px; }
.results-heading .selected-date-label { padding: 4px 7px; border-radius: 7px; color: #5d419f; background: #f1edff; font-weight: 700; }
.sort-button { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 8px 15px; border: 1px solid transparent; border-radius: 999px; color: var(--muted); background: #f4f6fa; font-size: 12px; font-weight: 700; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.sort-button:hover { color: var(--blue); background: #edf3ff; }
.sort-button-active { color: var(--blue); background: #edf3ff; }
.sort-direction { width: 18px; height: 18px; display: grid; place-items: center; }
.sort-direction svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sort-direction path { transition: opacity .15s ease, transform .15s ease; transform-origin: center; }
.sort-direction-none path { opacity: .55; }
.sort-direction-desc .sort-arrow-up { opacity: .2; transform: translateY(2px); }
.sort-direction-desc .sort-arrow-down { opacity: 1; }
.sort-direction-asc .sort-arrow-up { opacity: 1; }
.sort-direction-asc .sort-arrow-down { opacity: .2; transform: translateY(-2px); }

.product-list { display: grid; gap: 9px; margin-top: 28px; }
.product-row { overflow: hidden; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.product-row:hover { transform: translateY(-1px); border-color: #c8d3e7; box-shadow: 0 10px 28px rgba(32,46,77,.07); }
.product-row-link { display: grid; grid-template-columns: 116px minmax(0, 1fr) minmax(190px, 230px) 150px 28px; align-items: center; gap: 18px; min-height: 140px; padding: 11px 15px 11px 11px; }
.product-row-image { width: 116px; height: 116px; display: grid; place-items: center; overflow: hidden; border: 1px solid #edf0f5; border-radius: 14px; background: linear-gradient(145deg, #f8f9fc, #eef2f7); }
.product-row-image img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.image-placeholder { color: #9da5b5; font-size: 12px; }
.status-badge { display: inline-flex; align-items: center; width: max-content; padding: 6px 9px; border-radius: 999px; font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .02em; }
.badge-unchanged { color: #526174; background: rgba(255,255,255,.92); }
.badge-seo { color: #0b57d0; background: #e7f0ff; }
.badge-photos { color: #a6530d; background: #fff0dc; }
.badge-combined { color: #6340d9; background: #eee8ff; }
.badge-new { color: #117148; background: #dcf7e9; }
.badge-other { color: #596273; background: #edf0f4; }
.product-row-main { min-width: 0; }
.product-row-main h3 { margin: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 20px; line-height: 1.35; }
.product-row-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 9px; color: var(--muted); font-size: 13px; }
.product-row-meta strong { color: #50596a; font-weight: 800; }
.copy-value { border-radius: 4px; cursor: copy; transition: color .15s ease, background-color .15s ease; }
.copy-value:hover, .copy-value:focus-visible { color: var(--blue); background: #edf4ff; outline: 0; }
.copy-toast { position: fixed; z-index: 1000; left: 50%; bottom: 28px; translate: -50% 12px; padding: 9px 14px; border-radius: 9px; color: #fff; background: #172033; box-shadow: 0 8px 24px rgba(23,32,51,.22); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .16s ease, translate .16s ease; }
.copy-toast-visible { translate: -50% 0; opacity: 1; }
.stock-meta { white-space: nowrap; }
.stock-meta strong { color: inherit; }
.stock-positive { color: #14734a !important; }
.stock-zero { color: #b45309 !important; }
.stock-unknown { color: var(--muted) !important; }
.product-row-change { display: grid; justify-items: center; gap: 5px; min-width: 0; text-align: center; }
.product-row-change > strong { max-width: 100%; overflow: hidden; color: #394154; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.product-row-change time { color: var(--muted); font-size: 10px; }
.product-row-rank { display: grid; justify-items: end; gap: 5px; padding-left: 14px; border-left: 1px solid var(--line); }
.product-row-rank small { color: #7a6c9d; font-size: 9px; font-weight: 700; }
.product-row-rank strong { color: #4b357f; font-size: 20px; }
.product-row-arrow { color: #9aa5b8; font-size: 20px; transition: color .16s ease, transform .16s ease; }
.product-row:hover .product-row-arrow { color: var(--blue); transform: translateX(3px); }

.empty-state, .empty-history { grid-column: 1 / -1; text-align: center; padding: 58px 20px; border: 1px dashed #cfd5e2; border-radius: 18px; background: rgba(255,255,255,.5); }
.empty-state strong, .empty-history strong { font-size: 18px; }
.empty-state p, .empty-history p { color: var(--muted); }
.empty-state a { color: var(--blue); font-weight: 700; }
.list-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin-top: 22px; }
.page-size-form { grid-column: 1; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.page-size-form label { color: #4f586b; font-weight: 800; }
.page-size-form select { min-width: 62px; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: var(--surface); font: inherit; font-weight: 800; cursor: pointer; }
.page-size-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,104,255,.10); }
.page-size-form button { border: 0; border-radius: 9px; padding: 8px 10px; color: white; background: var(--blue); }
.pagination { grid-column: 2; display: flex; justify-content: center; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.pagination a { color: var(--blue); font-weight: 700; }

.back-link { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; padding: 12px 18px; border: 1px solid #cdd8ec; border-radius: 13px; color: var(--blue); background: var(--surface); box-shadow: 0 7px 20px rgba(32,46,77,.06); font-size: 15px; }
.back-link span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: white; background: var(--blue); font-size: 17px; transition: transform .16s ease; }
.back-link:hover { color: var(--blue-deep); border-color: #9fb8e9; box-shadow: 0 10px 25px rgba(20,104,255,.12); }
.back-link:hover span { transform: translateX(-3px); background: var(--blue-deep); }
.detail-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.detail-header h1 { font-size: clamp(28px, 3.5vw, 44px); max-width: 900px; }
.detail-header p { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.detail-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--blue); font-size: 13px; font-weight: 800; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .08em; }
.detail-sales-rank { padding: 6px 10px; border: 1px solid #e2dafa; border-radius: 999px; color: #5d419f; background: #f3efff; letter-spacing: .04em; }
.detail-stock { padding: 6px 10px; border: 1px solid currentColor; border-radius: 999px; background: rgba(255,255,255,.64); letter-spacing: .04em; }
.external-link { flex: 0 0 auto; padding: 13px 18px; font-size: 13px; }
.product-tabs { display: flex; gap: 4px; width: max-content; max-width: 100%; margin-top: 22px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.product-tab { padding: 10px 16px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 800; }
.product-tab:hover { color: var(--blue); background: #f3f6fb; }
.product-tab-active { color: white; background: var(--ink); }
.product-tab-active:hover { color: white; background: var(--ink); }

.current-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; margin-top: 24px; }
.panel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 28px rgba(32,46,77,.04); }
.panel-heading, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-heading > div, .section-title > div { display: flex; align-items: center; gap: 10px; }
.panel-heading h2, .section-title h2 { margin: 0; font-size: 19px; }
.section-number { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.soft-badge { padding: 6px 9px; border-radius: 999px; background: #f0f3f8; color: var(--muted); font-size: 10px; font-weight: 700; }
.current-content > h3 { margin: 20px 0 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.current-title { margin: 0; font-size: 20px; line-height: 1.5; font-weight: 700; }
.annotation-text { max-height: 300px; overflow: auto; color: #3e4759; font-size: 15px; line-height: 1.7; padding-right: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid figure { margin: 0; position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f6f8fb; }
.photo-grid img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.photo-grid figcaption { position: absolute; left: 5px; bottom: 5px; padding: 3px 5px; border-radius: 5px; background: rgba(24,32,51,.75); color: white; font-size: 8px; }
.detail-placeholder { min-height: 150px; grid-column: 1 / -1; display: grid; place-items: center; }

.history-section { margin-top: 38px; }
.section-title > span { color: var(--muted); font-size: 12px; }
.timeline { display: grid; gap: 14px; }
.event-card { padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.event-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.event-head > div { display: flex; align-items: center; gap: 10px; }
.event-head time, .event-head > span { color: var(--muted); font-size: 13px; }
.event-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.event-columns-with-rationale { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); }
.event-facts { min-width: 0; }
.event-column-title { margin: 18px 0 0; color: #4f586b; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.diff-block { margin-top: 20px; }
.diff-block h3 { margin: 0 0 10px; font-size: 16px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.diff-before, .diff-after { padding: 16px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; line-height: 1.65; }
.diff-before { background: #fff7f5; border-color: #f2dcd7; }
.diff-after { background: #f2fbf7; border-color: #d5ece0; }
.diff-grid small { display: block; color: var(--muted); font-weight: 800; margin-bottom: 7px; text-transform: uppercase; letter-spacing: .07em; }
.diff-grid p { margin: 0; }
details summary { cursor: pointer; font-weight: 700; }
details p { margin-top: 12px !important; }
.rationale { margin-top: 9px; color: var(--muted); font-size: 14px; }
.photo-strip { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; }
.photo-strip img { flex: 0 0 auto; width: 68px; height: 68px; object-fit: contain; border-radius: 8px; background: white; border: 1px solid var(--line); }
.event-note { margin: 18px 0 0; color: var(--muted); }
.imported-report-note { display: grid; gap: 10px; margin-top: 18px; padding: 15px; border: 1px solid #dbe5fa; border-radius: 13px; background: #f3f7ff; }
.imported-report-note > div { display: grid; gap: 4px; }
.imported-report-note strong { color: var(--blue); font-size: 12px; }
.imported-report-note span, .imported-report-note small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.imported-report-note details { padding-top: 9px; border-top: 1px solid #dbe5fa; }
.imported-report-note summary { color: var(--blue); font-size: 11px; }
.imported-report-note pre { max-height: 420px; overflow: auto; margin: 12px 0 0; padding: 14px; border-radius: 10px; background: white; color: #3e4759; white-space: pre-wrap; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.seo-rationale-column { min-width: 0; margin-top: 18px; padding: 20px; border: 1px solid #dbe5fa; border-radius: 15px; background: #f3f7ff; }
.seo-rationale-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.seo-rationale-heading > span { display: grid; place-items: center; width: 38px; height: 30px; border-radius: 9px; color: white; background: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.seo-rationale-heading h3 { margin: 0; font-size: 18px; }
.seo-rationale-date { display: block; margin-bottom: 12px; color: var(--blue); font-size: 14px; font-weight: 800; }
.seo-rationale-meta { margin: 7px 0; color: #536078; font-size: 14px; line-height: 1.55; }
.seo-rationale-column ul { display: grid; gap: 9px; margin: 15px 0; padding-left: 20px; color: #3e4759; font-size: 14px; line-height: 1.65; }
.seo-rationale-group { margin-top: 18px; }
.seo-rationale-group h4 { margin: 0 0 9px; color: #243451; font-size: 15px; line-height: 1.4; }
.seo-rationale-group ul { margin: 0; }
.seo-rationale-column > p { color: #3e4759; font-size: 14px; line-height: 1.65; }
.seo-rationale-column > small { display: block; margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.seo-rationale-empty { margin: 8px 0 0; color: var(--muted) !important; }
.pending-rationale-section { margin-top: 34px; }
.pending-rationale-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pending-rationale-list .seo-rationale-column { margin-top: 0; }

.search-stats-grid { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.search-stat { min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.search-stat span { color: var(--muted); font-size: 11px; }
.search-stat strong { font-size: 28px; letter-spacing: -.03em; }
.search-stat small { min-height: 16px; color: var(--muted); font-size: 11px; }
.search-stat-primary { color: white; border: 0; background: linear-gradient(135deg, #1769ff, #7159f4); }
.search-stat-primary span, .search-stat-primary small { color: rgba(255,255,255,.78); }
.delta-up { color: #168352 !important; font-weight: 800; }
.delta-down { color: #c34432 !important; font-weight: 800; }
.delta-flat { color: var(--muted) !important; font-weight: 800; }
.search-stat-primary .delta-up, .search-stat-primary .delta-down, .search-stat-primary .delta-flat { display: inline-flex; width: max-content; min-height: 0; padding: 4px 7px; border-radius: 7px; color: white !important; background: rgba(17,24,39,.18); font-weight: 900; text-shadow: 0 1px 2px rgba(17,24,39,.22); }
.period-note { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; padding: 14px 17px; border: 1px solid #dbe5fa; border-radius: 14px; background: #f1f6ff; font-size: 11px; }
.period-note div { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.period-note span { color: var(--muted); }
.period-note-warning { border-color: #f0d598; background: #fff8e8; }
.period-note-warning strong { color: #8a5b00; }
.query-period-note { margin: 0 0 10px; }
.query-section, .snapshot-history { margin-top: 36px; }
.query-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.query-table { width: 100%; min-width: 920px; border-collapse: collapse; font-size: 12px; }
.query-table th { padding: 13px 14px; color: var(--muted); background: #f7f9fc; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.query-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.query-table tbody tr:last-child td { border-bottom: 0; }
.query-table tbody tr:hover { background: #fafbfe; }
.query-table td:first-child { max-width: 260px; }
.query-table td:first-child strong, .query-table td:first-child small { display: block; }
.query-table td:first-child small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.query-group { display: inline-block; padding: 5px 7px; border-radius: 8px; color: #576276; background: #eff2f7; font-size: 9px; font-weight: 800; }
.position-cell { color: var(--blue); font-size: 16px; font-weight: 900; }
.table-empty { padding: 32px !important; color: var(--muted); text-align: center; }
.snapshot-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.snapshot-list article { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.snapshot-list time, .snapshot-list span, .snapshot-list small { color: var(--muted); font-size: 10px; }
.snapshot-list strong { color: var(--blue); font-size: 22px; }
.empty-search-state { max-width: 720px; margin: 48px auto 0; padding: 54px 34px; border: 1px dashed #c9d3e5; border-radius: 22px; background: rgba(255,255,255,.62); text-align: center; }
.empty-search-state h2 { margin: 14px 0 10px; font-size: 23px; }
.empty-search-state p { max-width: 540px; margin: 0 auto 18px; color: var(--muted); line-height: 1.6; }
.empty-search-state > span:last-child, .empty-search-state > strong { color: var(--blue); font-size: 12px; }
.empty-search-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: auto; border-radius: 16px; color: white; background: linear-gradient(145deg, var(--blue), var(--violet)); font-size: 24px; font-weight: 800; }

.seo-report-page { margin-top: -18px; }
.seo-report-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.seo-report-header h1 { margin: 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.035em; }
.seo-report-header p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.seo-summary-grid { display: grid; grid-template-columns: 1.2fr repeat(5, 1fr); gap: 9px; margin-top: 16px; }
.seo-summary-grid > a { min-height: 74px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.seo-summary-grid > a:hover { transform: translateY(-1px); border-color: #b8c8e8; box-shadow: 0 9px 24px rgba(32,46,77,.07); }
.seo-summary-grid span, .seo-summary-grid strong { display: block; }
.seo-summary-grid span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.seo-summary-grid strong { margin-top: 6px; font-size: 23px; }
.seo-summary-grid .seo-summary-primary { color: white; border: 0; background: linear-gradient(135deg, #1769ff, #7159f4); }
.seo-summary-grid .seo-summary-primary span { color: rgba(255,255,255,.8); }
.seo-summary-grid .seo-summary-active { outline: 3px solid rgba(20,104,255,.16); border-color: var(--blue); }
.seo-summary-grid .seo-summary-primary.seo-summary-active { outline-color: rgba(66,79,255,.24); }
.seo-report-toolbar { margin-top: 15px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.seo-report-toolbar form { display: flex; gap: 9px; }
.seo-report-toolbar .search-box { flex: 1; }
.seo-report-toolbar select { min-width: 190px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #f8f9fc; font: inherit; font-size: 14px; font-weight: 700; }
.seo-report-toolbar button { border: 0; border-radius: 12px; padding: 0 20px; color: white; background: var(--blue); font-weight: 800; }
.seo-report-toolbar button { cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.seo-report-toolbar button:hover { transform: translateY(-1px); background: var(--blue-deep); box-shadow: 0 10px 24px rgba(20,104,255,.24), 0 0 0 3px rgba(20,104,255,.09); }
.seo-hold-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); }
.seo-hold-filters > span { margin-right: 2px; color: var(--muted); font-size: 12px; font-weight: 800; }
.seo-hold-filter { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: #4f5b70; background: #f7f9fc; font-size: 12px; font-weight: 800; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.seo-hold-filter:hover { color: var(--blue); border-color: #aebfdf; background: #f0f5ff; }
.seo-hold-filter strong { display: inline-grid; min-width: 22px; height: 22px; place-items: center; padding: 0 6px; border-radius: 999px; color: #566176; background: #e8edf5; font-size: 11px; }
.seo-hold-filter-active { color: white; border-color: var(--blue); background: var(--blue); }
.seo-hold-filter-active:hover { color: white; border-color: var(--blue-deep); background: var(--blue-deep); }
.seo-hold-filter-active strong { color: var(--blue-deep); background: white; }
.seo-assessment-list { display: grid; gap: 10px; margin-top: 20px; }
.seo-assessment-row { display: grid; grid-template-columns: minmax(340px, 1.35fr) 110px 165px minmax(190px, .8fr); gap: 15px; align-items: center; padding: 13px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 16px; background: var(--surface); }
.seo-assessment-row.priority-high { border-left-color: #d74635; }
.seo-assessment-row.priority-medium { border-left-color: #dc8a1c; }
.seo-assessment-row.priority-low { border-left-color: #3481e8; }
.seo-assessment-row.priority-hold { border-left-color: #adb4c2; }
.seo-assessment-product { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 13px; align-items: center; }
.seo-assessment-product:hover h2 { color: var(--blue); }
.seo-assessment-image { width: 82px; height: 82px; display: grid; place-items: center; overflow: hidden; border: 1px solid #edf0f5; border-radius: 12px; background: #f6f8fb; color: var(--muted); font-size: 9px; }
.seo-assessment-image img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.seo-assessment-product h2 { margin: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 17px; line-height: 1.35; }
.seo-assessment-product p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.seo-assessment-priority { display: grid; justify-items: center; gap: 3px; text-align: center; }
.seo-assessment-priority span { font-size: 12px; font-weight: 800; }
.seo-assessment-priority strong { color: var(--blue); font-size: 24px; }
.seo-assessment-priority small { color: var(--muted); font-size: 10px; }
.seo-assessment-metrics, .seo-assessment-queries { display: grid; gap: 7px; }
.seo-assessment-metrics span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.seo-assessment-metrics strong { color: #374155; font-size: 13px; }
.seo-assessment-queries span { overflow: hidden; color: #344056; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.seo-assessment-queries small { color: var(--muted); }
.seo-assessment-excluded { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: #8b4661; font-size: 12px; }
.seo-assessment-excluded span { padding: 4px 8px; border-radius: 999px; background: #fff0f4; }
.seo-assessment-rationale { grid-column: 1 / -1; overflow: hidden; border-radius: 10px; background: #f7f9fc; }
.seo-assessment-rationale summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 13px; color: #4f5b70; font-size: 12px; font-weight: 800; list-style: none; cursor: pointer; transition: color .15s ease, background-color .15s ease; }
.seo-assessment-rationale summary::-webkit-details-marker { display: none; }
.seo-assessment-rationale summary::before { content: "→"; color: var(--blue); font-size: 15px; transition: transform .15s ease; }
.seo-assessment-rationale summary:hover { color: var(--blue); background: #f0f4fb; }
.seo-assessment-rationale[open] summary::before { transform: rotate(90deg); }
.seo-assessment-rationale p { margin: 0; padding: 13px 16px; border-top: 1px solid #e7ebf2; color: #4f5b70; font-size: 13px; line-height: 1.6; }
.rationale-toggle-open { display: none; }
.seo-assessment-rationale[open] .rationale-toggle-closed { display: none; }
.seo-assessment-rationale[open] .rationale-toggle-open { display: inline; }
.seo-report-empty { margin-top: 80px; }
.seo-detail-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.seo-detail-hero h1 { max-width: 1050px; margin: 18px 0 8px; font-size: clamp(28px, 4vw, 48px); line-height: 1.08; letter-spacing: -.04em; }
.seo-detail-hero > div:first-child > p { margin: 0; color: var(--muted); font-size: 12px; }
.seo-detail-priority { min-width: 190px; display: grid; gap: 5px; padding: 17px 19px; border: 1px solid var(--line); border-left: 5px solid #adb4c2; border-radius: 16px; background: var(--surface); }
.seo-detail-priority.priority-high { border-left-color: #d74635; }
.seo-detail-priority.priority-medium { border-left-color: #dc8a1c; }
.seo-detail-priority.priority-low { border-left-color: #3481e8; }
.seo-detail-priority small, .seo-detail-priority span { color: var(--muted); font-size: 10px; }
.seo-detail-priority strong { font-size: 22px; }
.seo-detail-priority b { color: var(--blue); font-size: 12px; }
.seo-detail-grid { display: grid; grid-template-columns: .9fr 1.5fr; gap: 18px; margin-top: 24px; }
.seo-detail-reason > p { margin: 6px 0 18px; color: #465269; font-size: 13px; line-height: 1.7; }
.seo-detail-metric-row { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.seo-detail-metric-row span { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.seo-detail-metric-row strong { color: var(--ink); }
.seo-detail-current .annotation-text { max-height: 320px; overflow: auto; }
.seo-query-review-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; margin-top: 18px; }
.seo-query-table { display: grid; gap: 7px; }
.seo-query-table > div { display: grid; grid-template-columns: minmax(240px, 1fr) 110px 155px 100px; gap: 18px; align-items: center; min-height: 58px; padding: 11px 16px; border-radius: 12px; background: #f7f9fc; }
.seo-query-table > div > strong { color: var(--ink); font-size: 15px; line-height: 1.35; }
.seo-query-table > div > span { display: grid; gap: 2px; color: var(--muted); }
.seo-query-table > div > span small { font-size: 11px; line-height: 1.2; }
.seo-query-table > div > span b { color: #344056; font-size: 14px; line-height: 1.25; }
.seo-excluded-list { display: flex; flex-wrap: wrap; gap: 7px; }
.seo-excluded-list span { padding: 7px 9px; border-radius: 999px; color: #8b4661; background: #fff0f4; font-size: 10px; }
.seo-proposal-panel { margin-top: 18px; }
.seo-proposal-empty { margin: 4px 0 0; padding: 17px; border-radius: 12px; color: var(--muted); background: #f7f9fc; font-size: 12px; line-height: 1.65; }

/* Dark theme keeps the same visual hierarchy while lowering glare. */
html[data-theme="dark"] .site-header { background: rgba(13,20,32,.94); }
html[data-theme="dark"] .main-nav a { color: #aeb8ca; }
html[data-theme="dark"] .main-nav a:hover,
html[data-theme="dark"] .header-admin:hover { color: var(--blue); background: #182438; }
html[data-theme="dark"] .main-nav .main-nav-active,
html[data-theme="dark"] .main-nav .main-nav-active:hover { color: #111827; background: #eef3ff; }
html[data-theme="dark"] .theme-toggle { color: #dce5f6; background: #182234; }
html[data-theme="dark"] .theme-toggle:hover { color: #ffffff; border-color: #52627d; background: #202c40; }

html[data-theme="dark"] :is(.search-box, .date-range-filter, .seo-report-toolbar select) { border-color: #3a4860; background: #1d283a; }
html[data-theme="dark"] .seo-hold-filter { color: #d3dbea; border-color: #3a4860; background: #1d283a; }
html[data-theme="dark"] .seo-hold-filter:hover { color: #ffffff; border-color: #52627d; background: #26344a; }
html[data-theme="dark"] .seo-hold-filter strong { color: #dce5f6; background: #2a374b; }
html[data-theme="dark"] .seo-hold-filter-active { color: #ffffff; border-color: var(--blue); background: var(--blue); }
html[data-theme="dark"] .seo-hold-filter-active strong { color: var(--blue-deep); background: #ffffff; }
html[data-theme="dark"] .search-box input { color: #f4f7ff; }
html[data-theme="dark"] .search-box input::placeholder { color: #c7d0df; opacity: 1; }
html[data-theme="dark"] .search-box span { color: #d6deec; }
html[data-theme="dark"] .date-range-filter legend { color: #f0f4fc; }
html[data-theme="dark"] .date-picker-control { color: #e5ebf6; background: #273348; }
html[data-theme="dark"] .date-picker-control:hover { color: #ffffff; background: #303d53; box-shadow: inset 0 0 0 1px #53627a; }
html[data-theme="dark"] .date-picker-control.date-picker-selected { color: #8cb6ff; background: #183155; }
html[data-theme="dark"] .clear-date,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .soft-badge,
html[data-theme="dark"] .query-group { color: #e0e6f1; background: #253147; }
html[data-theme="dark"] .chip:hover,
html[data-theme="dark"] .product-tab:hover { color: var(--blue); background: #1a3155; }
html[data-theme="dark"] .chip-active,
html[data-theme="dark"] .chip-active:hover,
html[data-theme="dark"] .product-tab-active,
html[data-theme="dark"] .product-tab-active:hover { color: #111827; background: #eef3ff; }
html[data-theme="dark"] .sort-button { color: #dce5f6; background: #1b2739; border-color: #3b4a62; }
html[data-theme="dark"] .sort-button:hover { color: #8cb6ff; background: #202f46; border-color: #526786; }
html[data-theme="dark"] .sort-button-active,
html[data-theme="dark"] .sort-button-active:hover { color: #6fa3ff; background: #1b2d4b; border-color: #3f5f8f; }
html[data-theme="dark"] .stat:hover,
html[data-theme="dark"] .product-row:hover,
html[data-theme="dark"] .seo-summary-grid > a:hover { border-color: #52627d; box-shadow: 0 10px 28px rgba(0,0,0,.24); }
html[data-theme="dark"] .stat-active:not(.stat-total) { border-color: #52627d; background: #192436; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
html[data-theme="dark"] .stat::after { background: #202b3d; }
html[data-theme="dark"] .stat-seo::after { background: #1a3155; }
html[data-theme="dark"] .stat-photo::after { background: #49341f; }
html[data-theme="dark"] .stat-combined::after { background: #302752; }

html[data-theme="dark"] :is(.product-row-image, .seo-assessment-image, .photo-grid figure) { background: linear-gradient(145deg, #f8f9fc, #e7ebf1); }
html[data-theme="dark"] :is(.product-row-meta strong, .product-row-change > strong, .page-size-form label, .event-column-title, .seo-assessment-metrics strong, .seo-assessment-queries span, .seo-query-table > div > span b) { color: #dce5f6; }
html[data-theme="dark"] .product-row-meta .copy-value,
html[data-theme="dark"] .product-row-meta .stock-meta strong { color: #aeb8c8; }
html[data-theme="dark"] .product-row-meta .copy-value:hover,
html[data-theme="dark"] .product-row-meta .copy-value:focus-visible { color: #8cb6ff; background: #1a3155; }
html[data-theme="dark"] .product-row-rank small { color: #c1b0ef; }
html[data-theme="dark"] .product-row-rank strong { color: #cdbfff; }
html[data-theme="dark"] .badge-unchanged { color: #c5cfdf; background: #263247; }
html[data-theme="dark"] .badge-seo { color: #a9c9ff; background: #18345d; }
html[data-theme="dark"] .badge-photos { color: #f6c18e; background: #4a321d; }
html[data-theme="dark"] .badge-combined { color: #c9bcff; background: #342858; }
html[data-theme="dark"] .badge-new { color: #8be0b8; background: #153d30; }
html[data-theme="dark"] .badge-other { color: #c5cfdf; background: #263247; }
html[data-theme="dark"] :is(.empty-state, .empty-history, .empty-search-state) { background: rgba(21,30,45,.7); border-color: #40506a; }
html[data-theme="dark"] .detail-sales-rank { color: #c9bcff; border-color: #514575; background: #2d2547; }
html[data-theme="dark"] .detail-stock { background: rgba(21,30,45,.7); }
html[data-theme="dark"] .annotation-text { color: #d3dced; }

html[data-theme="dark"] .diff-before { background: #302120; border-color: #61403b; }
html[data-theme="dark"] .diff-after { background: #173128; border-color: #315e4b; }
html[data-theme="dark"] .photo-strip img,
html[data-theme="dark"] .imported-report-note pre { background: #f7f9fc; color: #263247; }
html[data-theme="dark"] :is(.imported-report-note, .seo-rationale-column, .period-note) { border-color: #30486d; background: #13243c; }
html[data-theme="dark"] :is(.seo-rationale-meta, .seo-rationale-column ul, .seo-rationale-column > p) { color: #d3dced; }
html[data-theme="dark"] .seo-rationale-group h4 { color: #eef3ff; }
html[data-theme="dark"] .period-note-warning { border-color: #6c5428; background: #332a18; }
html[data-theme="dark"] .period-note-warning strong { color: #f1bf67; }
html[data-theme="dark"] .query-table th,
html[data-theme="dark"] .query-table tbody tr:hover { background: #111a29; }

html[data-theme="dark"] .seo-assessment-excluded span,
html[data-theme="dark"] .seo-excluded-list span { color: #f2a7bf; background: #482533; }
html[data-theme="dark"] :is(.seo-assessment-rationale, .seo-query-table > div, .seo-proposal-empty) { background: #111a29; }
html[data-theme="dark"] .seo-assessment-rationale summary { color: #cbd5e7; }
html[data-theme="dark"] .seo-assessment-rationale summary:hover { color: var(--blue); background: #182438; }
html[data-theme="dark"] .seo-assessment-rationale p { color: #cbd5e7; border-top-color: var(--line); }
html[data-theme="dark"] .seo-detail-reason > p { color: #cbd5e7; }

@media (max-width: 1000px) {
    .dashboard-overview { flex-direction: column; }
    .search-form { grid-template-columns: minmax(260px, 1fr) minmax(300px, .8fr) auto; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .current-layout { grid-template-columns: 1fr; }
    .search-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .search-stat-primary { grid-column: span 2; }
    .snapshot-list { grid-template-columns: repeat(3, 1fr); }
    .event-columns { grid-template-columns: 1fr; gap: 0; }
    .pending-rationale-list { grid-template-columns: 1fr; }
    .seo-summary-grid { grid-template-columns: repeat(3, 1fr); }
    .seo-assessment-row { grid-template-columns: minmax(320px, 1fr) 100px 150px; }
    .seo-assessment-queries { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .seo-detail-grid, .seo-query-review-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .product-row-link { grid-template-columns: 104px minmax(0, 1fr) 24px; grid-template-areas: "image main arrow" "image change arrow" "image rank arrow"; gap: 7px 13px; min-height: 128px; padding: 11px; }
    .product-row-image { grid-area: image; width: 104px; height: 104px; }
    .product-row-main { grid-area: main; }
    .product-row-main h3 { font-size: 18px; }
    .product-row-change { grid-area: change; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px 8px; }
    .product-row-change > strong { max-width: 180px; }
    .product-row-rank { grid-area: rank; display: flex; align-items: baseline; justify-items: start; gap: 6px; padding: 0; border: 0; }
    .product-row-rank strong { font-size: 14px; }
    .product-row-arrow { grid-area: arrow; align-self: center; }
}

@media (max-width: 720px) {
    .page-shell { padding: 28px 16px 52px; }
    .site-header { padding: 0 16px; }
    .detail-header { align-items: stretch; flex-direction: column; }
    .sync-card { min-width: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-total { grid-column: 1 / -1; }
    .search-form { grid-template-columns: 1fr; }
    .search-box { flex: none; width: 100%; min-width: 0; height: 46px; }
    .search-form button, .clear-date { grid-column: 1; height: 42px; }
    .date-range-filter { width: 100%; min-width: 0; flex-basis: auto; }
    .clear-date { min-height: 38px; }
    .list-footer { grid-template-columns: 1fr; justify-items: center; }
    .results-heading { align-items: flex-start; gap: 12px; }
    .sort-controls { align-items: stretch; }
    .page-size-form, .pagination { grid-column: 1; }
    .diff-grid { grid-template-columns: 1fr; }
    .external-link { text-align: center; }
    .search-stats-grid { grid-template-columns: 1fr 1fr; }
    .period-note { align-items: flex-start; flex-direction: column; }
    .snapshot-list { grid-template-columns: 1fr 1fr; }
    .site-header { height: auto; min-height: 76px; grid-template-columns: 1fr auto auto; gap: 10px; }
    .header-admin { display: none; }
    .header-actions { gap: 0; }
    .theme-toggle { width: 38px; justify-content: center; padding: 0; }
    .theme-toggle [data-theme-label] { display: none; }
    .main-nav { gap: 2px; }
    .main-nav a { padding: 9px 10px; font-size: 12px; }
    .seo-report-header { align-items: stretch; flex-direction: column; }
    .seo-report-page { margin-top: 0; }
    .seo-summary-grid { grid-template-columns: 1fr 1fr; }
    .seo-report-toolbar form { flex-direction: column; }
    .seo-report-toolbar select, .seo-report-toolbar button { min-height: 42px; }
    .seo-assessment-row { grid-template-columns: 1fr; }
    .seo-assessment-product { grid-column: 1 / -1; }
    .seo-assessment-priority { grid-template-columns: auto auto auto; align-items: baseline; justify-content: center; gap: 8px; }
    .seo-assessment-metrics { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); align-self: stretch; gap: 10px; }
    .seo-assessment-metrics span { display: grid; gap: 3px; text-align: center; }
    .seo-assessment-queries { grid-template-columns: 1fr; }
    .seo-detail-hero { align-items: stretch; flex-direction: column; }
    .seo-detail-priority { min-width: 0; }
    .seo-query-table > div { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
    .seo-query-table > div > strong { grid-column: 1 / -1; font-size: 16px; }
}

@media (max-width: 460px) {
    .product-row-link { grid-template-columns: 88px minmax(0, 1fr) 18px; gap: 6px 10px; min-height: 112px; }
    .product-row-image { width: 88px; height: 88px; }
    .product-row-main h3 { font-size: 17px; }
    .product-row-change > strong { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat { min-height: 96px; padding: 16px; }
    .brand small { display: none; }
    .sort-button { width: 100%; justify-content: center; }
    .product-tabs { width: 100%; }
    .product-tab { flex: 1; padding-inline: 9px; text-align: center; }
    .search-stats-grid { grid-template-columns: 1fr 1fr; }
    .search-stat-primary { grid-column: 1 / -1; }
    .snapshot-list { grid-template-columns: 1fr; }
}

