/* Match the browser before first paint, without scripts or saved overrides.
   The base stylesheet supplies the dark palette; light overrides it here. */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-2: #f7f8fa;
    --surface-3: #eceff3;
    --text: #17191d;
    --muted: #5e6671;
    --line: #d9dee5;
    --brand: #a70013;
    --brand-deep: #71000c;
    --accent: #cc1830;
    --yellow: #d49300;
    --green: #087b53;
    --shadow: 0 16px 38px rgba(37, 43, 52, .11);
  }
}
body { font-family: 'メイリオ', Meiryo, 'Lucida Grande', Verdana, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', Osaka, 'ＭＳ Ｐゴシック', sans-serif; }
.detail-back-wrap { display: flex; justify-content: center; margin: 24px 0 32px; }
.detail-back-button { display: inline-flex; align-items: center; justify-content: center; gap: .6em; width: min(100%, 360px); min-height: 60px; padding: 15px 22px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 1.125rem; font-weight: 800; text-align: center; text-decoration: none; box-shadow: var(--control-shadow); transition: box-shadow .14s ease, border-color .14s ease, translate .14s ease; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) {
  .detail-back-button:hover { border-color: var(--control-focus); box-shadow: var(--control-hover-shadow); translate: 0 -1px; }
}
.detail-back-button:active { translate: 0 1px; box-shadow: inset 0 2px 4px rgb(0 0 0 / .24); }

.brand-button,
.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.brand-button { padding: 0; text-align: left; }
.operation-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.operation-badges:empty { display: none; }
.operation-badges span { padding: 3px 6px; border: 1px solid var(--accent); border-radius: 4px; color: var(--text); background: var(--surface); font-size: .72rem; font-weight: 700; }
.operation-notice { padding: 8px; border-left: 3px solid var(--accent); background: var(--surface-2); color: var(--text); font-size: .85rem; }
.variant-row > div > a, .variant-row > div > button { display: grid; text-align: left; color: var(--text); text-decoration: none; }
.store-switcher span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; opacity: .72; }
.store-switcher span.active { opacity: 1; font-weight: 800; color: var(--accent); }
.store-switcher { color: #fff; }
.category-main { width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }

.loading-card,
.catalog-status {
  min-height: 100px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface);
}

