:root {
  --ink: #111318;
  --muted: #666b74;
  --line: #dedfe3;
  --surface: #ffffff;
  --soft: #f4f4f5;
  --accent: #c00009;
  --accent-dark: #910007;
  --green: #137a4f;
  --sidebar: #121316;
  --shadow: 0 16px 40px rgba(18, 19, 22, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f2f2f3; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Noto Sans JP", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; color: white; background: var(--accent); }
.skip-link:focus { top: 12px; }

.app-shell { min-height: calc(100vh - 92px); display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 92px; height: calc(100vh - 92px); display: flex; flex-direction: column; padding: 28px 18px 22px; color: white; background: var(--sidebar); }
.sidebar-brand { display: flex; align-items: center; gap: 13px; padding: 0 10px 34px; border-bottom: 1px solid rgba(255,255,255,.13); }
.sidebar-brand img { width: 52px; filter: none; }
.sidebar-brand div { min-width: 0; display: grid; gap: 5px; }
.sidebar-brand strong { color: rgba(255,255,255,.48); font-size: 9px; letter-spacing: .16em; }
.sidebar-brand span { font-size: 15px; font-weight: 650; }
.main-nav { display: grid; gap: 5px; margin-top: 26px; }
.nav-item { width: 100%; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; padding: 13px 12px; border: 0; border-radius: 8px; color: rgba(255,255,255,.63); background: transparent; text-align: left; transition: .2s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: var(--accent); }
.nav-item span { font: 500 10px/1 monospace; opacity: .58; }
.nav-item b { font-size: 14px; font-weight: 600; }
.nav-item em { min-width: 22px; padding: 3px 7px; border-radius: 99px; color: inherit; background: rgba(255,255,255,.13); font-size: 10px; font-style: normal; text-align: center; }
.sidebar-note { margin-top: auto; display: flex; align-items: flex-start; gap: 10px; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.13); }
.sidebar-note div { display: grid; gap: 4px; }
.sidebar-note b { font-size: 12px; }
.sidebar-note small { color: rgba(255,255,255,.48); font-size: 10px; line-height: 1.4; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #50d890; box-shadow: 0 0 0 4px rgba(80,216,144,.12); }

.main-content { min-width: 0; padding: 0 42px 56px; }
.ala-site-header { position: sticky; z-index: 20; top: 0; min-height: 92px; display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; padding: 0 42px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ala-site-brand { display: inline-flex; width: fit-content; align-items: center; }
.ala-site-brand img { display: block; width: auto; height: 32px; filter: invert(1); }
.ala-site-nav { display: flex; width: 100%; align-items: center; justify-self: stretch; gap: 2rem; min-width: 0; }
.ala-site-nav > a { position: relative; padding: 8px 0; color: var(--ink); font-size: 13px; letter-spacing: .04em; text-decoration: none; white-space: nowrap; }
.ala-site-nav > a::after { position: absolute; right: 0; bottom: 0; left: 0; height: 1px; background: var(--accent); content: ""; transform: scaleX(0); transform-origin: right; transition: transform 180ms ease; }
.ala-site-nav > a:hover::after, .ala-site-nav > a:focus-visible::after, .ala-site-nav > a.active::after { transform: scaleX(1); transform-origin: left; }
.ala-site-language-switcher { display: flex; overflow: hidden; flex: 0 0 auto; margin-left: auto; border: 1px solid rgba(17,17,17,.28); border-radius: 999px; background: var(--surface); }
.ala-site-language-switcher button { width: 38px; height: 34px; padding: 0; border: 0; border-right: 1px solid rgba(17,17,17,.15); color: var(--muted); background: transparent; font-size: 11px; }
.ala-site-language-switcher button:last-child { border-right: 0; }
.ala-site-language-switcher button.active { color: white; background: var(--ink); }
.ala-account { position: relative; z-index: 30; display: flex; flex: 0 0 auto; align-items: center; margin-left: auto; }
.ala-account + .ala-site-language-switcher { margin-left: 0; }
.ala-account-toggle { display: grid; width: 56px; height: 56px; place-items: center; padding: 0; border: 1px solid rgba(17,17,17,.08); border-radius: 50%; color: var(--ink); background: var(--surface); cursor: pointer; box-shadow: 0 7px 18px rgba(0,0,0,.12); }
.ala-user-avatar { display: grid; width: 40px; height: 40px; place-items: center; overflow: hidden; border: 5px solid #f0f0ef; border-radius: 50%; color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.ala-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ala-user-avatar svg { width: 22px; height: 22px; fill: currentColor; }
.ala-account-menu { position: absolute; top: calc(100% + 14px); right: 0; min-width: 330px; padding: 16px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--surface); box-shadow: 0 16px 40px rgba(18,19,22,.18); }
.ala-account-menu[hidden] { display: none !important; }
.ala-account:focus-within .ala-account-menu[hidden] { display: block !important; }
.ala-account-menu a, .ala-account-menu button { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 58px; padding: 12px 16px; border: 0; border-radius: 9px; color: inherit; background: transparent; cursor: pointer; font: inherit; text-align: left; text-decoration: none; }
.ala-account-menu-item > span:last-child, .ala-account-menu button > span:last-child { font-size: 17px; font-weight: 600; }
.ala-account-menu-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; }
.ala-account-menu-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.ala-account-menu a::after { display: none; }
.ala-account-menu a:hover, .ala-account-menu button:hover, .ala-account-menu a:focus-visible, .ala-account-menu button:focus-visible { background: var(--soft); }
.ala-account-menu .ala-account-logout { margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; color: var(--ink); }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 4px 0 0; font-size: clamp(25px, 2.3vw, 36px); line-height: 1; letter-spacing: -.045em; }
.eyebrow { margin: 0; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-search { position: relative; display: block; width: min(360px, 30vw); }
.topbar-search button { position: absolute; left: 10px; top: 5px; z-index: 1; width: 28px; height: 30px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 19px; line-height: 1; }
.topbar-search button:hover, .topbar-search button:focus-visible { color: var(--ink); }
.topbar-search input { width: 100%; height: 40px; padding: 0 13px 0 38px; border: 1px solid var(--line); border-radius: 7px; outline: none; background: white; }
.topbar-search input:focus { border-color: var(--ink); }
.topbar-search input:focus::placeholder { color: transparent; }
.compare-mode { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 11px 14px; border: 1px solid #f0c7c9; border-radius: 8px; color: var(--accent-dark); background: #fff7f7; font-size: 11px; }
.ai-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: white; font-size: 11px; }
.ai-pill i { width: 7px; height: 7px; border-radius: 50%; background: #d49b18; }
.ai-pill.ready i { background: var(--green); }
.language-switcher { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.language-switcher button { min-width: 34px; height: 28px; padding: 0 8px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; }
.language-switcher button.active { color: white; background: var(--ink); }

.view { display: none; padding-top: 32px; }
.view.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { position: relative; min-height: 140px; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.metric-card::after { content: ""; position: absolute; right: -34px; bottom: -44px; width: 110px; height: 110px; border: 1px solid rgba(192,0,9,.14); border-radius: 50%; }
.metric-card p { margin: 0; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin-top: 22px; font-size: 36px; line-height: 1; letter-spacing: -.05em; }
.metric-card small { display: block; margin-top: 8px; color: #8b8e95; font-size: 10px; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 18px; }
.overview-grid { margin-top: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 0 rgba(0,0,0,.01); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.panel h2, .section-intro h2 { margin: 7px 0 0; font-size: 21px; line-height: 1.2; letter-spacing: -.025em; }
.text-button { padding: 4px 0; border: 0; border-bottom: 1px solid var(--ink); background: transparent; font-size: 11px; }
.start-panel { color: white; background: var(--ink); }
.start-panel h2 { max-width: 310px; margin-top: 12px; font-size: 27px; }
.start-panel > p:not(.eyebrow) { margin: 18px 0 24px; color: rgba(255,255,255,.65); font-size: 13px; line-height: 1.65; }
.primary-button, .secondary-button { min-height: 40px; padding: 10px 16px; border-radius: 7px; font-size: 12px; font-weight: 650; }
.primary-button { border: 1px solid var(--accent); color: white; background: var(--accent); }
.primary-button:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.secondary-button:hover { border-color: var(--ink); }
.primary-button.full { width: 100%; }
.process-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.13); }
.process-steps span { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.55); }
.process-steps b { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; font-size: 9px; }
.process-steps i { font-size: 10px; font-style: normal; }

.popularity-list { display: grid; }
.popularity-row { display: grid; grid-template-columns: 34px minmax(150px, 1.3fr) minmax(110px, 1fr) 80px; align-items: center; gap: 14px; min-height: 58px; border-top: 1px solid var(--line); cursor: pointer; }
.popularity-row:first-child { border-top: 0; }
.popularity-row:hover, .popularity-row:focus-visible { background: #fafafa; outline: none; }
.popularity-row > b { color: #a1a3a8; font: 500 11px/1 monospace; }
.product-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.product-identity img, .product-thumb { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 7px; background: var(--soft); object-fit: cover; }
.product-identity div { min-width: 0; display: grid; gap: 3px; }
.product-identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.product-identity small { color: var(--muted); font-size: 10px; }
.heat-track { height: 5px; overflow: hidden; border-radius: 5px; background: #ededee; }
.heat-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.heat-value { font-size: 11px; text-align: right; }

.import-grid { align-items: stretch; }
.drop-zone { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 22px; border: 1px dashed #bbbcc1; border-radius: 9px; background: #fafafa; text-align: center; transition: .2s; }
.drop-zone.drag, .drop-zone:hover { border-color: var(--accent); background: #fff7f7; }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon { display: grid; width: 38px; height: 38px; margin-bottom: 4px; place-items: center; border-radius: 50%; color: white; background: var(--ink); font-size: 18px; }
.drop-zone strong { font-size: 13px; }
.drop-zone small { color: var(--muted); font-size: 10px; }
.drop-zone em { margin-top: 5px; color: var(--accent); font-size: 11px; font-style: normal; }
.field { display: grid; gap: 7px; margin: 17px 0; }
.field span { color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select, .search-box input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; outline: none; background: white; }
.field input:focus, .field select:focus, .search-box input:focus { border-color: var(--ink); }
.existing-panel { display: flex; flex-direction: column; justify-content: center; }
.existing-panel > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.7; }
.field.compact { max-width: 220px; margin-bottom: 14px; }
.source-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.preview-panel, .history-panel { margin-top: 18px; }
.count-pill { padding: 7px 11px; border-radius: 99px; color: var(--accent); background: #fff0f0; font-size: 11px; }
.notice { margin-bottom: 18px; padding: 12px 14px; border-left: 3px solid #d49b18; color: #6b500d; background: #fff8e5; font-size: 12px; }
.mapping-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.mapping-grid .field { margin: 0; }
.mapping-grid select { height: 36px; font-size: 11px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 11px 12px; color: #777b83; background: #f6f6f7; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.preview-panel td { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-footer { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 20px; }
.checkbox-row { display: inline-flex; align-items: center; gap: 7px; margin-right: auto; font-size: 11px; }
.status-label { display: inline-block; padding: 5px 8px; border-radius: 99px; color: var(--green); background: #eaf8f1; font-size: 9px; font-weight: 700; }
.status-label.preview { color: #8a6410; background: #fff8df; }
.status-label.error { color: var(--accent); background: #fff0f0; }
.primary-button:disabled, .secondary-button:disabled { opacity: .42; cursor: not-allowed; }

.section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 22px; }
.section-intro > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.review-list { display: grid; gap: 14px; }
.review-card { display: grid; grid-template-columns: minmax(0, 1fr) 100px minmax(0, 1fr) 190px; align-items: center; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.review-product { display: flex; align-items: center; gap: 13px; min-width: 0; }
.review-product img { width: 70px; height: 70px; flex: 0 0 auto; border-radius: 8px; background: var(--soft); object-fit: cover; }
.review-product div { min-width: 0; }
.review-product small { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.review-product strong { display: block; margin-top: 5px; font-size: 13px; line-height: 1.4; }
.review-product p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.match-score { text-align: center; }
.match-score strong { display: block; font-size: 26px; letter-spacing: -.04em; }
.match-score small { color: var(--muted); font-size: 9px; }
.review-actions { display: grid; gap: 7px; }
.review-actions button { width: 100%; min-height: 34px; }
.ai-result { margin-top: 8px; padding: 9px; border-radius: 6px; background: var(--soft); font-size: 10px; line-height: 1.45; }

.product-tools { align-items: center; }
.view-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.view-switch-button { min-width: 54px; height: 30px; padding: 0 10px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; }
.view-switch-button.active { color: white; background: var(--ink); }
.search-box { width: min(330px, 100%); position: relative; display: block; }
.search-box span { position: absolute; left: 12px; top: 8px; color: var(--muted); font-size: 19px; }
.search-box input { padding-left: 37px; }
.product-filter-bar { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, 1fr)) auto; gap: 9px; margin: 0 0 20px; }
.product-filter-bar label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.product-filter-bar .search-box { align-self: end; width: auto; }
.product-filter-bar input, .product-filter-bar select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; outline: none; background: white; font-size: 11px; }
.product-filter-bar input:focus, .product-filter-bar select:focus { border-color: var(--ink); }
.product-filter-bar > button { align-self: end; white-space: nowrap; }
.product-table tbody tr:hover { background: #fafafa; }
.product-table .view-product { border: 0; border-bottom: 1px solid var(--ink); padding: 2px 0; background: none; font-size: 10px; }
.product-card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.product-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; transition: transform .2s ease, box-shadow .2s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card-media { position: relative; display: grid; aspect-ratio: 1; min-height: 0; place-items: center; background: var(--soft); }
.product-card-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-card-media .product-thumb { width: 100%; height: 100%; border-radius: 0; }
.product-card-check { position: absolute; top: 10px; left: 10px; margin: 0; }
.product-card-body { display: grid; gap: 6px; padding: 13px; }
.product-card-title { overflow: hidden; min-height: 36px; padding: 0; border: 0; color: var(--ink); background: transparent; font-size: 13px; font-weight: 700; line-height: 1.4; text-align: left; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-card-brand { color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; }
.product-card-model { overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.product-card-price { font-size: 17px; line-height: 1.2; }
.product-card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.product-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.product-card-action { justify-self: start; }
.product-card-compare { min-height: 30px; padding: 7px 10px; font-size: 10px; }
.product-card-compare.is-armed { color: white; border-color: var(--accent); background: var(--accent); }
.compare-list-action { margin-left: 8px; color: var(--accent); }
.compare-check { width: 16px; height: 16px; accent-color: var(--accent); }
.product-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.product-pagination-controls { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pagination-button { min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; font-size: 11px; }
.pagination-button:hover:not(:disabled) { border-color: var(--ink); }
.pagination-button.active { border-color: var(--ink); color: white; background: var(--ink); }
.pagination-button:disabled { cursor: not-allowed; opacity: .38; }
.pagination-arrow { min-width: 58px; }
.product-pagination-total, .product-pagination-info { color: var(--muted); font-size: 10px; white-space: nowrap; }
.selection-strip { display: flex; flex-wrap: wrap; gap: 9px; min-height: 60px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.selection-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; background: var(--soft); font-size: 11px; }
.selection-chip button { border: 0; color: var(--muted); background: none; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.compare-card { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.compare-card h3 { min-height: 38px; margin: 0 0 14px; font-size: 13px; }
.compare-stat { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.compare-stat b { color: var(--ink); }
.chart-panel { margin-top: 18px; }
.trend-picker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.trend-picker select { min-width: 130px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 11px; }
.trend-picker select + select { min-width: 112px; }
.analysis-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.analysis-tab { min-height: 34px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: white; font-size: 11px; }
.analysis-tab:hover, .analysis-tab.active { border-color: var(--ink); color: white; background: var(--ink); }
.analysis-controls { display: flex; align-items: end; gap: 12px; margin-top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.analysis-controls > small { padding-bottom: 9px; color: var(--muted); font-size: 10px; }
.analysis-condition-picker { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.analysis-condition-picker select { min-width: 180px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 11px; }
.analysis-current-condition { color: var(--muted); font-size: 10px; }
.analysis-summary { margin: 0 0 20px; }
.analysis-summary-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
.analysis-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.analysis-stat { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.analysis-stat strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.analysis-stat b { font-size: 17px; }
.analysis-stat small { color: var(--muted); font-size: 9px; }
.condition-analysis { margin-top: 18px; }
.condition-focus { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; margin-bottom: 14px; padding: 14px; border-left: 3px solid var(--accent); background: var(--soft); font-size: 11px; }
.condition-focus strong { font-size: 20px; }
.condition-focus small { color: var(--muted); }
.condition-best { background: #fff8f8; }
.condition-best small { margin-left: 5px; color: var(--accent); }
.trend-label { margin: 4px 0 -3px; color: var(--muted); font-size: 10px; }
.chart-wrap { min-height: 280px; padding-top: 10px; }
.chart-wrap svg { width: 100%; height: 270px; overflow: visible; }
.chart-empty { display: grid; min-height: 220px; place-items: center; color: var(--muted); font-size: 12px; }
.chart-grid { stroke: #e4e4e6; stroke-width: 1; }
.chart-axis { fill: #858890; font-size: 9px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-dot { fill: white; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }

.product-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 26px 80px rgba(0,0,0,.24); }
.product-dialog::backdrop { background: rgba(5,6,8,.62); backdrop-filter: blur(4px); }
.dialog-close { position: sticky; z-index: 2; top: 16px; float: right; width: 34px; height: 34px; margin: 16px 16px 0 0; border: 0; border-radius: 50%; background: var(--soft); font-size: 20px; }
#product-detail, #comparison-detail { padding: 34px; }
.detail-header { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin: 6px 0; font-size: 25px; }
.detail-header p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.detail-overview { display: grid; grid-template-columns: minmax(250px, .9fr) minmax(0, 1.1fr); gap: 24px; margin: 24px 0; }
.detail-gallery, .detail-info { min-width: 0; }
.detail-gallery-main { display: grid; min-height: 300px; margin-top: 10px; place-items: center; border-radius: 10px; background: var(--soft); }
.detail-gallery-image { display: block; width: 100%; height: 300px; object-fit: contain; }
.detail-gallery-thumbs { display: flex; gap: 7px; overflow-x: auto; margin-top: 8px; }
.detail-gallery-thumb { flex: 0 0 auto; width: 54px; height: 54px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.detail-gallery-thumb.active { border-color: var(--accent); }
.detail-gallery-thumb img, .detail-gallery-thumb .product-thumb { display: block; width: 100%; height: 100%; border-radius: 3px; object-fit: cover; }
.gallery-empty { display: grid; min-height: 130px; place-items: center; color: var(--muted); font-size: 12px; }
.detail-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 10px; border: 1px solid var(--line); background: var(--line); }
.detail-info-item { min-width: 0; padding: 11px; background: white; }
.detail-info-item span { display: block; color: var(--muted); font-size: 9px; }
.detail-info-item strong { display: block; margin-top: 5px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.detail-description { margin: 14px 0 0; padding: 12px; color: var(--muted); background: var(--soft); font-size: 11px; line-height: 1.6; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.detail-metric { padding: 14px; border-radius: 8px; background: var(--soft); }
.detail-metric span { display: block; color: var(--muted); font-size: 9px; }
.detail-metric strong { display: block; margin-top: 7px; font-size: 17px; }
.comparison-heading { margin-bottom: 18px; }
.comparison-heading h2 { margin: 7px 0 0; font-size: 23px; }
.comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.comparison-side { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.comparison-image { display: grid; min-height: 220px; margin-bottom: 14px; place-items: center; background: var(--soft); }
.comparison-image img { width: 100%; height: 220px; object-fit: contain; }
.comparison-side h3 { min-height: 38px; margin: 6px 0 5px; font-size: 14px; line-height: 1.4; }
.comparison-model { min-height: 28px; margin: 0; color: var(--muted); font-size: 10px; }
.comparison-values { display: grid; gap: 1px; margin-top: 14px; background: var(--line); }
.comparison-row { display: grid; grid-template-columns: 120px repeat(2, minmax(0, 1fr)); gap: 10px; align-items: center; min-height: 42px; padding: 8px 10px; background: white; font-size: 11px; }
.comparison-values .comparison-row { grid-template-columns: 100px 1fr; }
.comparison-row > span { color: var(--muted); }
.comparison-row > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comparison-table { display: grid; gap: 1px; margin-top: 14px; background: var(--line); }
.comparison-table .comparison-row { grid-template-columns: 120px repeat(2, minmax(0, 1fr)); }
.comparison-value { color: var(--accent-dark); }
.comparison-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.lv-query-panel { max-width: 900px; margin: 0 auto; padding: clamp(34px, 8vw, 96px) clamp(20px, 6vw, 76px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.lv-query-panel h2 { margin: 10px 0 0; font-size: clamp(24px, 4vw, 38px); letter-spacing: -.04em; }
.lv-query-description { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.lv-search-form { display: flex; align-items: end; gap: 10px; max-width: 680px; margin-top: 34px; }
.lv-search-box { flex: 1; width: auto; }
.lv-search-box input { height: 48px; border-radius: 8px; font-size: 14px; }
.lv-search-form .primary-button { height: 48px; padding-inline: 24px; }
.lv-query-message { min-height: 18px; margin: 16px 0 0; color: var(--muted); font-size: 11px; }
.lv-query-results { display: grid; gap: 12px; margin-top: 16px; }
.lv-result-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.lv-result-image { display: grid; min-height: 150px; place-items: center; border-radius: 8px; background: var(--soft); }
.lv-result-image-item { display: block; width: 100%; height: 150px; object-fit: contain; }
.lv-result-content { min-width: 0; }
.lv-result-content h3 { margin: 6px 0; font-size: 15px; line-height: 1.4; }
.lv-result-content > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.lv-result-meta { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 13px; color: var(--muted); font-size: 10px; }
.lv-result-meta strong { color: var(--ink); font-size: 13px; }
.lv-insight-panel { margin-top: 18px; }
.lv-insight-section + .lv-insight-section { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.lv-insight-section h3 { margin: 0 0 7px; font-size: 12px; }
.lv-insight-section p, .lv-insight-section li { color: var(--muted); font-size: 12px; line-height: 1.7; }
.lv-insight-section p { margin: 0; }
.lv-insight-section ul { margin: 0; padding-left: 18px; }
.empty-state { color: var(--muted); font-size: 12px; }

.loading-overlay { position: fixed; z-index: 1000; inset: 0; display: grid; place-content: center; place-items: center; color: white; background: rgba(10,11,13,.72); backdrop-filter: blur(4px); }
.loading-overlay span { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.loading-overlay p { font-size: 12px; }
.toast { position: fixed; z-index: 1100; right: 24px; bottom: -100px; max-width: 360px; padding: 13px 16px; border-radius: 8px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; transition: bottom .25s ease; }
.toast.show { bottom: 24px; }
.toast.error { background: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .ala-site-header { padding-inline: 24px; }
  .main-content { padding-inline: 24px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .mapping-grid { grid-template-columns: repeat(3, 1fr); }
  .review-card { grid-template-columns: 1fr 70px 1fr; }
  .review-actions { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .product-filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .ala-site-header { position: sticky; grid-template-columns: 1fr; gap: 12px; padding: 16px 15px; }
  .sidebar { position: static; width: 100%; height: auto; padding: 15px; }
  .sidebar-brand { padding: 0 4px 14px; }
  .main-nav { grid-template-columns: repeat(5, minmax(68px, 1fr)); overflow-x: auto; margin-top: 12px; }
  .nav-item { display: flex; justify-content: center; padding: 10px 8px; white-space: nowrap; }
  .nav-item span, .nav-item em { display: none; }
  .sidebar-note { display: none; }
  .main-content { padding: 0 15px 40px; }
  .ala-site-brand img { height: 30px; }
  .ala-site-nav { justify-content: flex-start; gap: 18px; overflow-x: auto; padding-bottom: 2px; }
  .ala-site-nav > a { font-size: 12px; }
  .ala-account { margin-left: 0; }
  .ala-account-toggle { width: 48px; height: 48px; }
  .ala-user-avatar { width: 35px; height: 35px; border-width: 4px; }
  .ala-account-menu { top: calc(100% + 8px); right: 0; }
  .ala-site-language-switcher { margin-left: 0; }
  .topbar { min-height: 92px; align-items: flex-start; padding-top: 20px; }
  .topbar-actions { align-items: flex-end; flex-direction: column-reverse; gap: 7px; }
  .topbar-search { width: min(300px, 72vw); }
  .ai-pill { display: none; }
  .metric-grid, .two-column { grid-template-columns: 1fr; }
  .mapping-grid { grid-template-columns: repeat(2, 1fr); }
  .section-intro { align-items: flex-start; flex-direction: column; }
  .review-card { grid-template-columns: 1fr; }
  .match-score { text-align: left; }
  .review-actions { grid-column: auto; grid-template-columns: 1fr; }
  .product-filter-bar { grid-template-columns: 1fr 1fr; }
  .product-filter-bar .search-box, .product-filter-bar > button { grid-column: 1 / -1; }
  .product-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .detail-header { grid-template-columns: 1fr; }
  .detail-actions { justify-content: flex-start; }
  .detail-overview, .comparison-grid { grid-template-columns: 1fr; }
  .detail-header .primary-button { grid-column: auto; }
  .lv-search-form { align-items: stretch; flex-direction: column; }
  .lv-result-card { grid-template-columns: 1fr; }
  .lv-result-image { min-height: 210px; }
  .lv-result-image-item { height: 210px; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .analysis-controls { align-items: stretch; flex-direction: column; }
  .analysis-controls > small { padding-bottom: 0; }
  .condition-focus { grid-template-columns: 1fr auto; }
  .condition-focus small { grid-column: 1 / -1; }
  #product-detail, #comparison-detail { padding: 24px 18px; }
  .comparison-table .comparison-row { grid-template-columns: 90px repeat(2, minmax(0, 1fr)); }
  .popularity-row { grid-template-columns: 26px minmax(120px, 1fr) 60px; }
  .heat-track { display: none; }
}
