:root {
  --canvas: #f3f0e8;
  --paper: #fffdf8;
  --ink: #1d2d32;
  --muted: #6f7a79;
  --line: #d8d6cc;
  --navy: #153a43;
  --teal: #2a7777;
  --teal-pale: #e5f1ee;
  --amber: #a96d35;
  --amber-pale: #f5eadb;
  --violet: #716a91;
  --violet-pale: #eeeaf6;
  --rose: #a25258;
  --rose-pale: #f5e6e3;
  --shadow: 0 16px 40px rgba(35, 51, 50, .07);
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --mono: "SFMono-Regular", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--sans); }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }
.topbar { min-height: 70px; display: flex; align-items: center; gap: 30px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.88); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; letter-spacing: .06em; }
.wordmark-mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--navy); color: var(--paper); font: 10px var(--mono); letter-spacing: -.05em; }
.wordmark strong, .wordmark em { display: block; font: 10px var(--mono); font-style: normal; line-height: 1.1; }
.wordmark em { color: var(--teal); letter-spacing: .18em; }
.topbar-title { display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.eyebrow, .rail-label, .panel-ref, .mini-label, .detail-code, .card-code, .notice-mark, .notice-contract, .kind-mark, .status-chip, .layer-label, .footer, .search-block label, .rail-foot, .catalog-meta, .tab-intro .eyebrow { font: 10px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.topbar-title strong { font-size: 15px; font-weight: 650; }
.topbar-status { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.status-chip { padding: 7px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.status-chip.fixture { border-color: var(--amber); color: var(--amber); background: var(--amber-pale); }
.fixture-notice { display: flex; align-items: center; gap: 16px; min-height: 42px; padding: 0 34px; border-bottom: 1px solid #ded4c5; background: #f8f1e6; color: #5d5345; }
.fixture-notice p { margin: 0; font-size: 12px; }
.notice-mark { color: var(--amber); font-size: 9px; white-space: nowrap; }
.notice-contract { margin-left: auto; font-size: 9px; color: var(--teal); white-space: nowrap; }
.workspace { display: grid; grid-template-columns: minmax(230px, 19vw) minmax(300px, 29vw) minmax(540px, 1fr); align-items: start; min-height: calc(100vh - 112px); }
.catalog-rail { position: sticky; top: 0; display: flex; flex-direction: column; min-height: calc(100vh - 112px); padding: 40px 27px 22px 34px; border-right: 1px solid var(--line); background: #ebe8df; }
.rail-intro h1 { margin: 17px 0 13px; font-size: clamp(24px, 2.1vw, 35px); font-weight: 580; letter-spacing: -.05em; line-height: 1.13; }
.rail-intro h1 em { color: var(--teal); font-style: normal; }
.rail-intro p { max-width: 230px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.search-block { margin-top: 38px; }
.search-block label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; }
.search-control { display: grid; grid-template-columns: 20px 1fr 20px; align-items: center; min-height: 42px; padding: 0 9px; border: 1px solid var(--navy); background: var(--paper); }
.search-control span { font-size: 21px; line-height: 1; }
.search-control input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-control kbd { color: var(--muted); font: 10px var(--mono); text-align: right; }
.category-nav { margin-top: 37px; }
.rail-label { display: flex; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid #cbc8be; color: var(--muted); font-size: 9px; }
.category-list { display: flex; flex-direction: column; }
.category-button { display: flex; justify-content: space-between; align-items: center; padding: 12px 7px; border: 0; border-bottom: 1px solid #d5d2c8; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; text-align: left; }
.category-button:hover, .category-button.is-active { padding-left: 11px; color: var(--navy); background: rgba(255,253,248,.65); }
.category-button.is-active { border-left: 3px solid var(--teal); font-weight: 700; }
.category-button strong { color: var(--amber); font: 10px var(--mono); }
.rail-legend { margin-top: auto; padding-top: 34px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.rail-legend p { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
.legend-line { width: 19px; height: 2px; display: inline-block; }
.official-line { background: var(--teal); }
.interpretation-line { background: var(--amber); }
.relation-line { background: var(--violet); }
.rail-foot { display: flex; flex-direction: column; gap: 5px; padding-top: 22px; color: #8c8b83; font-size: 8px; }
.catalog-column { min-height: calc(100vh - 112px); padding: 40px 27px 50px; border-right: 1px solid var(--line); }
.column-heading { display: flex; justify-content: space-between; align-items: flex-end; min-height: 103px; margin-bottom: 28px; }
.column-heading h2 { margin: 15px 0 0; font-size: clamp(21px, 2vw, 30px); font-weight: 560; letter-spacing: -.06em; line-height: 1.2; }
.catalog-meta { display: flex; align-items: flex-end; gap: 8px; color: var(--muted); font-size: 8px; line-height: 1.35; text-align: right; }
.catalog-meta strong { color: var(--navy); font: 31px var(--mono); letter-spacing: -.1em; }
.product-list { display: flex; flex-direction: column; gap: 9px; }
.product-card { display: block; width: 100%; padding: 17px 17px 15px; border: 1px solid var(--line); border-left: 3px solid transparent; background: rgba(255,253,248,.67); color: inherit; cursor: pointer; text-align: left; text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.product-card:hover { border-color: var(--teal); background: var(--paper); transform: translateX(2px); }
.product-card.is-selected { border-color: var(--navy); border-left-color: var(--teal); background: var(--paper); box-shadow: var(--shadow); }
.card-topline, .card-footer, .panel-heading, .detail-kicker, .layer-legend, .component-strip-title, .editorial-next, .boundary-callout { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.kind-mark { display: inline-block; padding: 5px 6px; border: 1px solid currentColor; font-size: 8px; line-height: 1; }
.kind-FULL_LENS { color: var(--teal); }
.kind-MIXED_PRODUCT_BUNDLE { color: var(--amber); }
.kind-SAME_CONTENT_MULTIPACK, .kind-BASE_CONTENT_PRODUCT { color: var(--violet); }
.card-code { color: var(--muted); font-size: 9px; }
.product-card h3 { margin: 15px 0 8px; font-size: 15px; font-weight: 650; letter-spacing: -.03em; }
.card-summary { min-height: 42px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.card-footer { align-items: flex-end; margin-top: 14px; padding-top: 10px; border-top: 1px solid #e1ded5; }
.relevance-status, .card-relation { color: var(--amber); font: 9px var(--mono); letter-spacing: .04em; }
.card-relation { color: var(--violet); text-align: right; }
.card-lifecycle { color: var(--rose); font: 8px var(--mono); letter-spacing: .04em; }
.empty-state { padding: 42px 10px; color: var(--muted); text-align: center; }
.empty-state span { color: var(--amber); font: 11px var(--mono); }
.empty-state p { font-size: 12px; }
.detail-column { min-width: 0; padding: 40px 44px 70px; background: var(--paper); }
.detail-header { display: flex; justify-content: space-between; gap: 26px; padding-bottom: 27px; border-bottom: 1px solid var(--line); }
.detail-kicker { justify-content: flex-start; }
.detail-code { color: var(--muted); font-size: 9px; }
.detail-header h2 { max-width: 700px; margin: 14px 0 9px; font-size: clamp(28px, 3.5vw, 54px); font-weight: 560; letter-spacing: -.07em; line-height: 1.04; }
.detail-header p { max-width: 680px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.close-detail { width: 32px; height: 32px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 23px; line-height: 1; }
.layer-legend { justify-content: flex-start; flex-wrap: wrap; padding: 13px 0 17px; color: var(--muted); font: 9px var(--mono); }
.layer-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.official-dot { background: var(--teal); }
.interpretation-dot { background: var(--amber); }
.relation-dot { background: var(--violet); }
.detail-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--navy); }
.detail-tabs button { position: relative; padding: 13px 18px 11px 0; margin-right: 24px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; }
.detail-tabs button span { margin-left: 7px; color: var(--muted); font: 8px var(--mono); }
.detail-tabs button.is-active { color: var(--navy); }
.detail-tabs button.is-active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--teal); }
.detail-content { padding-top: 29px; }
.tab-intro { max-width: 760px; margin-bottom: 23px; }
.tab-intro h3 { margin: 10px 0 8px; font-size: clamp(21px, 2.3vw, 32px); font-weight: 580; letter-spacing: -.05em; }
.tab-intro p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.quick-block { min-height: 176px; padding: 16px; border-top: 3px solid var(--amber); background: var(--amber-pale); }
.quick-block strong { display: block; margin: 18px 0 10px; color: var(--navy); font: 12px var(--mono); letter-spacing: .04em; }
.quick-block p { margin: 0; color: #5d5143; font-size: 12px; line-height: 1.75; }
.rationale-block { border-color: var(--violet); background: var(--violet-pale); }
.why-block { border-color: var(--teal); background: var(--teal-pale); }
.why-block p { color: #3c5555; }
.quick-layers { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 23px; }
.official-surface, .interpretation-surface, .evidence-surface, .safety-surface { border: 1px solid var(--line); }
.official-surface { border-top: 3px solid var(--teal); background: #fbfdf9; }
.interpretation-surface { border-top: 3px solid var(--amber); background: #fffaf2; }
.evidence-surface { border-top: 3px solid var(--violet); background: #fbf9ff; }
.safety-surface { border-top: 3px solid var(--rose); background: #fff9f7; }
.layer-preview { min-height: 190px; padding: 17px; }
.panel-heading { justify-content: flex-start; min-height: 22px; }
.layer-label { font-size: 9px; font-weight: 700; }
.official-label { color: var(--teal); }
.interpretation-label { color: var(--amber); }
.relation-label { color: var(--violet); }
.evidence-label { color: var(--violet); }
.safety-label { color: var(--rose); }
.unknown-label { color: var(--muted); }
.panel-ref { margin-left: auto; color: #9a9d99; font-size: 8px; }
.layer-preview p { margin: 22px 0 11px; font-size: 13px; line-height: 1.8; }
.layer-preview small { color: var(--muted); font-size: 10px; line-height: 1.6; }
.fact-list { margin-top: 14px; }
.fact-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid #e4e6df; }
.fact-row:last-child { border-bottom: 0; }
.fact-row span, .fact-row small { color: var(--muted); font: 9px var(--mono); letter-spacing: .03em; }
.fact-row strong { font-size: 12px; line-height: 1.5; }
.fact-row small { color: var(--teal); text-align: right; }
.compact-facts { margin-top: 12px; }
.compact-facts .fact-row { grid-template-columns: 84px 1fr; gap: 7px; padding: 8px 0; }
.compact-facts .fact-row small { display: none; }
.bundle-panel, .relation-panel { margin-top: 23px; padding: 17px; border: 1px solid var(--line); background: #f7f5ee; }
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.why-block.official-surface, .why-block.interpretation-surface { min-height: 180px; padding: 15px; border-top-width: 2px; }
.why-block strong { display: block; margin: 14px 0 7px; font-size: 13px; line-height: 1.5; }
.why-block p { margin: 0 0 10px; font-size: 11px; line-height: 1.7; }
.why-block small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.mini-label { display: block; color: var(--muted); font-size: 8px; }
.component-strip { margin-top: 16px; border-top: 1px solid var(--line); }
.component-strip-title { padding: 12px 0 5px; color: var(--navy); font: 9px var(--mono); }
.component-strip-title small { color: var(--amber); font: 9px var(--mono); }
.component-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid #e1ded4; }
.component-row > div { display: flex; flex-direction: column; gap: 4px; }
.component-row strong { font-size: 11px; }
.component-row span, .component-row small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.component-row small { color: var(--teal); }
.scope-tag { align-self: flex-start; padding: 3px 5px; color: var(--amber) !important; border: 1px solid var(--amber); font: 8px var(--mono) !important; }
.boundary-callout { justify-content: flex-start; align-items: baseline; gap: 12px; margin-top: 14px; padding: 11px; background: var(--amber-pale); color: #6b5740; }
.boundary-callout span { color: var(--amber); font: 8px var(--mono); }
.boundary-callout p { margin: 0; font-size: 10px; }
.relation-path { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; gap: 12px; margin-top: 18px; }
.relation-path > div, .base-link { min-height: 92px; padding: 14px; border: 1px solid #cfcadf; background: var(--paper); text-align: left; }
.relation-path strong { display: block; margin: 10px 0 6px; color: var(--navy); font: 21px var(--mono); }
.relation-path small { display: block; color: var(--muted); font-size: 10px; }
.relation-arrow { color: var(--violet); font-size: 22px; text-align: center; }
.base-link { width: 100%; cursor: pointer; }
.base-link span { color: var(--violet); font: 8px var(--mono); }
.base-link strong { color: var(--violet); }
.relation-warning { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #d8d3e1; color: var(--violet); font-size: 11px; line-height: 1.6; }
.editorial-reading { padding: 21px; }
.reading-points { margin: 0; padding-left: 24px; }
.reading-points li { padding: 12px 0 12px 7px; border-bottom: 1px solid #e5dfd5; font-size: 13px; line-height: 1.75; }
.reading-points li:last-child { border-bottom: 0; }
.editorial-boundary { margin-top: 15px; padding: 17px; }
.editorial-boundary p { margin: 17px 0 0; font-size: 12px; line-height: 1.7; }
.editorial-next { justify-content: flex-start; margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); }
.editorial-next button { padding: 0; border: 0; background: none; color: var(--teal); cursor: pointer; font: 10px var(--mono); }
.deep-section { margin-bottom: 15px; padding: 17px; }
.deep-split { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.deep-section h4 { margin: 19px 0 8px; font-size: 14px; }
.deep-section p { color: var(--muted); font-size: 12px; line-height: 1.75; }
.deep-section ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.ingredient-list { margin-top: 12px; }
.ingredient-row { display: grid; grid-template-columns: minmax(120px, 1fr) 150px 1.4fr; align-items: baseline; gap: 14px; padding: 12px 0; border-bottom: 1px solid #e6e0d6; }
.ingredient-row strong { font-size: 12px; }
.ingredient-row span, .ingredient-row small { color: var(--muted); font-size: 10px; }
.unknown-section { padding: 17px 0; border-top: 1px solid var(--line); }
.unknown-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.unknown-list span { padding: 8px 9px; border: 1px dashed #bbbdb5; color: var(--muted); font-size: 10px; }
.muted-copy { color: var(--muted); }
.lifecycle-panel { margin: 0 0 18px; padding: 16px; border: 1px solid var(--rose); border-top: 3px solid var(--rose); background: var(--rose-pale); }
.lifecycle-label { color: var(--rose); }
.lifecycle-panel h4 { margin: 13px 0 6px; font-size: 14px; }
.lifecycle-panel p { margin: 0; color: #725158; font-size: 11px; line-height: 1.7; }
.lifecycle-panel ul { margin: 13px 0 0; padding-left: 18px; }
.lifecycle-panel li { margin-top: 8px; color: #725158; font-size: 11px; line-height: 1.6; }
.lifecycle-panel li small { display: block; color: var(--muted); font: 8px var(--mono); }
.lifecycle-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lifecycle-refs span { padding: 5px 7px; border: 1px dashed #c99da2; color: #725158; font: 8px var(--mono); }
.footer { display: flex; justify-content: space-between; padding: 17px 34px; border-top: 1px solid var(--line); color: #85867e; font-size: 8px; }
.mobile-only { display: none; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 210px minmax(280px, 34vw) minmax(480px, 1fr); }
  .catalog-rail { padding-left: 23px; padding-right: 17px; }
  .detail-column { padding-right: 27px; padding-left: 27px; }
  .topbar, .fixture-notice { padding-left: 23px; padding-right: 23px; }
  .topbar-status .status-chip:nth-child(2) { display: none; }
}

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 12px 24px; padding-top: 13px; padding-bottom: 13px; }
  .topbar-title { order: 3; flex-basis: 100%; }
  .topbar-status { margin-left: auto; }
  .fixture-notice { align-items: flex-start; flex-direction: column; gap: 5px; padding-top: 11px; padding-bottom: 11px; }
  .notice-contract { margin-left: 0; }
  .workspace { grid-template-columns: 185px minmax(280px, 38vw) minmax(440px, 1fr); }
  .catalog-rail { padding-left: 17px; padding-right: 13px; }
  .rail-intro h1 { font-size: 25px; }
  .quick-grid, .quick-layers { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .workspace { display: block; }
  .catalog-rail { position: static; display: block; min-height: auto; padding: 22px 17px 17px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-intro h1 { margin-top: 12px; font-size: 29px; }
  .rail-intro p { max-width: none; }
  .search-block { margin-top: 22px; }
  .category-nav { margin-top: 19px; }
  .category-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .category-button { min-height: 40px; justify-content: center; padding: 7px 4px; border: 1px solid #d5d2c8; font-size: 10px; text-align: center; }
  .category-button:hover, .category-button.is-active { padding-left: 4px; }
  .category-button.is-active { border-left: 3px solid var(--teal); }
  .category-button strong { display: none; }
  .rail-legend, .rail-foot { display: none; }
  .catalog-column { min-height: auto; padding: 25px 17px 27px; border-right: 0; }
  .column-heading { min-height: auto; margin-bottom: 17px; }
  .column-heading h2 { font-size: 24px; }
  .mobile-only { display: block; }
  .product-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .product-card { padding: 13px; }
  .product-card h3 { margin-top: 11px; font-size: 13px; }
  .card-summary { min-height: 0; font-size: 10px; }
  .card-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .card-relation { text-align: left; }
  .detail-column { padding: 28px 17px 45px; border-top: 7px solid var(--navy); }
  .detail-header h2 { font-size: 34px; }
  .detail-header p { font-size: 12px; }
  .detail-tabs { overflow-x: auto; }
  .detail-tabs button { flex: 0 0 auto; margin-right: 18px; padding-right: 0; }
  .why-grid, .deep-split { grid-template-columns: 1fr; }
  .component-row { grid-template-columns: 1fr; gap: 8px; }
  .relation-path { grid-template-columns: 1fr; gap: 7px; }
  .relation-arrow { transform: rotate(90deg); }
  .fact-row { grid-template-columns: 1fr; gap: 4px; }
  .fact-row small { text-align: left; }
  .ingredient-row { grid-template-columns: 1fr; gap: 4px; }
  .footer { align-items: flex-start; flex-direction: column; gap: 7px; padding: 15px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