.category-card .category-main { cursor: pointer; }
.category-main-copy { min-width: 0; }
.category-count { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.category-image-fallback { width: 84px; height: 100%; min-height: 112px; display: grid; place-items: center; background: linear-gradient(135deg,color-mix(in srgb,var(--accent) 18%,var(--surface)),var(--surface-2)); color: var(--accent); font-weight: 900; font-size: 1.5rem; }
.category-links button:not(.category-more) { appearance: none; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 700; }
.category-links button:hover { color: var(--accent); }
.category-links button small { color: var(--muted); }
.category-links a { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); text-decoration: none; font-size: .82rem; font-weight: 700; }
.category-links a:hover { color: var(--accent); }
.category-links a small { color: var(--muted); }
.scope-navigation { margin: 0 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.scope-navigation h2 { margin: 0 0 10px; font-size: 1rem; }
.mobile-label, .mobile-model-open { display: none; }
#modelDirectory { scroll-margin-top: 90px; }
.model-picker { width: min(620px,calc(100% - 24px)); max-width: none; height: min(720px,calc(100dvh - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); overflow: hidden; }
.model-picker[open] { display: flex; flex-direction: column; }
.model-picker::backdrop { background: rgb(0 0 0 / .58); }
.model-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.model-picker-head h2 { margin: 0; font-size: 1.05rem; }
.model-picker-head button { flex-shrink: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.model-picker-search { padding: 12px 16px 8px; }
.model-picker-search label { font-size: .8rem; color: var(--muted); }
.model-picker-search input { display: block; width: 100%; min-height: 46px; margin: 6px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; }
.model-picker-search p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.model-picker-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px max(16px,env(safe-area-inset-bottom)); }
.model-picker-body .model-navigation { margin: 0; padding: 0; border: 0; background: transparent; }
.model-picker-body .model-navigation h2 { display: none; }
.model-picker-body .model-navigation .category-links { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; padding: 0; background: transparent; }
.model-picker-body .category-links a { display: flex; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: .88rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.model-picker-body .category-links a::after { content: '›'; flex-shrink: 0; color: var(--muted); }
.model-picker-body .category-links a[hidden], #modelSearchEmpty[hidden] { display: none; }
.model-picker-body > p { color: var(--muted); font-size: .9rem; }
.model-picker :focus-visible, .mobile-model-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 840px) {
  .desktop-label { display: none; }
  .mobile-label { display: inline; }
  .catalog-title-row { gap: 10px; align-items: center; margin-bottom: 12px; }
  .catalog-title-row > div { min-width: 0; }
  .catalog-title-row .filter-open { flex-shrink: 0; min-height: 44px; padding-inline: 10px; font-size: .78rem; }
  .mobile-model-open { display: flex; align-items: center; gap: 12px; min-height: 64px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; }
  .mobile-model-open > svg { color: var(--accent); flex-shrink: 0; }
  .mobile-model-open > span { flex: 1; }
  .mobile-model-open strong { display: block; font-size: .95rem; }
  .mobile-model-open small { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; }
  .mobile-model-open > b { font-size: 1.5rem; color: var(--muted); }
  .scope-navigation { padding: 12px; margin-bottom: 14px; }
  .scope-navigation .category-links { padding: 0; border: 0; background: transparent; }
  .scope-navigation .category-links a { min-height: 40px; }
}
.scope-navigation .category-links, .model-navigation .category-links { display: flex; flex-wrap: wrap; gap: 7px; }
.model-navigation { margin: 24px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.model-navigation summary { cursor: pointer; margin-bottom: 12px; }
.model-navigation h2 { font-size: 1rem; margin: 0 0 12px; }
.maker-list a { display: flex; justify-content: space-between; gap: 8px; min-width: 0; padding: 9px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .84rem; text-align: left; text-decoration: none; }
.maker-list a:hover { background: var(--surface-3); color: var(--accent); }
.major-makers a { padding: 16px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-align: center; font-weight: 800; text-decoration: none; }
.major-makers a b { display: block; color: var(--muted); font-size: .72rem; }
a.preview-card, a.product-title { text-decoration: none; }
.prototype-pagination a { display: inline-grid; place-items: center; min-width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); text-decoration: none; }
.prototype-pagination a.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.variant-row > a { display: grid; min-width: 0; color: var(--text); text-align: left; text-decoration: none; }
.variant-row > a small, .variant-row > a span { color: var(--muted); font-size: .7rem; }

.maker-list button,
.major-makers button { cursor: pointer; }
.maker-list button { appearance: none; display: flex; justify-content: space-between; gap: 8px; min-width: 0; padding: 9px 10px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .84rem; text-align: left; }
.maker-list button:hover,
.maker-list button:focus-visible { background: var(--surface-3); color: var(--accent); outline: none; }

.preview-card { position: relative; }
.preview-card .product-maker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-card h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.active-filters span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 6px 10px; font-size: .82rem; }
.active-filters span::before { content: "絞込"; color: var(--accent); font-size: .68rem; font-weight: 900; }
.active-filters .filter-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .82rem; text-decoration: none; }
.active-filters .filter-chip::before { content: "絞込"; color: var(--accent); font-size: .68rem; font-weight: 900; }
.active-filters .filter-chip b { font-size: 1.2rem; line-height: 1; color: var(--muted); }
.active-filters .filter-chip:hover, .active-filters .filter-chip:focus-visible { border-color: var(--accent); color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.active-filters-bottom { display: none; }
@media (max-width: 840px) {
  .active-filters-bottom:not([hidden]) { display: flex; margin: 20px 0 0; }
  .active-filters-bottom .filter-chip { max-width: 100%; min-height: 44px; overflow-wrap: anywhere; }
  .active-filters-bottom .filter-chip::before, .active-filters-bottom .filter-chip b { flex-shrink: 0; }
}

.catalog-keyword-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
.catalog-keyword-form input { min-width: 0; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; }
.catalog-keyword-form input::placeholder { color: var(--muted); }
.catalog-keyword-form button { min-height: 42px; padding: 0 11px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.filter-panel > .secondary-button { margin-top: 16px; }
.price-range-form { margin-top: 12px; }
.price-range-inputs { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 6px; align-items: end; margin-bottom: 10px; }
.price-range-inputs label { min-width: 0; color: var(--muted); font-size: 12px; }
.price-range-inputs input { display: block; box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; margin-top: 5px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.price-range-inputs > span { align-self: end; padding-bottom: 12px; color: var(--muted); }
.price-range-form > button { width: 100%; min-height: 40px; font-size: 13px; }
.maker-filter { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.maker-filter legend { width: 100%; margin: 0 0 8px; }
.maker-filter legend small { float: right; color: var(--muted); font-weight: 400; }
.maker-filter > input[type=search] { width: 100%; min-height: 40px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .85rem; }
.maker-checklist { max-height: 264px; overflow-y: auto; margin-top: 6px; overscroll-behavior: auto; scrollbar-gutter: stable; }
/* Keep the entire desktop filter reachable below the measured sticky header. */
@media (min-width: 841px) {
  .filter-panel {
    top: var(--filter-sticky-top, 147px);
    max-height: calc(100vh - var(--filter-sticky-top, 147px) - 12px);
    max-height: calc(100dvh - var(--filter-sticky-top, 147px) - 12px);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}
.maker-check { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 4px; cursor: pointer; color: var(--text); font-size: .85rem; }
.maker-check[hidden] { display: none; }
.maker-check:hover, .maker-check:has(input:checked) { background: var(--surface-2); }
.maker-check input[type=checkbox] { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
.maker-check span { flex: 1; overflow-wrap: anywhere; }
.maker-check small { color: var(--muted); font-variant-numeric: tabular-nums; }
.maker-filter-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.maker-filter-actions[hidden] { display: none; }
.maker-filter-actions button { min-height: 40px; font: inherit; font-size: .8rem; cursor: pointer; }
.maker-filter-actions .plain-button { display: inline-flex; align-items: center; }
#makerSelectionStatus { margin: 6px 0 0; }

.catalog-status { min-height: 70px; margin-bottom: 16px; }
.catalog-status:empty { display: none; }
.catalog-results .no-results { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 12px; border-radius: 8px; text-align: left; }
.catalog-results .no-results h2 { margin: 0; color: var(--text); font-size: .95rem; line-height: 1.5; }
.catalog-results .no-results p { margin: 0; font-size: .8rem; line-height: 1.5; }
.catalog-results .prototype-pagination:empty { display: none; margin: 0; }
.similar-products { margin-top: 14px; padding-top: 0; border-top: 0; }
.similar-products h2 { margin: 0 0 8px; color: var(--text); font-size: 1.2rem; }
.similar-products > p { margin: 0 0 10px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.catalog-status.error { color: #ff8484; border-color: #ff8484; }
.catalog-products[aria-busy="true"] { opacity: .38; pointer-events: none; }

.product-title { min-height: 3.4em; }
.card-labels small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-spec { min-height: 2.8em; }
.stock-and-qty select { min-width: 72px; }
.catalog-image img,
.preview-card img,
.detail-gallery img,
.variant-list img,
.drawer-items img { object-fit: contain; background: #fff; }
.catalog-image img.image-missing,
.preview-card img.image-missing { opacity: .45; object-fit: scale-down; }

.prototype-pagination { position: relative; flex-wrap: wrap; }
.page-keyboard-hint { position: absolute; top: calc(100% + 7px); left: 0; width: 100%; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease; }
@media (hover: hover) and (pointer: fine) {
  .prototype-pagination:has(.page-step:hover) .page-keyboard-hint { opacity: .7; visibility: visible; }
}
.prototype-pagination:has(.page-step:focus-visible) .page-keyboard-hint { opacity: .7; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .page-keyboard-hint { transition: none; } }
.prototype-pagination button[disabled] { opacity: .38; cursor: default; }
.prototype-pagination .page-ellipsis { display: inline-grid; place-items: center; min-width: 28px; color: var(--muted); }

.detail-meta-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 18px; margin: 18px 0; }
.detail-meta-grid div { border-bottom: 1px solid var(--line); padding: 8px 0; }
.detail-meta-grid dt { color: var(--muted); font-size: .75rem; }
.detail-meta-grid dd { margin: 2px 0 0; font-weight: 700; word-break: break-word; }
.current-product-link { display: inline-flex; margin-top: 12px; color: var(--accent); font-weight: 800; text-decoration: none; }

.variant-list article.variant-row { display: grid; grid-template-columns: 70px minmax(0,1fr) auto auto; gap: 10px; align-items: center; }
.variant-list article img { width: 70px; height: 70px; border-radius: 8px; }
.variant-list article > button { min-width: 0; }
.variant-qty { display: grid; gap: 4px; font-size: .72rem; color: var(--muted); }
.variant-qty select { min-width: 68px; }
.variant-copy { min-width: 0; overflow-wrap: anywhere; }
.variant-copy > .link-button { width: 100%; padding: 0; }
.variant-copy > .link-button small, .variant-copy > .link-button span { color: var(--muted); font-size: .75rem; }

.selection-drawer .drawer-items { overflow-y: auto; max-height: calc(100vh - 290px); }
.drawer-items button { cursor: pointer; }

/* Product photos are authored in 4:3. Do not stretch their frames to card height. */
.catalog-image,
.catalog-products.compact .catalog-image {
  width: 100%; height: auto; min-height: 0; aspect-ratio: 4 / 3;
  padding: 0; align-self: start; overflow: hidden;
}
.catalog-image img { display: block; width: 100%; height: 100%; padding: 0; object-fit: contain; }
.preview-card img,
.detail-gallery img {
  display: block; width: 100%; height: auto; min-height: 0; max-height: none;
  aspect-ratio: 4 / 3; padding: 0; object-fit: contain; align-self: start;
}
.variant-list article img,
.drawer-items img { height: auto; aspect-ratio: 4 / 3; padding: 0; object-fit: contain; }

/* Match the 200px source thumbnails; keep catalog browsing information-dense. */
.catalog-products { grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 10px; }
.catalog-image { width: min(100%,200px); justify-self: center; margin-inline: auto; }
.catalog-card-body { padding: 10px; }
.catalog-card .product-title { min-height: 0; font-size: .86rem; }
.catalog-card .product-spec { min-height: 0; margin: 5px 0 8px; }
.catalog-card .card-labels { margin-bottom: 4px; }
.catalog-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 4px; }
.catalog-badges .operation-badges, .catalog-badges .card-labels { display: contents; }
.catalog-badges > .card-labels > small { margin-left: auto; }
.catalog-card .purchase-row { flex-wrap: wrap; align-items: center; padding-top: 6px; gap: 5px; }
.catalog-card .stock-and-qty { gap: 5px; }
.catalog-card .stock-and-qty select { min-width: 56px; }
/* Keep the purchase controls beside the item, not at the far edge of the row. */
.catalog-products.compact .purchase-row { justify-content: flex-start; gap: 16px; }
.catalog-products.compact .stock-and-qty { margin-left: 0; }
.variant-list article.variant-row {
  grid-template-columns: 70px minmax(0,360px) max-content max-content;
  justify-content: start;
}
.density-mobile-label { display: none; }
@media (max-width: 560px) {
  .density-desktop-label { display: none; }
  .density-mobile-label { display: inline; }
  .catalog-products { grid-template-columns: 1fr; gap: 8px; }
  .catalog-card { grid-template-columns: clamp(112px,34vw,140px) minmax(0,1fr); }
  .catalog-products.compact .catalog-card { display: block; }
  .catalog-products.compact .catalog-image { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .catalog-products.compact .catalog-card-body { padding: 12px; }
  .catalog-products.compact .purchase-row { justify-content: space-between; gap: 5px; }
  .catalog-products.compact .stock-and-qty { margin-left: auto; }
  .catalog-card-body { padding: 8px; }
  .catalog-card .product-title { font-size: .9rem; line-height: 1.45; }
  .catalog-card .operation-badges { gap: 3px; margin-bottom: 3px; }
  .catalog-card .operation-badges span { padding: 1px 4px; font-size: .625rem; line-height: 1.4; font-weight: 600; }
  .catalog-card .card-labels { margin-bottom: 3px; }
  .catalog-badges { gap: 3px; margin-bottom: 3px; }
  .catalog-card .card-labels span { padding: 1px 4px; font-size: .625rem; line-height: 1.4; font-weight: 600; }
  .catalog-card .product-spec { margin: 4px 0 6px; line-height: 1.35; }
  .catalog-card .purchase-row { flex-direction: row; }
  .catalog-card .purchase-row strong { font-size: .96rem; white-space: nowrap; }
  .catalog-card .stock-and-qty { margin-left: auto; }
}

/* 本家と同じ、数量を選んだ時だけ現れる一括カート操作。 */
.batch-bar {
  left: 50%;
  right: auto;
  bottom: 12px;
  border-radius: 13px;
  grid-template-columns: minmax(0,1fr) 92px;
  gap: 8px;
  width: min(520px, calc(100% - 24px));
  min-height: 66px;
  padding: 7px;
  transform: translateX(-50%);
  background: color-mix(in srgb,var(--surface) 94%,#000);
  border-color: var(--line);
  color: var(--text);
}
.batch-bar .batch-submit,
.batch-bar .reset-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  min-height: 52px;
  line-height: 1.15;
}
.batch-bar .batch-submit {
  position: relative;
  isolation: isolate;
  min-width: 230px;
  background: #c42337;
  color: #fff;
}
/* A narrow highlight travels around the edge without covering the label. */
@property --cart-glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.batch-bar .batch-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  pointer-events: none;
  background: conic-gradient(from var(--cart-glow-angle), transparent 0deg 240deg, #ffcf65 285deg, #fff 320deg, transparent 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: cart-edge-glow .4s linear 1 forwards;
}
@keyframes cart-edge-glow {
  from { --cart-glow-angle: 0deg; opacity: 1; }
  99.9% { opacity: 1; }
  to { --cart-glow-angle: 360deg; opacity: 0; }
}
.batch-bar .batch-submit:disabled::before { animation: none; opacity: 0; }
.batch-bar .batch-submit > span > svg {
  flex-shrink: 0;
  transform-origin: center bottom;
  animation: cart-icon-hop 1.8s ease-in-out infinite;
}
@keyframes cart-icon-hop {
  0%, 32%, 64%, 100% { transform: translateY(0); }
  16% { transform: translateY(-5px) rotate(-8deg); }
  48% { transform: translateY(-4px) rotate(6deg); }
}
.batch-bar .batch-submit:disabled > span > svg { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .batch-bar .batch-submit::before { animation: none; background: #ffcf65; opacity: .75; }
  .batch-bar .batch-submit > span > svg { animation: none; }
}
.batch-bar .batch-submit > span { display: inline-flex; align-items: center; gap: 3px; }
.batch-bar .batch-submit b { font-size: 1.08rem; }
.batch-bar .batch-submit small,
.batch-bar .reset-button small { font-size: .65rem; font-weight: 700; opacity: .82; }
.batch-bar .reset-button {
  min-width: 92px;
  padding-inline: 10px;
  background: #f4b400;
  color: #171717;
}

@media (max-width: 760px) {
  .store-switcher span { padding: 0 10px; }
  .prototype-notice { padding-inline: 12px; }
  .category-image-fallback { width: 70px; }
  .detail-meta-grid { grid-template-columns: 1fr; }
  .variant-list article.variant-row {
    grid-template-columns: clamp(96px,28vw,120px) minmax(0,1fr) 68px;
    grid-template-areas: "image copy copy" "cost cost quantity";
    gap: 8px 10px;
    align-items: start;
  }
  .variant-row > img { grid-area: image; }
  .variant-row > .variant-copy { grid-area: copy; }
  .variant-row > .variant-cost { grid-area: cost; align-self: center; }
  .variant-list article.variant-row > :last-child { grid-area: quantity; justify-self: end; align-self: center; margin: 0; }
  .variant-row .variant-price, .variant-row .variant-stock { display: block; text-align: left; }
  .variant-row .variant-price { white-space: nowrap; }
  .variant-list article img { width: 100%; height: auto; aspect-ratio: 4 / 3; padding: 0; }
  .batch-bar { bottom: calc(68px + env(safe-area-inset-bottom,0px)); }
}

@media (max-width: 560px) {
  .batch-bar {
    grid-template-columns: minmax(0,1fr) 88px;
    min-height: 64px;
    padding: 6px;
  }
  .batch-bar .batch-submit {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
    min-height: 52px;
  }
  .batch-bar .reset-button { min-width: 88px; }
}
.published-description { margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.published-description h2 { font-size: 18px; margin: 0 0 12px; }
.published-description p { line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 20px; }
.operation-badges:empty { display: none; }

/* Centered batch actions; the fixed mobile navigation stays usable beneath them. */
.global-search { grid-template-columns: minmax(0,1fr) 88px; }
.global-search input { border-radius: 9px 0 0 9px; }
.cart-button { text-decoration: none; }
[data-cart-count][hidden] { display: none !important; }
body.has-pending-cart { padding-bottom: 80px; }
.page-top-button {
  position: fixed; right: 18px; bottom: 18px; z-index: 65;
  display: grid; justify-items: center; gap: 2px; min-height: 54px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  font-size: .75rem;
}
.page-top-button small { font-size: .65rem; }
.has-pending-cart .page-top-button { bottom: 86px; }
.toast { bottom: 88px; }
.cart-busy a { pointer-events: none; }
.cart-busy .batch-submit { opacity: .7; cursor: wait; }
.find-dialog { width: min(480px,calc(100% - 24px)); padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); }
.find-dialog::backdrop { background: rgb(0 0 0 / .55); }
.find-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.find-dialog h2 { margin: 0; font-size: 1.1rem; }
.find-dialog-head button { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; width: 44px; height: 44px; font-size: 1.4rem; }
.find-dialog input[type=search] { width: 100%; min-height: 46px; margin: 8px 0 14px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 16px; }
.find-dialog .search-button { width: 100%; min-height: 46px; border: 0; border-radius: 8px; }
.find-dialog p { color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) {
  .global-search { grid-template-columns: minmax(0,1fr) 66px; }
  .page-top-button { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom,0px)); }
  body.has-pending-cart { padding-bottom: calc(144px + env(safe-area-inset-bottom,0px)); }
  .mobile-nav { height: calc(60px + env(safe-area-inset-bottom,0px)); padding-bottom: env(safe-area-inset-bottom,0px); }
  .mobile-nav a,.mobile-nav button { position: relative; align-content: center; gap: 3px; }
  .mobile-nav button > span { font-size: 18px; line-height: 18px; }
  .mobile-nav button:nth-child(4) { background: #ffc107; color: #171717; }
  .mobile-nav a:last-child { background: #198754; color: white; }
  .mobile-nav [data-cart-count] { position: absolute; top: 2px; right: 6px; padding: 1px 5px; background: #dc3545; color: white; border-radius: 10px; font-size: 11px; }
  .toast { bottom: calc(146px + env(safe-area-inset-bottom,0px)); }
}
.breadcrumb { flex-wrap: wrap; align-items: baseline; gap: 6px; }
.breadcrumb > a, .breadcrumb > span[aria-hidden] { flex: 0 0 auto; }
.breadcrumb > span[aria-current] { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.shop-guide { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-block: 16px 30px; }
.shop-guide a { color: var(--text); }
.operational-news img { max-width: 100%; height: auto; }
.news-date { text-align: right; font-size: .8rem; color: var(--muted); }
.operational-notices { padding-top: 12px; }
.operational-notices:empty { display:none; }
.operational-notices .alert { padding: 16px; background: var(--surface-2); color: var(--text); border: 1px solid var(--accent); }
.ann-dialog { background: var(--surface) !important; color: var(--text) !important; }
.ann-dialog a, .operational-notices a { color: var(--accent); }
.operational-notices .fedex-shipping-notice { line-height:1.65; }
.operational-notices .fedex-shipping-notice .mt-2 { margin-top:8px; }
.operational-notices .fedex-shipping-notice .mt-1 { margin-top:4px; }
.operational-notices .fedex-shipping-notice a { text-decoration:underline; }

/* Keep feedback visible while the server prepares the next filtered page. */
.catalog-loading { position:fixed; inset:0; z-index:10050; display:grid; place-items:center; background:rgba(0,0,0,.22); cursor:wait; }
.catalog-loading[hidden] { display:none; }
.catalog-loading-box { display:flex; align-items:center; gap:14px; padding:22px 28px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--text); box-shadow:0 8px 32px rgba(0,0,0,.2); font-weight:700; }
.catalog-spinner { width:30px; height:30px; border:3px solid var(--line); border-top-color:var(--accent); border-radius:50%; animation:catalog-spin .7s linear infinite; }
@keyframes catalog-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce){.catalog-spinner{animation:none}}
.account-link { text-decoration: none; }

/* Home only: a compact tackle-shop directory, using the original shop assets. */
.shop-home { --home-rule: #a40018; }
.shop-home .intro-shell { grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 24px; padding-block: 28px 22px; }
.shop-home .intro-copy { padding: 0; }
.home-shop-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.home-shop-label span { color: var(--muted); font-weight: 500; letter-spacing: .04em; }
.shop-home .intro-copy h1,.shop-home .intro-copy h2 { margin: 0 0 8px; font-size: clamp(26px,2.5vw,36px); letter-spacing: .03em; line-height: 1.35; }
.shop-home .intro-copy > p:last-child { font-size: 14px; line-height: 1.8; color: var(--text); }
.home-mobile-break { display: none; }
.home-shop-info { align-self: end; text-align: right; padding-bottom: 3px; font-size: 13px; color: var(--muted); }
.home-shop-info p { margin-bottom: 10px; }
.home-shop-info strong { color: var(--text); font-size: 20px; margin-left: 5px; font-variant-numeric: tabular-nums; }
.home-shop-info b { font-weight: 500; }
.home-shop-info nav { display: flex; justify-content: flex-end; gap: 18px; }
.home-shop-info a { color: var(--text); text-underline-offset: 4px; }
.home-jump { display: flex; gap: 0; border-top: 2px solid var(--home-rule); border-bottom: 1px solid var(--line); }
.home-jump a { min-width: 140px; padding: 12px 20px; color: var(--text); text-decoration: none; text-align: center; font-size: 14px; font-weight: 700; border-right: 1px solid var(--line); }
.home-jump a:hover { background: var(--surface-2); color: var(--accent); }
.shop-home .section-block { margin-top: 28px; }
.shop-home .section-heading { align-items: center; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.shop-home .section-heading h2,.shop-home .operational-news > h2 { padding-left: 12px; border-left: 4px solid var(--home-rule); font-size: 21px; line-height: 1.35; }
.shop-home h2[id] { scroll-margin-top: 175px; }
.shop-home .category-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px 32px; align-items: stretch; }
.shop-home .category-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; padding-bottom: 14px; }
.shop-home .category-main { grid-template-columns: 144px minmax(0,1fr); gap: 18px; min-height: 104px; padding: 12px 6px; background: transparent; border: 0; border-radius: 4px; }
.shop-home .category-main img { width: 144px; height: 72px; min-height: 0; padding: 0; object-fit: contain; background: transparent; border-radius: 4px; }
@media (prefers-color-scheme: dark) { .shop-home .category-main img { background: #fff; } }
.shop-home .category-main div { padding: 0; }
.shop-home .category-main h3 { font-size: 19px; line-height: 1.4; font-weight: 600; }
.shop-home .category-count { margin-top: 3px; font-size: 12px; font-weight: 400; }
.shop-home .category-text-only .category-main { grid-template-columns: 1fr; }
.shop-home .category-links { min-height: 0; gap: 2px 14px; padding: 4px 6px 0; border: 0; background: transparent; }
.shop-home .category-links:empty { display: none; }
.shop-home .category-links a { min-height: 30px; padding: 4px 0; gap: 4px; border: 0; border-radius: 0; background: transparent; font-size: 14px; font-weight: 500; line-height: 1.5; }
.shop-home .category-links a small { font-size: 12px; font-weight: 400; }
.shop-home .category-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.shop-home .category-main:hover { background: var(--surface-2); color: var(--accent); }
.shop-home .maker-section { padding: 24px 0; border-block: 1px solid var(--line); }
.shop-home .maker-filter { width: min(340px,100%); font-size: 12px; }
.shop-home .maker-filter input { border-radius: 4px; }
.shop-home .major-makers { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 10px; margin-bottom: 22px; }
.shop-home .major-makers a { display: block; padding: 6px 8px 10px; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent; }
.shop-home .major-makers a:hover { border-color: var(--accent); background: var(--surface-2); }
.maker-logo { display: grid; place-items: center; height: 76px; }
.maker-logo img { display: block; width: min(100%,160px); height: auto; max-height: 76px; object-fit: contain; }
.maker-logo .logo-on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .maker-logo .logo-on-light { display: none; }
  .maker-logo .logo-on-dark { display: block; }
  .maker-logo-color .logo-on-light { display: block; background: #fff; border-radius: 2px; }
  .maker-logo-color .logo-on-dark { display: none; }
}
.maker-logo-caption { font-size: 14px; }
.shop-home .major-makers a b { margin-top: 3px; font-size: 12px; font-weight: 400; }
.shop-home .maker-list a { padding: 10px; font-size: 14px; }
.shop-home .maker-list b { align-self: center; font-size: 12px; font-weight: 400; }
.shop-home .product-preview { grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 12px; }
.shop-home .preview-card { display: flex; flex-direction: column; align-items: stretch; border-radius: 12px; overflow:hidden; box-shadow: none; color: var(--text); }
.shop-home .preview-card > img { width: min(100%,200px); max-width: 200px; height: auto; aspect-ratio: 4/3; margin: 0 auto; padding: 0; object-fit: contain; }
.shop-home .preview-card-body { display: flex; flex: 1; flex-direction: column; padding: 10px; }
.shop-home .preview-card h3 { display: block; overflow: visible; min-height: 0; font-size: 14px; font-weight: 600; line-height: 1.5; }
.shop-home .preview-card .product-maker { font-size: 12px; margin-bottom: 4px; }
.shop-home .preview-meta { margin-top: auto; padding-top: 8px; flex-wrap: wrap; gap: 4px; }
.shop-home .preview-price { font-size: 16px; }
.shop-home .stock { font-size: 12px; padding: 2px 5px; }
.shop-home .operational-news { margin-bottom: 36px; }
.shop-home a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media(max-width:1100px) {
  .shop-home .intro-shell { grid-template-columns: 1fr; gap: 10px; }
  .home-shop-info { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; text-align: left; }
  .home-shop-info p { margin: 0; }
  .shop-home .category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 24px; }
  .shop-home .major-makers { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .shop-home .intro-shell { padding-block: 18px 16px; }
  .home-shop-label { font-size: 12px; gap: 5px 10px; }
  .home-mobile-break { display: initial; }
  .home-shop-info nav { gap: 14px; }
  .home-jump a { flex: 1; min-width: 0; padding: 11px 5px; }
  .shop-home .section-block { margin-top: 22px; }
  .shop-home .section-heading { gap: 12px; }
  .shop-home .section-heading h2 { font-size: 19px; }
  .shop-home .category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 14px; }
  .shop-home .category-main { grid-template-columns: 1fr; justify-items: center; text-align: center; align-content: center; gap: 10px; padding: 12px 4px; min-height: 145px; }
  .shop-home .category-main img { width: min(144px,100%); height: auto; aspect-ratio: 2/1; }
  .shop-home .category-main h3 { font-size: 17px; }
  .shop-home .category-links { padding-inline: 2px; gap: 2px 10px; }
  .shop-home .category-links a { min-height: 34px; }
  .shop-home .major-makers { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .maker-logo { height: 55px; }
  .maker-logo img { max-height: 55px; }
  .maker-logo-caption { font-size: 13px; }
  .shop-home .maker-heading { flex-wrap: wrap; }
  .shop-home .maker-filter { width: 100%; }
  .shop-home .product-preview { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .shop-home .preview-card-body { padding: 8px; }
  .shop-home .text-link { font-size: 13px; }
}
@media (max-width: 560px) {
  .header-actions .icon-button.account-link { display: flex; min-width: 52px; padding-inline: 4px; }
  .account-link small { font-size: .6rem; }
}

@media (max-width: 840px) {
  .site-header { top: calc(-1 * var(--mobile-header-scroll-height, 114px)); }
  .catalog-page > .breadcrumb, .detail-page > .breadcrumb {
    position: sticky; top: var(--mobile-sticky-search-height, 62px); z-index: 40;
    display: block; min-height: 38px; padding: 8px 6px; line-height: 1.7;
    overflow: visible; white-space: normal; overflow-wrap: anywhere;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .breadcrumb > a, .breadcrumb > span[aria-current] { display: inline; white-space: normal; overflow-wrap: anywhere; }
  .breadcrumb > span[aria-hidden] { margin-inline: 5px; }
  .shop-home h2[id], .variant-section, #variantTitle { scroll-margin-top: 78px; }
  .global-search input { font-size: 16px; }
}

/* Equal-sized image cards, including categories without an illustration.
   Navigation with no images (e.g. rods) retains compact text links. */
.scope-navigation .category-links:has(.category-image-link) { display: grid; grid-template-columns: repeat(auto-fill,142px); grid-auto-rows: 1fr; align-items: stretch; }
.scope-navigation .category-links:has(.category-image-link) > a { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; width: 100%; padding: 7px; gap: 7px; }
.scope-navigation .category-image-link img { display: block; width: 100%; height: auto; aspect-ratio: 8/5; object-fit: contain; border-radius: 4px; background: #fff; }
.scope-navigation .category-links:has(.category-image-link) > a:not(.category-image-link)::before { content: ''; display: block; width: 100%; aspect-ratio: 8/5; flex-shrink: 0; }
.scope-navigation .category-links:has(.category-image-link) > a > span { line-height: 1.45; overflow-wrap: anywhere; }
@media(max-width:560px) {
  .scope-navigation .category-links:has(.category-image-link) { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .scope-navigation .category-links:has(.category-image-link) > a { padding: 5px; font-size: 11px; gap: 5px; }
}

/* Production portal switcher; follow the browser's preferred theme. */
.portal-switcher-bar { width:100%; min-height:40px; background:var(--surface); border-bottom:1px solid var(--line); color:var(--text); position:relative; }
.portal-switcher-inner { width:100%; max-width:760px; min-height:40px; margin:0 auto; padding:0 .5rem; display:flex; align-items:stretch; }
.portal-switcher-link { position:relative; display:flex; flex:1 1 25%; align-items:center; justify-content:center; gap:.42rem; min-width:0; padding:0 .75rem; color:var(--text); font-size:.86rem; font-weight:600; line-height:1; text-decoration:none; white-space:nowrap; opacity:.66; transition:color .16s ease,opacity .16s ease,background-color .16s ease; }
.portal-switcher-icon { width:30px; height:22px; flex:0 0 auto; display:block; object-fit:contain; opacity:.98; filter:drop-shadow(0 1px 2px rgba(0,0,0,.42)) saturate(1.08) contrast(1.04); transition:transform .16s ease,opacity .16s ease; }
.portal-switcher-link:hover .portal-switcher-icon,.portal-switcher-link:focus-visible .portal-switcher-icon,.portal-switcher-link[aria-current="page"] .portal-switcher-icon { opacity:1; transform:translateY(-1px) scale(1.04); }
@media (prefers-color-scheme: dark) { .portal-switcher-link--general .portal-switcher-icon { background:radial-gradient(ellipse at center,rgba(255,255,255,.62) 0,rgba(255,255,255,.24) 48%,rgba(255,255,255,0) 74%); filter:drop-shadow(0 0 1px rgba(255,255,255,.8)) drop-shadow(0 1px 2px rgba(177,58,58,.68)) brightness(1.28) saturate(1.18); } }
.portal-switcher-link::after { content:""; position:absolute; right:.75rem; bottom:0; left:.75rem; height:3px; border-radius:3px 3px 0 0; background:var(--portal-accent); transform:scaleX(0); transform-origin:center; transition:transform .16s ease; }
.portal-switcher-link:hover,.portal-switcher-link:focus-visible { color:var(--portal-accent); opacity:1; background:rgba(127,127,127,.08); }
.portal-switcher-link:focus-visible { outline:2px solid var(--portal-accent); outline-offset:-3px; }
.portal-switcher-link[aria-current="page"] { font-weight:800; opacity:1; }
.portal-switcher-link[aria-current="page"]::after { transform:scaleX(1); }
@media(max-width:575.98px) {
  .portal-switcher-bar,.portal-switcher-inner { min-height:36px; }
  .portal-switcher-inner { padding:0; }
  .portal-switcher-link { min-height:36px; gap:.2rem; padding:0 .08rem; font-size:.76rem; }
  .portal-switcher-icon { width:24px; height:18px; }
  .portal-switcher-link::after { right:.35rem; left:.35rem; }
}
@media(prefers-reduced-motion:reduce) { .portal-switcher-link,.portal-switcher-link::after,.portal-switcher-icon { transition:none; } }

/* Keep the original full-colour emblem and white lettering. */
.brand img, .footer-inner img { filter: none; }
.header-actions .icon-button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-align: center; line-height: 1.2;
}
.header-actions .icon-button > svg,
.header-actions .icon-button > span { display: block; width: 20px; height: 20px; line-height: 20px; flex-shrink: 0; }
.header-actions .icon-button small { white-space: nowrap; }
/* The footer deliberately keeps a dark background in both page themes. */
.site-footer { --footer-text: #e3e7ec; --footer-muted: #bdc4ce; color: var(--footer-text); }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer a:focus-visible { outline: 2px solid #f4b400; outline-offset: 3px; }
.footer-inner img { object-fit: contain; object-position: left center; }
.footer-columns { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 24px; margin-top: 28px; }
.footer-columns h2 { margin: 0 0 12px; font-size: 15px; color: #fff; }
.footer-columns ul { list-style: none; margin: 0; padding: 0; }
.footer-columns li { margin-bottom: 4px; font-size: 13px; overflow-wrap: anywhere; }
.footer-columns a { display: inline-block; padding-block: 5px; }
.footer-stores { border-top: 1px solid #454b54; margin-top: 28px; padding-top: 18px; color: var(--footer-muted); font-size: 12px; }
.footer-stores p { margin: 0 0 12px; }
/* Shared affordances: only actual controls look raised, never the whole product card. */
.header-main { row-gap: 6px; }
.search-history-bar { grid-column: 2; grid-row: 2; min-width: 0; padding: 2px 0; color: #fff; background: transparent; }
.global-search { grid-template-columns: minmax(0,1fr) 88px; }
.global-search .search-button { border-radius: 0 8px 8px 0; }
#openSearchHistory { display: none; border-radius: 0 8px 8px 0; }
#desktopSearchHistory { display: flex; gap: 10px; flex-wrap: nowrap; min-width: 0; font-size: 12px; line-height: 1.5; align-items: center; }
#desktopSearchHistory .history-inline-terms { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#desktopSearchHistory .history-inline-terms a { margin-right: 14px; white-space: nowrap; }
#desktopSearchHistory .history-tail-button { flex-shrink: 0; white-space: nowrap; padding: 2px 7px; border: 1px solid rgba(255,255,255,.6); border-radius: 4px; background: transparent; color: #fff; font: inherit; font-size: 11px; line-height: 1.5; }
#desktopSearchHistory a { color: #fff; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
#openSearchHistory { flex-shrink: 0; border: 0; border-left: 1px solid var(--line); padding: 0 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
#searchHistoryDialog { max-height: 80vh; overflow-y: auto; }
#searchHistoryDialog p, .personal-note { color: var(--muted); font-size: .8rem; line-height: 1.6; }
#searchHistoryList { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 16px; }
#searchHistoryList a { padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface-2); overflow-wrap: anywhere; text-decoration: underline; }
#clearSearchHistory { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.favorite-toggle { min-height: 40px; margin-top: 8px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; }
.favorite-toggle > span { font-size: 22px; line-height: 1; vertical-align: middle; }
.favorite-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.detail-secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(100%, 280px); margin-top: 8px; }
.detail-secondary-actions > .favorite-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 100%; min-width: 0; height: 40px; margin: 0; font-weight: 400; text-align: center; text-decoration: none; }
.catalog-card button.favorite-compact:not(:disabled) { display: inline-flex; align-items: center; justify-content: center; width: 27px; min-width: 27px; height: 27px; min-height: 27px; margin: 0; padding: 2px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.catalog-card .favorite-compact > svg { display: block; width: 16px; height: 16px; padding: 0; background: transparent; fill: none; }
.catalog-card .favorite-compact[aria-pressed="false"] { color: var(--muted); }
.catalog-card .favorite-compact[aria-pressed="true"] > svg { fill: #f58aa9; }
.toolbar-controls { flex-wrap: wrap; }
@media (max-width: 560px) {
  .toolbar-controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; width: 100%; }
  .toolbar-controls label { display: grid; gap: 4px; min-width: 0; }
  .toolbar-controls select { width: 100%; margin-left: 0; }
  .toolbar-controls .density-switch { grid-column: 1 / -1; justify-self: end; }
}
.catalog-card button.favorite-compact:not(:disabled):active { outline: none; }
.catalog-card .card-labels small { display: inline; }
.shop-home #productPreview, .shop-home #favoriteProducts { grid-auto-rows: 1fr; align-items: stretch; }
.favorite-preview { display: flex; flex-direction: column; min-width: 0; }
.shop-home .favorite-preview .preview-card { display: flex; flex: 1; height: auto; }
.favorite-preview .favorite-toggle { flex-shrink: 0; width: 100%; }
.shop-home .preview-card-body > .preview-meta, .shop-home .preview-card-body > .personal-note { margin-top: auto; }
#favoriteProducts:empty { display: none; }
.shop-home .category-card { padding-bottom: 0; border-bottom: 0; }
.shop-home .category-grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; }
.shop-home .category-main { display: flex; flex-direction: column; justify-content: center; gap: 10px; height: 100%; min-height: 166px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); text-align: center; }
.shop-home .category-main img { width: min(180px,100%); height: 90px; aspect-ratio: 2/1; background: transparent; }
@media (prefers-color-scheme: dark) { .shop-home .category-main img { background: transparent; } }
.shop-home .category-main h3 { font-size: 17px; font-weight: 700; }
.shop-home .category-count { display: block; margin-top: 4px; font-size: 12px; }
.shop-home .category-text-only .category-main { background: var(--surface-2); }
.shop-home :is(.category-card,.category-main,.major-makers a,.maker-list a,.home-jump a,.published-description,.operational-notices .alert) { border-radius:12px; }
.shop-home .maker-list { border-radius:12px; overflow:hidden; }
.shop-home .maker-list > [hidden], .maker-toggle[hidden] { display:none; }
.maker-toggle { display:block; margin:14px auto 0; padding:10px 28px; min-height:44px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); font:inherit; cursor:pointer; }
.maker-toggle:hover { background:var(--surface-3); color:var(--accent); }
.shop-home .maker-filter input { border-radius:8px; }
@media (max-width: 1200px) { .shop-home .category-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 840px) { .shop-home .category-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 560px) {
  .shop-home .category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .shop-home .category-main { min-height: 150px; padding: 12px 8px; gap: 8px; }
  .shop-home .category-main img { height: 76px; }
  .shop-home .category-main h3 { font-size: 16px; }
}
@media (max-width: 840px) {
  .search-history-bar { display: none; }
  .global-search { grid-template-columns: minmax(0,1fr) 56px 44px; }
  .global-search .search-button { border-radius: 0; }
  #openSearchHistory { display: block; padding-inline: 8px; font-size: 12px; }
}
:root { --control-shadow: 0 2px 3px rgba(20,30,45,.18); --control-hover-shadow: 0 3px 7px rgba(20,30,45,.25); --control-focus: #a90020; }
@media (prefers-color-scheme: dark) { :root { --control-shadow: 0 2px 4px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.12); --control-hover-shadow: 0 3px 8px rgba(0,0,0,.75), inset 0 0 0 1px rgba(255,255,255,.45); --control-focus: #ffd35a; } }
button, a[href], select, summary, input[type="checkbox"], input[type="radio"] { cursor: pointer; }
button:disabled, select:disabled, input:disabled, [aria-disabled="true"] { cursor: not-allowed; }
:is(button:not(.product-title,.catalog-image,.brand-button,.link-button,.plain-button), .scope-navigation a, .model-navigation a, .category-main, .maker-list a, .major-makers a, .home-jump a, .mobile-model-open, .filter-chip, .header-actions a, .prototype-pagination a, .current-product-link):not(:disabled,[aria-disabled="true"]) {
  box-shadow: var(--control-shadow);
  transition: box-shadow .14s ease, border-color .14s ease, translate .14s ease;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  :is(button:not(.product-title,.catalog-image,.brand-button,.link-button,.plain-button), .scope-navigation a, .model-navigation a, .category-main, .maker-list a, .major-makers a, .home-jump a, .mobile-model-open, .filter-chip, .header-actions a, .prototype-pagination a, .current-product-link):not(:disabled,[aria-disabled="true"]):hover {
    border-color: var(--control-focus);
    box-shadow: var(--control-hover-shadow);
    translate: 0 -1px;
  }
  :is(.product-title,.link-button,.plain-button,a[href]):hover { text-decoration: underline; text-underline-offset: 3px; }
  .catalog-image:hover { outline: 2px solid var(--control-focus); outline-offset: -2px; }
}
:is(button,a[href],select,summary,input[type="checkbox"],input[type="radio"]):focus-visible {
  outline: 3px solid var(--control-focus); outline-offset: 3px;
}
:is(button:not(.product-title,.catalog-image,.brand-button,.link-button,.plain-button), .scope-navigation a, .model-navigation a, .category-main, .maker-list a, .major-makers a, .home-jump a, .mobile-model-open, .filter-chip, .header-actions a, .prototype-pagination a, .current-product-link):not(:disabled,[aria-disabled="true"]):active {
  translate: 0 1px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.24);
  outline: 2px solid var(--control-focus); outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
  :is(button,a[href],select) { transition: none !important; translate: none !important; }
}
@media(max-width: 1000px) { .footer-columns { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width: 560px) {
  .header-actions .icon-button:not(.cart-button):not(.account-link):not(.login-link) { display: none; }
  .footer-columns { grid-template-columns: 1fr; gap: 22px; }
  .footer-columns section + section { border-top: 1px solid #454b54; padding-top: 20px; }
  .footer-columns li { font-size: 14px; }
  .footer-columns a { padding-block: 10px; }
}

/* Login and MyPage remain reachable on every screen size. */
.header-actions .icon-button.login-link, .header-actions .icon-button.account-link { display:flex; text-decoration:none; }
@media(max-width:560px) {
  .header-main { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .header-main .brand img { max-width:100%; }
  .header-actions .icon-button.login-link { min-width:44px; padding-inline:4px; }
  .login-link small { font-size:.6rem; }
}
